Issues with PWM device configuration and alias resolution in Zephyr #81850
Replies: 1 comment
-
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.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello Zephyr Community,
I'm encountering errors when trying to build my Zephyr application for controlling an LED using PWM i am using mec1521 ASSY 6883 development board . Below are the details of my configuration:
Code Overview:
In the main.c file, I’m trying to control an LED using PWM, and here is the relevant code:
#include <zephyr/kernel.h>
#include <zephyr/sys/printk.h>
#include <zephyr/device.h>
#include <zephyr/drivers/pwm.h>
/* Define PWM specifications for the LED */
static const struct pwm_dt_spec pwm_led0 = PWM_DT_SPEC_GET(DT_ALIAS(pwm_led0));
#define MIN_PERIOD PWM_MSEC(1)
#define MAX_PERIOD PWM_SEC(1U)
void main(void) {
printk("PWM LED Control Example\n");
}
Device Tree Configuration:
Here is the relevant section from my .dts overlay:
& pwm-0 {
status = "okay";
channel-gpios = <&gpio_040_076 0xb GPIO_ACTIVE_HIGH>;
};
pwmleds {
compatible = "pwm-leds";
pwm_led0: pwm_led_0 {
pwms = <&pwm-0 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>; /* Channel 0, Period 20ms /
label = "PWM_LED0";
};
};
/ Define PWM channel for LED2 /
& pwm_led0 {
pwms = <&pwm-0 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>; / Channel 0 */
label = "PWM_LED2";
};
Errors Encountered:
When trying to build the project, I am receiving the following errors:
The error seems to be related to how the PWM alias and associated properties are being handled.
What I’ve Tried:
• Verified the device tree overlay configuration.
• Ensured that the aliases are correctly defined.
• Checked if the PWM driver is correctly registered.
Question:
Could anyone help me understand why these undeclared errors are happening? Is there an issue with how I have defined the alias for the PWM LED, or am I missing something in the device tree setup? Any guidance on fixing these errors would be appreciated.
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions