platformio / platform-espressif8266

Espressif 8266: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/espressif8266
Apache License 2.0
330 stars 219 forks source link

oak fails to link #273

Closed tcurdt closed 1 year ago

tcurdt commented 2 years ago

Just trying to build a blink program I get the following link failure for the oak.

$ pio run -t upload
Processing oak (platform: espressif8266; board: oak; framework: arduino)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/oak.html
PLATFORM: Espressif 8266 (3.2.0) > DigiStump Oak
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
PACKAGES: 
 - framework-arduinoespressif8266 3.30002.0 (3.0.2) 
 - tool-esptool 1.413.0 (4.13) 
 - tool-esptoolpy 1.30000.201119 (3.0.0) 
 - tool-mklittlefs 1.203.210628 (2.3) 
 - tool-mkspiffs 1.200.0 (2.0) 
 - toolchain-xtensa 2.100300.210717 (10.3.0)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 35 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Linking .pio/build/oak/firmware.elf
/Users/tcurdt/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/10.3.0/../../../../xtensa-lx106-elf/bin/ld: .pio/build/oak/libFrameworkArduino.a(core_esp8266_main.cpp.o):(.text._ZL12loop_wrapperv+0x8): undefined reference to `setup'
/Users/tcurdt/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/10.3.0/../../../../xtensa-lx106-elf/bin/ld: .pio/build/oak/libFrameworkArduino.a(core_esp8266_main.cpp.o):(.text._ZL12loop_wrapperv+0xc): undefined reference to `loop'
/Users/tcurdt/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/10.3.0/../../../../xtensa-lx106-elf/bin/ld: .pio/build/oak/libFrameworkArduino.a(core_esp8266_main.cpp.o): in function `_ZL12loop_wrapperv':
core_esp8266_main.cpp:(.text._ZL12loop_wrapperv+0x25): undefined reference to `setup'
/Users/tcurdt/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/10.3.0/../../../../xtensa-lx106-elf/bin/ld: core_esp8266_main.cpp:(.text._ZL12loop_wrapperv+0x31): undefined reference to `loop'
collect2: error: ld returned 1 exit status
*** [.pio/build/oak/firmware.elf] Error 1
valeros commented 1 year ago

Hi @tcurdt ! Sorry for the late reply, seems like there is something wrong with your sketch code. Is it a .cpp file or .ino? If it's .cpp, have you included Arduino.h at the top of your file?

tcurdt commented 1 year ago

Man, I just noticed I opened a really shitty ticket :) Sorry about that!

I didn't have the original code anymore. But it was easy to give it another try.

#include "Arduino.h"

#define LED LED_BUILTIN

void setup()
{
  pinMode(LED, OUTPUT);
  Serial.begin(115200);
}

void loop()
{
  digitalWrite(LED, HIGH);
  delay(500);

  digitalWrite(LED, LOW);
  delay(500);

  Serial.write("Hello\n");
}
$ pio run           
Processing oak (platform: espressif8266; board: oak; framework: arduino)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/oak.html
PLATFORM: Espressif 8266 (3.2.0) > DigiStump Oak
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
PACKAGES: 
 - framework-arduinoespressif8266 @ 3.30002.0 (3.0.2) 
 - tool-esptool @ 1.413.0 (4.13) 
 - tool-esptoolpy @ 1.30000.201119 (3.0.0) 
 - toolchain-xtensa @ 2.100300.210717 (10.3.0)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 35 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Retrieving maximum program size .pio/build/oak/firmware.elf
Checking size .pio/build/oak/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [===       ]  34.3% (used 28072 bytes from 81920 bytes)
Flash: [===       ]  25.4% (used 265585 bytes from 1044464 bytes)
=================================================================================== [SUCCESS] Took 0.36 seconds ==================================================================================

Seems like it's all good now.