crp

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

crp

874 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mcu_programmer on Thu Sep 09 08:17:19 MST 2010
I have studied the crp example in lpc11xx examples. It seems that implementation wastes 0x0300 bytes.

Is there a way to write a linker script to program position 0x02FC with a specific value without wasting code space?
0 项奖励
回复
2 回复数

865 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mcu_programmer on Thu Sep 09 13:47:44 MST 2010
Thanks.

Got it to work.
0 项奖励
回复

865 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Jesse.Rosenberg on Thu Sep 09 10:46:33 MST 2010
You can use the map file, or other tools like nm to determine which functions and constants will fit, and then manually place them in your linker script. The downside is that this strategy depends on manual configuration.

An alternative is to place small library routines and/or CMSIS routines prior to the CRP section. This may not optimally fill the space between the exception vector and the CRP location, but it is better than leaving the space unfilled.

E.g. A linker script that will include common routines might look like this    
.text :
    {
        [U]FILL(0xFF);[/U]
        KEEP(*(.isr_vector))
        [U]*(.text.Reset_Handler .text.SystemInit .text.SystemCoreClockUpdate)[/U]
        [U]. = 0x000002FC;[/U]
        [U]KEEP(*(.crp))[/U]
        *(.text*)
        *(.rodata*)

    } > MFlash32

You may also find this application note useful in terms of analyzing your program image: http://ics.nxp.com/support/documents/microcontrollers/zip/an10963.zip

I think you've probably got an idea as to how CRP works, but just in case anyone else find's this thread useful here is another recent application note: http://ics.nxp.com/support/documents/microcontrollers/pdf/an10968.pdf
0 项奖励
回复