2022-04-06 02:30 PM
The chip shortage has led to some complications, and I've built a batch of products using any chips I can lay my hands on. This has led to a random selection of STM32s: the F042F6P6, F042F6P7, and F070F6P6. They're mostly compatible, but my application uses USB, so ...
In practice, using the PLL for everything seems fine but I've got hundreds of these around the world based on F042s already, so it makes me uneasy that the next firmware update might be messing with something that already works.
Trying to use the HSI48 on the STM32F070 silently breaks the USB as you'd expect: the rest of the chip functions normally; peripheral initialisation works; one gets the RESET interrupt when the host tries to talk, but no data ever gets through.
So how can we automatically tell the difference between the chips to select the correct mode? DEBUGMCU_IDCODE comes back with 0x445 rev 0x1000 for both chips; HSI48RDY flag works on both chips; the CRS peripheral seems to function and reset as normal on both chips. Even though neither is a documented feature of the F070.
As far as I can tell, F070 is basically identical to F042 but the CAN peripheral has been exposed and the link between HSI48 and USB has been removed. I spent all day on this and eventually made it an option byte, but that's an extra and easily-overlooked step in production commissioning.
2022-04-06 02:38 PM
> I spent all day on this and eventually made it an option byte,
AFAIK this (i.e. marking it yourself, in whatever manner, at production) is the only way.
> that's an extra and easily-overlooked step in production commissioning.
Yes, but there's no better option, again AFAIK.
JW
2022-04-06 02:43 PM
If both chips have the same DEBUGMCU_IDCODE, they have the same die. The F040 can no longer be ordered. As long as the revision code is the same at for the F070, treat it as the same.
2022-04-06 03:10 PM
>>USB has been removed
More probably not tested, and perhaps disabled. Saving test time, and licencing cost..
Apt to be the same die, with the same mask set.
2022-04-07 02:22 AM
Maybe comparison of the "information block" ending at 0x1FFFF7FF gives a clue. Problem is that this contains also calibration constants which differ from one device to another, so it's hard to tell which parts are *type* specific.
2022-04-08 04:59 AM
Indeed, there seems to be a simple distiction in information block according to AN2606 :
F04xxx bootloader is either version 10.0 or 10.1, whereas for
F070x6 and F70xB version is 10.2 or 10.3. So simply look for the version number ...