Flash mcumgr hex only

Hi,

    I am working with nRF52832_dvk board, i am testing the OTA example as per in this link. https://devzone.nordicsemi.com/guides/nrf-connect-sdk-guides/b/software/posts/ncs-dfu

this example has mcumgr bootloader as well for image validation and all . so now i wanted to flash only that mcumgr hex file. not all the application hex file. how to achieve that . if am not wrong that mcumgr hex will be in ( build/mcuboot/zephyr/) but here other hex files also there , 

1. mcuboot_primary_app.hex

2. mcuboot_primary.hex.

3.merged.hex

4.zephyr.hex 

what all these hex files for ? , among them which one is for mcuboot bootloader ? 

which tool i need to use to flash that hex file (bootloader hex only). from where i can get that hex . Kindly guide for the same.

  • Hi Shikamaru, 

    I would like to clarify that MCUMGR is image management library, it's not a bootloader. The bootloader is MCUBoot

    If you only want the MCUBoot hex file, you can find the hex file inside \build\mcuboot\zephyr folder. 

    Could you let us know what exactly you want to do with the mcuboot hex file ? Note that, unlike the bootloader in nRF5 SDK, the MCUBoot bootloader doesn't do DFU process itself (except for Serial recovery mode) it only does the booting and image swapping/testing part. 

  • I would like to clarify that MCUMGR is image management library, it's not a bootloader. The bootloader is MCUBoot

    hi hung bui, 

                     My bad !, thanks for the clarification. 

    If you only want the MCUBoot hex file, you can find the hex file inside \build\mcuboot\zephyr folder. 

    Yes got it. 

    Could you let us know what exactly you want to do with the mcuboot hex file ?

    my requirement is that , " Mcuboot will do booting as well as image swapping or testing" as you mentioned. here while swapping the image it will use flash write or read api's to copy image . so I have custom flash api's(read , write ..etc.) , my requirement is to replace mcuboot' s  read, write with our own read and write api's . 

    For the same purpose I need to understand which all are the files this is utilizing , how do figure it out. Kindly suggest.

    If you only want the MCUBoot hex file, you can find the hex file inside \build\mcuboot\zephyr folder. 

    and how can I flash only that hex file , do I need any further tools for that purpose.

  • HI Shikamaru, 

    I haven't done this modification myself so I'm not sure what would be the correct way of doing that. But if you have a look at \bootloader\mcuboot\boot\nuttx\src\flash_map_backend\flash_map_backend.c, you can find their own definition of flash read/write/erase API. 

    I would assume CONFIG_SOC_FLASH_NRF need to be changed so that you can direct MCUBoot to choose your own implementation. 

    Shikamaru said:
    how can I flash only that hex file , do I need any further tools for that purpose.

    You can flash a hex file using nrfjprog.exe command line tool.

Related