Hi,
I am working on a bootloader code for MK22FN512VLH12, which is running in high speed mode. I am using processor expert code in KDS to read the latest image from SD card and start the firmware update. For successful flash operations I tried to switch the clock to lower frequency and start the normal run. But after the flash write, when I tried to jump into the application, it is restarting and comes to the bootloader code again. It goes to __thumb_startup() of the firmware and restarting without goes to main.But when I tried the same bootloader code in 60Mhz at normal run mode, it is successfully jumping to the application. My firmware is running at high speed mode, So I need to setup the bootloader code in same frequency. Please help
From what you described, seems like you are programming flash under HSRUN mode. This is not allowed. Flash programming can only be done under normal run mode. Flash driver will return error. Maybe you did not successfully programmed flash and tried to jump to flash and run something incorrect in flash and caused a reset.
Hao
Hello ,
1) What about the clock mode(FEI , PEE .....) of booloader and your application code ?
2) You said "I tried the same bootloader code in 60Mhz at normal run mode", so this meaning you
can improve the speed , so what about your question ?
BR
Alice
Hi,
Thanks for the reply. Clock mode is PEE. I mean bootloader code can successfully jump to the application when it running at 60 MHz,but it won't work. When core frequency is 120 MHz, I need to switch it to 60 MHz before starting the flash operation as it is not supported in HSRUN mode. After a successful flash write of latest image,the code will reset and it automatically goes to 120 MHz core frequency. Then tries to jump to the application. There I am facing this reset problem. If the core frequency of bootloader is 60 MHz at time of jump to the application it will stuck in the startup stage of application itself, in __init_hardware() function. Because my application is running in HSRUN mode.
Hello ,
For the clock speed , in your application code , when you configure the clock to 60M,
after it jump to the APP, it will run these code to configure the clock to 60M, so i think
this not the reason.
While in the bootloader , the clock mode is PEE mode ,before jump to APP, you must
be configure it to FEI mode , or when jump to APP, it can not conifgure the clock.
For the at the start , the clock run from the FEI mode .
Please have a try.
Hope it helps
Alice