This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Help needed to perform BLE DFU using another BLE as central

Hello,

I need some help or advice on the easiest way to perform DFU in a nRF52832 device using a nRF52820 as a central through BLE.

My nRF52832 device already has the DFU working, as I can perform updates using nrfConnect (android and/or PC). Now I need to be able to use the other board, containing a nRF52820 device, as a gateway to perform the update. 

Seen lots of threads on the forum, but seems that it has never been made available by Nordic.

Also found some samples using the UART port to perform DFU, but it isn't an option in my case.

The approach shown here would be ideal. Is that feasable? What should I do?

I accept any suggestion, as long as the solution is a nRF52820 (connected to a PC via USB)  performing BLE DFU in a nRF52832 device.

Thanks in advance.

Parents Reply Children
  • Hi Sigurd,

    Sorry, forgot to mention. I am using nRF5 SDK v17.10 and IAR 9 on windows11.

    Best Regards,

  • Hi,

    The easiest way to perform DFU from a PC is to use nRF Util together with a nRF52840 dongle. With the nRF52820 you are looking custom solution to handle reception and forwarding of the init command and FW image to your target. Documentation for the BLE DFU protocol can be found in the SDK documentation here: BLE.

    Best regards,

    Vidar

  • As my trial to build my own bootloader, without DFU, I did as follows:

    - Reserved for bootloader the area 0x26000 ~ 0x47fff. Set intvec_address as 0x26000;

    - Reserved for application the area 0x48000 ~ 0x7ffff . Set intvec_address as 0x48000;

    If bootloader detects a valid application (by reading a flag stored in flash address 0x7c000), it performs a jump to the application area. The code is as:

    if(validFw) {
          /* Jump to user application */
          JumpAddress = *(__IO uint32_t*) (APPLICATION_ADDRESS);
          JumpToApplication = (pFunction) JumpAddress;
          /* Initialize user application's Stack Pointer */
          __set_MSP(*(__IO uint32_t*) APPLICATION_ADDRESS); /* APPLICATION_ADDRESS = 0x48000 */
          //nrf_sdh_enable_request();
          //sd_softdevice_vector_table_base_set(APPLICATION_ADDRESS);
          JumpToApplication();
        }
     

    But something goes wrong and it just restarts to bootloader. I tried setting the interrupt vector address for softdevice (sd_softdevice_vector_table_base_set(APPLICATION_ADDRESS)) but it didn't work either.

    Any idea of what am I doing wrong?

  • It looks like you are retrieving the SP and Reset vector from the same address. The initial stack pointer value is stored at the intvec_address while the reset handler is at intvec_address+0x4.

    You must also call sd_softdevice_vector_table_base_set() to make the softdevice forward interrupts to your application.

  • I got my bootloader working by calling sd_softdevice_vector_table_base_set(). Based my code on the legacy bootloader found on sdk v11.

    Thanks Vidar and Sigurd for your support.

Related