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.

CCS: pre-defined CRC write in flash for ROM area(flash) safety test

Other Parts Discussed in Thread: TMS570LC4357, HALCOGEN

Tool/software: Code Composer Studio

In tms570lc4357 board, I want to check the flash area is acted in normal operation. 

I will use the CRC value to check flash area safety. In the data sheet, CRC controller offer as AUTO mode. And it needs the pre-defined CRC value. 

I want to use CRC controller as AUTO mode in used-area. I think I need to write the pre-defined CRC value in flash which is not contained in CRC calculation.

I want to know the way flash write in specific memory. If it is impossible, let me know the flash area checking method with CRC controller as AUTO mode.

  • Hello,

    You question has been addressed to a TI engineer.

    Best regards,
    Miro

  • Hello Minwoo,

    1. You can write the pre-determined CRC to FEE (bank 7) using the FEE driver. The FEE driver is generated by HALCoGen.

    2. You can write the pre-determined CRC to a section which is at a specific flash location.

         1. create a section using #pragma SET_DATA_SECTION (".preCRC")

         2. in linker cmd file, locate this section to a specific place of the flash

           .preCRC :{} > crcFlash

  • Hello QJ Wang,

    I know that I can make save space for pre-defined CRC. Then, How i can write value in the save space?

    Thanks and Regards,

    Minwoo

  • Hello Minwoo,

    The pre-determined CRC is written to crcFlash when loading your code to flash.

    MEMORY

    {

    VECTORS (X) : origin=0x00000000 length=0x00000020

     crcFlash (RX) : origin=0x00000020 length=0x00000010

    FLASH0 (RX) : origin=0x00000030 length=0x001FFFD0

    FLASH1 (RX) : origin=0x00200000 length=0x00200000

    STACKS (RW) : origin=0x08000000 length=0x00001500

    RAM (RW) : origin=0x08001500 length=0x0007db00

    }

    SECTIONS

    {

    /* USER CODE BEGIN (5) */

    /* USER CODE END */

    .intvecs : {} > VECTORS

    .text align(32) : {} > FLASH0 | FLASH1

    .const align(32) : {} > FLASH0 | FLASH1

    .cinit align(32) : {} > FLASH0 | FLASH1

    .pinit align(32) : {} > FLASH0 | FLASH1

    .bss : {} > RAM

    .data : {} > RAM

    .sysmem : {} > RAM

    /* USER CODE BEGIN (6) */

    .preCRC :{} > crcFlash

    /* USER CODE END */

    }

  • Hello QJ Wang,

    I'm sorry to bother you, this question again.

    I build the project with the reference code(the upper example is used).

    I cannot confirm the preCRC area in map file. So, I have some question about this operation.

    1. If the preCRC is written in the crcFlash area, how can i access the this area.(it means how i can read the crc value)

    2. the crc value which is created by the code (.preCRC :{} > crcFlash) is calculated by which range (I think it calculate the CRC in 0x00000020 to 0x0000002F)

       -  I want the calculated CRC with full flash memory( example : in the upper code, the range is 0x00000030 ~ 0x001FFFFF). Then how i can get CRC in the range?

    Thanks and Regards,

    Minwoo

  • Hello Minwoo,

    The following is my test:

    1. define Data section in main.c which contain your pre-determined CRC value:

    #pragma SET_DATA_SECTION(".preCRC")

    uint32 preCRC[2] = {0x30ADF95E, 0x604CC4EB};

    #pragma SET_DATA_SECTION()

    void main()

    {

    uint32 a, b, c;

    a=preCRC[0];

    b=preCRC[0];

    c=a+b;

    2. in Linker CMD file, define a memory region for those CRC data

    MEMORY

    {

    VECTORS (X) : origin=0x00000000 length=0x00000020

    crcFlash (RX) : origin=0x00000020 length=0x00000020

    FLASH0 (RX) : origin=0x00000040 length=0x0013FF00

    3. in Linker CMD file, map the preCRC section (defined in main.c) to the memory region defined in step 2

    .preCRC :{} LOAD=crcFlash, run = RAM

    After loading the project, the pre-determined CRC value is loaded to 0x20 in flash.


     

  • 1. If the preCRC is written in the crcFlash area, how can i access the this area.(it means how i can read the crc value)

    QJ> Those are pre-determined CRC value used for comparison with the calculated value using CRC module. You can use this address 0x20 as the source address of the DMA packet. You can store the pre-determined CRC to FEE (emulated EEPROM), SRAM (data array), or Flash.   

    2. the crc value which is created by the code (.preCRC :{} > crcFlash) is calculated by which range (I think it calculate the CRC in 0x00000020 to 0x0000002F)

    QJ> You provide this pre-determined CRC value of your application code in any range of the flash. For example, you have bootloader and application, and bootloader is located in flash sector 0, and the application is located in flash sector 6 to sector 10. The pre-determined the CRC value of your application code is calculated on your PC using the same polynomial. This pre-determined CRC value is transferred to bootloader together with the application image. Your bootloader programs the application to sector 6 to sector 10, and write the pre-determined CRC to: FEE, or SRAM, or flash. Everytime when you boot your system, you can verify your application code using CRC (compare the calculated CRC and pre-determined CRC)..

       -  I want the calculated CRC with full flash memory( example : in the upper code, the range is 0x00000030 ~ 0x001FFFFF). Then how i can get CRC in the range?

    QJ> you can calculate the CRC value for any memory range.