Author Topic: STM32 CUBE STM32 PGR Post Compile CRC Help  (Read 922 times)

0 Members and 1 Guest are viewing this topic.

Offline LaserSteveTopic starter

  • Super Contributor
  • ***
  • Posts: 1393
  • Country: us
STM32 CUBE STM32 PGR Post Compile CRC Help
« on: January 20, 2025, 07:34:07 pm »
My company needs to have Future Electronics program a large batch of STM32-F-07.  Programmer of the Code is overseas, works on a Linux platform, sends us a finished, compiled, ASM in HEX.  Problem is his CRC he sends us does not match the CRC I get if I open it in the Cube tools running on Win 11 in the states. When we send it to Future, their web page asks for a CRC.  Of course, Future uses a service to program that I cannot easily reach. When the processors are programmed, they go right to the SMD line when received here. Of course, our contract is for minor corrections to long agoi finished code, and I can't have the raw source.

So Future is asking for a CRC (Which One?) and a vector or offset if one exists, my retired predecessor once knew the answer to this, when the boards were last spun five years ago, but he cannot remember.

It seems there is more than one way to calc the CRC, and a query to the STM corporate forum yielded bad news, seems we would need a NDA with ST to find out how to write a script to have the IDE do the calc.

Anyone send out their programming?  We need many, many, trays of this part.  Anyone been through this sort of mess before? The rep will be here tomorrow, but I'm not sure even he can get us an answer.

Help a newbie to production please!

Thanks,

Steve

Anyone have an idea of what to do ? 
« Last Edit: January 20, 2025, 07:36:31 pm by LaserSteve »
"Analog and Loving It"
 

Online Siwastaja

  • Super Contributor
  • ***
  • Posts: 9526
  • Country: fi
Re: STM32 CUBE STM32 PGR Post Compile CRC Help
« Reply #1 on: January 20, 2025, 07:46:05 pm »
CRC is just the name of the concept. There are nearly infinite number of different CRCs - even the number of very commonly used ones for file integrity checking is probably more than 10.

Only Future Electronics can know and specify what kind of CRC they want to have. This information should be easily available and not guesswork - it's pretty weird if they don't specify it openly (they must have some instructions about the ordering process, right?). If this crucial piece of information is missing, then they should be easily able to answer to your inquiry about it. If not, it sounds like you need another contractor to do the programming, IMHO.

Once you know what the correct CRC is, I'm sure your programmer (who wrote the code) is well able to calculate the CRC - which in itself is just a few lines of code, with a lot of resources available online.
« Last Edit: January 20, 2025, 07:48:47 pm by Siwastaja »
 
The following users thanked this post: LaserSteve

Offline LaserSteveTopic starter

  • Super Contributor
  • ***
  • Posts: 1393
  • Country: us
Re: STM32 CUBE STM32 PGR Post Compile CRC Help
« Reply #2 on: January 20, 2025, 09:11:19 pm »
One would think Future would have a .PDF somewhere. So far I haven't found it.

Steve
"Analog and Loving It"
 

Offline peter-h

  • Super Contributor
  • ***
  • Posts: 4501
  • Country: gb
  • Doing electronics since the 1960s...
Re: STM32 CUBE STM32 PGR Post Compile CRC Help
« Reply #3 on: January 23, 2025, 06:03:54 pm »
It is very easy to set up a post build step (a .bat file if under windows) to append a CRC to a file.

As per above, there is a huge number of different CRCs but once you find the algorithm, you can find somebody on freelancer.com who will write you a win32 command line utility which will calculate and append the CRC to your file :)

You can also generate a .hex file straight out of Cube, but then you have extra work to append a CRC to that because you have to go hex to binary, append the CRC, and back to hex.

The binary or hex output is done with arm-none-eabi-objcopy.exe
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf