raspberrypi / pico-sdk

BSD 3-Clause "New" or "Revised" License
3.74k stars 930 forks source link

Cannot use any specific pico-w libraries, include errors #916

Closed diminDDL closed 2 years ago

diminDDL commented 2 years ago

After updating the pico-sdk to the latest version (to use the pico w) by running git pull I tried to compile a simple example to see if everything worked. And it didn't. Any time I try to include for example pico_cyw43_arch in my target_link_libraries and try to build something I get [build] /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: cannot find -lpico_cyw43_arch. Did I update the sdk wrong? Why can't it find it. If I navigate to the PICO_SDK_PATH/src/rp2_common/pico_cyw43_arch/ manually with the file explorer I can see the files and everything. So, it is there, cmake just can't find it.

kilograham commented 2 years ago

you need to use PICO_BOARD=pico_w

diminDDL commented 2 years ago

Can you clarify where exactly should I add this? Edit: Adding set(PICO_BOARD=pico-w) to the cmakefile seems to have initialized it.

lurch commented 2 years ago

See section 2.2 of https://datasheets.raspberrypi.com/picow/connecting-to-the-internet-with-pico-w.pdf

kilograham commented 2 years ago

TLDR pass -DPICO_BOARD=pico_w to CMake, or add PICO_BOARD=pico_w to your environment (or as you say add set(PICO_BOARD pico_w) to your CMakeLists.txt