Skip to main content
PZitn.1
Associate
April 21, 2022
Question

Is it possible to programmatically recognize the exact type of MCUs?

  • April 21, 2022
  • 3 replies
  • 818 views

STM32L412CBT6P and STM32L412CBT6 processors are used in our boards. We use the same firmware for them. The question is. It is possible to programmatically recognize which of them is mounted on the board. For example, from a unique number? The HAL_GetREVID () and HAL_GetDEVID () functions give the same result for both MCUs.

This topic has been closed for replies.

3 replies

TDK
April 21, 2022

No, it's not.

Depending on the hardware, you may be able to probe the pins in software to determine pullups, grounded pins, etc, to determine what hardware it's running on and infer the chip type.

"If you feel a post has answered your question, please click ""Accept as Solution""."
waclawek.jan
Super User
April 21, 2022

Try to read out this register:

0693W00000Lye3sQAB.pngIt does not mention the SMPS version of LQFP-48, but AFAIK that was an afterthought and the RM might not have been updated properly.

JW

PZitn.1
PZitn.1Author
Associate
April 22, 2022

Too bad it's not possible. I solved it on your advice. I set the internal pull down to pin PB8. After the reading, I distinguished the circumstances hw as 0 for MCU STM32L412CBT6P and 1 for STM32L412CBT6. Thanks for advice.