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

DFU mode on custom board.

Hello,

I have custom board with nRF52832, and I want to have possibility to DFU over UART. I tested example bootloader (nRF5_SDK_11.0.0\examples\dfu\bootloader\pca10040\dual_bank_serial_s132) on nRF52 DK. On my custom board I don't have any buttons, so I did some changes. First, I turned off button handling. Also in main.c I commented out this line:

dfu_start |= ((nrf_gpio_pin_read(BOOTLOADER_BUTTON) == 0) ? true: false);

In my custom app is function for enter to DFU mode.

void dfu_mode_on(void)
{
    uint32_t err_code;

    err_code = sd_power_gpregret_clr(0xFF);
    APP_ERROR_CHECK(err_code);
    printf("@clear gpregret register:%lu\r\n", err_code);
    err_code = sd_power_gpregret_set(0xB1);
    APP_ERROR_CHECK(err_code);
    device_reset();
}

I also needed to delete this from main.c in bootloader:

if (init_softdevice)

First, I flash DK with softdevice. Next - bootloader. After that I do reboot, and DK comes into DFU mode.

Next:

nrfutil.exe dfu genpkg dfu_nrf52832_xxaa_s132.zip --sd-req 0xFFFE --application-version 0 --dev-type 0 --dev-revision 0 --application nrf52832_xxaa_s132.hex
nrfutil.exe dfu serial --package dfu_nrf52832_xxaa_s132.zip --port=COM5 --baudrate=38400

On DK everything works like a charm, even entering to DFU mode from my app. Unfortunetly my custom board cannot enter to DFU mode after flash bootloader and reboot. I do everything like in DK, so why it is not working? Without bootloader my custom app works fine (UART handling also) on my custom board and DK.

EDIT

I checked it with logic analyzer. There is no answer from my custom board after I try to send app with DFU. On custom board I have different RX/TX pins numbers comparing to nRF52 DK board. Maybe it is the problem? Where should I change these pins then?

Related