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

OTA FWU bootloader timeout after SDK v8.1.0 upgrade

There's no question, I'm just posting this here in the hopes that it helps someone else out.

After I upgraded my Keil packs to the newest SDK (v8.1.0), my OTA FWU bootloader mysteriously stopped working (originally based on example project). I was using Master Control Panel v3.9.0.6 to test it out, and I would get an error as soon as it started. I looked at the MCP log and found this:

Response received for Request Op Code = 3

Ultimately, I traced down the source of the problem by setting a breakpoint in dfu_error_notify() in dfu_transport_ble.c and seeing where it was getting called from, which was this snippet in app_data_process():

err_code = hci_mem_pool_rx_produce(length, (void **) &mp_rx_buffer);
if (err_code != NRF_SUCCESS)
{
    dfu_error_notify(p_dfu, err_code);
    return;
}

It turns out that upgrading the Keil Packs overwrote the contents of hci_mem_pool_internal.h from this (the correct version):

#define TX_BUF_SIZE       4u         	/**< TX buffer size in bytes. */
#define RX_BUF_SIZE       32u  				/**< RX buffer size in bytes. */
#define RX_BUF_QUEUE_SIZE 8u           /**< RX buffer element size. */

to this (the incorrect version and the default if you don't change it):

#define TX_BUF_SIZE       600u         /**< TX buffer size in bytes. */
#define RX_BUF_SIZE       TX_BUF_SIZE  /**< RX buffer size in bytes. */
#define RX_BUF_QUEUE_SIZE 4u           /**< RX buffer element size. */

Moral of the story: be careful when updating Keil Packs!

Parents
  • Thanks @Hung for looking into this. BTW the key difference between the example bootloader and my configuration is this little check box in the Keil Pack Selector to use the latest versions of all software packs:

    checkbox in Software Pack selector

    I think what happened is that when I upgraded my Keil packs, Keil automatically deleted the original hci_mem_pool_internal.h (which was specially modified for the DFU bootloader) and replaced it with the stock version.

    It would be much better from a code management perspective if Nordic moved all project-specific configuration values (like the contents of nrf_drv_config.h, hci_mem_pool_internal.h, and twi_master_config.h) out of the SDK packs and into each example project's source code. From my perspective, everything in the SDK should be considered read-only unless I have a very very good reason to change it.

Reply
  • Thanks @Hung for looking into this. BTW the key difference between the example bootloader and my configuration is this little check box in the Keil Pack Selector to use the latest versions of all software packs:

    checkbox in Software Pack selector

    I think what happened is that when I upgraded my Keil packs, Keil automatically deleted the original hci_mem_pool_internal.h (which was specially modified for the DFU bootloader) and replaced it with the stock version.

    It would be much better from a code management perspective if Nordic moved all project-specific configuration values (like the contents of nrf_drv_config.h, hci_mem_pool_internal.h, and twi_master_config.h) out of the SDK packs and into each example project's source code. From my perspective, everything in the SDK should be considered read-only unless I have a very very good reason to change it.

Children
Related