cancel
Showing results for 
Search instead for 
Did you mean: 

Checksum (EWARMv5)

greg_t
Associate II
Posted on August 03, 2010 at 16:22

Checksum (EWARMv5)

11 REPLIES 11
swhite2
Associate III
Posted on May 17, 2011 at 14:00

EWARM 5.xx doen not, to my knowledge, support calculating  a CRC the way the STM32 peripheral does. I've heard that this is coming but then so is Christmas.

IAR does supply the source code for ielftool so you could make the modifications yourself. I chose to write my own program that works on .bin files instead.

I've developed a header structure that includes CRC's (header + code) but its a commercial product so I can't share it. That said its not hard to come up with such a header. However if you want the header at the start of your image it'll conflict with the ARM exception vectors. Those (except for reset, initial SP) can be moved however.

smart2
Associate II
Posted on May 17, 2011 at 14:00

Take a look at IAR application note.

http://supp.iar.com/Support/?note=91733

swhite2
Associate III
Posted on May 17, 2011 at 14:00

Nice application note except that it won't help. ielftool calculates checksums on a byte-by-byte basis. The STM32 CRC peripheral does so on a 32-bit word basis. You'll never get IAR's checksum to match ST's even if you set all the other parameters (polynomial, bit-order, initial value etc) correctly.

You may want to review this thread.

https://my.st.com/public/STe2ecommunities/mcu/Lists/ARM%20CortexM3%20STM32/CRC%20calculation%20in%20software

Posted on May 17, 2011 at 14:00

''... checksum (CRC) ...''

 

Please don't write like that: it suggests that ''Checksum'' and ''CRC'' are equivalent or interchangeable terms  - they are not!

 

Checksums and CRCs are entirely different things.

greg_t
Associate II
Posted on May 17, 2011 at 14:00

neil.andrew, I am sorry if you got offended   = )

greg_t
Associate II
Posted on May 17, 2011 at 14:00

I've used the IAR explanation and it worked 

http://supp.iar.com/Support/?Note=11927

swhite2
Associate III
Posted on May 17, 2011 at 14:00

Perhaps you'd like to share the exact setup in the ''Checksum'' tab of IAR. I take it the resulting value matched that generated by the STM32 CRC generator over the same memory range.

greg_t
Associate II
Posted on May 17, 2011 at 14:00

No

I've used CRC16

sros
Associate II
Posted on May 17, 2011 at 14:00

You can find a description on how to ''calculate CRC32 as in STM32 hardware'' at IAR's ''Technical Note 64424''

http://supp.iar.com/Support/?note=64424&from=search+result