Skip to main content
PMana.1
Associate II
October 24, 2021
Solved

How to convert the code from one MCU to another MCU on the same series?

I am working on a project and the example is written for STM32L476RG. I would like to use some other STM32 mcus for my product such as STM32L486RG, STM32L496RG, STM32L4A6RG. Could you please help me to know, would this code run on the above-mentioned mcus without making any changes to the code? Do I need to make any changes for the libraries to make this work? What all changes are to be made for the code to work. I am using almost all the peripherals.

This topic has been closed for replies.
TDK
TDKBest answer
October 24, 2021

In general, in moving to a more capable chip within the same family, your code should run without modification. It's not a hard rule, however, and there are exceptions.

The STM32L486RG is just a STM32L476RG + CRYPTO, so the code will run there without modification.

The STM32L496RG has more RAM and FLASH and some extra peripherals, but should otherwise be compatible. Code should run without modification unless you're doing FLASH modifications. But I can't be 100% on that.

STM32L4A6RG = STM32L496RG + crypto, so code is compatible between those except for crypto functions.

Doing a diff on the relevant CMSIS header files can expose the differences in detail.

"If you feel a post has answered your question, please click ""Accept as Solution""."

2 replies

TDK
TDKBest answer
October 24, 2021

In general, in moving to a more capable chip within the same family, your code should run without modification. It's not a hard rule, however, and there are exceptions.

The STM32L486RG is just a STM32L476RG + CRYPTO, so the code will run there without modification.

The STM32L496RG has more RAM and FLASH and some extra peripherals, but should otherwise be compatible. Code should run without modification unless you're doing FLASH modifications. But I can't be 100% on that.

STM32L4A6RG = STM32L496RG + crypto, so code is compatible between those except for crypto functions.

Doing a diff on the relevant CMSIS header files can expose the differences in detail.

"If you feel a post has answered your question, please click ""Accept as Solution""."
ST Technical Moderator
October 25, 2021

Hello @PMana.1​ ,

There are many resources that analyze the steps required to migrate between STM32L4 series considering the migration of hardware, device (s) and firmware.

I hope these resources are helpful for you.

When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.

Imen

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks