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

Install bootloader from dfu .zip-file on empty/erased nRF52

I have a BLE board with a nRF52832 and some peripherals. It came with a preinstalled bootloader and firmware (the bootloader supports DFU via BLE to upgrade the bootloader and the firmware).

In the past I wrote my own firmware for the board based on a example from the nRF SDK. I erased the whole board using nRFgo Studio and used the debug link of a nRF51 devkit to flash a softdevice and my own firmware. All that worked flawlessly.

Now I want to reinstall the bootloader and firmware that came with the board (I just need to install the bootloader, the firmware is then easily installed via BLE DFU). My problem is that I don't have the hex file of that bootloader, I only have the .zip files for DFU and I do not know how to install them without a bootloader already running.

I have two zip files, one that only contains the bootloader and one that contains bootloader and softdevice. Both contain 3 files: *.bin, *.dat and manifest.json.

What is the easiest way to install that firmware on the board?

The manifest.json files look like this:

only bootloader:

{
    "manifest": {
        "bootloader": {
            "bin_file": "ebootloader.bin",
            "dat_file": "ebootloader.dat",
            "init_packet_data": {
                "application_version": 4294967295,
                "device_revision": 2,
                "device_type": 5,
                "firmware_crc16": 52615,
                "softdevice_req": [
                    168
                ]
            }
        },
        "dfu_version": 0.5
    }
}

bootloader with softdevice:

{
    "manifest": {
        "dfu_version": 0.5,
        "softdevice_bootloader": {
            "bin_file": "sd_bl.bin",
            "bl_size": 16384,
            "dat_file": "sd_bl.dat",
            "init_packet_data": {
                "application_version": 4294967295,
                "device_revision": 2,
                "device_type": 5,
                "firmware_crc16": 61420,
                "softdevice_req": [
                    65534
                ]
            },
            "sd_size": 146000
        }
    }
}

Parents
  • Hi Johannes, 

    if you have the zip that only contains the bootloader, then you can use Jlink Commander and the loadbin command to load the ebootloader.bin as long as you know its start address. 

    loadbin Load *.bin file into target memory. Syntax: loadbin <filename>, <addr>

    The manifest file indicates that this is a zip package generated using a old version of nrfutil and is compatible with our legacy DFU solution, i.e. SDK v11 and backwards. The older bootloaders were by default placed at 0x7A000 and took up 16kB( 4 flash pages)

    You also need to write the bootloader start address to UICR, specifically 0x10001014. E.g. if the bootloader starts at 0x7A000 then this is the value that should be written to 0x10001014. You can do this using nrfjprog and the --memwr command. 

    Best regards

    Bjørn

Reply
  • Hi Johannes, 

    if you have the zip that only contains the bootloader, then you can use Jlink Commander and the loadbin command to load the ebootloader.bin as long as you know its start address. 

    loadbin Load *.bin file into target memory. Syntax: loadbin <filename>, <addr>

    The manifest file indicates that this is a zip package generated using a old version of nrfutil and is compatible with our legacy DFU solution, i.e. SDK v11 and backwards. The older bootloaders were by default placed at 0x7A000 and took up 16kB( 4 flash pages)

    You also need to write the bootloader start address to UICR, specifically 0x10001014. E.g. if the bootloader starts at 0x7A000 then this is the value that should be written to 0x10001014. You can do this using nrfjprog and the --memwr command. 

    Best regards

    Bjørn

Children
No Data
Related