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

unable to download larger bootloader

Hello,

Is there any DFU package that can be created that would enable downloading a larger bootloader? In this case, we have the non-debug bootloader loaded and want to switch to the debug version of the bootloader via a DFU download. These are "sealed" units.

  • Unfortunately not. Although it is possible to change the UICR value of the bootloader start address (see the NRF_UICR_BOOTLOADER_START_ADDRESS macro in nrf_bootloader_info.h & this link), this is not advisable because if you make a mistake, you could brick the whole device. From talking with other colleagues at work, it seems this process is very tricky & complicated. Therefore, there is a high chance that you could brick the device. I would recommend debugging via a cabled connection if that is a possibility (depending on how "sealed" the devices are).

  • Speaking of updating the UICR, there seems to be some magic there I am missing when reflashing the entire chip. I have a script that does an eraseall, then reloads all the software components. When the script completes it will not boot. If I then open NRFgo and select "nRF5x Programming" it suddenly comes to life. What is happening and how can I incorporate that in a script? I have a feeling it has something to do with the UICR registers.

  • Can you see your device in Windows File Explorer as a JLINK external disk after you run your eraseall script? What happens when you type nrfjrpog -i in a windows command window? Can you see the Segger ID of your device? I am slightly unsure what exactly happens when you press nrf5x Programming because I am not able to click it myself. But when I click the Segger ID under "nrf52 development boards", I am  sure the device flash is read, as you can see the different regions (application, softdevice, bootloader) in the graphic in the middle. Something similar like this can be done by using nrfjprog commands.

  • You must be using a different version of "NRFgo Studio". I am using version 1.21.2.10.

    Yes, the JLink ID is returned when you run "nrfjproj -i"

    Attached is a file which contains all the commands executed to erase, reprogram and hopefully bring the process back to life. The processor does not boot after the reload. However going into "NRFgo Studio" as previously described does cause the processor to boot and run the application. The application must be doing something more than just reading the flash.

    nrfjprog.exe --family NRF52 --eraseall
    nrfjprog.exe --family NRF52 --verify --program s132_nrf52_5.0.0_softdevice.hex
    nrfjprog.exe --family NRF52 --verify --program bootloader-debugoption.hex
    nrfjprog.exe --family NRF52 --verify --program app_settings.hex
    nrfjprog.exe --family NRF52 --reset
    nrfjprog.exe --family NRF52 --verify --program nrf52832_xxaa.hex
    nrfjprog.exe --family NRF52 --reset
    
    Ran these on the command line
      545  nrfjprog.exe --family NRF52 --readuicr uicr.bin
      546  nrfjprog.exe --family NRF52 --readcode code.bin
      547  nrfjprog.exe --family NRF52 --reset
      548  nrfjprog.exe --family NRF52 --run
      549  nrfjprog.exe --family NRF52 --readregs
      550  nrfjprog.exe --family NRF52 --readram ram.bin
      551  nrfjprog.exe --family NRF52 --reset
    

  • I am missing a `nrfjprog.exe --family NRF52 --run` at the end of the sequence. Looks like you just kept the MCU in reset.

Related