Distinguishing H5 processor type from firmware
We are using a mix of stm32 - G473, H503, H523, H563, H573.
For each of these, we have a bootloader that locks the chip security (to Closed for full regression with password on the H5s).
If we inadvertently put the wrong bootloader on a board, some combinations will brick the board - specifically, loading 523 or 563 bootloaders onto 503 or 573 boards goes to the closed state without a useful password in place.
I would like to programmatically check that each bootloader is running on its expected target before setting security. I see the IDCODE register contains 0x484 for STM32H562/563/573, or 0x478 for STM32H523/533. Unfortunately this distinguishes the 523/563 which is not such a problem for us, but not the 563/573 which is our problem.
Ideally, I would like a (different) function for each of our micros that will run correctly on the expected micro but return an error (or possibly hard fault) on anything else.
Thanks
