在线时间0 小时
UID1356339
注册时间2008-6-4
NXP金币0
该用户从未签到
新手上路

- 积分
- 1
- 最后登录
- 1970-1-1
|
现在只在用FRDM-KL25Z开发板学习HIDBootloader功能.
用的是freescale的参考例程AN4764SW_Freescale_HID_Bootloader_r10
不过,对于ICF文件,还有一些细节没有搞明白.
下面红色字体部分,这些section是定义在其它文件中的吗? 具体是什么意思?
我都找不到这些section在哪里定义的.
另外这个bootloader是怎么实现跳转到用户代码区域的,
我看到启动代码,都是跳到main()去,那就跳到bootloader的main()去啊.怎么跳到用户代码去的?
*********************************************************
void start(void)
{
/* Disable the watchdog timer */
// SIM_COPC = 0x00;
FTFA_FPROT3 = 0xFE;
/* Copy any vector or data sections that need to be in RAM */
common_startup();
/* Perform clock initialization, default UART initialization,
* initializes clock out function, and enables the abort button
*/
// sysinit();
/* Jump to main process */
main();
}
********************************************************************
/*###ICF### Section handled by ICF editor, don't touch! ****/
/*-Editor annotation file-*/
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
/*-Memory Regions-*/
define symbol __ICFEDIT_region_ROM1_start__ = 0xC0;
define symbol __ICFEDIT_region_ROM1_end__ = 0x400;
define symbol __ICFEDIT_region_ROM2_start__ = 0x410;
define symbol __ICFEDIT_region_ROM2_end__ = (128*1024);//********
define symbol __ICFEDIT_region_RAM_end__ = 0x20000000;
define symbol __ICFEDIT_region_RAM_start__ = __ICFEDIT_region_RAM_end__ - (16*1024)/4 + 0x410;//********
/*-Specials-*/
define symbol __ICFEDIT_intvec_start__ = 0;
define symbol __ICFEDIT_cfm_start__ = 0x400;
/*-Sizes-*/
define symbol __ICFEDIT_size_cstack__ = (1*1024);//********
define symbol __ICFEDIT_size_heap__ = (2*1024);//********
/**** End of ICF editor section. ###ICF###*/
define symbol __region_RAM2_start__ = 0x20000000;
define symbol __region_RAM2_end__ = __region_RAM2_start__ + ((16*1024)*3)/4;//********
define exported symbol __VECTOR_TABLE = 0x00000000;
define exported symbol __VECTOR_RAM = __ICFEDIT_region_RAM_start__ - 0x410;
define exported symbol __BOOT_STACK_ADDRESS = __region_RAM2_end__ - 8;
//DAS define symbol __code_start__ = 0x00000410;//********
define symbol __code_start__ = 0x000000C0;//********
define memory mem with size = 4G;
define region ROM_region = mem:[from __ICFEDIT_region_ROM1_start__ to __ICFEDIT_region_ROM1_end__] | mem:[from __ICFEDIT_region_ROM2_start__ to __ICFEDIT_region_ROM2_end__];// | mem:[from __region_FlexNVM_start__ to __region_FlexNVM_end__];//********
define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__] | mem:[from __region_RAM2_start__ to __region_RAM2_end__];
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
initialize manually { readwrite };
initialize manually { section .data};
initialize manually { section .textrw };
do not initialize { section .noinit };
define block CodeRelocate { section .textrw_init };
define block CodeRelocateRam { section .textrw };
place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
place at address mem:__ICFEDIT_cfm_start__ { readonly section .cfm };
place at address mem:__code_start__ { readonly section .noinit, block CodeRelocate, readonly object FlashProgramCheck.o, readonly object FlashProgramLongword.o, readonly object USB_ICP.o, readonly object USB_HID.o, readonly object Flash_InitD.o};
place in ROM_region { readonly};
place in RAM_region { readwrite, block CodeRelocateRam,
block CSTACK, block HEAP };
|
|