cancel
Showing results for 
Search instead for 
Did you mean: 

How to migrate the code from STM32L476RG to STM32F072 controller?

PM.1
Associate II

I am having a code for the target device stm32l476rg and now i need to port the code to stm32f072. Is it possible to migrate. if yes how is it possible . I saw both are pin to pin compatible so no need of hardware changes.

7 REPLIES 7
berendi
Principal

STM32L476RG has a lot of peripherals that doesn't exist on STM32F072. Where did you see that they are pin compatible?

PM.1
Associate II

Hi Berendi,

Hereby attaching the pinouts of both L476 and F072. STM32F072 is having less peripherals than the L476 IC. I want to use the peripherals which is there in stm32f072. I want t0 migrate the code written for the L476 to F072.

0690X00000DXL2QQAX.png

0690X00000DXL26QAH.png

berendi
Principal

These figures don't cover the possible alternate functions.

The first step is to check the GPIO alternate function settings of your application on the L4, and find out whether the same peripheral functions are available on the F0 on the same pins.

Yes sir I have checked that also. The peripherals which I wanted is same in both of the controllers. I would like to know how to convert the code which is in L4 to F0 in cube ide.

Ozone
Lead

If the initial L476 application is in any regard serious, you will have a performance problem.

A M0 is hardly an equivalent M4F replacment.

- change references to target mcu or subfamily in IDE settings or makefiles

- change related headers names in sources

- change system clock settings in RCC

- make clock-related modifications e.g. UART baudrate

- compile and fix any occurred errors and problems

JW

Pin compatibility does not mean application compatibility.

Each peripheral must be checked separately to see that all their parameters are compatible.

Clock (RCC) setup must be done from scratch, they are not even vaguely similar.

Basic communication, timer and GPIO might work with few changes in the source. Timings should be revised.

Although the base peripherals are register compatible, timer and DMA interconnections are different.