Skip to content

boards: arm: rpi_pico_w: LED missing from devicetree #66915

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

Open
mytechnotalent opened this issue Dec 23, 2023 · 11 comments
Open

boards: arm: rpi_pico_w: LED missing from devicetree #66915

mytechnotalent opened this issue Dec 23, 2023 · 11 comments
Assignees
Labels
Enhancement Changes/Updates/Additions to existing features platform: Raspberry Pi Pico Raspberry Pi Pico (RPi Pico)

Comments

@mytechnotalent
Copy link

Describe the bug

I have attempted to build Zephyr within Kali Linux on an x64-based architecture as well as a Debian Raspberry Pi 5 OS as well as Windows x64. I have attempted to build the blinky project and I get the exact error each time.

Environment
1)x64 Kali Linux
2)ARM64 RP5
3)x64 Windows

west build -p always -b rpi_pico_w samples/basic/blinky
-- west build: making build dir /home/kali/zephyrproject/zephyr/build pristine
-- west build: generating a build system
Loading Zephyr default modules (Zephyr base).
-- Application: /home/kali/zephyrproject/zephyr/samples/basic/blinky
-- CMake version: 3.27.9
-- Found Python3: /usr/bin/python3 (found suitable version "3.11.7", minimum required is "3.8") found components: Interpreter 
-- Cache files will be written to: /home/kali/.cache/zephyr
-- Zephyr version: 3.5.99 (/home/kali/zephyrproject/zephyr)
-- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
-- Board: rpi_pico_w
-- ZEPHYR_TOOLCHAIN_VARIANT not set, trying to locate Zephyr SDK
-- Found host-tools: zephyr 0.16.4 (/home/kali/zephyr-sdk-0.16.4)
-- Found toolchain: zephyr 0.16.4 (/home/kali/zephyr-sdk-0.16.4)
-- Found Dtc: /home/kali/zephyr-sdk-0.16.4/sysroots/x86_64-pokysdk-linux/usr/bin/dtc (found suitable version "1.6.0", minimum required is "1.4.6") 
-- Found BOARD.dts: /home/kali/zephyrproject/zephyr/boards/arm/rpi_pico/rpi_pico_w.dts
-- Generated zephyr.dts: /home/kali/zephyrproject/zephyr/build/zephyr/zephyr.dts
-- Generated devicetree_generated.h: /home/kali/zephyrproject/zephyr/build/zephyr/include/generated/devicetree_generated.h
-- Including generated dts.cmake file: /home/kali/zephyrproject/zephyr/build/zephyr/dts.cmake
Parsing /home/kali/zephyrproject/zephyr/Kconfig
Loaded configuration '/home/kali/zephyrproject/zephyr/boards/arm/rpi_pico/rpi_pico_w_defconfig'
Merged configuration '/home/kali/zephyrproject/zephyr/samples/basic/blinky/prj.conf'
Configuration saved to '/home/kali/zephyrproject/zephyr/build/zephyr/.config'
Kconfig header saved to '/home/kali/zephyrproject/zephyr/build/zephyr/include/generated/autoconf.h'
-- Found GnuLd: /home/kali/zephyr-sdk-0.16.4/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd (found version "2.38") 
-- The C compiler identification is GNU 12.2.0
-- The CXX compiler identification is GNU 12.2.0
-- The ASM compiler identification is GNU
-- Found assembler: /home/kali/zephyr-sdk-0.16.4/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
-- Using ccache: /usr/bin/ccache
-- Configuring done (3.8s)
-- Generating done (0.0s)
-- Build files have been written to: /home/kali/zephyrproject/zephyr/build
-- west build: building application
[1/131] Preparing syscall dependency handling

[7/131] Generating include/generated/version.h
-- Zephyr version: 3.5.99 (/home/kali/zephyrproject/zephyr), build: zephyr-v3.5.0-3464-gbeb43bdf202b
[8/131] Performing configure step for 'second_stage_bootloader'
-- The C compiler identification is GNU 12.2.0
-- The CXX compiler identification is GNU 12.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /home/kali/zephyr-sdk-0.16.4/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /home/kali/zephyr-sdk-0.16.4/arm-zephyr-eabi/bin/arm-zephyr-eabi-c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The ASM compiler identification is GNU
-- Found assembler: /home/kali/zephyr-sdk-0.16.4/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
-- Configuring done (0.2s)
-- Generating done (0.0s)
-- Build files have been written to: /home/kali/zephyrproject/zephyr/build/bootloader
[9/131] Performing build step for 'second_stage_bootloader'
[1/2] Building ASM object CMakeFiles/boot_stage2.dir/home/kali/zephyrproject/modules/hal/rpi_pico/src/rp2_common/boot_stage2/boot2_w25q080.S.obj
[2/2] Linking ASM executable boot_stage2
[58/131] Building C object CMakeFiles/app.dir/src/main.c.obj
FAILED: CMakeFiles/app.dir/src/main.c.obj 
ccache /home/kali/zephyr-sdk-0.16.4/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc -DKERNEL -DK_HEAP_MEM_POOL_SIZE=0 -DPICOLIBC_LONG_LONG_PRINTF_SCANF -D_FORTIFY_SOURCE=1 -D_POSIX_C_SOURCE=200809 -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR__=1 -I/home/kali/zephyrproject/zephyr/include -I/home/kali/zephyrproject/zephyr/build/zephyr/include/generated -I/home/kali/zephyrproject/zephyr/soc/arm/rpi_pico/rp2 -I/home/kali/zephyrproject/modules/hal/cmsis/CMSIS/Core/Include -I/home/kali/zephyrproject/zephyr/modules/cmsis/. -I/home/kali/zephyrproject/modules/hal/rpi_pico/src/rp2_common/hardware_base/include -I/home/kali/zephyrproject/modules/hal/rpi_pico/src/rp2_common/hardware_clocks/include -I/home/kali/zephyrproject/modules/hal/rpi_pico/src/rp2_common/hardware_watchdog/include -I/home/kali/zephyrproject/modules/hal/rpi_pico/src/rp2_common/hardware_xosc/include -I/home/kali/zephyrproject/modules/hal/rpi_pico/src/rp2_common/hardware_pll/include -I/home/kali/zephyrproject/modules/hal/rpi_pico/src/rp2_common/hardware_irq/include -I/home/kali/zephyrproject/modules/hal/rpi_pico/src/rp2_common/hardware_sync/include -I/home/kali/zephyrproject/modules/hal/rpi_pico/src/rp2_common/hardware_timer/include -I/home/kali/zephyrproject/modules/hal/rpi_pico/src/rp2_common/hardware_resets/include -I/home/kali/zephyrproject/modules/hal/rpi_pico/src/rp2_common/pico_bootrom/include -I/home/kali/zephyrproject/modules/hal/rpi_pico/src/rp2040/hardware_regs/include -I/home/kali/zephyrproject/modules/hal/rpi_pico/src/rp2040/hardware_structs/include -I/home/kali/zephyrproject/modules/hal/rpi_pico/src/common/pico_base/include -I/home/kali/zephyrproject/modules/hal/rpi_pico/src/rp2_common/pico_platform/include -I/home/kali/zephyrproject/zephyr/modules/hal_rpi_pico -I/home/kali/zephyrproject/modules/hal/rpi_pico/src/rp2_common/hardware_gpio/include -I/home/kali/zephyrproject/modules/hal/rpi_pico/src/rp2_common/hardware_uart/include -isystem /home/kali/zephyrproject/zephyr/lib/libc/common/include -fno-strict-aliasing -Os -imacros /home/kali/zephyrproject/zephyr/build/zephyr/include/generated/autoconf.h -fno-printf-return-value -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m0plus -mthumb -mabi=aapcs -mfp16-format=ieee -mtp=soft --sysroot=/home/kali/zephyr-sdk-0.16.4/arm-zephyr-eabi/arm-zephyr-eabi -imacros /home/kali/zephyrproject/zephyr/include/zephyr/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-pic -fno-pie -fno-asynchronous-unwind-tables -ftls-model=local-exec -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop -fmacro-prefix-map=/home/kali/zephyrproject/zephyr/samples/basic/blinky=CMAKE_SOURCE_DIR -fmacro-prefix-map=/home/kali/zephyrproject/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/home/kali/zephyrproject=WEST_TOPDIR -ffunction-sections -fdata-sections --specs=picolibc.specs -std=c99 -MD -MT CMakeFiles/app.dir/src/main.c.obj -MF CMakeFiles/app.dir/src/main.c.obj.d -o CMakeFiles/app.dir/src/main.c.obj -c /home/kali/zephyrproject/zephyr/samples/basic/blinky/src/main.c
In file included from /home/kali/zephyrproject/zephyr/include/zephyr/toolchain/gcc.h:98,
                 from /home/kali/zephyrproject/zephyr/include/zephyr/toolchain.h:50,
                 from /home/kali/zephyrproject/zephyr/include/zephyr/kernel_includes.h:23,
                 from /home/kali/zephyrproject/zephyr/include/zephyr/kernel.h:17,
                 from /home/kali/zephyrproject/zephyr/samples/basic/blinky/src/main.c:8:
/home/kali/zephyrproject/zephyr/include/zephyr/device.h:89:41: error: '__device_dts_ord_DT_N_ALIAS_led0_P_gpios_IDX_0_PH_ORD' undeclared here (not in a function)
   89 | #define DEVICE_NAME_GET(dev_id) _CONCAT(__device_, dev_id)
      |                                         ^~~~~~~~~
/home/kali/zephyrproject/zephyr/include/zephyr/toolchain/common.h:137:26: note: in definition of macro '_DO_CONCAT'
  137 | #define _DO_CONCAT(x, y) x ## y
      |                          ^
/home/kali/zephyrproject/zephyr/include/zephyr/device.h:89:33: note: in expansion of macro '_CONCAT'
   89 | #define DEVICE_NAME_GET(dev_id) _CONCAT(__device_, dev_id)
      |                                 ^~~~~~~
/home/kali/zephyrproject/zephyr/include/zephyr/device.h:216:37: note: in expansion of macro 'DEVICE_NAME_GET'
  216 | #define DEVICE_DT_NAME_GET(node_id) DEVICE_NAME_GET(Z_DEVICE_DT_DEV_ID(node_id))
      |                                     ^~~~~~~~~~~~~~~
/home/kali/zephyrproject/zephyr/include/zephyr/device.h:233:34: note: in expansion of macro 'DEVICE_DT_NAME_GET'
  233 | #define DEVICE_DT_GET(node_id) (&DEVICE_DT_NAME_GET(node_id))
      |                                  ^~~~~~~~~~~~~~~~~~
/home/kali/zephyrproject/zephyr/include/zephyr/drivers/gpio.h:331:25: note: in expansion of macro 'DEVICE_DT_GET'
  331 |                 .port = DEVICE_DT_GET(DT_GPIO_CTLR_BY_IDX(node_id, prop, idx)),\
      |                         ^~~~~~~~~~~~~
/home/kali/zephyrproject/zephyr/include/zephyr/drivers/gpio.h:367:9: note: in expansion of macro 'GPIO_DT_SPEC_GET_BY_IDX'
  367 |         GPIO_DT_SPEC_GET_BY_IDX(node_id, prop, 0)
      |         ^~~~~~~~~~~~~~~~~~~~~~~
/home/kali/zephyrproject/zephyr/samples/basic/blinky/src/main.c:21:40: note: in expansion of macro 'GPIO_DT_SPEC_GET'
   21 | static const struct gpio_dt_spec led = GPIO_DT_SPEC_GET(LED0_NODE, gpios);
      |                                        ^~~~~~~~~~~~~~~~
In file included from /home/kali/zephyrproject/zephyr/include/zephyr/arch/arm/arch.h:20,
                 from /home/kali/zephyrproject/zephyr/include/zephyr/arch/cpu.h:19,
                 from /home/kali/zephyrproject/zephyr/include/zephyr/kernel_includes.h:37:
/home/kali/zephyrproject/zephyr/include/zephyr/devicetree.h:238:32: error: 'DT_N_ALIAS_led0_P_gpios_IDX_0_VAL_pin' undeclared here (not in a function)
  238 | #define DT_ALIAS(alias) DT_CAT(DT_N_ALIAS_, alias)
      |                                ^~~~~~~~~~~
/home/kali/zephyrproject/zephyr/include/zephyr/devicetree.h:4313:9: note: in definition of macro 'DT_CAT7'
 4313 |         a1 ## a2 ## a3 ## a4 ## a5 ## a6 ## a7
      |         ^~
/home/kali/zephyrproject/zephyr/include/zephyr/devicetree/gpio.h:110:9: note: in expansion of macro 'DT_PHA_BY_IDX'
  110 |         DT_PHA_BY_IDX(node_id, gpio_pha, idx, pin)
      |         ^~~~~~~~~~~~~
/home/kali/zephyrproject/zephyr/include/zephyr/drivers/gpio.h:332:24: note: in expansion of macro 'DT_GPIO_PIN_BY_IDX'
  332 |                 .pin = DT_GPIO_PIN_BY_IDX(node_id, prop, idx),                 \
      |                        ^~~~~~~~~~~~~~~~~~
/home/kali/zephyrproject/zephyr/include/zephyr/drivers/gpio.h:367:9: note: in expansion of macro 'GPIO_DT_SPEC_GET_BY_IDX'
  367 |         GPIO_DT_SPEC_GET_BY_IDX(node_id, prop, 0)
      |         ^~~~~~~~~~~~~~~~~~~~~~~
/home/kali/zephyrproject/zephyr/samples/basic/blinky/src/main.c:21:40: note: in expansion of macro 'GPIO_DT_SPEC_GET'
   21 | static const struct gpio_dt_spec led = GPIO_DT_SPEC_GET(LED0_NODE, gpios);
      |                                        ^~~~~~~~~~~~~~~~
/home/kali/zephyrproject/zephyr/include/zephyr/devicetree.h:238:25: note: in expansion of macro 'DT_CAT'
  238 | #define DT_ALIAS(alias) DT_CAT(DT_N_ALIAS_, alias)
      |                         ^~~~~~
/home/kali/zephyrproject/zephyr/samples/basic/blinky/src/main.c:15:19: note: in expansion of macro 'DT_ALIAS'
   15 | #define LED0_NODE DT_ALIAS(led0)
      |                   ^~~~~~~~
/home/kali/zephyrproject/zephyr/samples/basic/blinky/src/main.c:21:57: note: in expansion of macro 'LED0_NODE'
   21 | static const struct gpio_dt_spec led = GPIO_DT_SPEC_GET(LED0_NODE, gpios);
      |                                                         ^~~~~~~~~
[67/131] Building C object zephyr/drivers/clock_control/CMakeFiles/drivers__clock_control.dir/clock_control_rpi_pico.c.obj
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: /usr/bin/cmake --build /home/kali/zephyrproject/zephyr/build

Copy link

Hi @mytechnotalent! We appreciate you submitting your first issue for our open-source project. 🌟

Even though I'm a bot, I can assure you that the whole community is genuinely grateful for your time and effort. 🤖💙

@thedjnK
Copy link
Collaborator

thedjnK commented Dec 23, 2023

This board does not have an LED on it, therefore blinky will not compile because of the lack of an LED. You need to add an overlay to designate an LED

@thedjnK thedjnK closed this as not planned Won't fix, can't repro, duplicate, stale Dec 23, 2023
@mytechnotalent
Copy link
Author

@thedjnK the PicoW does in-fact have an onboard LED on PIN25 so not sure what you mean.

@thedjnK
Copy link
Collaborator

thedjnK commented Dec 24, 2023

So it does

@thedjnK thedjnK reopened this Dec 24, 2023
@thedjnK thedjnK added bug The issue is a bug, or the PR is fixing a bug platform: Raspberry Pi Pico Raspberry Pi Pico (RPi Pico) labels Dec 24, 2023
@thedjnK thedjnK changed the title doc: Documentation issue in 'develop/getting_started/index' boards: arm: rpi_pico_w: LED missing from devicetree Dec 24, 2023
@yonsch
Copy link
Collaborator

yonsch commented Dec 24, 2023

The Pico W does have an LED, but it's not connected to the RP2040 directly -it's connected to the CYW43 chip. So theoretically we can have blinky working, but only after we have a driver for the wifi chip.

@mytechnotalent
Copy link
Author

@yonsch with the wide-adoption of the PicoW particularly with BTLE it would make sense to accommodate this port. The CYW43 is well documented and should not be a heavy lift.

@yonsch
Copy link
Collaborator

yonsch commented Dec 24, 2023

@mytechnotalent There's a Zephyr specific driver in the making by the chip's vendor, I can't find it at the moment

@mytechnotalent
Copy link
Author

@yonsch do we have any idea when the PicoW port will be supported as you mentioned there is a driver in the making? Thanks again for your help and a Happy New Year! I am excited to be involved in the Zephyr Community!

@yonsch
Copy link
Collaborator

yonsch commented Jan 1, 2024

@mytechnotalent

do we have any idea when the PicoW port will be supported as you mentioned there is a driver in the making?

Turns out it was merged, but still without SPI support, see here: #63721 (comment)

Happy New Year! I am excited to be involved in the Zephyr Community!

Happy new year, welcome aboard :)

@mytechnotalent
Copy link
Author

Thank you so much @yonsch I appreciate that. Is there a work around to get the Bluetooth examples working properly with the Pico W as I am unable to even get anything to compile.

@henrikbrixandersen henrikbrixandersen added Enhancement Changes/Updates/Additions to existing features and removed bug The issue is a bug, or the PR is fixing a bug labels Jan 16, 2024
@Xiretza
Copy link

Xiretza commented May 11, 2024

Since I haven't seen it mentioned here yet, this is blocked by #67092.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Changes/Updates/Additions to existing features platform: Raspberry Pi Pico Raspberry Pi Pico (RPi Pico)
Projects
None yet
Development

No branches or pull requests

5 participants