cancel
Showing results for 
Search instead for 
Did you mean: 

STL Library CRC Calculating

gokhannsahin
Associate II

I am using the STL library from X-CUBE-STL. To check the data in flash, I have to calculate CRC in the post build section and upload it to flash. ST provides an example post build command for this. But there is a problem, no data in flash is filled with 0xFF, while in the generated bin file it is filled with 0x00. I figured that I need to add "--gap-fill 0xFF" for this. After adding this command, the bin file was filled with 0xFF as expected, but the CRC value Cube Programmer calculated is still the same. That is, the data being 0x00 or 0xFF did not change to the CRC value generated by Cube Programmer. Could this be a process priority issue in the post build part? Or is there a problem with the cube programmer?

Post build given by ST:

arm-none-eabi-objcopy -O binary "$ {BuildArtifactFileBaseName} .elf" "$ {BuildArtifactFileBaseName} .bin" && arm-none-eabi-size "$ {BuildArtifactFileName}" && echo "\" STM32_Programmer_CLI.exe \ " -sl \ "$ {CWD} \\ $ {BuildArtifactFileName} \" 0x8000000 0x08018000 0x400 "> call_prg.bat &&" $ {CWD} \ call_prg.bat "

Updated to fill in 0xFF:

arm-none-eabi-objcopy -O binary --gap-fill 0xFF "$ {BuildArtifactFileBaseName} .elf" "$ {BuildArtifactFileBaseName} .bin" && arm-none-eabi-size "$ {BuildArtifactFileName}" && echo "\ "STM32_Programmer_CLI.exe \" -sl \ "$ {CWD} \\ $ {BuildArtifactFileName} \" 0x8000000 0x08018000 0x400 "> call_prg.bat &&" $ {CWD} \ call_prg.bat "

1 REPLY 1
kwo
Associate II

I'm curious if you managed to solve the issue? I have similar problem.