This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Enabling CRC check on bootup for TM4C123



I asked this question in another thread and was told that that the devices group may have more clues as to what is going on.

https://e2e.ti.com/support/embedded/tirtos/f/355/p/548144/2017971#2017971

I think we are close, as the flags are getting set in the image for the binpack utility to write the CRC. When modifying the image to simulate a failure however, I cannot get the image to not boot. I am thinking that something is missing and the bootloader is not checking the CRC before running my user code.

Regards,

Joseph

  • Hello Joseph

    How have you configured the Boot Loader to check for CRC and the Application image to insert the CRC?

    In the bootloader there is a define for ENFORCE_CRC. Is that uncommented

    In the Application image there is a process to add the placeholder in the startup vector file so that binpack can replace it with the CRC checksum. How is the same being done (Can you share the startup C file)
  • Amit,

    As stated in the other post, I am using RTOS so the startup.c file is not a file in my project. I am assuming you want to see it to make sure that I have added the keywords to the end of my vector table. I am pretty certain that they are set as the binpack.exe executes with no errors on my .bin file.

    The thing I am unsure though is how to include the bootloader code into my project. I assume that you include the bl_main.c file into the project along with bl_crc32.h, but how does the compiler know that this code belongs in the bootloader and where to put it? Also since this code would be in flash, this would be a stage 1 bootloader where the TI ROM bootloader would be the stage 0? I am expecting something called like this:
    ROM(stage 0)->Flash(Stage1)->Flash(user code). Is this the correct implementation? With that all being true I guess I would have to offset my user code start address and the stage 1 would now start at address space 0x000000.

    Regards,
    Joseph
  • Hello Jospeh

    You are right. The ROM boot loader calls the Flash boot loader which in turn calls the application. The flash boot loader resides at 0x0 and the application resides at multiple of page boundary of 0x400. The ROM does not have a CRC check. Only the flash boot loader when enabled with the CRC check can do so.

    The compiler does not know anything about a code. It converts human readable code to a machine readable format based on the switches and options it has been provided with.

    To use a boot loader you would need to look at the examples already provided in TivaWare.

    Since you have RTOS having the startup file, I am not sure if the RTOS would add the keyword at all. Simplest method is to convert the out file to bin file (using mhex4bin utility in CCS), open the bin file in a binary editor and check if the keywords are in the correct position at the end of the interrupt vector table.
  • Amit,

    I understand that there are examples of the bootloader code, but it does not explain the steps in how to set up the use of the bootloader, specifically how to set user code start address and ensure that the bootloader code starts at address 0x0. I have already figured out how to add the key. With RTOS you have to use some of the unused interrupts for holding the keys. The method described in the linked to thread seems to work. Mostly I am concerned with adding the bootloader and the process of doing that.

    Regards,
    Joseph
  • Hello Joseph

    The application address is defined in the bl_config.h file in the boot loader example. The linker command file for the boot loader example ensures that the boot loader start is 0x0.