Dear Expert,
I need some description for "Customize Boot loader" to upgrade firmware application on K22F over the UART.
I downloaded bootloader from Kinetis Bootloader|Freescale
And able to compile and updated the bootloader then In application I updated memory location in linker files and it is working fine.
But I am not able to understand the entire process. So Can you please guide/suggest me the exact path/setting to meet this expectation correctly.
Let me know if more inputs required.
Regards,
Sunil
已解决! 转到解答。
Hello Sunil,
Please try :
MEMORY {
m_interrupts (RX) : ORIGIN = 0x0000A000, LENGTH = 0x00000400
m_flash_config (RX) : ORIGIN = 0x0000A400, LENGTH = 0x00000010
m_interrupts_ram (RW) : ORIGIN = 0x1FFF0000, LENGTH = 0x00000400
m_text (RX) : ORIGIN = 0x0000A410, LENGTH = 0x00070000
m_data (RW) : ORIGIN = 0x1FFF0400, LENGTH = 0x0000FC00
m_data_2 (RW) : ORIGIN = 0x20000000, LENGTH = 0x00010000
}
For we need configure the uer's Application code from 0xA000 , you can refer to this DOC :
Kinetis Bootloader Demo Applications User's Guide.pdf
BR
Alice
Hello Sunil,
Does this can help you :"...\ FSL_Kinetis_Bootloader_1_2_0\FSL_Kinetis_Bootloader_1_2_0\doc " -> 2.4 Start-up process .
There also have a "Figure 2-1. Kinetis bootloader start-up flowchart" .
Hope it helps!
Have a great day,
Alice
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Alice,
Thanks for the reply and looking into it.
As above mentioned, I am able to upgrade my application after updated few fields in linker file:
MEMORY {
m_interrupts (RX) : ORIGIN = 0x00000000, LENGTH = 0x00000400
m_flash_config (RX) : ORIGIN = 0x00000400, LENGTH = 0x00000010
m_interrupts_ram (RW) : ORIGIN = 0x1FFF0000, LENGTH = 0x00000400
m_text (RX) : ORIGIN = 0x00000410, LENGTH = 0x0007FBF0
m_data (RW) : ORIGIN = 0x1FFF0400, LENGTH = 0x0000FC00
m_data_2 (RW) : ORIGIN = 0x20000000, LENGTH = 0x00010000
}
But there are some issue with the application which is not running every time.
Demo led app is working fine.
I am trying to find the root cause of this issue.
Regards,
Sunil
Hello Sunil,
Please try :
MEMORY {
m_interrupts (RX) : ORIGIN = 0x0000A000, LENGTH = 0x00000400
m_flash_config (RX) : ORIGIN = 0x0000A400, LENGTH = 0x00000010
m_interrupts_ram (RW) : ORIGIN = 0x1FFF0000, LENGTH = 0x00000400
m_text (RX) : ORIGIN = 0x0000A410, LENGTH = 0x00070000
m_data (RW) : ORIGIN = 0x1FFF0400, LENGTH = 0x0000FC00
m_data_2 (RW) : ORIGIN = 0x20000000, LENGTH = 0x00010000
}
For we need configure the uer's Application code from 0xA000 , you can refer to this DOC :
Kinetis Bootloader Demo Applications User's Guide.pdf
BR
Alice
Hi Alice,
Problem is same after changing the map, some time it is working some time not.
I have also tried to change the map address as per recommendation.
During debugging I found the below:
- Demo Led Apps:
app starting address - 0xa3e1
stack pointer - 0x1fff0400
- My app:
app starting address - 0xa4d9
stack pointer - 0x20010000
Can it cause the problem ?
Regards,
Sunil
Hi Alice,
The issue has resolved just I created a new program without processor expert and its running fine.
I modified the following memory map:
MEMORY {
m_interrupts (RX) : ORIGIN = 0x0000A000, LENGTH = 0x00000400
m_flash_config (RX) : ORIGIN = 0x0000A400, LENGTH = 0x00000010
m_interrupts_ram (RW) : ORIGIN = 0x1FFF0000, LENGTH = 0x00000400
m_text (RX) : ORIGIN = 0x0000A410, LENGTH = 0x00070000
m_data (RW) : ORIGIN = 0x1FFF0400, LENGTH = 0x0000FC00
m_data_2 (RW) : ORIGIN = 0x20000000, LENGTH = 0x00010000
}
Thanks for the help.
Sunil
Hello Sunil,
I have test on my side , create a PE project about k22 , please see the attachment .
In the PE project , we need configure some place when use the KBOOT:
- in the linker file :
- disable the "generate linker file" :
then the .bin file can work well on KBOOT, you can test it .
Hope it helps
Have a great day,
Alice
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Alice,
Thanks a lot, It is working fine for me as well.
I have customized the blhost utility to upgrade the firmware of K22F for Linux environment.
But In my project I am using two K22F MCU for different purpose.
Connection is like:
My use case is : MCU-2 firmware will be updated from Host and MCU-1 will be updated via MCU-2 over the UART.
I am confirming the feasibility and approche.
Please provide your inputs/suggestion.
Regards,
Sunil
Hi Alice,
Hope you are doing good.
I am trying to add gpio check in bootloader code, means:
When the system is in bootloader mode the status of gpio should be high otherwise low.
I am not able to found the place where I can put the logic.
Another thing Is it possible to connect device in bootloader mode with defined baudrate instead of auto baud.
Your early help will be much appreciated.
Regards,
Sunil
Hello Sunil,
1. About your MCU1 - MCU2 mode , i have not test , and i think it can realize after you change the code of KBOOT
successfully, while i have never change the code before .
2. For all of your question , they are all need reading the KBOOT code in detail , then change the baud rate ,
and also configure the GPIO .
For these days , i'm going to port one bootloader to FRDM-K22 board , if you need , after i finish it , i can send to you .
BR
Alice
Hi Alice,
Yes we are reading the KBOOT code in details.
Sure you can share with me once you finish this part.
Mean while I am also working on it and will share my findings as well.
Regards,
Sunil
Hello Sunil,
For last week, i went on a business trip, sorry for reply you late, and first congratulation to you have solved it .
And do you meaning you use the same modified memory map , it can work well on the project without PE, and
it can not work with PE project ? I will test i on my side .
BR
Alice