2022-04-21 06:52 AM
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.
2022-04-21 08:23 AM
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.
2022-04-21 08:43 AM
Try to read out this register:
It 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
2022-04-22 07:41 AM
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.