PlatformIO Community

VSCode PlaformIO NodeMCU esp8266-nonos-sdk - Cannot compile

Hi all,
Been having a hard time to compile the Blink example for the esp8266-nonos-sdk using PlatformIO in VSCode.

  • Ubuntu: 18.04.3
  • PlatformIO: Home 3.0.1 - Core 4.1.0

Initially i was getting an error on
uart_init that i solved by:

  1. Adding #include "driver/uart.h"
  2. changing the code to: uart_init(BIT_RATE_115200, BIT_RATE_115200);

But now i get the following compile error:

Verbose mode can be enabled via '-v, --verbose' option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/nodemcuv2.html
PLATFORM: Espressif 8266 2.3.2 > NodeMCU 1.0 (ESP-12E Module)
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
PACKAGES: toolchain-xtensa 1.40802.0 (4.8.2), framework-esp8266-nonos-sdk 2.1.0, tool-esptool 1.413.0 (4.13), tool-esptoolpy 1.20800.0 (2.8.0)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 0 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Compiling .pio/build/nodemcuv2/src/user_main.o
Linking .pio/build/nodemcuv2/firmware.elf
/home/paulo/.platformio/packages/framework-esp8266-nonos-sdk/lib/libmain.a(app_main.o): In function 'user_uart_wait_tx_fifo_empty':
(.irom0.text+0x740): undefined reference to 'user_rf_cal_sector_set'
/home/paulo/.platformio/packages/framework-esp8266-nonos-sdk/lib/libmain.a(app_main.o): In function 'user_uart_wait_tx_fifo_empty':
(.irom0.text+0x748): undefined reference to 'user_init'
/home/paulo/.platformio/packages/framework-esp8266-nonos-sdk/lib/libmain.a(app_main.o): In function 'flash_data_check':
(.irom0.text+0x8e7): undefined reference to 'user_rf_cal_sector_set'
/home/paulo/.platformio/packages/framework-esp8266-nonos-sdk/lib/libmain.a(app_main.o): In function 'flash_data_check':
(.irom0.text+0xb62): undefined reference to 'user_init'
collect2: error: ld returned 1 exit status
*** [.pio/build/nodemcuv2/firmware.elf] Error 1

I have tried to search for solution but cannot seem to find the problem.
Do i have the correct Packages for the platform version i am using?
I see some mismatches in the version numbers: PLATFORM: Espressif 8266 2.3.2
framework-esp8266-nonos-sdk 2.1.0

Thanks for some help in advance.
paulojfonseca

Found the problem.
I was using a .cpp extension.
renaming to user_main.c solved it!

1 Like