-
Notifications
You must be signed in to change notification settings - Fork 933
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
Compilation issue after upgrading to 2.0.0 from 1.5.1 #1929
Comments
I've stumbled upon this too. It looks like I need to add more include directories because there are two such files:
But I wonder what's the official way to configure the build system? |
The include directories should be correct by default, so there is something else messed up with your build environment(s) can you post |
Sure. |
Hmm, can you try with https://github.com/raspberrypi/FreeRTOS-Kernel instead (the upstream does not have latest fixes or SDK 2.0.0 related changes, but i wasn't aware it was broken with SDK 2.0.0) |
Unfortunately, still the same error. |
yeah, i mean that shouldn't be the fix |
Oh, well, yeah.. not sure where people came up with that method of pulling in FreeRTOS_Kernel You should use FreeRTOS_Kernel_Import.cmake (like pico-sdk-import) |
Here's my
|
And just to reiterate: the above CMakeLists works with SDK 1.5.1 but not with 2.0.0. If I upgrade to 2.0.0, it doesn't work. If I downgrade back to 1.5.1, it works. I can't share the whole codebase, but I can try to cook up something that I can share (closer to a minimal working example). |
@kilograham Here's an example of the problem. It compiles with SDK 1.5.1 but not with 2.0.0. The failure with SDK 2.0.0 is the same as the one above
This probably isn't not a truly minimal working example; it's a pared down version of what I started with. I could try making a truly minimal example, but hopefully the example is close enough. |
Same issue with this library we wrote here actually. Compilation works just fine under 1.5.1 but fails with the same error above in 2.0.0. [ 1%] Building C object build/CMakeFiles/usb_desc.dir/src/usb_descriptors.c.obj
[ 1%] Building C object build/CMakeFiles/usb_desc.dir/home/poofjunior/external_projects/pico-sdk/lib/tinyusb/src/portable/raspberrypi/rp2040/dcd_rp2040.c.obj
[ 1%] Building C object build/CMakeFiles/usb_desc.dir/home/poofjunior/external_projects/pico-sdk/lib/tinyusb/src/portable/raspberrypi/rp2040/rp2040_usb.c.obj
[ 1%] Building C object build/CMakeFiles/usb_desc.dir/home/poofjunior/external_projects/pico-sdk/lib/tinyusb/src/device/usbd.c.obj
[ 2%] Building C object build/CMakeFiles/usb_desc.dir/home/poofjunior/external_projects/pico-sdk/lib/tinyusb/src/device/usbd_control.c.obj
[ 2%] Building C object build/CMakeFiles/usb_desc.dir/home/poofjunior/external_projects/pico-sdk/lib/tinyusb/src/class/audio/audio_device.c.obj
[ 2%] Building C object build/CMakeFiles/usb_desc.dir/home/poofjunior/external_projects/pico-sdk/lib/tinyusb/src/class/cdc/cdc_device.c.obj
[ 3%] Building C object build/CMakeFiles/usb_desc.dir/home/poofjunior/external_projects/pico-sdk/lib/tinyusb/src/class/dfu/dfu_device.c.obj
[ 3%] Building C object build/CMakeFiles/usb_desc.dir/home/poofjunior/external_projects/pico-sdk/lib/tinyusb/src/class/dfu/dfu_rt_device.c.obj
[ 3%] Building C object build/CMakeFiles/usb_desc.dir/home/poofjunior/external_projects/pico-sdk/lib/tinyusb/src/class/hid/hid_device.c.obj
[ 3%] Building C object build/CMakeFiles/usb_desc.dir/home/poofjunior/external_projects/pico-sdk/lib/tinyusb/src/class/midi/midi_device.c.obj
[ 4%] Building C object build/CMakeFiles/usb_desc.dir/home/poofjunior/external_projects/pico-sdk/lib/tinyusb/src/class/msc/msc_device.c.obj
[ 4%] Building C object build/CMakeFiles/usb_desc.dir/home/poofjunior/external_projects/pico-sdk/lib/tinyusb/src/class/net/ecm_rndis_device.c.obj
[ 4%] Building C object build/CMakeFiles/usb_desc.dir/home/poofjunior/external_projects/pico-sdk/lib/tinyusb/src/class/net/ncm_device.c.obj
[ 4%] Building C object build/CMakeFiles/usb_desc.dir/home/poofjunior/external_projects/pico-sdk/lib/tinyusb/src/class/usbtmc/usbtmc_device.c.obj
[ 5%] Building C object build/CMakeFiles/usb_desc.dir/home/poofjunior/external_projects/pico-sdk/lib/tinyusb/src/class/vendor/vendor_device.c.obj
[ 5%] Building C object build/CMakeFiles/usb_desc.dir/home/poofjunior/external_projects/pico-sdk/lib/tinyusb/src/class/video/video_device.c.obj
[ 5%] Building C object build/CMakeFiles/usb_desc.dir/home/poofjunior/external_projects/pico-sdk/lib/tinyusb/src/tusb.c.obj
[ 6%] Building C object build/CMakeFiles/usb_desc.dir/home/poofjunior/external_projects/pico-sdk/lib/tinyusb/src/common/tusb_fifo.c.obj
[ 6%] Building C object build/CMakeFiles/usb_desc.dir/home/poofjunior/external_projects/pico-sdk/src/rp2_common/hardware_irq/irq.c.obj
/home/poofjunior/external_projects/pico-sdk/src/rp2_common/hardware_irq/irq.c:8:10: fatal error: pico/runtime_init.h: No such file or directory
8 | #include "pico/runtime_init.h"
| ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [build/CMakeFiles/usb_desc.dir/build.make:342: build/CMakeFiles/usb_desc.dir/home/poofjunior/external_projects/pico-sdk/src/rp2_common/hardware_irq/irq.c.obj] Error 1
make[1]: *** [CMakeFiles/Makefile2:2013: build/CMakeFiles/usb_desc.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
It's worth mentioning that we are invoking TinyUSB calls directly and needed to pull out usb_descriptors.c in the process. |
I'm now able to build with both pico SDK 1.5.1 and 2.0.0. I use FetchContent_Populate to get pico SDK and FreeRTOS SDK. I include their import cmake files before declaring my project and everything works out. |
@sakhnik Glad you got it working! Do you have any insight into why those changes help? (I'm trying to figure out if there are any lessons for how to do this without FetchContent.) |
@leondisctech, nothing specific. I just followed the README from freertos RP2040 port. They suggest including their cmake module before project(), and that's it. I didn't try without FetchContent. |
Ok, it looks like tweaking the parent library's CMakeLists.txt fixed it. # old
target_link_libraries(usb_desc tinyusb_device pico_unique_id)
# new
target_link_libraries(usb_desc tinyusb_device pico_unique_id pico_stdlib) It looks like we did something eyebrow-raising by ripping out usb_desc and trying to compile its dependencies alone, but adding |
@Poofjunior Thanks for the tip! Adding pico_stdlib did the trick. @kilograham Any idea why this file now needs both |
It needs |
I hit the same issue, I've made PR #1956 that fixes these compile errors in my testing |
latest PR merged into develop |
I have a project where I have the Pico SDK in a git submodule. I recently tried upgrading the SDK from version 1.5.1 to version 2.0.0, and now I have compilation issues where runtime_init.h isn't found. The following is from running cmake and make in a clean build directory. (I deleted the build directory as instructed in the SDK 2.0.0 release notes.) The error is about 7 lines from the bottom. (
/Users/foo/bar/pico-sdk/src/common/pico_sync/mutex.c:9:10: fatal error: pico/runtime_init.h: No such file or directory
)Running cmake/build thru visual studio has some different flags but produces similar output except that it gives the error both in mutex.c and time.c.
I'm guessing this is just me goosing up git submodules and/or cmake somehow, but I'd appreciate any guidance.
The text was updated successfully, but these errors were encountered: