Hello Kerry Zhou,
I really appreciate your fast support!
The compiler optimization was already turned off...
After building the bootloader(debug build), the bootloader codesize is at 37.380 bytes (text-section for application code):
arm-none-eabi-size --format=berkeley "MKV58F1M0VLL24_Bootloader.elf"
text data bss dec hex filename
37380 364 5120 42864 a770 MKV58F1M0VLL24_Bootloader.elf
By way of comparison, the bootloader codesize of the release build is way smaller because of compiler optimization in size (-Os):
arm-none-eabi-size --format=berkeley "MKV58F1M0VLL24_Bootloader.elf"
text data bss dec hex filename
22620 356 5088 28064 6da0 MKV58F1M0VLL24_Bootloader.elf
Nevertheless, the Problem occurs in both builds.
By the way, this is the MEMORY specification of my bootloader:
MEMORY
{
m_itcm (RX) : ORIGIN = 0x00000000, LENGTH = 0x00010000
m_interrupts (RX) : ORIGIN = 0x10000000, LENGTH = 0x00000400
m_flash_config (RX) : ORIGIN = 0x10000400, LENGTH = 0x00000010
m_text (RX) : ORIGIN = 0x10000410, LENGTH = 0x000FFBF0
m_data (RW) : ORIGIN = 0x20000000, LENGTH = 0x00020000
m_ocram (RW) : ORIGIN = 0x2F000000, LENGTH = 0x00010000
}
and this is the one for my application:
MEMORY
{
m_data (RW) : ORIGIN = 0x00000400, LENGTH = 0x0000FC00
m_interrupts (RX) : ORIGIN = 0x1000A000, LENGTH = 0x000003C0
m_bca (RX) : ORIGIN = 0x1000A3C0, LENGTH = 0x00000040
m_text (RX) : ORIGIN = 0x1000A400, LENGTH = 0x000F5C00
m_data_2 (RW) : ORIGIN = 0x20000000, LENGTH = 0x00020000
m_data_3 (RW) : ORIGIN = 0x2F000000, LENGTH = 0x00010000
}
In addition, BL_APP_VECTOR_TABLE_ADDRESS is set to 0x1000A000, which suits the address stated in the Kinetis Flash Tool.
Do you see any further possible problem sources?
With kind regards,
Julian Schork