Esp8266 non os sdk has errors when building new project

Hi.
I use vscode and platformio for compiling esp8266 sdk.
When i build project and choose esp8266 nonos sdk after that the include paths in jason file are not present in the folders.


What should i do?

These are just warnings, you can ignore them. If it builds correctly then there’s no problem.

1 Like

The problem is after i created the project the include folder and src folder were empty and i thought there is some problems that they did not create.
Should i build the main file and add the include libraries myself?

Yes, you must create those yourself. See platform-espressif8266/examples/esp8266-nonos-sdk-blink at develop · platformio/platform-espressif8266 · GitHub. You should copy the user_config.h from include/, the user_main.c from src/ and add the build_flags directive from the platformio.ini to yours.

1 Like

Thank you very much.
I used that file.
After i want to compile the project it wants some file to run.
what should i do?

I’ve also experienced this error after creating a new project with a new framework… see Intermittent can't build issue, shows "Configure a Task" popup list · Issue #2554 · platformio/platformio-vscode-ide · GitHub. For me, restarting VSCode fixes it.

1 Like

Thanks alot.
Restarting worked

Something is weird to me.
In user_main.c file there isnt main and while(1) as in other micro controllers main files!

The main entry point is user_init() and from there you need to implement your entire logic. This practically is your main(). You can just put a while(1) loop there if you need it. The binky sketch operates on an interrupt-based timer so it doesn’t need this super-loop structure.

Check the documentation at GitHub - espressif/ESP8266_NONOS_SDK at release/v2.1.x.

1 Like

Does it have any function that i can give the external crystal frequency i use?
Or i have to use just 26 MHZ crystal ?
How can i search through the c files like gpio.c and etc ?
There are not in the project tab in vscode.

I’ve looked through the NonOS and didn’t find anything regarding crystal frequency setting. PlatformIO has all configurations for the ESP8266 at Espressif 8266 — PlatformIO latest documentation, including CPU frequency.

Yes because the framework is not part of the project folder. First of all you can Ctrl+Click on the function to follow them in VSCode, also the files are stored in the path you have already shown, C:\Users\<user>\.platformio\packages\framework-esp8266-nonos-sdk\driver_lib\driver is e.g. where gpio16.c would be stored.

Ctrl+Click leads me to .h file
thanks i think i have to search in the folders

You are right, due to the fact that the nonos builder script doesn’t pass the path of the implementation to the CPPPATH…

If you change this list

to

    CPPPATH=[
        join(FRAMEWORK_DIR, "include"),
        join(FRAMEWORK_DIR, "extra_include"),
        join(FRAMEWORK_DIR, "driver_lib", "include"),
        join(FRAMEWORK_DIR, "include", "espressif"),
        join(FRAMEWORK_DIR, "include", "lwip"),
        join(FRAMEWORK_DIR, "include", "lwip", "ipv4"),
        join(FRAMEWORK_DIR, "include", "lwip", "ipv6"),
        join(FRAMEWORK_DIR, "include", "nopoll"),
        join(FRAMEWORK_DIR, "include", "ssl"),
        join(FRAMEWORK_DIR, "include", "json"),
        join(FRAMEWORK_DIR, "include", "openssl"),
        join(FRAMEWORK_DIR, "driver_lib", "driver"),
    ],

in your local C:\Users\<user>\.platformio\platforms\espressif8266\builder\frameworks\esp8266-nonos-sdk.py file and execute a IntelliSense rebuild in the project (Ctrl+Shift+P → Rebuild IntelliSense), you should be able to follow the function to the implementation.


This appears when i Ctrl+Shift+P .What should i do?

You start typing in “Rebuil…” until Rebuild IntelliSense comes up and press enter…

nothing happened after pressing enter

In the bottom taskbar there’ll be a message saying “Rebuilding IntelliSense…” for a brief period. After it’s gone you should be able to see the effect of the changes done to the builder script and be able to follow functions to their definitions.

I saw the message but still cant lead to .c file when crtl+click

For some functions, the .c file is not provided, since they’re just calling a function in the pre-burned mask-ROM of the ESP8266 where the function is stored, at some pre-determined address.

Only for those functions in driver_lib\driver you will be able to follow to the source code, e.g. gpio16_output_conf() from gpio16.c. I’ve tested this.

For functions like gpio_output_set(), the SDK simply says

that that function is located at this address in the mask-ROM – you cannot see the source code behind it because Espressif does not provide it.

I wanted to find it to see if i can configure other gpios the way i want.
So how can i do this?
Is there any documents that explains how should i use this sdk functions to set customized timers,gpios,wifi,etc?