This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Debugging bootloader + application ?

Hello,

I have a question on how to debug an application that consists of two separate projects - namely a bootloader+firmware upload part and the actual application - that runs on an ADuC845.

The bootloader will be located in the memory area 0xE000-0xF7FF, the application in 0x0000-0xDFFF.

Unfortunately, the emulator erases the complete code memory when loading a file to debug, so it is not possible to load the application, then the bootloader, and then debug the bootloader with the application in place.

Can I use the hex2bin/bin2hex utilities to merge the two hex files and start debugging ?

Regards,
Christoph

Parents
  • This is a better way to download the two different hex files, but u cant debug it.(I assume that u hav coded in C)

    Basically, I only want to debug the bootloader while having the application code in place, since the bootloader does a checksum over the application to verify that it is valid.

    I know that I cannot debug the application if I am working with the bootloader project. This does not matter, as the bootloader is transparent and the application does know that the bootloader is present.

    Cant you merge the two projects, instead?

    I thought about this first, but unless there is no other choice, I would prefer not to for several reasons:

    1. No part of the bootloader will be called after it jumps to the entry point of the application, so all of the RAM used by the bootloader can be re-used by the application. The bootloader will use quite a bit of RAM (~50 bytes idata, 256 bytes xdata), most of it as global variables, so making the application re-use the RAM will be fairly messy.

    2. The bootloader is supposed to stay unchanged. This is a minor technicality, but I would like it to be a separate project that I can point to and say "No changes here."

Reply
  • This is a better way to download the two different hex files, but u cant debug it.(I assume that u hav coded in C)

    Basically, I only want to debug the bootloader while having the application code in place, since the bootloader does a checksum over the application to verify that it is valid.

    I know that I cannot debug the application if I am working with the bootloader project. This does not matter, as the bootloader is transparent and the application does know that the bootloader is present.

    Cant you merge the two projects, instead?

    I thought about this first, but unless there is no other choice, I would prefer not to for several reasons:

    1. No part of the bootloader will be called after it jumps to the entry point of the application, so all of the RAM used by the bootloader can be re-used by the application. The bootloader will use quite a bit of RAM (~50 bytes idata, 256 bytes xdata), most of it as global variables, so making the application re-use the RAM will be fairly messy.

    2. The bootloader is supposed to stay unchanged. This is a minor technicality, but I would like it to be a separate project that I can point to and say "No changes here."

Children
  • ...I thought about this first, but unless there is no other choice, I would prefer not to for several reasons...

    Ok I agree with you.

    ...Basically, I only want to debug the bootloader while having the application code in place, since the bootloader does a checksum over the application to verify that it is valid...

    So, you want to test whether the bootloader is able to validate the checksum of the application.

    You see whether this will work.

    First you add a module in the bootloader, which can read the bytes thro UART and write it in to your FLASH(starting from the address for the application).

    Then, you download the bootloader code into the FLASH and then pass the hex codes of the application thro UART and write it into FLASH.

    Then you call your checksum calculation module and debug it as you wish.

    You can make the process simple by loading a small sample application instead of your actual application.

    - Neo