Hi guys,
I have a question, i can't have my boot_loader work.
I just want my boot_loader to lauch application at a specified location, and it doesn't work.
The MCU i use is LX4F230H5QR.
Here is what i have done.
1. Build Boot_loader and burn it with LM Flash Programmer with offset 0, checked "erase entire flash"
2. Build Application and burn it with LM Flash Programmer with offset 0x1000, checked "erase necessary pages"
Below is the .icf files for Boot_loader
//
// Define a memory region that covers the entire 4 GB addressible space of the
// processor.
//
define memory mem with size = 4G;
//
// Define a region for the on-chip flash.
//
define region FLASH = mem:[from 0x00000000 to 0x0003ffff];
//
// Define a region for the on-chip SRAM.
//
define region SRAM = mem:[from 0x20000000 to 0x20007fff];
//
// Indicate that the sections containing the boot loader code should be
// initialized by copying.
//
initialize manually with packing = none { section INTVEC };
initialize manually with packing = none { section CODE };
initialize manually with packing = none { section .text };
initialize manually with packing = none { section .rodata };
initialize manually with packing = none { section .data };
keep { section INTVEC };
keep { section INTVEC_init };
//
// Indicate that the noinit values should be left alone. This includes the
// stack, which if initialized will destroy the return address from the
// initialization code, causing the processor to branch to zero and fault.
//
do not initialize { section .noinit };
//
// Place the interrupt vectors at the start of flash/SRAM.
//
place at start of FLASH { readonly section INTVEC_init };
place at start of SRAM { readwrite section INTVEC };
//
// Place the remainder of the read-only items into flash/SRAM.
//
place in FLASH { readonly section CODE_init };
place in SRAM { readwrite section CODE };
place in FLASH { readonly section .text_init };
place in SRAM { readwrite section .text };
place in FLASH { readonly section .rodata_init };
place in SRAM { readwrite section .rodata };
place in FLASH { readonly section .data_init };
place in SRAM { readwrite section .data };
place in FLASH { readonly };
//
// Place all read/write items into SRAM.
//
place in SRAM { readwrite };
Below is the icf file for my Application
/*###ICF### Section handled by ICF editor, don't touch! ****/
/*-Editor annotation file-*/
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
/*-Specials-*/
define symbol __ICFEDIT_intvec_start__ = 0x00000000;
/*-Memory Regions-*/
define symbol __ICFEDIT_region_ROM_start__ = 0x00001000;
define symbol __ICFEDIT_region_ROM_end__ = 0x0003FFFF;
define symbol __ICFEDIT_region_RAM_start__ = 0x20000000;
define symbol __ICFEDIT_region_RAM_end__ = 0x20007FFF;
/*-Sizes-*/
define symbol __ICFEDIT_size_cstack__ = 0x800;
define symbol __ICFEDIT_size_heap__ = 0x2000;
/**** End of ICF editor section. ###ICF###*/
define memory mem with size = 4G;
define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
initialize by copy { readwrite };
do not initialize { section .noinit };
place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
place in ROM_region { readonly };
place in RAM_region { readwrite,
block CSTACK, block HEAP };
I just use the bl_main file in the boot_loader.
As i don't need anything to be done in boot_loader except launch application from specified location.
So i disable the UART, SSI, USB and so on.
But once i build the project, it gives error.
Linking
Error[Li005]: no definition for "ConfigureDevice" [referenced from D:\AmazonRecorder\AmazonBootLoader\ewarm\Obj\bl_startup_ewarm.o]
Error[Li005]: no definition for "Updater" [referenced from D:\AmazonRecorder\AmazonBootLoader\ewarm\Obj\bl_startup_ewarm.o]
Error while running Linker
So i have to enable below in bl_config.h
//#define UART_ENABLE_UPDATE
So it can pass compilation.
Also i disable erverything in updater function of bl_main.
But the boot_loader still can't start the application.
Can someone give me some suggestion?