[{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003cp\u003e\u003cspan\u003eAs part of a series on Zephyr with Adafruit hardware, this guide documents the process I used to diagnose a problem with building Zephyr's hello_world sample app for Raspberry Pi Pico 2. By the time you read this, there's a good chance the Zephyr folks may have already fixed the problem that tripped me up. But, perhaps my troubleshooting process will be a useful reference.\u003c/span\u003e\u003c/p\u003e\n\u003cp\u003e\u003cspan\u003eTLDR: Use \u003ccode\u003ewest build ... -- -DCONFIG_PICOLIBC_USE_MODULE=y\u003c/code\u003e to build picolibc from source, or delete the \u003ccode\u003e~/.cache/zephyr\u003c/code\u003e cache directory.\u003c/span\u003e\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003ch2\u003eThe Linker Error\u003c/h2\u003e\n\u003cp\u003eWorking towards the goal of writing a new board definition for the Adafruit Feather RP2350, I've been looking at how the device tree setup for the existing Raspberry Pi Pico 2 board definition works. When I got around to trying to build the hello world sample app for the Pico 2, which also uses the RP2350, I got stuck on a linker error.\u003c/p\u003e\n\u003cp\u003eBelow, I've included a console log which is a bit long. But, it shows some interesting details. The main error messages come in pairs that follow this pattern:\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ccode\u003e...\u003cspan\u003earm-zephyr-eabi/lib/./libc.a(strcmp.S.o): conflicting CPU architectures 17/2\u003c/span\u003e\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003e\u003cspan\u003e...ld: failed to merge target specific data of file ... /libc.a(strcmp.S.o)\u003c/span\u003e\u003c/code\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003eAfter the console log, I'll explain how I tracked this down and found a workaround.\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"code","content":"(.venv) $ west build -p always -b rpi_pico2/rp2350a/m33 samples/hello_world\n-- west build: making build dir /home/sam/code/zephyr-workspace/zephyr/build pristine\n-- west build: generating a build system\nLoading Zephyr default modules (Zephyr base).\n-- Application: /home/sam/code/zephyr-workspace/zephyr/samples/hello_world\n-- CMake version: 3.25.1\n-- Found Python3: /home/sam/code/zephyr-workspace/.venv/bin/python3 (found suitable version \"3.11.2\", minimum required is \"3.10\") found components: Interpreter \n-- Cache files will be written to: /home/sam/.cache/zephyr\n-- Zephyr version: 4.0.99 (/home/sam/code/zephyr-workspace/zephyr)\n-- Found west (found suitable version \"1.3.0\", minimum required is \"0.14.0\")\n-- Board: rpi_pico2, qualifiers: rp2350a/m33\n-- ZEPHYR_TOOLCHAIN_VARIANT not set, trying to locate Zephyr SDK\n-- Found host-tools: zephyr 0.17.0 (/home/sam/zephyr-sdk-0.17.0)\n-- Found toolchain: zephyr 0.17.0 (/home/sam/zephyr-sdk-0.17.0)\n-- Found Dtc: /home/sam/zephyr-sdk-0.17.0/sysroots/x86_64-pokysdk-linux/usr/bin/dtc (found suitable version \"1.6.0\", minimum required is \"1.4.6\") \n-- Found BOARD.dts: /home/sam/code/zephyr-workspace/zephyr/boards/raspberrypi/rpi_pico2/rpi_pico2_rp2350a_m33.dts\n-- Generated zephyr.dts: /home/sam/code/zephyr-workspace/zephyr/build/zephyr/zephyr.dts\n-- Generated pickled edt: /home/sam/code/zephyr-workspace/zephyr/build/zephyr/edt.pickle\n-- Generated devicetree_generated.h: /home/sam/code/zephyr-workspace/zephyr/build/zephyr/include/generated/zephyr/devicetree_generated.h\n-- Including generated dts.cmake file: /home/sam/code/zephyr-workspace/zephyr/build/zephyr/dts.cmake\nParsing /home/sam/code/zephyr-workspace/zephyr/Kconfig\nLoaded configuration '/home/sam/code/zephyr-workspace/zephyr/boards/raspberrypi/rpi_pico2/rpi_pico2_rp2350a_m33_defconfig'\nMerged configuration '/home/sam/code/zephyr-workspace/zephyr/samples/hello_world/prj.conf'\nConfiguration saved to '/home/sam/code/zephyr-workspace/zephyr/build/zephyr/.config'\nKconfig header saved to '/home/sam/code/zephyr-workspace/zephyr/build/zephyr/include/generated/zephyr/autoconf.h'\n-- Found GnuLd: /home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/arm-zephyr-eabi/bin/ld.bfd (found version \"2.38\") \n-- The C compiler identification is GNU 12.2.0\n-- The CXX compiler identification is GNU 12.2.0\n-- The ASM compiler identification is GNU\n-- Found assembler: /home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc\n-- Using ccache: /usr/bin/ccache\n-- Configuring done\n-- Generating done\n-- Build files have been written to: /home/sam/code/zephyr-workspace/zephyr/build\n-- west build: building application\n[1/138] Preparing syscall dependency handling\n\n[2/138] Generating include/generated/zephyr/version.h\n-- Zephyr version: 4.0.99 (/home/sam/code/zephyr-workspace/zephyr), build: d3d7e185babb\n[133/138] Linking C executable zephyr/zephyr_pre0.elf\nFAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map /home/sam/code/zephyr-workspace/zephyr/build/zephyr/zephyr_pre0.map \n: \u0026\u0026 ccache /home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc  -gdwarf-4 zephyr/CMakeFiles/zephyr_pre0.dir/misc/empty_file.c.obj -o zephyr/zephyr_pre0.elf  zephyr/CMakeFiles/offsets.dir/./arch/arm/core/offsets/offsets.c.obj  -T  zephyr/linker_zephyr_pre0.cmd  -Wl,-Map=/home/sam/code/zephyr-workspace/zephyr/build/zephyr/zephyr_pre0.map  -Wl,--whole-archive  app/libapp.a  zephyr/libzephyr.a  zephyr/arch/common/libarch__common.a  zephyr/arch/arch/arm/core/libarch__arm__core.a  zephyr/arch/arch/arm/core/cortex_m/libarch__arm__core__cortex_m.a  zephyr/arch/arch/arm/core/cortex_m/cmse/libarch__arm__core__cortex_m__cmse.a  zephyr/lib/libc/picolibc/liblib__libc__picolibc.a  zephyr/lib/libc/common/liblib__libc__common.a  zephyr/soc/soc/rp2350a/rp2350/libsoc__raspberrypi__rpi_pico__rp2350.a  zephyr/drivers/clock_control/libdrivers__clock_control.a  zephyr/drivers/console/libdrivers__console.a  zephyr/drivers/gpio/libdrivers__gpio.a  zephyr/drivers/pinctrl/libdrivers__pinctrl.a  zephyr/drivers/reset/libdrivers__reset.a  zephyr/drivers/serial/libdrivers__serial.a  zephyr/drivers/timer/libdrivers__timer.a  modules/hal_rpi_pico/libmodules__hal_rpi_pico.a  -Wl,--no-whole-archive  zephyr/kernel/libkernel.a  -L/home/sam/code/zephyr-workspace/zephyr/build/zephyr  zephyr/arch/common/libisr_tables.a  -Wl,--gc-sections  -Wl,--build-id=none  -Wl,--sort-common=descending  -Wl,--sort-section=alignment  -Wl,-u,_OffsetAbsSyms  -Wl,-u,_ConfigAbsSyms  -nostdlib  -static  -Wl,-X  -Wl,-N  -Wl,--orphan-handling=warn  -Wl,-no-pie  -specs=picolibc.specs  -DPICOLIBC_LONG_LONG_PRINTF_SCANF -L\"/home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/thumb/v8-m.main/nofp\" -lc -lgcc \u0026\u0026 cd /home/sam/code/zephyr-workspace/zephyr/build/zephyr \u0026\u0026 /usr/bin/cmake -E true\n/home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld: error: /home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/../../picolibc/arm-zephyr-eabi/lib/./libc.a(strcmp.S.o): conflicting CPU architectures 17/2\n/home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld: failed to merge target specific data of file /home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/../../picolibc/arm-zephyr-eabi/lib/./libc.a(strcmp.S.o)\n/home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld: error: /home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/../../picolibc/arm-zephyr-eabi/lib/./libc.a(memcpy.c.o): conflicting CPU architectures 17/2\n/home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld: failed to merge target specific data of file /home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/../../picolibc/arm-zephyr-eabi/lib/./libc.a(memcpy.c.o)\n/home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld: error: /home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/../../picolibc/arm-zephyr-eabi/lib/./libc.a(memset.c.o): conflicting CPU architectures 17/2\n/home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld: failed to merge target specific data of file /home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/../../picolibc/arm-zephyr-eabi/lib/./libc.a(memset.c.o)\n/home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld: error: /home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/../../picolibc/arm-zephyr-eabi/lib/./libc.a(strlen.c.o): conflicting CPU architectures 17/2\n/home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld: failed to merge target specific data of file /home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/../../picolibc/arm-zephyr-eabi/lib/./libc.a(strlen.c.o)\n/home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld: error: /home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/../../picolibc/arm-zephyr-eabi/lib/./libc.a(libc_errno_errno.c.o): conflicting CPU architectures 17/2\n/home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld: failed to merge target specific data of file /home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/../../picolibc/arm-zephyr-eabi/lib/./libc.a(libc_errno_errno.c.o)\n/home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld: error: /home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/../../picolibc/arm-zephyr-eabi/lib/./libc.a(libc_string_strnlen.c.o): conflicting CPU architectures 17/2\n/home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld: failed to merge target specific data of file /home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/../../picolibc/arm-zephyr-eabi/lib/./libc.a(libc_string_strnlen.c.o)\n/home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld: error: /home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/../../picolibc/arm-zephyr-eabi/lib/./libc.a(libc_tinystdio_printf.c.o): conflicting CPU architectures 17/2\n/home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld: failed to merge target specific data of file /home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/../../picolibc/arm-zephyr-eabi/lib/./libc.a(libc_tinystdio_printf.c.o)\n/home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld: error: /home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/../../picolibc/arm-zephyr-eabi/lib/./libc.a(libc_tinystdio_puts.c.o): conflicting CPU architectures 17/2\n/home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld: failed to merge target specific data of file /home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/../../picolibc/arm-zephyr-eabi/lib/./libc.a(libc_tinystdio_puts.c.o)\n/home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld: error: /home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/../../picolibc/arm-zephyr-eabi/lib/./libc.a(libc_tinystdio_vflprintf.c.o): conflicting CPU architectures 17/2\n/home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld: failed to merge target specific data of file /home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/../../picolibc/arm-zephyr-eabi/lib/./libc.a(libc_tinystdio_vflprintf.c.o)\n/home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld: error: /home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/../../picolibc/arm-zephyr-eabi/lib/./libc.a(libc_tinystdio_vflscanf.c.o): conflicting CPU architectures 17/2\n/home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld: failed to merge target specific data of file /home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/../../picolibc/arm-zephyr-eabi/lib/./libc.a(libc_tinystdio_vflscanf.c.o)\n/home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld: error: /home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/../../picolibc/arm-zephyr-eabi/lib/./libc.a(libc_tinystdio_vprintf.c.o): conflicting CPU architectures 17/2\n/home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld: failed to merge target specific data of file /home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/../../picolibc/arm-zephyr-eabi/lib/./libc.a(libc_tinystdio_vprintf.c.o)\n/home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld: error: /home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/../../picolibc/arm-zephyr-eabi/lib/./libc.a(libc_string_strchr.c.o): conflicting CPU architectures 17/2\n/home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld: failed to merge target specific data of file /home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/../../picolibc/arm-zephyr-eabi/lib/./libc.a(libc_string_strchr.c.o)\n/home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld: error: /home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/../../picolibc/arm-zephyr-eabi/lib/./libc.a(libc_tinystdio_fgetc.c.o): conflicting CPU architectures 17/2\n/home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld: failed to merge target specific data of file /home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/../../picolibc/arm-zephyr-eabi/lib/./libc.a(libc_tinystdio_fgetc.c.o)\n/home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld: error: /home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/../../picolibc/arm-zephyr-eabi/lib/./libc.a(libc_tinystdio_ungetc.c.o): conflicting CPU architectures 17/2\n/home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld: failed to merge target specific data of file /home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/../../picolibc/arm-zephyr-eabi/lib/./libc.a(libc_tinystdio_ungetc.c.o)\n/home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld: error: /home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/../../picolibc/arm-zephyr-eabi/lib/./libc.a(libc_tinystdio_compare_exchange.c.o): conflicting CPU architectures 17/2\n/home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld: failed to merge target specific data of file /home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/../../picolibc/arm-zephyr-eabi/lib/./libc.a(libc_tinystdio_compare_exchange.c.o)\n/home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld: error: /home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/../../picolibc/arm-zephyr-eabi/lib/./libc.a(libc_tinystdio_exchange.c.o): conflicting CPU architectures 17/2\n/home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld: failed to merge target specific data of file /home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/../../picolibc/arm-zephyr-eabi/lib/./libc.a(libc_tinystdio_exchange.c.o)\ncollect2: error: ld returned 1 exit status\nninja: build stopped: subcommand failed.\nFATAL ERROR: command exited with status 1: /usr/bin/cmake --build /home/sam/code/zephyr-workspace/zephyr/build","metadata":{"language":"terminal","linenums":false}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003ch2\u003eResearch\u003c/h2\u003e\n\u003cp\u003eOften, the first thing I do when a build crashes mysteriously is feed the error message to a search engine and see what comes up.\u003c/p\u003e\n\u003ch3\u003e\u003cspan\u003e\"conflicting CPU architectures\"\u003c/span\u003e\u003c/h3\u003e\n\u003cp\u003e\u003cspan\u003eWhen I started searching for the \"conflicting CPU architectures 17/2\" error message, I found forum threads discussing the possibility of attempting to link ARM object code that had been compiled for incompatible architectures. In particular, there was some talk about hardware floating point and software floating point implementations (\u003ccode\u003e-mfloat-abi=soft\u003c/code\u003e, \u003ccode\u003e-mfloat-abi=hard\u003c/code\u003e, etc). The floating point stuff caught my eye because the RP2350's Cortex-M33 has hardware floating point, but the RP2040's Cortex-M0+ does not. So, it seemed maybe relevant.\u003c/span\u003e\u003cspan\u003e\u003c/span\u003e\u003c/p\u003e\n\u003cp\u003e\u003cspan\u003eAt that point, I decided to look for more information about which object files were being linked together and which architectures those files had been compiled for.\u003c/span\u003e\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003ch3\u003eWhich files were being linked?\u003c/h3\u003e\n\u003cp\u003eMy first problem was to identify what the build system was doing when all the errors happened. Looking at the console log, the trouble seems to start on a line that begins with\u003c/p\u003e\n\u003cp\u003e\u0026nbsp;\u003ccode\u003eFAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map ...\u003c/code\u003e\u003c/p\u003e\n\u003cp\u003eOn the next line, there was a really long command line that starts with\u003c/p\u003e\n\u003cp\u003e\u0026nbsp;\u003ccode\u003e: \u0026amp;\u0026amp; ccache /home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc ...\u003c/code\u003e\u003c/p\u003e\n\u003cp\u003eThen, the first error line included this stuff (I added line breaks with\u0026nbsp;\u003ccode\u003e\\\u003c/code\u003e for easier reading):\u003c/p\u003e\n\u003cpre class=\"notranslate\"\u003e\u003ccode class=\"notranslate\"\u003e/home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/\\\u003cbr\u003e../../../../arm-zephyr-eabi/bin/ld: \\\u003cbr\u003eerror: /home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../\\\u003cbr\u003elib/gcc/../../picolibc/arm-zephyr-eabi/lib/./libc.a(strcmp.S.o): \\\u003cbr\u003econflicting CPU architectures 17/2\u003c/code\u003e\u003c/pre\u003e\n      \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003cp\u003eSo, pulling that error line apart, and resolving the \u003ccode\u003e..\u003c/code\u003e relative directories, the most interesting bits are:\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ccode\u003ezephyr-sdk-0.17.0/arm-zephyr-eabi/bin/ld\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003ezephyr-sdk-0.17.0/arm-zephyr-eabi/lib/picolibc/arm-zephyr-eabi/lib/libc.a(strcmp.S.o)\u003c/code\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003eWhat I read there is, the \u003ccode\u003eld\u003c/code\u003e linker from the \u003ccode\u003earm-zephyr-eabi\u003c/code\u003e toolchain of the version 0.17.0 Zephyr SDK got angry about something involving \u003ccode\u003estrcmp.S.o\u003c/code\u003e from the \u003ccode\u003elibc.a\u003c/code\u003e prebuilt library file. Also, that library comes from the version of picolibc which is bundled with the\u0026nbsp;\u003ccode\u003earm-zephyr-eabi\u003c/code\u003e toolchain.\u003c/p\u003e\n\u003cp\u003eBased on that, I came up with these questions:\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003eWhere did the reference to \u003ccode\u003estrcmp.S.o\u003c/code\u003e come from that caused \u003ccode\u003eld\u003c/code\u003e to try linking against \u003ccode\u003elibc.a\u003c/code\u003e?\u003c/li\u003e\n\u003cli\u003eWhy is Zephyr's build system using that version of picolibc instead of the picolibc module from the Zephyr workspace directory (downloaded as part of \u003ccode\u003ewest init ...\u003c/code\u003e)?\u003c/li\u003e\n\u003cli\u003eOnce I identify the two files being linked, can I tell which architecture those files were compiled for?\u003c/li\u003e\n\u003cli\u003eOnce I know the target architectures of the object files, will it turn out that one is for hardware floating point and the other is for soft floating point?\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp\u003eFor the first question, I used \u003ccode\u003egrep\u003c/code\u003e to examine the \u003ccode\u003ebuild/zephyr/zephyr_pre0.map\u003c/code\u003e file that \u003ccode\u003ewest build\u003c/code\u003e creates in the build directory:\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"code","content":"(.venv) $ grep strcmp build/zephyr/zephyr_pre0.map \n/home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/../../picolibc/arm-zephyr-eabi/lib/./libc.a(strcmp.S.o)\n                              zephyr/kernel/libkernel.a(device.c.obj) (strcmp)\n .text          0x0000000000000000       0x1c /home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/../../picolibc/arm-zephyr-eabi/lib/./libc.a(strcmp.S.o)\n .data          0x0000000000000000        0x0 /home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/../../picolibc/arm-zephyr-eabi/lib/./libc.a(strcmp.S.o)\n .bss           0x0000000000000000        0x0 /home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/../../picolibc/arm-zephyr-eabi/lib/./libc.a(strcmp.S.o)\n .ARM.extab     0x0000000000000000        0x0 /home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/../../picolibc/arm-zephyr-eabi/lib/./libc.a(strcmp.S.o)\n .ARM.exidx     0x0000000000000000        0x8 /home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/../../picolibc/arm-zephyr-eabi/lib/./libc.a(strcmp.S.o)\n .debug_frame   0x0000000000000000       0x20 /home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/../../picolibc/arm-zephyr-eabi/lib/./libc.a(strcmp.S.o)\n                0x000000000000109a       0x1a /home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/../../picolibc/arm-zephyr-eabi/lib/./libc.a(strcmp.S.o)","metadata":{"language":"terminal","linenums":false}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003cp\u003eI'm not an expert on what everything means in the \u003ccode\u003ezephyr_pre0.map\u003c/code\u003e file. But, I see that the lines which include \u003ccode\u003e\u003cspan\u003estrcmp.S.o\u003c/span\u003e\u003c/code\u003e refer to \u003cspan\u003e\u003ccode\u003elibc.a\u003c/code\u003e from picolibc and \u003ccode\u003ezephyr/kernel/libkernel.a\u003c/code\u003e. So, it looks like the other file was \u003ccode\u003ebuild/zephyr/kernel/libkernel.a\u003c/code\u003e.\u003c/span\u003e\u003cspan\u003e\u003c/span\u003e\u003c/p\u003e\n\u003ch3\u003e\u003cspan\u003eObjdump .o and .a files\u003c/span\u003e\u003c/h3\u003e\n\u003cp\u003e\u003cspan\u003eTo check the target architectures, I used \u003ccode\u003earm-zephyr-eabi-objdump\u003c/code\u003e\u0026nbsp;that comes with the \u003ccode\u003earm-zephyr-eabi\u003c/code\u003e toolchain, like this:\u003c/span\u003e\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"code","content":"(.venv) $ ~/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/arm-zephyr-eabi-objdump -f \\\n    ~/zephyr-sdk-0.17.0/arm-zephyr-eabi/picolibc/arm-zephyr-eabi/lib/libc.a | grep -A 4 strcmp.S.o\nstrcmp.S.o:     file format elf32-littlearm\narchitecture: armv4t, flags 0x00000011:\nHAS_RELOC, HAS_SYMS\nstart address 0x00000000\n\n(.venv) $ ~/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/arm-zephyr-eabi-objdump -f \\\n    build/zephyr/kernel/libkernel.a | head -n 6\nIn archive build/zephyr/kernel/libkernel.a:\n\nmain_weak.c.obj:     file format elf32-littlearm\narchitecture: armv8-m.main, flags 0x00000011:\nHAS_RELOC, HAS_SYMS\nstart address 0x00000000","metadata":{"language":"terminal","linenums":false}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003cp\u003eWhat I see there is:\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003e\n\u003ccode\u003elibc.a\u003c/code\u003e was compiled for \u003ccode\u003earmv4t\u003c/code\u003e (really old, no hardware floating point)\u003c/li\u003e\n\u003cli\u003e\n\u003ccode\u003elibkernel.a\u003c/code\u003e was compiled for \u003ccode\u003earmv8-m.main\u003c/code\u003e (Coretex-M33 with hardware floating point)\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp\u003eSo, at this point, it seems likely the linker error was trying to tell us those two CPU targets were incompatible. For another data point, when I compiled the hello world sample app successfully for a Pi Pico (RP2040), the architecture for\u0026nbsp;\u003ccode\u003elibkernel.a\u003c/code\u003e was \u003ccode\u003earmv6s-m\u003c/code\u003e. It looks like maybe linking \u003ccode\u003earmv6s-m\u003c/code\u003e with \u003ccode\u003earmv4t\u003c/code\u003e is okay, but perhaps \u003ccode\u003earmv8-m.main\u003c/code\u003e with \u003ccode\u003earmv4t\u003c/code\u003e is not possible.\u003c/p\u003e\n\u003cp\u003eIf you want more background on the different ARM architecture target names, take a look at the \u003ca href=\"https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html\" target=\"_blank\"\u003egcc ARM Options\u003c/a\u003e documentation.\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003ch2\u003eFinding a Workaround\u003c/h2\u003e\n\u003cp\u003eOnce I learned the \u003cspan\u003e\u003ccode\u003ezephyr-sdk-0.17.0/arm-zephyr-eabi/lib/picolibc\u003c/code\u003e version of picolibc was not suitable, my next question was, how do I get \u003ccode\u003ewest build\u003c/code\u003e\u0026nbsp;to compile picolibc from source?\u003c/span\u003e\u003c/p\u003e\n\u003cp\u003e\u003cspan\u003eIt turns out the Zephyr config option \u003ccode\u003eCONFIG_PICOLIBC_USE_MODULE\u003c/code\u003e exists and does just what I need. Based on my reading of various Zephyr documentation pages, GitHub discussions, and so on, it sounds like the Zephyr SDK toolchains are normally supposed to have a prebuilt picolibc library. But, in the case of the RP2350 SoC, which was only recently added to Zephyr, maybe that isn't working yet. I'm not sure. In any case, compiling picolibc from source works.\u003c/span\u003e\u003c/p\u003e\n\u003cp\u003e\u003cspan\u003eThis is my workaround:\u003c/span\u003e\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"code","content":"(.venv) $ west build -p always -b rpi_pico2/rp2350a/m33 samples/hello_world -- -DCONFIG_PICOLIBC_USE_MODULE=y\n...[irrelevant stuff edited out]...\n-- west build: building application\n[1/1095] Preparing syscall dependency handling\n\n[6/1095] Generating include/generated/zephyr/version.h\n-- Zephyr version: 4.0.99 (/home/sam/code/zephyr-workspace/zephyr), build: v4.0.0-4610-gb7cfa54c1837\n[1095/1095] Linking C executable zephyr/zephyr.elf\nMemory region         Used Size  Region Size  %age Used\n IMAGE_DEF_FLASH:          28 B        128 B     21.88%\n           FLASH:       15716 B    4194048 B      0.37%\n             RAM:        3968 B       520 KB      0.75%\n        IDT_LIST:          0 GB        32 KB      0.00%\nGenerating files from /home/sam/code/zephyr-workspace/zephyr/build/zephyr/zephyr.elf for board: rpi_pico2\nConverted to uf2, output size: 32256, start address: 0x10000000\nWrote 32256 bytes to zephyr.uf2","metadata":{"language":"terminal","linenums":false}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003cp\u003eThe important part is the \u003ccode\u003e\u003cspan\u003e-- -DCONFIG_PICOLIBC_USE_MODULE=y\u003c/span\u003e\u003c/code\u003e at the end of the \u003ccode\u003ewest build ...\u003c/code\u003e line.\u003c/p\u003e\n\u003cp\u003eWhen you give a command to \u003ccode\u003ewest build\u003c/code\u003e, the options after \u003ccode\u003e--\u003c/code\u003e will get passed along to CMake. So, it's possible to alter some configuration settings, similar to putting the settings in one of the \u003ca href=\"https://docs.zephyrproject.org/latest/build/cmake/index.html\" target=\"_blank\"\u003evarious CMake config files\u003c/a\u003e that Zephyr uses.\u003c/p\u003e\n\u003cp\u003eI still don't know why \u003ccode\u003ewest build\u003c/code\u003e was trying to link against an unsuitable\u0026nbsp;\u003ccode\u003epicolibc\u003c/code\u003e library. But, telling it to compile \u003ccode\u003epicolibc\u003c/code\u003e from source seems to be an effective workaround.\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n        \u003ch2\u003eAnother Fix\u003c/h2\u003e\n\u003cp\u003eThanks to GitHub user @xudongzheng for the suggestion that clearing the Zephyr cache might resolve the problem. I tried that and it worked, but I have no clue what caused the problem with the cache:\u003c/p\u003e\n      \n\n\n\n\n","metadata":{}},{"element_type":"code","content":"(.venv) $ rm -r ~/.cache/zephyr\n(.venv) $ rm -r build\n(.venv) $ west build -p always -b rpi_pico2/rp2350a/m33 samples/hello_world\n...\n-- west build: building application\n[1/138] Preparing syscall dependency handling\n\n[3/138] Generating include/generated/zephyr/version.h\n-- Zephyr version: 4.0.99 (/home/sam/code/zephyr-workspace/zephyr), build: v4.0.0-4610-gb7cfa54c1837\n[138/138] Linking C executable zephyr/zephyr.elf\nMemory region         Used Size  Region Size  %age Used\n IMAGE_DEF_FLASH:          28 B        128 B     21.88%\n           FLASH:       15272 B    4194048 B      0.36%\n             RAM:        3968 B       520 KB      0.75%\n        IDT_LIST:          0 GB        32 KB      0.00%\nGenerating files from /home/sam/code/zephyr-workspace/zephyr/build/zephyr/zephyr.elf for board: rpi_pico2\nConverted to uf2, output size: 31232, start address: 0x10000000\nWrote 31232 bytes to zephyr.uf2","metadata":{"language":"terminal","linenums":false}},{"element_type":"text","content":"\n        \u003cp\u003eBy checking the map file in the build directory using\u0026nbsp;\u003ccode\u003egrep\u003c/code\u003e, we can see that this time \u003ccode\u003estrcmp\u003c/code\u003e was coming from \u003cspan\u003e\u003ccode\u003ezephyr-sdk-0.17.0/arm-zephyr-eabi/picolibc/arm-zephyr-eabi/lib/thumb/v8-m.main/nofp/libc.a\u003c/code\u003e, which is a suitable choice for Cortex-M33:\u003c/span\u003e\u003c/p\u003e\n      ","metadata":{}},{"element_type":"code","content":"(.venv) $ grep strcmp build/zephyr/zephyr_pre0.map\n/home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/../../picolibc/arm-zephyr-eabi/lib/thumb/v8-m.main/nofp/libc.a(strcmp.S.o)\n                              zephyr/kernel/libkernel.a(device.c.obj) (strcmp)\n .text          0x0000000000000000       0x14 /home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/../../picolibc/arm-zephyr-eabi/lib/thumb/v8-m.main/nofp/libc.a(strcmp.S.o)\n .data          0x0000000000000000        0x0 /home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/../../picolibc/arm-zephyr-eabi/lib/thumb/v8-m.main/nofp/libc.a(strcmp.S.o)\n .bss           0x0000000000000000        0x0 /home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/../../picolibc/arm-zephyr-eabi/lib/thumb/v8-m.main/nofp/libc.a(strcmp.S.o)\n .ARM.extab     0x0000000000000000        0x0 /home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/../../picolibc/arm-zephyr-eabi/lib/thumb/v8-m.main/nofp/libc.a(strcmp.S.o)\n .ARM.exidx     0x0000000000000000        0x8 /home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/../../picolibc/arm-zephyr-eabi/lib/thumb/v8-m.main/nofp/libc.a(strcmp.S.o)\n .debug_frame   0x0000000000000000       0x20 /home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/../../picolibc/arm-zephyr-eabi/lib/thumb/v8-m.main/nofp/libc.a(strcmp.S.o)\n                0x000000000000109a       0x20 /home/sam/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/../../picolibc/arm-zephyr-eabi/lib/thumb/v8-m.main/nofp/libc.a(strcmp.S.o)","metadata":{"language":"terminal","linenums":false}}]