<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Error while using the CAF LEDs module</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/114620/error-while-using-the-caf-leds-module</link><description>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 &amp;quot;CONFIG_LED_PWM was assigned the value y, but got the value n. Missing dependencies: DT_HAS_PWM_LEDS_ENABLED</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 12 Sep 2024 12:47:10 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/114620/error-while-using-the-caf-leds-module" /><item><title>RE: Error while using the CAF LEDs module</title><link>https://devzone.nordicsemi.com/thread/502307?ContentTypeID=1</link><pubDate>Thu, 12 Sep 2024 12:47:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e907cbf4-b812-46e6-bc21-a256c6f56c13</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Christian,&lt;/p&gt;
[quote user="ilockit_CFR"]I attached two files with and withoude the heap config. The only thing that differs is&amp;nbsp;CONFIG_HEAP_MEM_POOL_SIZE.[/quote]
&lt;p&gt;Thank you for the file. Apparently, &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/v3.6.99-ncs2/kernel/mempool.c#L59-L82"&gt;k_malloc will not be compiled if HEAP_MEM_POOL_SIZE is 0&lt;/a&gt;, and that config is defaulted to 0.&amp;nbsp;I still feel like the direct dependency is a bit unintuitive, but I suppose it makes sense.&lt;/p&gt;
[quote user="ilockit_CFR"]&lt;p&gt;thanks for your answer. The application compiles, but can you please explain why I have to include the&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;module_state_event.h header and define this module name?&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;[/quote]
&lt;p&gt;I meant to send two links in my last reply but looks like it got merged into one. This is explained in the lost link:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-2.7.0/page/nrf/libraries/caf/caf_overview.html#c.module_state_event"&gt;Common Application Framework overview (nordicsemi.com)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Preprocessors are used to create a C symbol for each module, which is used for sending and receiving events.&amp;nbsp;Due to the implementation, MODULE has to be defined before module_state_event.h header.&lt;/p&gt;
&lt;p&gt;If you are interested, the macro is resolved in this part of the code:&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v2.7.0/include/caf/events/module_state_event.h#L289-L331"&gt;sdk-nrf/include/caf/events/module_state_event.h at v2.7.0 · nrfconnect/sdk-nrf (github.com)&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error while using the CAF LEDs module</title><link>https://devzone.nordicsemi.com/thread/502148?ContentTypeID=1</link><pubDate>Wed, 11 Sep 2024 13:23:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3480e3f4-a813-4cbf-bb0c-8a3fdc8ca7ac</guid><dc:creator>ilockit_CFR</dc:creator><description>&lt;p&gt;Hi Hieu,&lt;/p&gt;
&lt;p&gt;thanks for your answer. The application compiles, but can you please explain why I have to include the&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;module_state_event.h header and define this module name?&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;I attached two files with and withoude the heap config. The only thing that differs is&amp;nbsp;CONFIG_HEAP_MEM_POOL_SIZE.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/without_5F00_heap_2E00_config"&gt;devzone.nordicsemi.com/.../without_5F00_heap_2E00_config&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/heap_2E00_config"&gt;devzone.nordicsemi.com/.../heap_2E00_config&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Hope this helps,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Christian&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error while using the CAF LEDs module</title><link>https://devzone.nordicsemi.com/thread/502130?ContentTypeID=1</link><pubDate>Wed, 11 Sep 2024 12:48:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b0bc735-c569-45a2-a766-9294c0844bc5</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Christian,&lt;/p&gt;
[quote user="ilockit_CFR"]The first error disappeared when I added the config parameter&amp;nbsp;CONFIG_HEAP_MEM_POOL_SIZE=2048 like discussed&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/92488/cannot-build-minimal-code-with-caf-enabled"&gt;here&lt;/a&gt;. Unfortunately this wasn&amp;#39;t mentioned in the documentation.&amp;nbsp;[/quote]
&lt;p&gt;From a search, I acknowledge that setting CONFIG_HEAP_MEM_POOL_SIZE fixes it for&amp;nbsp;you and other people, but it makes no sense at all that it does. Could you please get me the compiled Kconfig files before and after setting CONFIG_HEAP_MEM_POOL_SIZE to see what the whole changes are?&lt;/p&gt;
&lt;p&gt;If you are using sysbuild, it is located in &amp;lt;build dir&amp;gt;/&amp;lt;app name&amp;gt;/zephyr/.config. Otherwise, it is located in &amp;lt;build dir&amp;gt;/zephyr/.config.&lt;/p&gt;
[quote user="ilockit_CFR"]For the second error I found&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/97040/error-message-from-caf-module"&gt;this&lt;/a&gt;&amp;nbsp;case, but I don&amp;#39;t know how to change a module name. Maybe you can explain to me what I have to do to solve this issue.&amp;nbsp;[/quote]
&lt;p&gt;You just need to define the macro MODULE in your main application source file. Refer:&amp;nbsp;&lt;br /&gt;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v2.7.0/applications/nrf_desktop/src/main.c#L9"&gt;https://github.com/nrfconnect/sdk-nrf/blob/v2.7.0/applications/nrf_desktop/src/main.c#L9&lt;br /&gt;https://docs.nordicsemi.com/bundle/ncs-2.7.0/page/nrf/libraries/caf/caf_overview.html#c.module_state_event&lt;br /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error while using the CAF LEDs module</title><link>https://devzone.nordicsemi.com/thread/502100?ContentTypeID=1</link><pubDate>Wed, 11 Sep 2024 11:47:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b1d28c86-c22b-4eac-82d6-b2a46a75f794</guid><dc:creator>ilockit_CFR</dc:creator><description>&lt;p&gt;Hi Hieu,&lt;/p&gt;
&lt;p&gt;when I re-opened VS Code today the initial error message was gone. But now I get other errors when compiling my application.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;pre class="ui-code" data-mode="text"&gt;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&amp;#39;:
C:/ncs/v2.7.0/nrf/subsys/app_event_manager/app_event_manager.c:119: undefined reference to `k_malloc&amp;#39;
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&amp;#39;:
C:/ncs/v2.7.0/nrf/subsys/caf/modules/leds.c:306: undefined reference to `__module_main&amp;#39;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The first error disappeared when I added the config parameter&amp;nbsp;CONFIG_HEAP_MEM_POOL_SIZE=2048 like discussed&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/92488/cannot-build-minimal-code-with-caf-enabled"&gt;here&lt;/a&gt;. Unfortunately this wasn&amp;#39;t mentioned in the documentation.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;For the second error I found&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/97040/error-message-from-caf-module"&gt;this&lt;/a&gt;&amp;nbsp;case, but I don&amp;#39;t know how to change a module name. Maybe you can explain to me what I have to do to solve this issue.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Christian&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error while using the CAF LEDs module</title><link>https://devzone.nordicsemi.com/thread/502072?ContentTypeID=1</link><pubDate>Wed, 11 Sep 2024 10:07:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:909d04a0-ff4a-4f11-b153-5dd788f1eb7a</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Christian,&lt;/p&gt;
&lt;p&gt;Have you made sure that other PWM configurations are also done correctly yet?&lt;/p&gt;
&lt;p&gt;We have a guide for that here:&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-2.7.0/page/nrf/libraries/caf/leds.html#configuring_pwm_leds"&gt;CAF: LEDs module (nordicsemi.com)&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>