Content originally posted in LPCWare by CodeRedSupport on Thu Jul 22 07:26:47 MST 2010
Quote: curtvm
The problem is the linker incorrectly using BLX, and until the linker is corrected a workaround is needed. I guess it also can be said objdump is happy decoding that incorrect BLX instruction when producing the lss file.
The issue your refer to is actually a Cortex-M0 specific issue, so only affects LPC11xx, not LPC13xx or LPC17xx.
Quote: curtvm
To CodeRedSupport-
any idea when the linker will be corrected? also will you be able to get the debugging to work for functions that run from ram?
(I am using 3.3.4, and I see 3.4.0 is available, so maybe its fixed already)
It is very likely that later this year we will release a version of the LPCXpresso IDE that encorporates a more recent version of gcc than the current 4.3.3. Such a release will also include a linker with the CM0 BLX issue fixed. I cannot commit to a firm data for this though - so please don't ask!
With regards to debugging functions from RAM, I am afraid that at present I'm not actually 100% sure what is causing the behaviour that is been seen. The best workarounds I can see at present are:
[LIST=1]
[*]Instruction step into the RAM function (ie through the long branch veneer). Once you have reached the RAM function, you appear to be able to debug "as normal".
[*]If you want to set a breakpoint on the RAM function, set it on the long branch veneer, rather than the function itself. If your ram function is called ram_func(), then the veneer will be '__ram_func_veneer'. Use the breakpoint view to set a breakpoint on this, either by using the symbol name, or by looking in the mapfile/disassembly file to find the address. Once you then hit the breakpoint in the veneer, you appear to be able to source step into the ram function without problem
[*]If possible, use function pointers to jump to the RAM function rather than relying upon the the linker's long branch veneer. Then you don't see any problem debugging the RAM function - as far as I can tell :)
[/LIST]
Regards,
CodeRedSupport