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

I want to use a UART DFU Bootloader in 52840, I uploaded a app by nrfutil, If I want to enter the DFU mode again in the app, I should press button 1 and then press button 4, I want to know the mechanism?

Hi guys:

  a. I use a uart dfu bootloader(loacation: SDK-location\nRF5_SDK_15.0.0_a53641a\nRF5_SDK_15.0.0_a53641a\examples\dfu\secure_bootloader\pca10056_uart) in 52840 soc.

  b.I flashed the bootloader and SoftDevice by nrfjprog firstly.(cmd: nrfjprog -f NRF52 --program boot.hex)

  c.Then, I upload app.zip package by nrfutil.(cmd: nrfutil  dfu serial -pkg test-dfu15.zip -p COM16 ), the app is SDK-location\nRF5_SDK_15.0.0_a53641a\nRF5_SDK_15.0.0_a53641a\examples\ble_peripheral\ble_app_uart.

  d. I found If I want to enter the bootloader again when Iam in app, I should press the DK-52840 board button 1 and then press button 4.

  Can you tell me the mechanism and the funtion of button 1 and button 4?

  Thanks.

    

Parents
  • Hi,

    The ble_app_uart example application does not include any way of entering the bootloader. So without modifying it, the typical way to enter the bootloader would be to press the reset button while pressing button 16. This is because if you look at the bootloader, you can see that it's sdk_config.h (examples\dfu\secure_bootloader\pca10040_uart\config\sdk_config.h) have set NRF_BL_DFU_ENTER_METHOD_BUTTON to 1 and NRF_BL_DFU_ENTER_METHOD_BUTTON_PIN to 16, which is the GPIO used by botton 4 on the nRF52 DK. If you now look at the bootloder implementation you can see the code that checks NRF_BL_DFU_ENTER_METHOD_BUTTON_PIN to decide if DFU mode should be entered in dfu_enter_check() in components\libraries\bootloader\nrf_bootloader.c.

  • A: I hadn't edit the Bootloader(SDK-location\nRF5_SDK_15.0.0_a53641a\nRF5_SDK_15.0.0_a53641a\examples\dfu\secure_bootloader\pca10056_uart) and the APP(SDK-location\nRF5_SDK_15.0.0_a53641a\nRF5_SDK_15.0.0_a53641a\examples\ble_peripheral\ble_app_uart) project. they all come come the SDK example.I just flashed them.

    B: I made an experiment: If my program run in app, I can press button 1 to stop the app run, then i press button 4 will enter dfu mode.

    C:I can't understand the mechanism.

  • Hi,

    These buttons are handled very differently in this case. The ble_app_uart sample only use Button 1 and button 2 (referred to as 0 and 1 in code), where button 1 is used to sleep and disconnect, depending on state (see BSP BLE Button Assignments). This sleep is system off, and wakeup here will be in form of a reset.

    When the device wakes up from system off mode the bootloader runs, and checks if button 4 is pressed, as NRF_BL_DFU_ENTER_METHOD_BUTTON_PIN is set to 25 in the example bootloader project for the nRF52840 DK. If it is, it enters DFU mode.

  • Thanks for your reply. 

    I found a stranger phenomeno:

    A: If i only flashed  the ble_app_uart and SoftDevice. the button 1 is used to sleep and disconnect, depending on state (see BSP BLE Button Assignments).  It works well.

    B: However. When I flashed ble_app_uart 、SoftDevice and Bootloader,the button 1 is not worked. you can test it in your convenience. It's a bug?

Reply Children
Related