Error while using the CAF LEDs module

Hi, 

I tried to implement the CAF LEDs module as described here. But when added the Kconfig variable CONFIG_LED_PWM=y I got the error message "CONFIG_LED_PWM was assigned the value y, but got the value n. Missing dependencies: DT_HAS_PWM_LEDS_ENABLED"

How do I enable the PWM LEDs? My dts file looks similar to the description of the CAF LEDs module. 

pwmleds0 {
		compatible = "pwm-leds";
		status = "okay";
	
		red_pwm_led: red_pwm_led {
				status = "okay";
				pwms = <&pwm0 0 PWM_MSEC(1) PWM_POLARITY_INVERTED>;
				label = "LED0 red";
		};
	
		green_pwm_led: green_pwm_led {
				status = "okay";
				pwms = <&pwm0 1 PWM_MSEC(1) PWM_POLARITY_INVERTED>;
				label = "LED0 green";
		};
	
		blue_pwm_led: blue_pwm_led {
				status = "okay";
				pwms = <&pwm0 2 PWM_MSEC(1) PWM_POLARITY_INVERTED>;
				label = "LED0 blue";
		};
	};

Best regards,

Christian

Parents
  • Hi Christian,

    Have you made sure that other PWM configurations are also done correctly yet?

    We have a guide for that here: CAF: LEDs module (nordicsemi.com).

    Best regards,

    Hieu

  • Hi Hieu,

    when I re-opened VS Code today the initial error message was gone. But now I get other errors when compiling my application.

     

    c:/ncs/toolchains/ce3b5ff664/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/libzephyr.a(app_event_manager.c.obj): in function `app_event_manager_alloc':
    C:/ncs/v2.7.0/nrf/subsys/app_event_manager/app_event_manager.c:119: undefined reference to `k_malloc'
    c:/ncs/toolchains/ce3b5ff664/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: modules/nrf/subsys/caf/modules/lib..__nrf__subsys__caf__modules.a(leds.c.obj): in function `app_event_handler':
    C:/ncs/v2.7.0/nrf/subsys/caf/modules/leds.c:306: undefined reference to `__module_main'

    The first error disappeared when I added the config parameter CONFIG_HEAP_MEM_POOL_SIZE=2048 like discussed here. Unfortunately this wasn't mentioned in the documentation. 

    For the second error I found this case, but I don't know how to change a module name. Maybe you can explain to me what I have to do to solve this issue. 

    Best regards, 

    Christian

Reply
  • Hi Hieu,

    when I re-opened VS Code today the initial error message was gone. But now I get other errors when compiling my application.

     

    c:/ncs/toolchains/ce3b5ff664/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/libzephyr.a(app_event_manager.c.obj): in function `app_event_manager_alloc':
    C:/ncs/v2.7.0/nrf/subsys/app_event_manager/app_event_manager.c:119: undefined reference to `k_malloc'
    c:/ncs/toolchains/ce3b5ff664/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: modules/nrf/subsys/caf/modules/lib..__nrf__subsys__caf__modules.a(leds.c.obj): in function `app_event_handler':
    C:/ncs/v2.7.0/nrf/subsys/caf/modules/leds.c:306: undefined reference to `__module_main'

    The first error disappeared when I added the config parameter CONFIG_HEAP_MEM_POOL_SIZE=2048 like discussed here. Unfortunately this wasn't mentioned in the documentation. 

    For the second error I found this case, but I don't know how to change a module name. Maybe you can explain to me what I have to do to solve this issue. 

    Best regards, 

    Christian

Children
Related