2019-02-25 07:56 AM
Hello,
I'm using a STM32L433CCU3 in my Application with STM32CubeMX.
I'm download my hex-files with the STM32CubeProgrammer in UART serial download mode.
If I start my application directly after download with the "Run after programming"-function of the STM32CubeProgrammer my software runs 30% slower than as a start from a cold-boot.
Is there any reason for this behaviour.
Best regards
Andreas Fecht
2019-02-25 08:04 AM
Not starting the clocks properly or making assumptions? Make sure to clear auto/local variables in the routines that configure the clocks. Make sure to explicitly set clocks rather than make assumptions they will be in reset conditions.
To understand the issue print out telemetry and register settings so you can observe the differences.
2019-02-25 08:55 AM
I've not made any changes in the clock section of the STM32CubeMX.
Everything is on default settings.
2019-02-25 11:15 AM
Ok, and may be that's too sloppy..
Auto/local variables are on the stack, the stack contains random undefined crap.
You're going to have to dig to find the reason. You can start by unpacking the clocking state.
I don't have your code, I don't have your boards.
//****************************************************************************
extern const uint32_t MSIRangeTable[];
//****************************************************************************
uint32_t MSICLOCK(void) // sourcer32@gmail.com
{
uint32_t msirange = 0;
uint32_t cr = RCC->CR;
uint32_t csr = RCC->CSR;
if (cr & RCC_CR_MSIRGSEL)
msirange = (csr & RCC_CSR_MSISRANGE) >> RCC_CSR_MSISRANGE_Pos; /* MSISRANGE from RCC_CSR applies */
else
msirange = (cr & RCC_CR_MSIRANGE) >> RCC_CR_MSIRANGE_Pos; /* MSIRANGE from RCC_CR applies */
/*MSI frequency range in HZ*/
return(MSIRangeTable[msirange]);
}
//***************************************************************************
printf("Core=%d, %d MHz\n", SystemCoreClock, SystemCoreClock / 1000000);
printf("MCLK=%d\n", MSICLOCK());
printf("HCLK=%d\n", HAL_RCC_GetHCLKFreq());
printf("APB1=%d\n", HAL_RCC_GetPCLK1Freq());
printf("APB2=%d\n", HAL_RCC_GetPCLK2Freq());