IDE setup for micropython development

C programming, build, interpreter/VM.
Target audience: MicroPython Developers.
Post Reply
nagylzs
Posts: 39
Joined: Sat Jan 19, 2019 8:01 pm

IDE setup for micropython development

Post by nagylzs » Wed Dec 18, 2019 3:12 pm

I'm trying to setup Visual Studio Code under Linux, to be used for MicroPython development with esp32.
I'm using this directory structure:

Code: Select all

/
 |- esp-idf
 |- micropython
 |- modules
 |- xtensa-esp23-elf
Here, "micropython" contains the micropython source code, and the "modules" directory is for custom external C modules ( https://docs.micropython.org/en/latest/ ... dules.html )

I have created this c_cpp_properties.json file:

Code: Select all

{
    "configurations": [
        {
            "name": "Linux",
            "includePath": [
                "${workspaceFolder}/esp-idf/components/soc/esp32/include/**",
                "${workspaceFolder}/esp-idf/micropython/**"
            ],
            "defines": [],
	    "compilerPath": "${workspaceFolder}/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc",
            "cStandard": "c11",
            "cppStandard": "c++14",
            "intelliSenseMode": "clang-x64"
        }
    ],
    "version": 4
}
I'm getting errors about undefined identifiers. They are mostly MP_QSTR_* identifiers. I'm not sure how hey work, they are actually undefined. They must have been generated somehow. The basic example for external C modules also contains this:

MP_QSTR_example

What are these? Are they some kind of generated macros? Can I make VS code accept them?

I could also use a different IDE if it works better (although I'm already familiar with VS code).

nagylzs
Posts: 39
Joined: Sat Jan 19, 2019 8:01 pm

Re: IDE setup for micropython development

Post by nagylzs » Wed Dec 18, 2019 3:21 pm

Also, compilation errors are not clickable.

Example:

https://imgur.com/EPCYVnE


It might be because in the error message, the path is relative to the micropython/ports/esp32 build dir, I'm not sure.

Post Reply