cancel
Showing results for 
Search instead for 
Did you mean: 

How to distinguish between a STM32F042F6 and an STM32F070F6?

bensupper
Associate

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 ...

  • Best practice for F042 is to use HSI48 and the CRS to generate a decent USB clock.
  • Only alternative for F070 is to use PLL multiplied up, but that's OK because the F070 has a tighter clock tolerance.

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.

5 REPLIES 5

> 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

Uwe Bonnes
Principal III

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.

>>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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Andreas Bolsch
Lead II

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.

Andreas Bolsch
Lead II

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 ...