2021-10-28 02:14 AM
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
2021-10-28 06:41 AM
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 :
After that I think you should be able to run your project.
BR,
AMVE.1
2021-10-28 07:16 AM
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.
2021-10-28 07:41 AM
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
2021-10-28 08:19 AM
2021-10-29 02:47 AM
Hello CAben.1,
You need to make some updates on your code :
/**USART1 GPIO Configuration
PA12 ------> USART1_RTS
PA11 ------> USART1_CTS
PA10 ------> USART1_TX
PA9 ------> USART1_RX
*/
BR,
2021-10-29 07:07 AM
Hello AMVE .1,
Thank you for your response. I made the suggested updates and got the project running sucessfully. Thank you.
Best Regards.