cancel
Showing results for 
Search instead for 
Did you mean: 

Calculate and check CRC over bin file STM32F205

Barbie
Associate II
Posted on October 20, 2014 at 13:51

I want to make a CRC check over the APP  FLASH area (I use a BIN file) to know that my APP update O.K.

For that I have some question.

1. Does the IAR has an option of giving me the CRC of he BIN file I made ?

2. How can I know when I made a bin file its size so I can know later till where to check on teh FLASH (does the IAR also give me this data)?

3. If  no answer for any of the above question is there a application I can use over the BIN file which can give me that data?

Thanks

Bar.

#bin-file-crc
3 REPLIES 3
Posted on October 20, 2014 at 15:18

A .BIN file has inferred size (it's as big as it is), if you want to encode specific sizes you'll need to examine what symbols the linker exports, start with the vendor documentation, and look at the .MAP file.

One of several threads along similar lines

[DEAD LINK /public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/flash%20CRC%20integrity&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&currentviews=608]https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=%2Fpublic%2FSTe2ecommunities%2Fmcu%2FLists%2Fcortex_mx_stm32%2Fflash%20CRC%20integrity&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B¤tviews=608
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
chen
Associate II
Posted on October 20, 2014 at 15:22

Hi

''1. Does the IAR has an option of giving me the CRC of he BIN file I made ?''

Do not know off the top of my head.

Read the manual for the linker (if not try the compiler).

''2. How can I know when I made a bin file its size so I can know later till where to check on teh FLASH (does the IAR also give me this data)?''

Almost all linkers will tell you (to some degree) the output size

eg GNU gcc for the ARM

''Print size information

   text       data        bss        dec        hex    filename

 488588      10920      15300     514808      7daf8    application.elf

Print size information done''

''I want to make a CRC check over the APP  FLASH area (I use a BIN file) to know that my APP update O.K.''

Are you only doing this during the flash update or are you going to do this on each boot up and execute?

If you try to do this for boot and execution consider this issue :

Where does the length and CRC get stored (without affecting the binary image, there will be a circular dependancy if it does!)

Posted on October 20, 2014 at 18:54

http://www.iar.com/Global/Resources/Developers_Toolbox/Building_and_debugging/Checksums_Simplified.pdf

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..