2011-07-30 11:38 PM
Dear all,
I have 2 applications in my STM32 microcontroller; the Boot Loader & the Main Application. It starts with the bootloader perform some actions and then it (Jumps) to a known address to execute the main application. The problem I've have is that system clock in boot loader differs from that in the main application. and when it jumps to the main application, it is executed successfully but alaways with the boot loader's clock; eventhough, I reconfigure it in the main application. My question is, how do I re-configure the system clock when I jump to the main application? Thanks in advance, Celo2011-07-31 05:30 AM
You need to make the clock setting code smarter so that it determines the current conditions and acts accordingly.
For example : Don't assume specific conditions, reset or otherwise. Don't turn on HSE if it is already running. Don't select a clock that isn't running. Turn on HSI if it has been turned off. If you are running from the PLL, you must switch to a different clock *before* reprogramming the PLL and waiting for it to relock. Then switch it back. Don't select, or wait on, clocks that already set and valid.2011-07-31 06:25 AM
Actually, even if I disable PLL, HSE and HSI in the main application, it is still executed correctly using the bootloader clock !!!
2011-07-31 07:49 AM
Actually, even if I disable PLL, HSE and HSI in the main application, it is still executed correctly using the bootloader clock !!!
Then clearly you aren't doing those things, check your code flow.