I want to make a bootloader function in my application.
My starting point is example f28069_flash_kernel that is pretty straight forward.
Only I want to split the bootloader and main program in flash.
I want to dedicate flash sector A of H for the bootloader and the rest of my main program.
I was thinking something like this:
void main (void)
{
Init hardware.
if (runbootloader == true)
{
copy bootloader to memory;
start bootloader function
restart;
}
start main program.
}
My question is: how do I keep the code separated in FLASH?
Thanks!