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

  • Thanks

    one thing I forgot to tell you that in my application I have used UICR address 0x10001080  to store the unique id of the device.  When I Commented UICR part of the code and repeat the procedure as above mentioned in the thread then I got 2 different sections of bootloader and application.

    => I want to use UICR in our application. Can you suggest an approach to solve this problem with UICR?

    =>I didn't use softdevice. so can you tell me whether the following function is correct or not?

    void set_dfu_mode()
    {
    nrf_drv_spi_uninit(&spi);
    NRF_POWER->GPREGRET = 0xFF;
    NRF_POWER->GPREGRET = 0xB1

    NVIC_SystemReset();

    }

Related