2016-10-14 06:17 AM
I'm building a bootloader and it shall run on a 100pin STM32F407 and a 64pin STM32F405. From reading the reference manual they seem very similar (except for some peripherals). My dev-environment does include an assembler initial start-file (xxxx.S).
Is it possible due to their similarities to use the same binary on those two? If so, can the program still distinguish on what HW it is running (without external help of strapping pins)? I did read about the ''unique device ID'' register. So far I can't find any indication that there is a part of that ID that suggests a certain device. Since it says: ''unique for any device and in any context.'' (page 1702, RM0090). #stm32f405-stm32f407-bootloader2016-10-14 07:33 AM
Yes, if you just use the subset of features supported by the 405 you can run that same code on a 407. If you build for a 205, you can run that on a 405 or 407
If you write your SystemInit()/SetSysClock() smartly to use DGBMCU->IDCODE (pg 1689) to extract the DEVID you can identify the core and set the clocks appropriately for 401, 411, 429, 446 parts too.To see a 405 vs 407, you might be able to see if the Ethernet clock enable is sticky or not. But if you don't use any of the 407 peripherals, I see this as a non-issue.The different pin count devices share a common die, so from the internal perspective they look the same. If you want to avoid external strapping consider writing to OTP/Options Bytes during board assembly/test.