Hi I want to design my own boot loader for KE-02Z controller.
Should I write my boot loader code inside main.c or should I create a Separate Boot loader.c source file and then write the code in it ?
Since, all my processor expert generated code's header files will be included in main.c. If I have to write a separate boot loader code, then I still have to keep the empty main.c file in my project ?
Thanks
Solved! Go to Solution.
Hello Ganesh,
I think you still have not know the bootlaoder clearly.
In the main() function , you should writhe when re-flash the application code ,
and when jump to the application, for example , when press one button .
These all refer to your demand , i still strongly recommend you refer to this DOC:
Kinetis Bootloader to Update Multiple Devices in a Network - for Cortex-M0+
especially the bootloader flowchart, this flowchart is consider overall, of course you
can not consider so much , for example , you can only check whether the SW1 button
pressed .
YOu can also refer to the bootlaoder project of KE02 i have send to you .
Hope it hleps
Have a great day,
Alice
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hello Gnesh,
I think both are OK, what's the question with you when write to the main.c ?
BR
Alice
Oh thanks.
My question with respect to main.c is
Even though I create a separate source file (say Boot loader.c) and write the entire Boot loader code in it, when I generate Processor Expert code all the included component's header files will be inside main.c() file right ? like this
That was my doubt. I write a separate Boot loader.c source file which contains my boot loader code and the main.c source file will be empty with just the included header files. Is this correct way or should I write my boot loader code (which I wrote in Boot loader.c) inside main.c ??
Hello Ganesh,
- The header files will be included automatic when generate code,
we needn't care it .
- If you write nothing on the main(), how do you start run your project ?
BR
Alice
Hey Alice,
That is exactly my question. When my entire boot loader code is in a separate source file, what should I put in the main.c file ?
I have done this to make this program run before the main gets executed.
Am I wrong ?
Hello Ganesh,
I think you still have not know the bootlaoder clearly.
In the main() function , you should writhe when re-flash the application code ,
and when jump to the application, for example , when press one button .
These all refer to your demand , i still strongly recommend you refer to this DOC:
Kinetis Bootloader to Update Multiple Devices in a Network - for Cortex-M0+
especially the bootloader flowchart, this flowchart is consider overall, of course you
can not consider so much , for example , you can only check whether the SW1 button
pressed .
YOu can also refer to the bootlaoder project of KE02 i have send to you .
Hope it hleps
Have a great day,
Alice
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hey Alice,
In the link that you sent, there are example codes only KL26 and K22 controllers. I ll look into the logic of the KL26 boot loader as KE-02Z controllers are Cortex M0+ controllers. Thanks will get back to you when I face any issue after reading your article.
Thanks