Skip to main content
Andreas Fecht
Associate II
February 25, 2019
Question

Different application-speed after download

  • February 25, 2019
  • 3 replies
  • 829 views

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

This topic has been closed for replies.

3 replies

Tesla DeLorean
Guru
February 25, 2019

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.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Andreas Fecht
Associate II
February 25, 2019

I've not made any changes in the clock section of the STM32CubeMX.

Everything is on default settings.

Tesla DeLorean
Guru
February 25, 2019

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());

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..