cancel
Showing results for 
Search instead for 
Did you mean: 

STM32_Programmer_cli STL LIb crc calculation error

ivanobono
Associate II
 

I'm currently working on a project using an STM32G473RCT6. I've integrated the STL Lib (Self-Test Library) and intended to use STM32_Programmer_cli.exe with the -sl option to add the CRC block.

The application starts at 0x08040000 and continues for a maximum of 128K, up to 0x08060000.

  • There will therefore be an area of 0x20000/1024=128 CRCs, which will occupy 128×4=512 bytes.

  • In practice, the application itself can only occupy 0x1FE00 bytes because the last block will be available for the CRC Area.

  • Based on the STL documentation, these CRCs will be inserted at address 0x08060000512=0x0805FE00.

The command I'm using is:

STM32_Programmer_cli.exe -sl "firmware.bin" 0x08040000 0x08060000 0x400

The resulting binary has the entire section between the end of the original binary and 0x0805FE00 padded with 0xFF.

Upon checking the CRCs that were inserted starting from 0x0805FE00, I can see that the first ones correctly match the CRC of the application blocks. However, when it reaches the CRCs corresponding to the 0xFF-filled area, they are set to 0xFFFFFFFF, which I believe is incorrect (the CRC32 803.2 for an area full of 0xFF is 0xB83AFFF4).

Is this an error in the tool, or am I doing something wrong?

0 REPLIES 0