<?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>LED array indication while dfu process in MCU boot</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/112690/led-array-indication-while-dfu-process-in-mcu-boot</link><description>I am working on a project where my hardware includes an array of LEDs. I want to run an LED pattern on the array during the DFU process. I have tried to find a solution for this and found that there is an MCUboot indication LED macro available in Zephyr</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 07 Aug 2024 06:28:20 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/112690/led-array-indication-while-dfu-process-in-mcu-boot" /><item><title>RE: LED array indication while dfu process in MCU boot</title><link>https://devzone.nordicsemi.com/thread/497264?ContentTypeID=1</link><pubDate>Wed, 07 Aug 2024 06:28:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b0a94140-4713-4efe-952f-5b760c3f8470</guid><dc:creator>Priyesh Shahi</dc:creator><description>&lt;p&gt;Thank you &lt;span&gt;Abhijith&lt;/span&gt;,&lt;/p&gt;
&lt;p&gt;I will try with these files also.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LED array indication while dfu process in MCU boot</title><link>https://devzone.nordicsemi.com/thread/497197?ContentTypeID=1</link><pubDate>Tue, 06 Aug 2024 15:00:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cc83fd96-bb05-4c5f-b6b6-8b747f1db2f8</guid><dc:creator>Menon</dc:creator><description>&lt;p&gt;hello Priyesh,&lt;/p&gt;
[quote user="Priyesh Shahi"]However, I would still like to know which driver file or BLE service file handles the downloading of packets from BLE. Additionally, it seems the MCUBOOT_INDICATION_LED is only for UART. Even after enabling it, the LED did not blink. I also tried printing logs in the &lt;code&gt;main.c&lt;/code&gt; file of &lt;code&gt;zephyr/boot&lt;/code&gt; to see where the code sets the LED, but none of those logs printed during a DFU over BLE. The only logs that printed were from the LED initialization function. It appears the indication LED may not be working for DFU over BLE.[/quote]
&lt;p&gt;DFU over BLE is primarily managed by the Simple Management Protocol (SMP) service in the nRF Connect SDK. I recommend checking &lt;span style="color:rgba(0, 0, 255, 1);"&gt;&lt;code&gt;ncs\v2.x.x\zephyr\subsys\mgmt\mcumgr\transport\smp_bt.c&lt;/code&gt;&lt;/span&gt;, which handles the Bluetooth transport layer specific to SMP, and &lt;span style="color:rgba(0, 0, 255, 1);"&gt;&lt;code&gt;smp.c&lt;/code&gt;&lt;/span&gt;, which handles the core SMP.&lt;/p&gt;
&lt;p&gt;Yes, you are right that the MCUBOOT_INDICATION_LED feature is typically used for UART-based DFU and might not be directly tied to the BLE DFU process. I think you can achieve this by modifying the SMP callbacks&lt;/p&gt;
&lt;p&gt;Kind Regards,&lt;/p&gt;
&lt;p&gt;Abhijith&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LED array indication while dfu process in MCU boot</title><link>https://devzone.nordicsemi.com/thread/496793?ContentTypeID=1</link><pubDate>Fri, 02 Aug 2024 11:32:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a5e19c44-3a85-4e6b-a771-e5bb99686f04</guid><dc:creator>Priyesh Shahi</dc:creator><description>&lt;p&gt;Hi Abhijith,&lt;/p&gt;
&lt;p&gt;Thank you for your response.&lt;/p&gt;
&lt;p&gt;It&amp;#39;s okay if you can&amp;#39;t compare the nRF5 SDK and the nRF Connect SDK. thank you for your help with the MCUBOOT_INDICATION_LED configuration.&lt;/p&gt;
&lt;p&gt;Regarding the firmware packets, I have managed to implement a solution&lt;/p&gt;
[quote userid="112989" url="~/f/nordic-q-a/112690/led-array-indication-while-dfu-process-in-mcu-boot/493964"]In case you don&amp;#39;t want to modify sdk code, I used MCUmgr callbacks&amp;nbsp;to implement something&amp;nbsp;similar to what you describe:&lt;br /&gt;&lt;a id="" href="https://docs.zephyrproject.org/latest/services/device_mgmt/mcumgr_callbacks.html"&gt;https://docs.zephyrproject.org/latest/services/device_mgmt/mcumgr_callbacks.html&lt;/a&gt;[/quote]
&lt;p&gt;However, I would still like to know which driver file or BLE service file handles the downloading of packets from BLE. Additionally, it seems the MCUBOOT_INDICATION_LED is only for UART. Even after enabling it, the LED did not blink. I also tried printing logs in the &lt;code&gt;main.c&lt;/code&gt; file of &lt;code&gt;zephyr/boot&lt;/code&gt; to see where the code sets the LED, but none of those logs printed during a DFU over BLE. The only logs that printed were from the LED initialization function. It appears the indication LED may not be working for DFU over BLE.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LED array indication while dfu process in MCU boot</title><link>https://devzone.nordicsemi.com/thread/496775?ContentTypeID=1</link><pubDate>Fri, 02 Aug 2024 08:23:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0973e584-603b-4548-8c8f-3aa3a9ad9734</guid><dc:creator>Menon</dc:creator><description>&lt;p&gt;Hello Priyesh,&lt;/p&gt;
&lt;p&gt;I apologize, but I won&amp;#39;t be able to compare the nRF5 SDK and the nRF Connect SDK because I don&amp;#39;t have any experience working with the older nRF5 SDK. I really don&amp;#39;t know how it works.&lt;/p&gt;
&lt;p&gt;Regarding the configuration of &lt;code&gt;MCUBOOT_INDICATION_LED&lt;/code&gt;, you can&lt;a href="https://academy.nordicsemi.com/courses/nrf-connect-sdk-intermediate/lessons/lesson-8-bootloaders-and-dfu-fota/topic/exercise-1-dfu-over-uart/#:~:text=To%20indicate%20that%20MCUboot%20is%20in%20Serial%20Recovery%20mode%2C%20it%20is%20nice%20to%20have%20an%20indicator%20LED.%20We%20can%20enable%20this%20by%20setting%20CONFIG_MCUBOOT_INDICATION_LED."&gt; check this sample&lt;/a&gt;. In the sample, this configuration is used for serial recovery and also shows how to configure the LED.&lt;/p&gt;
[quote user="Priyesh Shahi"] Can you help me identify which file exactly handles the firmware packets being downloaded from Bluetooth?[/quote]
&lt;p&gt;I couldn&amp;#39;t understand this last point very well. Could you please clarify what you mean by &amp;quot;file&amp;quot; here? In nRF connect SDK OTA DFU is based on BLE service.&lt;/p&gt;
&lt;p&gt;Kind Regards,&lt;/p&gt;
&lt;p&gt;Abhijith&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LED array indication while dfu process in MCU boot</title><link>https://devzone.nordicsemi.com/thread/496584?ContentTypeID=1</link><pubDate>Thu, 01 Aug 2024 10:17:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ddae53d5-bea0-4865-8505-4ab6a754ccb6</guid><dc:creator>Priyesh Shahi</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Sorry for the late response, but I was busy with some other work. I have tried almost all these solutions, but even the MCUBOOT_INDICATION_LED is not doing anything when my device is downloading the DFU packets from Bluetooth. Can you help me identify which file exactly handles the firmware packets being downloaded from Bluetooth?&lt;/p&gt;
&lt;p&gt;Additionally, I have experience working with the nRF5 SDK, where we used the &lt;code&gt;nrf_dfu_req_handler.c&lt;/code&gt; file to handle packet downloads and made changes there. Is there a similar file or handler in the nRF Connect SDK?&lt;/p&gt;
&lt;p&gt;Thank you for your assistance.&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Priyesh Shahi&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LED array indication while dfu process in MCU boot</title><link>https://devzone.nordicsemi.com/thread/494024?ContentTypeID=1</link><pubDate>Tue, 16 Jul 2024 05:09:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:50d065aa-a388-4577-bbcc-c2eaf0aebb36</guid><dc:creator>Priyesh Shahi</dc:creator><description>&lt;p&gt;Thanks for the detailed instructions! I will try this approach and let you know if it works. I&amp;#39;ll implement the changes in &lt;code&gt;board.c&lt;/code&gt; and make the necessary modifications to the configuration and CMakeLists.txt files. I&amp;#39;ll also write the &lt;code&gt;system_led_blink()&lt;/code&gt; function. I&amp;#39;ll update you on the results soon.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LED array indication while dfu process in MCU boot</title><link>https://devzone.nordicsemi.com/thread/493976?ContentTypeID=1</link><pubDate>Mon, 15 Jul 2024 17:22:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2e9f2d59-05c7-4227-9157-0ab5ed5d66e6</guid><dc:creator>KWolfe81</dc:creator><description>&lt;p&gt;I was able to&amp;nbsp;do the exact same without modifying&amp;nbsp;MCUboot.&amp;nbsp; I put MCUboot hooks in board.c as that file is compiled by both the APP and the child image (mcuboot).&amp;nbsp;&amp;nbsp;Best practice&amp;nbsp;would put it elsewhere, but it&amp;#39;s the least&amp;nbsp;intrusive way.&lt;br /&gt;&lt;br /&gt;In child_image/mcuboot.conf, I set:&lt;br /&gt;&lt;br /&gt;CONFIG_BOOT_IMAGE_ACCESS_HOOKS=y&lt;br /&gt;CONFIG_BOOT_IMAGE_ACCESS_HOOK_NRF5340=n&lt;/p&gt;
&lt;p&gt;In my board&amp;#39;s associated CMakeLists.txt file, I set:&lt;br /&gt;&lt;br /&gt;zephyr_library_include_directories(${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/bootutil/include)&lt;br /&gt;zephyr_library_include_directories(${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/zephyr/include)&lt;br /&gt;&lt;br /&gt;Then defined the following functions in board.c.&amp;nbsp;You&amp;#39;ll need to write your own system_led_blink() function.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;pre class="ui-code" data-mode="text"&gt;#include &amp;lt;bootutil/image.h&amp;gt;
#include &amp;lt;bootutil/bootutil.h&amp;gt;

//-----------------------------------------------------------------------------
int boot_perform_update_hook(int img_index, struct image_header *img_head, const struct flash_area *area)
{
    system_led_blink(LED_COLOR_OFF, LED_COLOR_PURPLE, 250);
    return BOOT_HOOK_REGULAR;
}

//-----------------------------------------------------------------------------
int boot_read_swap_state_primary_slot_hook(int image_index, struct boot_swap_state *state)
{
    return BOOT_HOOK_REGULAR;
}

//-----------------------------------------------------------------------------
fih_int boot_image_check_hook(int img_index, int slot)
{
    FIH_RET(fih_int_encode(BOOT_HOOK_REGULAR));
}

//-----------------------------------------------------------------------------
int boot_copy_region_post_hook(int img_index, const struct flash_area *area, size_t size)
{
    system_led_set_color(LED_COLOR_WHITE);
    return 0;
}

//-----------------------------------------------------------------------------
int boot_read_image_header_hook(int img_index, int slot, struct image_header *img_head)
{
    return BOOT_HOOK_REGULAR;
}&lt;/pre&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LED array indication while dfu process in MCU boot</title><link>https://devzone.nordicsemi.com/thread/493964?ContentTypeID=1</link><pubDate>Mon, 15 Jul 2024 15:37:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b951554d-a983-4ba3-9230-9073843c8ec6</guid><dc:creator>Nicolas Goualard</dc:creator><description>&lt;p&gt;In case you don&amp;#39;t want to modify sdk code, I used MCUmgr callbacks&amp;nbsp;to implement something&amp;nbsp;similar to what you describe:&lt;br /&gt;&lt;a id="" href="https://docs.zephyrproject.org/latest/services/device_mgmt/mcumgr_callbacks.html"&gt;https://docs.zephyrproject.org/latest/services/device_mgmt/mcumgr_callbacks.html&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LED array indication while dfu process in MCU boot</title><link>https://devzone.nordicsemi.com/thread/492787?ContentTypeID=1</link><pubDate>Mon, 08 Jul 2024 15:41:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5b38cb30-bccb-4909-b9a1-743973f039da</guid><dc:creator>Menon</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;To implement your use case, you need to edit the source code of MCUboot integrated with the SDK. When doing this, you must ensure compatibility with each SDK update. Other than that, I don&amp;#39;t foresee any issues.&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Abhijith&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LED array indication while dfu process in MCU boot</title><link>https://devzone.nordicsemi.com/thread/492591?ContentTypeID=1</link><pubDate>Mon, 08 Jul 2024 04:19:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:121d7300-a0b4-4c6f-9866-c3f067d41f4f</guid><dc:creator>Priyesh Shahi</dc:creator><description>&lt;p&gt;Is it good practice to change the code inside the SDK directory, or is there a better way to do this?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LED array indication while dfu process in MCU boot</title><link>https://devzone.nordicsemi.com/thread/492469?ContentTypeID=1</link><pubDate>Fri, 05 Jul 2024 13:10:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b9ae3d46-774c-4dc9-a2c3-71123765f948</guid><dc:creator>Menon</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;First, you need to define the GPIOs for the LEDs in the Device Tree Source (DTS) file or create an overlay file that specifies the dedicated GPIOs for your LED array. Next, modify the MCUBoot bootloader code to handle the array of LEDs. Customize the MCUBoot source code (located at `bootloader\mcuboot\boot\zephyr\main`) to loop through and toggle the LEDs during the indication phase.&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Abhijith&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LED array indication while dfu process in MCU boot</title><link>https://devzone.nordicsemi.com/thread/492155?ContentTypeID=1</link><pubDate>Thu, 04 Jul 2024 04:37:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b5ce8c53-0727-45a8-a1ca-ff79dce45b71</guid><dc:creator>Priyesh Shahi</dc:creator><description>&lt;p&gt;I am using NCS v2.5.1 on the nRF52840. I know about the &lt;code&gt;CONFIG_MCUBOOT_INDICATION_LED&lt;/code&gt; setting, but I need help using this setting for an array of LEDs. Can you please assist me with that?&lt;/p&gt;
&lt;p&gt;I have eight Leds on board which are connected&amp;nbsp; to different gpios.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LED array indication while dfu process in MCU boot</title><link>https://devzone.nordicsemi.com/thread/492120?ContentTypeID=1</link><pubDate>Wed, 03 Jul 2024 19:09:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0a3b55f1-58e0-4479-bb4e-b47febad3a3b</guid><dc:creator>Menon</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I wanted to let you know that I have been assigned to this case and have started looking into it. Could you share the SDK version you are working with and specify which Nordic chip or development kit you are using? When you update the mcuboot code, you need to account for each update coming for the SDK. I assume that by &amp;quot;LED function&amp;quot; you mean &lt;a href="https://github.com/nrfconnect/sdk-mcuboot/blob/main/boot/zephyr/main.c#L528"&gt;CONFIG_MCUBOOT_INDICATION_LED&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Kind Regards,&lt;/p&gt;
&lt;p&gt;Abhijith&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>