Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler error after updating pico-sdk #46

Open
jerryneedell opened this issue Dec 31, 2024 · 1 comment
Open

Compiler error after updating pico-sdk #46

jerryneedell opened this issue Dec 31, 2024 · 1 comment

Comments

@jerryneedell
Copy link
Contributor

jerryneedell commented Dec 31, 2024

After updating my installation of the pico-sdk to the latest (2.1.0) I get this error in the examples:

[  0%] Built target bs2_default
[  0%] Built target bs2_default_library
[ 20%] Built target pico_lorawan_default_dev_eui
[ 40%] Built target pico_lorawan_erase_nvm
[ 60%] Built target pico_lorawan_hello_abp
[ 80%] Built target pico_lorawan_hello_otaa
[ 80%] Building C object examples/otaa_temperature_led/CMakeFiles/pico_lorawan_otaa_temperature_led.dir/main.c.o
/home/jerryneedell/projects/pico-lorawan/examples/otaa_temperature_led/main.c:28:17: error: 'PICO_DEFAULT_SPI_INSTANCE' undeclared here (not in a function)
   28 |         .inst = PICO_DEFAULT_SPI_INSTANCE,
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [examples/otaa_temperature_led/CMakeFiles/pico_lorawan_otaa_temperature_led.dir/build.make:76: examples/otaa_temperature_led/CMakeFiles/pico_lorawan_otaa_temperature_led.dir/main.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:2104: examples/otaa_temperature_led/CMakeFiles/pico_lorawan_otaa_temperature_led.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

The error can be resolved by changing

         .inst = PICO_DEFAULT_SPI_INSTANCE,

to

         .inst = PICO_DEFAULT_SPI_INSTANCE(),

With this change the example builds and runs as expected.

This appears to be a known breaking change in the SDK
raspberrypi/pico-sdk#1804 (comment)

The change is needed in all the examples.

Can anyone confirm/deny this behavior? I'll be happy to submit a PR for it, but I want to make sure I have not misunderstood something.

@fes0j
Copy link

fes0j commented Jan 7, 2025

Yes, I can confirm the same error! I second guessed my self, but even after cleaning up everything and doing a new build, the error persisted.

Thanke you for the pointer! I can confirm a successful compilation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants