This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Question related to Serial DFU

Hi,

-I have a custom board using nrf 52832 and I have interfaced LIS2DH12 using an SPI interface.
-I am using SDK 15.2.0. I didn't use softdevice.
-I have written a simple application in which I have collected raw data from LIS2DH12 whenever I have sent commands.
It is working Successfully.
- Now I want to test serial DFU  with our application. Whenever I will send a command for DFU then it will enter DFU mode
as follows.

void set_dfu_mode()
{
ret_code_t err_code;
nrf_delay_ms(10);

nrf_drv_spi_uninit(&spi);

err_code = sd_power_gpregret_clr(RET_REG_DFU,0xFF);
APP_ERROR_CHECK(err_code);
err_code = sd_power_gpregret_set(RET_REG_DFU,0xB1);
APP_ERROR_CHECK(err_code);
NVIC_SystemReset();



}

I have referred following document to generate combined hex. devzone.nordicsemi.com/.../getting-started-with-nordics-secure-dfu-bootloader

// Generate bootloader setting
nrfutil settings generate --family NRF52 --application C:\Data\nrf52832\nRF5_SDK_15.2.0_9412b96\nRF5_SDK_15.2.0_9412b96\examples\peripheral\serial_test\pca10040\s132\armgcc\_build\nrf52832_xxaa.hex --application-version 1 --bootloader-version 1 --bl-settings-version 1 bootloader_setting.hex

//Generate bootloader hex
mergehex --merge C:\Data\nrf52832\nRF5_SDK_15.2.0_9412b96\nRF5_SDK_15.2.0_9412b96\examples\dfu\secure_bootloader\pca10040_uart\arm5_no_packs\_build\nrf52832_xxaa_mbr.hex C:\pc-nrfutil-master\bootloader_setting.hex --output serial_bootloader.hex


//Combined hex = bootloader + application
mergehex --merge C:\pc-nrfutil-master\cod_bootloader.hex C:\Data\nrf52832\nRF5_SDK_15.2.0_9412b96\nRF5_SDK_15.2.0_9412b96\examples\peripheral\serial_test\pca10040\s132\armgcc\_build\nrf52832_xxaa.hex --output serial_dfu_test.hex.

Whenever I am trying to program combined hex using nrfGo studio, after successfully programming I didn't observe separate bootloader section and application on nrfGo studio. pls, Refer to image 1

But Whenever I have a separate program bootloader and application hex then I got a separate bootloader section in nrfGo studio. before burning application hex. After burning the application hex didn't get a separate bootloader section and application.pls, refer to images 2 and 3.

The same test I have performed using blinky_mbr.hex and bootloader_secure_uart_debug_without_bonds_mbr.hex then I got a separate section of bootloader and application hex. Refer to image 4.

According to you what Memory setting I should be used?

Thanks in advance

  • Hi,

    The code you use to enter DFU mode looks to be correct, but I see you are using nRF GO studio for programming. This program has been deprecated and replaced by the Programmer app in nRF connect for desktop. Could you try to program the merged hex with this program instead? Also, we have a bug in the current mergehex program (v.10.12.x) that may corrupt the application image, so please make sure you are not using this version to merge the hex files (to check the version number, run mergehex --version)

    Best regards,

    Vidar

  • Could you try to program the merged hex with this program instead? 

    => I have tried using mergehex but the results are the same.

    => I want to perform serial OTA without this softdevice. What is the correct procedure to perform serial OTA?

    => In the dfu example secure_dfu_test_images folder, I have found that blinky_mbr.hex. 

    Also in the blinky example, there are two subfolders blank and MBR. What is the difference between this?

    Because whenever I am trying to generate bootloader setting hex using blank hex file then nrfutil gives the error.

  • You need to program the MBR (located in \components\softdevice\mbr\nrf52832\hex) and also make sure that your application starts at address 0x1000 in flash, and 0x20000008 in RAM (same as the blinky mbr sample).

    Also in the blinky example, there are two subfolders blank and MBR. What is the difference between this?

    The mbr project is configured so that it does not overlap with the MBR.

  • You need to program the MBR (located in \components\softdevice\mbr\nrf52832\hex) and also make sure that your application starts at address 0x1000 in flash, and 0x20000008 in RAM (same as the blinky mbr sample).

    =>  I have changed start address as per the blinky mbr sample. I have used the following command and generate a combined hex. The generated flashed using the program bootloader option of nrfGo.

    mergehex --merge C:\Data\nrf52832\nRF5_SDK_15.2.0_9412b96\nRF5_SDK_15.2.0_9412b96\components\softdevice\mbr\nrf52832\hex\mbr_nrf52_2.2.2_mbr.hex C:\pc-nrfutil-master\serial_bootloader.hex --output serial_mbr_bootloader.hex

    => Then application hex is burned but I got the same result.

  • Please use the Programmer app as I suggested earlier. Also, please confirm what version of mergehex you are using.

Related