Closed Supermarcel10 closed 6 months ago
There are actually two compilers needed during building an RP2040 UF2 file. A native (x64) compiler used to build the native elf2uf2.exe
executable, and then the (arm) cross-compiler used to build picoTest.elf
(which elf2uf2.exe
then turns into picoTest.uf2
). And it looks like at least one of your errors is caused by trying to use the cross-compiler to build the native elf2uf2 executable.
I've personally not used CLion, but perhaps section 10.2 of https://datasheets.raspberrypi.com/pico/getting-started-with-pico.pdf will steer you in the right direction?
I see. I'll take a look at section 10.2 and see if I can start from scratch and get it working by any means.
I had the same error on CLion, but I can't remember if the circumstances were the same. Anyway, I do remember the solution: In Build, Execution, Deployment -> CMake I had the toolchain set to gnu_arm_embedded. Reverting it back to Use Default fixed the problem. Maybe this works for you.
Ok I see! That has resolved my issue with being able to build. I cannot express how long I spent on this, thinking I'm doing something wrong with the other compiler. Didn't realise I'm not supposed to use the ARM Toolchain compiler for the entirity of the build. Thank you!
@raarts however, I use the default ,but same error :
it really drive me crazy , even though I have re-install Clion, but same error, which does not happen before
Maybe it has to do with the fact I use a Mac M1?
The following CMakeLists.txt loads perfectly fine.
However, when building I get the following errors:
This is pretty unusual since "CMAKE_C_COMPILER" and "CMAKE_CXX_COMPILER are present in CMakeLists.txt - it looks like it's a bug/issue specifically with
pico_add_extra_outputs(${PROJECT_NAME})
which calls EL2UF2Build without passing the correct environment?I have tried passing full directories, and PATH compiler names (as can be seen bt the commented line above the sets) in CMake. This had the same result.
To temporarily solve this I manually put "CC" and "CXX" environment variables when building, which resulted in a different error.
I have tried two ARM toolchain versions and they both fail the same way. Toolchain version 13.2 Rel1 is the replacement of 10.3.1 (as shown in RaspberryPi tutorials) which is deprecated.
I have also tried pulling in pico_examples and it fails in the same manner, which makes me believe it's an error with pico-sdk rather than the compilers or configuration.
If anyone has any suggestions of what I can try, feel free to comment and I'll be able to test further.
Host OS: Windows 10 22H2 x86 Target OS: Generic RP2040 ARM (RPi Pico W) IDE: CLion CL-232.9921.42 September 12, 2023 ARM Toolchains: GNU 10.3.1, 13.2 Rel1