Loading...
 

SW4STM32 and SW4Linux fully supports the STM32MP1 asymmetric multicore Cortex/A7+M4 MPUs

   With System Workbench for Linux, Embedded Linux on the STM32MP1 family of MPUs from ST was never as simple to build and maintain, even for newcomers in the Linux world. And, if you install System Workbench for Linux in System Workbench for STM32 you can seamlessly develop and debug asymmetric applications running partly on Linux, partly on the Cortex-M4.
You can get more information from the ac6-tools website and download (registration required) various documents highlighting:

System Workbench for STM32


Initialisation fails when using CubeMX and HSE clock source

This bug was introduced by CubeMX v4.20.
In SystemClock_Config() function, when HSE is selected it generates code:

RCC_OscInitTypeDef RCC_OscInitStruct;
RCC_ClkInitTypeDef RCC_ClkInitStruct;

/**Initializes the CPU, AHB and APB busses clocks
*/
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_HSE;
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
RCC_OscInitStruct.HSEPredivValue = RCC_HSE_PREDIV_DIV1;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL9;
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
{
Error_Handler();
}

Notice the OscillatorType filed is initialized for BOTH HSI and HSE, while later field HSIState is never set.

So you have two solutions:

  • either remove RCC_OSCILLATORTYPE_HSI for the line to be like this:
    • RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
  • or add HSIState field like this:
    • RCC_OscInitStruct.HSIState = RCC_HSI_ON;


I hope they will fix this ASAP, as you have to edit SystemClock_Config() every time the project is regenerated..