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

Button 4 to enter the DFU mode?

Hello, I am evaluating ways to enter the DFU mode when application is corrupted (i.e. it does not reach the code for entering bootloader).

The documentation states that the DFU mode is started when "Button 4 is pressed when starting the device".

Does this mean that the bootloader binary blob itself checks whether GPIO P0.20 (Button 4 at PCA10028) is low during startup? If so, does it use any other GPIO pins (i.e. for LEDs)?

Alternatively, is there any other way to start bootloader after successfully loading "corrupted" application?

Thank you,

Adam

Parents
  • Hi,

    Yes, the bootloader checks whether button 4 is held during startup, and if so enters DFU mode instead of starting the application.

    In addition the bootloader uses an LED.

    You will find the bootloader code in the SDK, under <sdk folder>\examples\dfu\bootloader. In main.c you will find BOOTLOADER_BUTTON and UPDATE_IN_PROGRESS_LED defined, near the top. These defines uses the board support package, so defining BOARD_PCA10028 will set up the bootloader to use the pin numbers for BSP_BUTTON_3 and BSP_LED_2 on that particular board.

    Regards, Terje

  • Hello, thank you for quick answer. This is nice - I thought the bootloader was a binary blob (like the SoftDevice) but now I see that I am able to modify its source code to fit my needs.

Reply Children
Related