Electrical – STM32F405 code compatibility with STM32F407

armstm32stm32cubemxstm32f4stm32f4-discovery

I have to do a project which will be based on STM32F405VG (100 Pin) but I don't have that MCU at the moment. Instead I have STM32F4-Discovery board which has STM32F407VG (100 Pin) on board. All the specs of both MCUs are same, as shown below including pin numbers, clock, flash, RAM etc except that the 'F407 has 2 additional peripheral interfaces namely Camera and Ethernet.

If I do all my development using the 'F4 Discovery board but select the 'F405 MCU in the CubeMX project creation and flash this code in the 'F407 MCU on the Discovery board .. do all the testing and later when I will get the 'F405 custom board then will I be able to use this code for 'F405 exactly as it is tested on the 'F407 MCU?

enter image description here

Best Answer

The STM32F407 is a strict superset of the STM32F405. (Indeed, they share a single datasheet.) As long as you're working with the same package and flash size, code that runs on the '405 will work identically on the '407.