Hi Christopher Burg,
Yes, you can use the FRDM k22 bootloader in your K22FN256LH12 , but you need to do the following modification, actually, just modify the flash size.
1. memory_map_k22f512.c with this:
memory_map_entry_t g_memoryMap[] = {
{ 0x00000000, 0x0003ffff, kMemoryIsExecutable, &g_flashMemoryInterface }, // Flash array (256KB)
{ 0x1fffc000, 0x20007fff, kMemoryIsExecutable, &g_normalMemoryInterface }, // SRAM (48KB)
{ 0x40000000, 0x4007ffff, kMemoryNotExecutable, &g_deviceMemoryInterface }, // AIPS peripherals
{ 0x400ff000, 0x400fffff, kMemoryNotExecutable, &g_deviceMemoryInterface }, // GPIO
{ 0xe0000000, 0xe00fffff, kMemoryNotExecutable, &g_deviceMemoryInterface }, // M4 private peripherals
{ 0 } // Terminator
};
2. MK22FN512xxx12_application_0x0000.ld, KDS IDE.
MEMORY
{
m_interrupts (RX) : ORIGIN = 0x00000000, LENGTH = 0x00000400
m_flash_config (RX) : ORIGIN = 0x00000400, LENGTH = 0x00000010
m_text (RX) : ORIGIN = 0x00000410, LENGTH = 0x0003FBF0
m_data (RW) : ORIGIN = 0x1FFFC000, LENGTH = 0x0000C000
}
No other point need to modify, yes, you need to use the reset pin to enter the bootloader mode.
If you still have problems, you also can try the UART bootloader on your own board, whether you UART bootloader have problems or not?
Besides, when you build the bootloader code, you can use the release mode, otherwise, the code size may larger than 0xa000, then you can't port your application to relocate in 0xa000.
From my own viewpoint, even you don't modify it, you also can download the code, because your bootloader didn't larger than 256K, so I think you can download freedom_bootloader.bin in folder NXP_Kinetis_Bootloader_2_0_0\targets\MK22F51212\iar\binaries to your own chip directly.
Please try it on your side.
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------