İsmail Altay Ataman
İsmail Altay Ataman

Reputation: 13

Using same codes on different STM32F3/F4 MCUs

Currently I'm working with STM32F303ZET6 (with Nucleo development board) in a university project. We also need to make an all SMT PCB including the microcontroller. The problem we have is we can't find SMT verison of STM32F303ZET6 in our country.

So we have to change our microcontroller but currently STM32F303ZET6 is all I got and I'll write all of the code with it. I'm planning to use arm mbed for the libraries and development environment. My question is can I use same codes I wrote for STM32F303ZET6 for some other STM32F3 or STM32F4 microcontroller?

Upvotes: 0

Views: 1108

Answers (1)

Clifford
Clifford

Reputation: 93534

There is a great deal of commonality between STM32F2, STM32F3 and STM32F4 series. Both F3 and F4 are Cortex-M4 and all three series share common peripherals. In some cases you may find pin-multiplexing options differ, or there are certain peripherals available in one part but not the other.

Different parts may have a different number of USARTs, ADCs, DACs etc. And differing number of available GPIOs. So you should check that the peripherals and ports you use are available on the alternate part.

It is really a matter of going through the data sheet and comparing the function, capabilities and pin-out options for the parts. If you are using the STM32Cube you should have few compatibility issue (Cube has other issues but cross-part compatibility is its main purpose).

The clock trees for each part tend to differ, so you will need part specific C runtime start-up code, but that is normally provided by the toolchain.

Upvotes: 1

Related Questions