2020-12-16 10:41 PM - last edited on 2023-06-16 09:56 AM by Kevin HUBER
Hi,
I just approach to STM32MP1 and want to port some project from STM32F4/L4 to M4 Core in STM32MP1.
To start, I'm just trying use engineering mode fisrt. I have a STM32MP157C-DK2 board and a new project is generated by STM32CubeMX, all configurations is default and I'm using STM32CubeMP1 v1.3.0.
Unfortunately, I always reach an issue when HAL_RCC_OscConfig always returns HAL_ERROR each time called from SystemClock_Config. Specifically, the following if condition in stm32mp1xx_hal_rcc.c is reached and my program stucks in an infinite loop.
if (IS_HSE_IN_USE())
{
if ((__HAL_RCC_GET_FLAG(RCC_FLAG_HSERDY) != RESET) && (RCC_OscInitStruct->HSEState != RCC_HSE_ON))
{
return HAL_ERROR;
}
}
Am I missing something or I must write my own HAL_RCC_OscConfig? Again, all configurations is kept as default of STM32MP157C-DK2 board.
Thanks,
Bao Son.
2020-12-17 08:58 PM
Hello
Is crystal selected in RCC settings for HSE?
Try to give some more HSE Statup Timeout Value in RCC settings on STM32Cube
2020-12-18 08:06 AM
Hello Vangelis,
Looks like that's not my problem. I checked again and found that if I start a new debugging session through the built-in debugger, it reassigns the PC's new address. That was not to my expectation as I wanted both the cores and the peripherals to be reset. In my case I was forced to hit the reset button before starting a new debugging session, which was a bit inconvenient :grinning_face_with_sweat: .
In another development, I also found that my GPIO configuration was generated wrong, or more accurately it's not generated by neither STM32CubeMX nor CubeIDE. No one was created and I had to configure manually. I don't see this issue in F4 product line. Maybe, it's only appear on new models such as STM32MP1. Have you had same issue? It needs explanation from someone in ST. A tool that was created for convenience, but in practice it was frustrating :\ .
Thanks,
BS.
2021-01-11 01:17 AM
Hi @Bao Son Le ,
Sorry to see you post so late.
Are you using STM32CubeIDE or another IDE ?
Olivier
2021-01-20 08:49 AM
Hi @Bao Son Le ,
I think I have explanation for both issues :
If one comment answer your question, please close this topic by choosing Select as Best. This will help other users to find that answer faster.
Thx
Olivier
2021-01-27 06:13 AM
Hi Olivier,
Sorry for late reply. About the first point, I'll tried and feedback later. However, with the second point, I see your suggestion just works when we configure input/output GPIOs. If I want to assign some GPIO pins as alternative function GPIOs (I2C, SPI etc.), they still don't generate as expected. Maybe the feature is still incomplete and we need to wait for the next updates, don't we?
Thank you,
Bao Son
2021-01-27 06:17 AM
Hi @Bao Son Le ,
For second point regarding GPIO with alternate function assign to peripheral take care to assign the peripheral to the M4 context and check there's no conflict.
If still not working please be more specific ( exact GPIOs , Ip, function etc.. ) in order I can try to reproduce
Olivier