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

How do Debug DFU?

I've followed the instructions here to try and get my J-Link debugger to run in bootloader.

I am using a newer SDK and SD (than the post was written for) so that may have something to do with why I can't get the debugger to run.

I'm using: Custom PCB with nRF51422 (256K ROM) chip SDK 9.0 SD 310 version 3.0

For the bootloader I started with the dfu_dual_bank_ble_s310_pca10028 example, and added the DFU support to my custom application.

I can successfully do OTA BLE updates. I want to be able to step through the bootloader code to get a better understanding of how it works, and make a few minor changes to customize it to my application. I can not do this until I can get my debugger working.

Are there updated instructions on how to debug the bootloader, or can someone guide me through the changes from the above example to get the bootloader running?

Thanks, Clint

Parents
  • Hi

    I use the default bootloader in SDK 9.0.0 for SD 310 and follow the instruction given on the given thread, and I am able to debug the bootloader. What difficulties are you facing exactly? Are you seeing any errors or is a breakpoint in the bootloader main function just not hit when you start the debugger?

    It is possible that you need more space for the bootloader than given in the linked thread if you have made any modifications to the default bootloader in the SDK. To check if that is the issue, you could set

    #define BOOTLOADER_REGION_START 0x00030000
    

    and set IROM start to be 0x00030000 and IROM size to 0xFC00

    Optimally, you can see how much ROM (flash space) the bootloader occupies when it is not compressed by summing the Code, RO-data and RW-data sizes that is given when you compile uncompressed bootloader

    Update 2.10.2015 You must erase the chip by e.g. pressing "ERASE ALL" in nRFgo Studio, then program softdevice again, then the bootloader. Have you done that?

    Keil runs nrfjprog.exe in the the background when programming the bootloader. I have the following arguments set in Keil to program the bootloader

    image description

Reply
  • Hi

    I use the default bootloader in SDK 9.0.0 for SD 310 and follow the instruction given on the given thread, and I am able to debug the bootloader. What difficulties are you facing exactly? Are you seeing any errors or is a breakpoint in the bootloader main function just not hit when you start the debugger?

    It is possible that you need more space for the bootloader than given in the linked thread if you have made any modifications to the default bootloader in the SDK. To check if that is the issue, you could set

    #define BOOTLOADER_REGION_START 0x00030000
    

    and set IROM start to be 0x00030000 and IROM size to 0xFC00

    Optimally, you can see how much ROM (flash space) the bootloader occupies when it is not compressed by summing the Code, RO-data and RW-data sizes that is given when you compile uncompressed bootloader

    Update 2.10.2015 You must erase the chip by e.g. pressing "ERASE ALL" in nRFgo Studio, then program softdevice again, then the bootloader. Have you done that?

    Keil runs nrfjprog.exe in the the background when programming the bootloader. I have the following arguments set in Keil to program the bootloader

    image description

Children
  • This worked but in order to get the debugger to work in the DFU I had to: 1- Build the DFU in Keil uVision 5 and enter the debug mode (which loaded the DFU source code into Keil's debugger). 2- Exit the debugger, and use the nNRgo Studio's Program Bootloader tab to load the bootloader 3- Go back to uVision and click the debugger button. At which point I could use the debugger.

    I do not understand why, but in order to get the debugger to run I had to load the DFU with nRFgo Studio.

Related