platformio / platform-raspberrypi

Raspberry Pi: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/raspberrypi
Apache License 2.0
73 stars 96 forks source link

Unable to use hardware/flash.h from pico-sdk #38

Open kk7ds opened 2 years ago

kk7ds commented 2 years ago

I hope this is the right place to open this issue.

When building something that uses functions from hardware/flash.h I get the following unresolved symbol:

.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: .pio/build/rp2040/src/main.cpp.o: in function `save()':
main.cpp:(.text._Z4savev+0x12): undefined reference to `flash_range_erase(unsigned long, unsigned int)'
.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: main.cpp:(.text._Z4savev+0x1e): undefined reference to `flash_range_program(unsigned long, unsigned char const*, unsigned int)'
collect2: error: ld returned 1 exit status
*** [.pio/build/rp2040/firmware.elf] Error 1

This same code works fine in the Arduino IDE (1.0) and arduino-cli. The two symbols referenced are calls I'm making of course.

Is there some build_flags= that I need to set in order to link against the proper library? I have tried the released version of platform-raspberrypi as well as pointing it directly at this github repo and the behavior is the same.

sergiomiracco commented 1 year ago

I have the same issue using platformio