2021-11-14 07:20 AM
Newly generated code by SMT32CubeMX (6.1.1) hang at SystemClock_Config(). the hardware can boot up with the old code generated by STM32CubeMX previously.
Further investigation showed
__HAL_RCC_GET_SYSCLK_SOURCE() == RCC_SYSCLKSOURCE_STATUS_HSI or ((__HAL_RCC_GET_SYSCLK_SOURCE() == RCC_SYSCLKSOURCE_STATUS_PLLCLK) && (__HAL_RCC_GET_PLL_OSCSOURCE() == RCC_PLLSOURCE_HSI)) is false
/* Check if HSI is used as system clock or as PLL source when PLL is selected as system clock */
if((__HAL_RCC_GET_SYSCLK_SOURCE() == RCC_SYSCLKSOURCE_STATUS_HSI)
|| ((__HAL_RCC_GET_SYSCLK_SOURCE() == RCC_SYSCLKSOURCE_STATUS_PLLCLK) && (__HAL_RCC_GET_PLL_OSCSOURCE() == RCC_PLLSOURCE_HSI)))
The file - system_stm32f3xx.c is different code
/* Reset the RCC clock configuration to the default reset state ------------*/
/* Set HSION bit */
RCC->CR |= 0x00000001U;
/* Reset CFGR register */
RCC->CFGR &= 0xF87FC00CU;
/* Reset HSEON, CSSON and PLLON bits */
RCC->CR &= 0xFEF6FFFFU;
/* Reset HSEBYP bit */
RCC->CR &= 0xFFFBFFFFU;
/* Reset PLLSRC, PLLXTPRE, PLLMUL and USBPRE bits */
RCC->CFGR &= 0xFF80FFFFU;
/* Reset PREDIV1[3:0] bits */
RCC->CFGR2 &= 0xFFFFFFF0U;
/* Reset USARTSW[1:0], I2CSW and TIMs bits */
RCC->CFGR3 &= 0xFF00FCCCU;
/* Disable all interrupts */
RCC->CIR = 0x00000000U;
But I added this code into new code. it's the same, still hang. And also use the same *ioc file to generate the code by STM32CubeMXIDE. it can boot up.
Please any bode help to give your ideas. thanks.
Regards,
Jiannong
2021-11-16 06:53 AM
Hello @Community member ,
Can you please use the latest release of STM32CubeMx v6.3 ?
If you still have the same issue with the latest release, please share your ioc file to try reproduce this from my side.
Imen
2021-11-16 06:30 PM
Hi Imen,
I tried STM32CubeMX V6.3. the issue is the same. Actually, the ioc file is very simple, only enable internal clock.
I tried to use STM32CubeIDE to open the same ioc file and it works.
Also when use new revision of STM32CubeMX, there are some other issues
Please advise on what these issues cause. Any IAR revision requirement?
Thanks,
Jiannong
2021-11-18 06:44 AM
Adding @Khouloud OTHMAN , @Khouloud ZEMMELI from CubeMx team to review and confirm this issue in CubeMX tool.
Imen