CRC of Data section in Load Memory location

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

CRC of Data section in Load Memory location

2,192 Views
ivekengineer
Contributor III

First, thanks for the new CRC linker feature - I needed that!

 

I am using a DSC (MC56F8257).

 

How do I get the linker to store the crc of the data memory with the load address as the start address, and p_mem  (P_RECTYPE) as the type instead of the run address and x_mem (X_RECTYPE) type?

 

 

This is important because I want to verify my application stored in FLASH from a bootloader, before jumping into (running) the application.

 

Or, alternatively, is there a way to perform a single crc over a range of p_memory that includes all sections (vectors, data, text, etc.).


Labels (1)
Tags (1)
0 Kudos
Reply
7 Replies

1,477 Views
TICS_Fiona
NXP Employee
NXP Employee

For further question, could you please summit a Serive Request on line, or just mail to support@freescale.com ? Thank you

0 Kudos
Reply

1,477 Views
TICS_Fiona
NXP Employee
NXP Employee

is there a way to perform a single crc over a range of p_memory that includes all sections (vectors, data, text, etc.). 

--> You can get CRC for whole p_memoy, or for d memory, but It is impossible to check CRC by funtion CRC16_check() in application code. Because debuger will erase flash before programming, the flash unit that are not used by application will be written as 0xFFFF, this will cause different CRC calucated in Link time and Run time.

0 Kudos
Reply

1,477 Views
TICS_Fiona
NXP Employee
NXP Employee

It is possible to use load address as start address instead of run address in p_mem to get CRC. To do it,  need some code like below in LCF:

        .ApplicationCode :
        {

              .....

               __pROM_data_start = .;

           

        } > .p_Code

   .data_in_p_flash_ROM : AT(__pROM_data_start)

        {

          

      __xRAM_data_start = .;

            ...

              * (.data)

              # save data end and calculate data block size
              . = ALIGN(2);
              __xRAM_data_end = .;
              __data_size = __xRAM_data_end - __xRAM_data_start;

            __pROM_data_end = __pROM_data_start +  __data_size - 1.;

        } > .p_flash_ROM_data   

.crc : {

crc1 = CRC16( __pROM_data_start, __pROM_data_end);

} > x_RAM2

0 Kudos
Reply

1,477 Views
ivekengineer
Contributor III

Yes, I have tried something like this several different ways.  I keep getting an error such as the following:

Description Resource Path Location Type

Linker command file error at line 180 start & end symbols must be in the same segment! MotorMCU    C/C++ Problem

0 Kudos
Reply

1,477 Views
trytohelp
NXP Employee
NXP Employee

Hi,

Please let me know the tool version used.

To do that you must:

   Under Eclipse IDE

    1-      Start Eclipse and click on Help ¦ Freescale Licenses

      The Status column gives the status of the license.

      Under Product, select it and click on details.

      A new dialog show up giving license details.

      Provide us all info displayed

    2-      Start Eclipse and click on Help ¦ About CodeWarrior Development Studio

      Under Installed Products, you will see the version used.

regards

Pascal

0 Kudos
Reply

1,477 Views
ivekengineer
Contributor III

CodeWarrior for MCU, version 10.4, Build Id: 130425

0 Kudos
Reply

1,477 Views
trytohelp
NXP Employee
NXP Employee

Thanks for info.

I've contacted a colleague regarding this question.

Keep you informed.

Pascal

0 Kudos
Reply