Hi Yon hona,
Actually, KL17 already have the ROM bootloader, I don't know you still use the flash bootloader.
If you want to add some your own function in the bootloader, you can use the flash bootloader.
But from your linker file,your application code relocate have the problems.
As you know, flash address 0X400 is the flash configuration field, this is the very important area to the kinetis chip.

I think you can relocate your application code to flash address 0x1000, besides, you must make sure your bootloader code size is smaller than 0x1000.
Then modify the linker file like this:
this is the bootloader memory:
MEMORY
{
/* Define each memory region */
PROGRAM_FLASH (rx) : ORIGIN = 0x00, LENGTH = Your bootloader size/* 1K bytes (alias Flash) */
Flash_00 (rx) : ORIGIN = 0x400, LENGTH = 0x3fc00 /* 255K bytes (alias Flash2) */
SRAM (rwx) : ORIGIN = 0x1fffe000, LENGTH = 0x8000 /* 32K bytes (alias RAM) */
}
and this is the application:
MEMORY
{
/* Define each memory region */
PROGRAM_FLASH (rx) : ORIGIN = 0x1000, LENGTH = flash total size-0x1000/* 255K bytes (alias Flash) */
Flash_00 (rx) : ORIGIN = 0x1400, LENGTH = 0x400 /* 1K bytes (alias Flash2) */
SRAM (rwx) : ORIGIN = 0x1fffe000, LENGTH = 0x8000 /* 32K bytes (alias RAM) */
}
You can try it again.
I still want to say, if you don't have the special usage, you can use the chip's ROM bootloader, more detail, please refer to the reference manual, Chapter 13
Kinetis ROM Bootloader
If you still have question about it, please let me know!
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------