cancel
Showing results for 
Search instead for 
Did you mean: 

Problem migrating from STM32 NUCLEO LO73RZ board to STM32 NUCLEO F411RE board.

CAben.1
Associate II

Hello Everyone, 

i am really new to STM32's and i have a question regarding project migration from one MCU to another.

The original project which was built on the STM32 NUCLEO LO73RZ board, and i am trying to run it on an STM32 NUCLEO F411RE board. Unfortunately, the original project has no .ioc file (or at least i can't find it), so i can't use the method suggested on the ST website. I have tried following the tips from various websites but to no avail. I also tried to create a new project and manually configure it but i just wouldn't work.

I will be glad if asomeone has advice/suggestions i could pursue. Thank you.

PS. I attached the file underneath.

https://github.com/WurthElektronik/WirelessConnectivity-SDK_STM32

6 REPLIES 6
Aime
ST Employee

Hello CAben.1,

First it's normal that your project couldn't run on NUCLEO F411RE board, because you don't have the right drivers (for F4 board) to execute it.

To get the drivers you should use STMCubeMX or STMCubeIDE and select the right board NUCLEO F411RE.

You don't need to configure any I/Os or Clocks (you can just keep the default values) because all your configuration is described in your global.h and global.c files.

Once is done, you need to make a few updates :

  • Import the WCON_Drivers folder in your new project.
  • In global.h file change the #include "stm32l0xx_hal.h" by "#include "stm32f4xx_hal.h".
  • In global.c file you need to check on your Clock configuration in the function "SystemClock_Config(void)" according to your board configuration (datasheet and Reference Manual).
  • Remove the original main.c (run by default) and use the one desired "Metis, Proteus, ...". ref : http://www.we-online.com/ANR008 page 24.

After that I think you should be able to run your project.

BR,

AMVE.1

CAben.1
Associate II

Hello AMVE.1,

Thank you for your answer. I followed the steps the steps as you suggested, at the moment i have errors with the "SystemClock_Config(void)". In global.c, all the configurations are done as you could see. When i build the project, i get an undefinded SystemClock_Config(void) error. So i moved the the clock configs from the global.c to main.c (*PS. The one i am using is ThyoneI file), and now i get errors like:

/Drivers/STM32F4xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h:3248:37: error: 'RCC_PLL_MUL8' undeclared (first use in this function); did you mean 'RCC_PLLMUL_8'?

 3248 | #define RCC_PLLMUL_8        RCC_PLL_MUL8

   |                   ^~~~~~~~~~~~

../Core/Src/main.c:101:34: note: in expansion of macro 'RCC_PLLMUL_8'

 101 |  RCC_OscInitStruct.PLL.PLLMUL = RCC_PLLMUL_8;

   |                 ^~~~~~~~~~~~

../Core/Src/main.c:120:40: error: 'RCC_PERIPHCLK_USART1' undeclared (first use in this function); did you mean 'RCC_PERIPHCLK_RTC'?

 120 |  PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_USART1;

   |                    ^~~~~~~~~~~~~~~~~~~~

   |                    RCC_PERIPHCLK_RTC

../Core/Src/main.c:121:17: error: 'RCC_PeriphCLKInitTypeDef' {aka 'struct <anonymous>'} has no member named 'Usart1ClockSelection'; did you mean 'PeriphClockSelection'?

 121 |  PeriphClkInit.Usart1ClockSelection = RCC_USART1CLKSOURCE_PCLK2;

   |         ^~~~~~~~~~~~~~~~~~~~

   |         PeriphClockSelection

../Core/Src/main.c:121:40: error: 'RCC_USART1CLKSOURCE_PCLK2' undeclared (first use in this function); did you mean 'RCC_SWPMI1CLKSOURCE_PCLK'?

 121 |  PeriphClkInit.Usart1ClockSelection = RCC_USART1CLKSOURCE_PCLK2;

   |                    ^~~~~~~~~~~~~~~~~~~~~~~~~

   |                    RCC_SWPMI1CLKSOURCE_PCLK

make: *** [Core/Src/subdir.mk:34: Core/Src/main.o] Error 1.

My question, do i need to use the default clock configs from the my board or what exactly did you mean by checking the clock configs according m´to my datasheet?

Thank you.

Aime
ST Employee

In global.c the clock is configured as HSE_BYPASS Mode with the parameters RCC_OscInitStruct.PLL.PLLMUL = RCC_PLLMUL_8 and RCC_OscInitStruct.PLL.PLLDIV = RCC_PLLDIV_2. Just make sure that your board can provided it.

But I don't think this is the issue here, in global.h SystemClock_Config() is declared as "extern" so without moving it into your main.c (ThyoneI file) the compilator should be able to find it just by including the "global.h" file.

Can you show me the structure of your project ?

BR.

AMVE.1

CAben.1
Associate II

Thank you AMVE.

Sure, you can see the structure. I have attached the project here.

Aime
ST Employee

Hello CAben.1,

You need to make some updates on your code :

  • In global.c ( HAL_UART_MspInit() and HAL_UART_MspDeInit() ) the USART1 configuration for the Nucleo F411RE is :

   /**USART1 GPIO Configuration

   PA12   ------> USART1_RTS

   PA11   ------> USART1_CTS

  PA10   ------> USART1_TX

  PA9   ------> USART1_RX

  */

  • In global.c ( UART_Init() ) remove the lines (huart1.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE and huart1.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT) it's no longer available on F4 drivers.
  • In Thyonel.c ( ThyoneI_Init() ) change the pins PA9, PA10 because they are already used as USART1.
  • In your SystemClock_Config() I recommend you to use the HSI with the PLL ON and the parameters M = 12, N = 96, P = 2 so you will have a 64MHz of SYSCLOCK

0693W00000GVsmuQAD.png0693W00000GVt3VQAT.pngBR,

CAben.1
Associate II

Hello AMVE .1,

Thank you for your response. I made the suggested updates and got the project running sucessfully. Thank you.

Best Regards.