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

Replacing bootloader through nrfjprog - Error: Single: Invalid Bank

I am trying to upload a bootloader to an nRF52832 chip. (This chip is on the ruuvitag and is programmed through their developer board).

I got the bootloader working on the DK but when I tried to upload it to the Ruuvitag I get the log output: Error: Single: Invalid Bank Info: Error code - sd_ble_cfg_set: 0x00000000

The ruuvitag comes with a bootloader based on SDK 12 and SD 3. I am using SDK 13 and SD 4. I am programming using nrfjprog and compiling with GCC.

I suspect that the issue is because of some settings related to the original bootloader that gets confused when loaded with the SDK 13 bootloader, but I am really stuck.

  • Sorry Hung, I should've exaplained clearer. I have the Bluetooth working, and the softdevices definitely runs with no issue. The board definitely has the crystal on it too. I can get the example working such that I can see the DFU, connect to it, but when I attempt to upload the firmware to it, it fails. I'll work on getting that log output for you ASAP.

  • Still, can you simply list all the steps you did to update the firmware ? It's really hard to help you if you just reveal information partly like this. Please erase the chip and follow the steps I described here and let me know it fails at which step, make sure you update a simple application at the beginning ble_app_hrs for example.

  • Hey Hung, I will try to explain the full situation clearer.

    I have been developing with both the Nordic DK and a Ruuvitag, which uses the nRF52832 chip and has a breakout board to program that directly. I have been developing on a mac using GCC and programming the board using nrfjprog. I recently moved to using SDK 14.1 and SD 5.

    I have been able to program the both the DK and the Ruuvitag with many of the nordic examples and have my own program which works on both, which uses BLE with softdevices. I now would likely the ability to upload my firmware OTA.

    I have simply used the Nordic DFU example (secure_dfu_ble) as my bootloader. I erase the chip using nrfjprog, upload softdevices then upload the bootloader. On the DK this works perfectly, and I am able to upload my program and get the expected output.

    The Ruuvitag has a custom board.h file which does some pin mapping, and with this included instead of the pca10040 board the program uploads with no problem. The only issue is that the program doesn't seem to work, I don't see DfuTarg as an option in nrf Toolbox like I see with the DK (note that this is slightly different to earlier re: SDK update). And so have no opportunity to even try and upload the firmware.

    I then altered the program to output over UART so I could see what was happening, I made the changes to the softdevices RAM as the program suggested and get the following output:

    <info> nrf_sdh_soc: Inside main
    <info> nrf_sdh_soc: LED's initisialised
    <info> nrf_sdh_soc: Buttons initialised
    <debug> nrf_sdh_soc: In nrf_bootloader_init
    <debug> nrf_sdh_soc: in weak nrf_dfu_init_user
    <debug> nrf_sdh_soc: In real nrf_dfu_init
    <debug> nrf_dfu_settings_svci: Running nrf_dfu_settings_init(sd_irq_initialized=false).
    <debug> nrf_sdh_ble: Calling nrf_dfu_flash_init(sd_irq_initialized=false)...
    <debug> nrf_sdh_ble: Initializing nrf_fstorage_nvmc backend.
    <debug> nrf_sdh_soc: Initializing the clock.
    <debug> nrf_sdh_soc: Enter nrf_dfu_continue
    <error> nrf_sdh_soc: Single: Invalid bank
    <debug> nrf_sdh_soc: Enter nrf_dfu_app_is_valid
    <debug> nrf_sdh_soc: Return false in valid app check
    <debug> nrf_sdh_soc: In nrf_dfu_transports_init
    <debug> nrf_sdh_soc: num transports: 1
    <debug> nrf_sdh_soc: Initializing BLE DFU transport
    <debug> nrf_sdh_soc: vector table: 0x00073000
    <debug> nrf_sdh_soc: vector table: 0x00073000
    <debug> nrf_sdh_soc: Error code - sd_softdevice_vector_table_base_set: 0x00000000
    <debug> nrf_sdh_soc: Enabling SoftDevice.
    <debug> nrf_sdh_soc: SoftDevice enabled.
    <debug> nrf_sdh_soc: nrf_dfu_settings_adv_name_is_valid FALSE
    <debug> nrf_sdh_soc: Regular adv name
    <debug> nrf_sdh_soc: #### Advertising NO BONDING ####
    <debug> nrf_sdh_soc: Finished initializing BLE DFU transport
    <debug> nrf_sdh_soc: After nrf_dfu_transports_init
    <debug> nrf_sdh_ble: Calling nrf_dfu_flash_init(sd_irq_initialized=true)...
    <debug> nrf_sdh_ble: Initializing nrf_fstorage_sd backend.
    <debug> nrf_sdh_soc: Waiting for events
    

    Note that this output is the same for both the DK and the Ruuvitag but, again, the Ruuvitag doesn't advertise anything when the DK works perfectly.

    Thanks for your time.

  • Could you clarify, earlier you mentioned: " I can get the example working such that I can see the DFU, connect to it, but when I attempt to upload the firmware to it, it fails. " Meaning you actually saw DFUTarg advertising by the Ruvitag ?

    One thing you should check if a phone/central device may automatically connect to the Ruvitag or not. If you were bonded with the central before, the central may automatically connect to the device. You can try to change the BLE address before advertising.

Related