cancel
Showing results for 
Search instead for 
Did you mean: 

CRC calculation for Hex file

Mujeeb  Shaik
Associate II
Posted on March 20, 2017 at 07:38

Hi All,

I am planning to have CRC calculation for my Hex file generated and i want to keep that CRC at the end memory location of hex file generated ,

Is there any option in SPCstudio to enbale CRC so that when IDE is generating hex file it can calculate the CRC and keep it at the end location of the generated Hex file,

while flashing to the board we can remove that CRC bytes and flash the hex file,

Please let me know is there any option to enable in SPCstdio.

Thanks in advance,

---

Thanks & Regards,

Mujeeb

#crc #spc5
This discussion has been locked for participation. If you have a question, please start a new topic in order to ask your question
4 REPLIES 4
Erwan YVIN
ST Employee
Posted on March 22, 2017 at 11:31

Hello Mujeeb ,

Sorry, we have not a test application in SPC5Studio which generates the checksum of the hex file.

i would use srecord for that.

https://mcuoneclipse.com/2015/04/26/crc-checksum-generation-with-srecord-tools-for-gnu-and-eclipse/

 

http://www.avrfreaks.net/forum/tutgccadding-crc-and-app-length-hex-files

 

                   Best regards

                              Erwan

Posted on March 23, 2017 at 06:20

Hi Erwan,

Thanks for your response,

As per my understanding Srecord is separate utility,How to add this utility to SPCstdio,if it is not possible to add how we can use srecord standalone,

In link whatever provided by you (

/external-link.jspa?url=https%3A%2F%2Fmcuoneclipse.com%2F2015%2F04%2F26%2Fcrc-checksum-generation-with-srecord-tools-for-gnu-and-eclipse%2F

)is for

Kinetis Design Studio(MCU is ARM based) but in my case SPC560B is not ARM based so how to use Srecordfor SPC560B family which is not ARM based can you please help me in this regards,it will be really very helpful to me.

Thanks in advance,

Thanks & Regards,

Mujeeb.

Posted on March 23, 2017 at 11:42

Hello Mujeeb ,

For this task , you need a separate utility to calculate a checksum and to reintegrate it in the elf by updating your makefile during link procedure.

it is the same spirit for MPC56

https://community.nxp.com/docs/DOC-329541

 

in the binary directory (freevle-gcc plugins) you have all the tools to do that.  (use objcopy)

http://stackoverflow.com/questions/24150030/storing-crc-into-an-axf-elf-file

 

                     Best Regards

                                   Erwan

PLank
Associate

Hello Mujeeb,

If it is difficult to integrate SRECORD, then I will suggest you to use it as separate entity.

If you want to know how to use it as standalone. Follow beliw link.​

https://embdsysbasics.blogspot.com/2018/12/hex-file-checksum-calculator-using.html?m=1

Use your hex file as input to srec tool and append crc to hex using srec tool.​

Then load hex file to target.