earlephilhower / arduino-pico

Raspberry Pi Pico Arduino core, for all RP2040 and RP2350 boards
GNU Lesser General Public License v2.1
2.02k stars 421 forks source link

linker issue, pico w, arduino framework and platform io #1824

Closed sverrham closed 11 months ago

sverrham commented 11 months ago

Hello, not sure if this is the right place, so sorry if it is wrong.

I hade this working but then I removed the platform io pakages to get a clean update, (something might have gone wrong here)

But now I can't seem to link with fhe following error when using the #include "pico/cyw43_arch.h"

Linking .pio\build\pico\firmware.elf
c:/xxx/.platformio/packages/toolchain-rp2040-earlephilhower/bin/../lib/gcc/arm-none-eabi/12.3.0/../../../../arm-none-eabi/bin/ld.exe: .pio\build\pico\libFrameworkArduino.a(lwip_wrap.cpp.o): in function `_ZN9LWIPMutexC2Ev':
lwip_wrap.cpp:(.text._ZN9LWIPMutexC2Ev[_ZN9LWIPMutexC5Ev]+0x28): undefined reference to `__isPicoW'
c:/xxx/.platformio/packages/toolchain-rp2040-earlephilhower/bin/../lib/gcc/arm-none-eabi/12.3.0/../../../../arm-none-eabi/bin/ld.exe: .pio\build\pico\libFrameworkArduino.a(lwip_wrap.cpp.o): in function `_ZN9LWIPMutexD2Ev':
lwip_wrap.cpp:(.text._ZN9LWIPMutexD2Ev[_ZN9LWIPMutexD5Ev]+0x28): undefined reference to `__isPicoW'
collect2.exe: error: ld returned 1 exit status

Not sure if this is something related to any update or just on my side, (I expect it is on my side but I am struggling to figure it out).

PACKAGES:

earlephilhower commented 11 months ago

Double check you set the board to the Pico W in your ini file. This variable is only present in the PicoW board variant.

sverrham commented 11 months ago

Thank you for quick comment, I have this, I thought it worked, did something change?


[env:pico]
platform = https://github.com/maxgerhardt/platform-raspberrypi.git
board = pico
framework = arduino
board_build.core = earlephilhower
upload_protocol = cmsis-dap
debug_tool = cmsis-dap
debug_init_break = tbreak loop

monitor_speed = 115200
build_flags = -D ARDUINO_RASPBERRY_PI_PICO_W
earlephilhower commented 11 months ago

Nope, you're trying to build for the plain pico. The board line need to be fixed to either picow or rpipicow or appropriate (I don't use P.IO so can't really say, but this has caught others as well).

sverrham commented 11 months ago

facepalm, how I am abel to get up in the mornings suprises me 🤣 worked at once with rpipicow, dont know how I got it compiled before.

earlephilhower commented 11 months ago

Hehe, no worries! We'll chalk it up to the quantum nature of builds and leave it at that. :laughing: