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

Some questions about DFU

Hello!

(SDK15, nrf52832, SES)

I started to implement DFU in my code following this tutorial. So far with the tutorial i have the following issue.

1. In the section D1. Flash bootloader and softdevice says to flash the softdevice then the bootloader. I have figured out so far that the softdevice is s132_nrf52_6.0.0_softdevice.hex. As for the bootloader, is it the secure_bootloader_ble_s132_pca10040.hex ??

2. In the infocenter, testing section, it says the BUTTON 4 is the one that activates the DFU mode. I have checked the code in examples\dfu\secure_bootloader\pca10040_ble and i haven´t found where that is implemented. Does that code is always in DFU mode?

3. Following the 2. question, I want to activate the DFU mode when getting an instruction from the App. I found the following code in this forum:

// Disable the SoftDevice and restart properly in bootloader mode
void bootloader_start() {
  // A "simple" reset is not enough, the SD and IRQs must be disabled first
  ble_dfu_evt_t evt;
  memset(&evt, 0, sizeof(evt));
  evt.ble_dfu_evt_type = BLE_DFU_START;
  dfu_app_on_dfu_evt(&m_dfus, &evt);
}

I wanted to know if it's the right way to enter DFU mode because i couldn´t find the BUTTON 4 action which activates the DFU mode, and if there is another way to enter DFU.

4. This is a silly question, but i just wanted to be sure before starting. The code in the DFU example that is written in the main should be implemented right when i start the DFU mode and not when my App start right?

Sorry about all the questions, i'm just getting started with DFU.

Thanks,

Parents
  • Hi,

    1. Yes, that is correct.

    2. Referring to SDK 15, you can see the handling of the button in nrf_bootloader.c by searching for NRF_BL_DFU_ENTER_METHOD_BUTTON in that file. In a nutshell: if defined, a gpio input is read and if asserted this indicate that the bootloader should enter DFU mode instead of starting the application.

    3. I recommend you refer to the Buttonless DFU Template Application to see how you enter DFU mode from the application. (Note that the tutorial you refer to is not updated for SDK 15, so whenever it does not match SDK 15 examples or documentation, stick to what you find for SDK 15.)

    4. If you with DFU example mean bootloader example, then this main function is the bootloader main function and should stay there. If you don't have specific requirements, then I recommend you use the example bootloader as is without any modifications at all (except for replacing the example public key with your own public key). 

Reply
  • Hi,

    1. Yes, that is correct.

    2. Referring to SDK 15, you can see the handling of the button in nrf_bootloader.c by searching for NRF_BL_DFU_ENTER_METHOD_BUTTON in that file. In a nutshell: if defined, a gpio input is read and if asserted this indicate that the bootloader should enter DFU mode instead of starting the application.

    3. I recommend you refer to the Buttonless DFU Template Application to see how you enter DFU mode from the application. (Note that the tutorial you refer to is not updated for SDK 15, so whenever it does not match SDK 15 examples or documentation, stick to what you find for SDK 15.)

    4. If you with DFU example mean bootloader example, then this main function is the bootloader main function and should stay there. If you don't have specific requirements, then I recommend you use the example bootloader as is without any modifications at all (except for replacing the example public key with your own public key). 

Children
No Data
Related