on
2023-05-22
08:15 AM
- edited on
2023-12-07
05:42 AM
by
Laurids_PETERSE
In continuation of part 1 of this article [1], we will also briefly discuss how you can easily export your STM32 project to different STM32 series using the “List pinout compatible MCUs” option in the STM32CubeMX.
If you are having problems with sourcing your STM32 series component, you can easily export your MCU project ioc file to a different STM32 series using two different methods. For this feature demonstration, we pick the Nucleo-L476 but you can use other MCU of your choice as well.
Two options for importing your project:
1) Method 1:
How to switch from one STM32 to another using STM32CubeMX
2) Method 2:
MCU1 to MCU2 migration option within STM32CubeIDE
This time, we open the STM32F4 ioc project that we have already created in the previous section. We use method 2 (“List pinout compatible MCUs” feature), discussed in the above link, for importing our project to a new MCU.
Select the desired MCU that you would like to transfer your pinout to using the “Alt-L” keyboard shortcut.
Note: Sometimes, the pins and functionality do not always transfer to new MCU platform due to pinout or peripheral incompatibilities. In that scenario, STM32CubeMX transfers as much as possible, but you need to manually adjust some of the configurations yourself.
Figure 21 shows an incorrect pin assignment for the GPIO connected to a pushbutton and other issues that are not observable from the figure like for example: incorrect configuration for the DAC peripheral.
Using the schematic, we find the correct GPIO connected to the pushbutton on the Nucleo-L476 (“B1 user”): Schematic [2]. For example, the B1 user (Blue) is connected to PC13 on the Nucleo-L476.
Figure 23 to 26 show the changes in DAC, DMA, and clock tree settings required for STM32L4.
After compiling the STM32L476 project and running the program, we will observe the following figures as depicted in figures 27 and 28. Figures 27 and 28 replicate the original example project (figs. 1 and 2 respectively) without the STM32CubeMX ioc file.
If you have any issues with the project implementation, please refer to the following link [3] for the completed STM32F4DISCOVERY and STM32L4 Nucleo projects.
https://www.st.com/content/ccc/resource/technical/layouts_and_diagrams/schematic_pack/group2/5a/85/d6/9a/34/e2/47/1d/MB1136-DEFAULT-C05_Schematic/files/MB1136-DEFAULT-C05_Schematic.pdf/jcr:content/translations/en.MB1136-DEFAULT-C05_Schematic.pdf
https://www.st.com/content/dam/AME/2023/MDG/stm32f407disc-and-nucleol476-projects.zip