yon hona

KL17 Flash resident bootloader

Discussion created by yon hona on Feb 25, 2018
Latest reply on Mar 6, 2018 by yon hona

Hi,

 

I'm developing a flash resident bootloader on the KL17 MCU.

The project consist from a bootloader and application.

The bootloader jump to the application is working correctly, I can see that the some GPIOs are initialized in the application.

But later in the application, the program jumps to hard fault handler due to unknown instruction.

I suspect that the linker script it not right.

this is the bootloader memory:

MEMORY
{
/* Define each memory region */
PROGRAM_FLASH (rx) : ORIGIN = 0x00, LENGTH = 0x400 /* 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 = 0x400, LENGTH = 0x3fc00 /* 255K bytes (alias Flash) */

Flash_00 (rx) : ORIGIN = 0x00, LENGTH = 0x400 /* 1K bytes (alias Flash2) */
SRAM (rwx) : ORIGIN = 0x1fffe000, LENGTH = 0x8000 /* 32K bytes (alias RAM) */
}

 

what am I doing wrong?

 

Thanks

Outcomes