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

Original UART DFU bootloader SDK example ported from NRF6310 board to PCA10001 board does not work.

Hi,

Original UART DFU bootloader SDK example ported from NRF6310 board to PCA10001 board does not work.

What did I do wrong - can anybody please help me ? Thanks in advance.

I copied the original UART DFU bootloader code from C:\Keil_v5\ARM\Device\Nordic\nrf51822\Board\nrf6310\device_firmware_updates\bootloader\arm under C:\Keil_v5\ARM\Device\Nordic\nrf51822\Board\pca10001 and changed it to be suitable for pca10001 - changed pin numbers of Buttons and leds, memory areas etc.

In Keil I changed Target values: IROM1: Start : 0x14000, Size: 0x2B000, IRAM1: Start : 0x20002000, Size: 0x2000.

I used the following UART pins:

tx: pin 9 rx: pin 12 ground: gnd NO cts nor rts pins used !

Then I flashed the bootloader to pca10001 board with Keil and started the Keil debugger.

Then I tried to send blinky_arm.hex file from dos cmd prompt to pca10001 board but there was transmission timeout after about 5 seconds:

C:\Keil_v5\ARM\Device\Nordic\nrf51822\Board\nrf6310\device_firmware_updates\experimental\hci_dfu_send_hex>hci_dfu_send_hex.exe -f blinky_arm.hex -p COM3 Sending file blinky_arm.hex to COM3, flow control = False Progress: 0 Transmission timeout. Ack out of sequence, or no ack returned

In bootloader code bootloader_app_is_valid function the Keil debugger stopped at breakpoint with these values:

DFU_BANK_0_REGION_START: 0x00014000 p_bootloader_settings->bank_0: 0xFF

bool bootloader_app_is_valid(uint32_t app_addr) { const bootloader_settings_t * p_bootloader_settings;

// There exists an application in CODE region 1.
if (DFU_BANK_0_REGION_START == EMPTY_FLASH_MASK)
{
    return false;
}

bool success = false;

switch (app_addr)
{
    case DFU_BANK_0_REGION_START:
        bootloader_util_settings_get(&p_bootloader_settings);

        // The application in CODE region 1 is flagged as valid during update.
        if (p_bootloader_settings->bank_0 == BANK_VALID_APP)
        {

...

There was also BOOTLOADER_TIMEOUT in wait_for_events function:

static void wait_for_events(void) {

for (;;)
{			
    // Wait in low power state for any events.
    uint32_t err_code = sd_app_evt_wait();
		
    APP_ERROR_CHECK(err_code);

    // Event received. Process it from the scheduler.
    app_sched_execute();			
		
    if ((m_update_status == BOOTLOADER_COMPLETE) || 
        (m_update_status == BOOTLOADER_TIMEOUT)  ||
        (m_update_status == BOOTLOADER_RESET))
    {

...

Why did not the hci_dfu_send_hex.exe send the blinky_arm.hex file ?

Best Regards, Devtim

Parents
  • Hi,

    Thanks for your reply.

    Now wait_for_events - fuction in bootloader.c begins with BOOTLOADER_UPDATING state. After that I started to send hex file via UART with this command:

    hci_dfu_send_hex.exe -f blinky_arm.hex -p COM5

    But when after this the process stays waiting for next event in sd_app_evt_wait() call:

    static void wait_for_events(void)

    {

    for (;;)
    {
        // Wait in low power state for any events.
        uint32_t err_code = sd_app_evt_wait();
        APP_ERROR_CHECK(err_code);
    
        // Event received. Process it from the scheduler.
        app_sched_execute();
    
        if ((m_update_status == BOOTLOADER_COMPLETE) ||
            (m_update_status == BOOTLOADER_TIMEOUT)  ||
            (m_update_status == BOOTLOADER_RESET))
    

    In the same time also hci_dfu_send - process stays in wait loop:

    C:\Keil_v5\ARM\Device\Nordic\nrf51822\Board\nrf6310\device_firmware_updates\experimental\hci_dfu_send_hex>hci_dfu_send_hex.exe -f blinky_arm.hex -p COM5

    Sending file blinky_arm.hex to COM5, flow control = False Progress: 0

    Why does not the bootloader continue and receive the hex file ?

    Thanks in advance.

    Br, Devtim

Reply
  • Hi,

    Thanks for your reply.

    Now wait_for_events - fuction in bootloader.c begins with BOOTLOADER_UPDATING state. After that I started to send hex file via UART with this command:

    hci_dfu_send_hex.exe -f blinky_arm.hex -p COM5

    But when after this the process stays waiting for next event in sd_app_evt_wait() call:

    static void wait_for_events(void)

    {

    for (;;)
    {
        // Wait in low power state for any events.
        uint32_t err_code = sd_app_evt_wait();
        APP_ERROR_CHECK(err_code);
    
        // Event received. Process it from the scheduler.
        app_sched_execute();
    
        if ((m_update_status == BOOTLOADER_COMPLETE) ||
            (m_update_status == BOOTLOADER_TIMEOUT)  ||
            (m_update_status == BOOTLOADER_RESET))
    

    In the same time also hci_dfu_send - process stays in wait loop:

    C:\Keil_v5\ARM\Device\Nordic\nrf51822\Board\nrf6310\device_firmware_updates\experimental\hci_dfu_send_hex>hci_dfu_send_hex.exe -f blinky_arm.hex -p COM5

    Sending file blinky_arm.hex to COM5, flow control = False Progress: 0

    Why does not the bootloader continue and receive the hex file ?

    Thanks in advance.

    Br, Devtim

Children
No Data
Related