Error: "Unsupported board: sw0 devicetree alias is not defined" in Button Sample #81266
-
Message: Hi Zephyr Community, I'm building the button sample for the mec15xxevb_assy6853 board, but I encountered the following error: /home/jayesh/zephyrproject/zephyr/samples/basic/button/src/main.c:117:2: error: #error "Unsupported board: sw0 devicetree alias is not defined" It seems like the sw0 devicetree alias is not defined in the configuration. How can I resolve this issue or define the alias for the button (sw0) in the devicetree? Any guidance would be greatly appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 19 replies
-
Hello, sw0 is not defined in devicetree for this board, so you have to create an overlay and define a button and it's alias yourself. |
Beta Was this translation helpful? Give feedback.
-
Hi, I have already cross-checked with the MEC1501 datasheet but couldn’t find clear information about these values or how they relate to the board's GPIO configuration. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Hi adahn I'm encountering errors when trying to build my Zephyr application for controlling an LED using PWM. and i am using the mec1521 assy 6883 board only . Below are the details of my configuration: Device Tree Configuration: /* Define PWM channel for LED2 / Errors Encountered:
|
Beta Was this translation helpful? Give feedback.
-
I recently updated the repository with the suggestions provided, and now when I try to build the application for the mec15xxevb_assy6853 board, I'm encountering the following error: CMake Error at /home/jayesh/zephyrproject/zephyr/cmake/modules/dts.cmake:311 (message): devicetree error: Call Stack (most recent call first): The error points to a parse issue in the mec15xxevb_assy6853_mec1501_hsz.overlay file at line 46. The expected format seems to be a / or label reference, but I'm not sure what went wrong in the overlay configuration. Has anyone faced a similar issue? Could you suggest possible solutions or guide me in troubleshooting this parse error? Here is the updated repository link: https://github.com/leenaarora18/pwm_updated_version_1.git Thank you for your help! |
Beta Was this translation helpful? Give feedback.
-
It's very hard to follow your code, you have 2 files with the same name -
|
Beta Was this translation helpful? Give feedback.
-
I am facing the following error while building the Zephyr blinky_pwm sample application: from /home/jayesh/zephyrproject/zephyr/samples/basic/blinky_pwm/src/main.c:14: I have ensured that the project configuration includes CONFIG_PWM=y, but the errors persist. How can I resolve this issue? Is there anything specific that needs to be added to the device tree or overlay file to define the pwm_led0 alias correctly? For reference, here is the updated link to the repository: https://github.com/leenaarora18/plinky_pwm_version_2.git |
Beta Was this translation helpful? Give feedback.
-
Can you suggest me please ? |
Beta Was this translation helpful? Give feedback.
According to zephyr/include/zephyr/dt-bindings/gpio/microchip-xec-gpio.h file, for example
MCHP_GPIO_DECODE_156
goes toXEC_GPIO_HELPER(&gpio_140_176, 14)
which goes to&gpio_140_176, 14
which can be rewritten as&gpio_140_176, 0xE
. SoMCHP_GPIO_DECODE_156
macro means&gpio_140_176, 14
.