2010-08-03 07:22 AM
Checksum (EWARMv5)
2011-05-17 05:00 AM
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.2011-05-17 05:00 AM
Take a look at IAR application note.
2011-05-17 05:00 AM
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.2011-05-17 05:00 AM
''... 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.
2011-05-17 05:00 AM
2011-05-17 05:00 AM
2011-05-17 05:00 AM
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.
2011-05-17 05:00 AM
2011-05-17 05:00 AM
You can find a description on how to ''calculate CRC32 as in STM32 hardware'' at IAR's ''Technical Note 64424''