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

Debug application with bootloader installed

I would like to be able to leave the bootloader installed and debug an application. I have been able to use the merge tools to get the hex files all merged and generate the crc etc.. That all works. The problem is that this data is incorrect when the application changes. I don't know of a way to modify the elf file to re-calculate the crc before debugging starts. Can this be done with the nordic tools?

Also, it seems that the buttonless dfu service can't be compiled without the bootloader present. Hence the need to debug the application with the bootloader installed.

  • Hi jmag,

    Which debugger program are you using ? you don't need to combine hex file to be able to debug. Simply set break point in your application, after the bootloader switches to application you will hit the break point inside the application. In other words, the debugger doesn't need to know about the bootloader.

    If you modify the application and have trouble enterring application because of the CRC check in the bootloader, you can either make a script to generate bootloader setting (with updated CRC) and flash that or you can simply disable CRC check inside bootloader. You can enable it back after you are done with debugging.

  • I am using Atollic (eclipse). The reason for the post was to avoid jumping through the hoops of having to change either the bootloader or the application every time. When the bootloader is installed and you try to run the application, it never gets to main because the CRC check fails. Seems there should be an easier way to do this. Based on your comments, it looks like the best way would be to create a new bootloader which doesn't check the CRC, and use that only during debug.

  • @jmag: Yes, the easiest is to disable CRC check on the bootloader. I'm not so sure about Eclipse, but in most IDE you can set up an additional load file, that you can flash inaddition to the current application hex. You can set up the bootloader setting hex file to update the CRC inside the bootloader setting. But this option requires a script to run to create the bootloader setting hex.

Related