2024-12-02 08:49 AM
I updated to CubeMX 6.13.0 and firmware package 1.12.0 for and STM32H755BIT chip and found several issues with the new release:
HAL_RCC_GetPCLK1Freq();
HAL_RCC_GetPCLK2Freq();
Screen capture showing 240 MHz clock rate on PCLK:
2024-12-03 01:14 AM
Hello @djanovy
First let me thank you for posting.
Could you please share your IOC in order to check your configuration? This will help further the investigation.
THX
Ghofrane
2024-12-03 05:43 AM
Hello @djanovy
When configuring the Supply Source to :Power _LDO_Supply
The generated code using CubeMX 6.13.0 will be :
void SystemClock_Config(void)
{
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
/** Supply configuration update enable
*/
HAL_PWREx_ConfigSupply(PWR_LDO_SUPPLY);
calling HAL_PWREx_ConfigSupply(PWR_LDO_SUPPLY);
prepares your microcontroller to use the LDO for power management. When ExitRun0Mode()
is subsequently executed, it will configure the system to ensure that the LDO is enabled and ready, allowing for a smooth transition back to normal operational mode from a low-power state.
So no need for you to add anything.
I am looking forward to receiving your feedback and IOC.
THX
Ghofrane
2024-12-03 07:46 AM
Version 6.12 and 6.13 .ioc files attached. I'm also sending the main.c files and the simple post.c file that showed the PCLK frequencies at 240 MHz. The main.com in this message is for the CM7 core. This web interface only allows three files at a time, so I will include the other two files in the next message.
The first indicator that I noticed in my real application was the USART output data on the CM7 core was corrupted indicating an incorrect baud rate.
In the main.c files I have commented out the code where the two cores coordinate their boot sequence, allowing them to boot independently. CTI option bytes are also set in the OpenOCD target config to prevent the cores from halting each other.
Let me know if there is anything else I can provide.
2024-12-03 07:50 AM
2024-12-03 09:11 AM
Just to clarify the sequence of function calls...
ExitRun0Mode() is called in startup_stm32h755xx_CM7.s, line 64:
/* Call the ExitRun0Mode function to configure the power supply */
bl ExitRun0Mode
/* Call the clock system initialization function.*/
bl SystemInit
before HAL_PWREx_ConfigSupply(PWR_LDO_SUPPLY) is called from main() -> SystemClock_Config():
void SystemClock_Config(void)
{
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
/** Supply configuration update enable
*/
HAL_PWREx_ConfigSupply(PWR_LDO_SUPPLY);
ExitRun0Mode() from system_stm32h7xx_dualcore_boot_cm4_cm7.c checks for a define 'USE_PWR_LDO_SUPPLY'. I do not see where this define gets set in any of the source code/header files.
void ExitRun0Mode(void)
{
#if defined(USE_PWR_LDO_SUPPLY)
#if defined(SMPS)
/* Exit Run* mode by disabling SMPS and enabling LDO */
PWR->CR3 = (PWR->CR3 & ~PWR_CR3_SMPSEN) | PWR_CR3_LDOEN;
#else
/* Enable LDO mode */
PWR->CR3 |= PWR_CR3_LDOEN;
#endif /* SMPS */
2024-12-03 10:53 AM - edited 2024-12-03 10:55 AM
I found the 'USE_PWR_LDO_SUPPLY' define in the Makefile. Since I don't use the CubeMX generated Makefile, I wasn't finding it. For people in a similar situation it would help if there was an warning error if a specific supply mode is not selected similar to how CORE_CM7 is checked:
#if defined(DUAL_CORE) && !defined(CORE_CM4) && !defined(CORE_CM7)
#error "Dual core device, please select CORE_CM4 or CORE_CM7"
#endif
I had previously added the define to my Symbol list and the testing done above included the define.
2024-12-03 03:17 PM
I have a related problem but in a CMake project for STM32H7B3LIHxQ. This project has SupplySource set to PWR_DIRECT_SMPS_SUPPLY in the RCC settings. When generating the code, it defines BOTH USE_PWR_LDO_SUPPLY and USE_PWR_DIRECT_SMPS_SUPPLY in the CMakeLists.txt file.
2024-12-03 03:23 PM
2024-12-03 03:44 PM
How the power supply is configured depends on the circuit layout (how your device powered), the clock frequency you are running at, the VOS level, and other items. See your reference manual, RM0455, Section 6, p. 260, for full details. Figure 20 on page 266 shows the allowed configurations.
What problem are you seeing?