I had a problem when I moved to a Cygwin hosted GNU build (using a
Phycore 2294).
The hex files downloaded correctly but did not appear to run on the
target. Strangely, the problem was being caused by the order in
which the startup code was structured.
If my startup code was as follows, the file jumped into
the "undefined" vector loop:
<--BEGIN CODE-->
Vectors:
b _start // reset - _start
ldr pc,_undf // undefined - _undf
ldr pc,_swi // SWI - _swi
ldr pc,_pabt // program abort - _pabt
ldr pc,_dabt // data abort - _dabt
nop // reserved
ldr pc,[pc,#-0xFF0] // IRQ - read the VIC
ldr pc,_fiq // FIQ - _fiq
_undf: .word __undf // undefined
_swi: .word __swi // SWI
_pabt: .word __pabt // program abort
_dabt: .word __dabt // data abort
_irq: .word __irq // IRQ
_fiq: .word __fiq // FIQ
__undf: b . // undefined
__swi: b . // SWI
__pabt: b . // program abort
__dabt: b . // data abort
__irq: b . // IRQ
__fiq: b . // FIQ
_start:
// Startup code here
<--END CODE-->
But if I moved the exception loops to below the start code (shown
below), then everything seemed to work fine.
<--BEGIN CODE-->
Vectors:
b _start // reset - _start
ldr pc,_undf // undefined - _undf
ldr pc,_swi // SWI - _swi
ldr pc,_pabt // program abort - _pabt
ldr pc,_dabt // data abort - _dabt
nop // reserved
ldr pc,[pc,#-0xFF0] // IRQ - read the VIC
ldr pc,_fiq // FIQ - _fiq
_undf: .word __undf // undefined
_swi: .word __swi // SWI
_pabt: .word __pabt // program abort
_dabt: .word __dabt // data abort
_irq: .word __irq // IRQ
_fiq: .word __fiq // FIQ
_start:
// Startup code here
__undf: b . // undefined
__swi: b . // SWI
__pabt: b . // program abort
__dabt: b . // data abort
__irq: b . // IRQ
__fiq: b . // FIQ
<--END CODE-->
I have no explanation for this but it worked for me (after a couple
of days of head-scratching). If anyone can explain why this is the
case I would love to know!?!?
Hope this helps,
David
--- In lpc2000@yahoogroups.com, "Richard Rauscher" <richard@m...>
wrote:
> I've moved from the Keil uVision3 to a linux hosted GNU build
using the
> exact same linker script. Here are the two pertinent targets from
the
> Makefile, one for linking and one for creating the hex file (which
I then
> download from my windows system with Philip's LPC210x_ISP utility).
>
>
> FW.elf : $(SOBJS) $(COBJS)
> $(LD) -o FW.elf $(SOBJS) $(COBJS) $(LIBPATH) -
lc -lgcc -T Target.ld
>
> FW.hex : FW.elf
> arm-elf-objcopy -O ihex FW.elf FW.hex
>
> hth,
>
> --rich
>
> ________________________________
>
> From: Charles Manning [mailto:manningc2@a...]
> Sent: Sat 10/23/2004 9:18 PM
> To: lpc2000@yahoogroups.com; peterburdine
> Subject: Re: [lpc2000] Programming GNU hex files
>
>
> On Saturday 23 October 2004 03:42, peterburdine wrote:
> > I seem to be having problems trying to program my Phycore LPC2994
> > module when I use the GNU toolset. I have tried using both JTAG
and
> > the Philips utility, and neither of them will successfully
program the
> > chip. It will instead have the the previous program. If I used
the
> > Keil toolset I do not have this problem. Does anyone have any
> > suggestions? I am using uVision 3.
> >
> > Thanks,
> > Peter
>
> This is most likely something to do with either your start up file
or your
> ldscript.
>
> Have a look at the two map files and see how they differ, that
should give
> some clues.
>
> -- CHarles
>
>
> Yahoo! Groups Sponsor
> ADVERTISEMENT
> click here
<http://us.ard.yahoo.com/SIG=129ko57bh/M=295196.4901138.6071305.30011
76/D=groups/S=1706554205:HM/EXP=1098677698/A=2128215/R=0/SIG=10se96mf
6/*http://companion.yahoo.com>
>
>
> ________________________________
>
> Yahoo! Groups Links
>
>
> * To visit your group on the web, go to:
> http://groups.yahoo.com/group/lpc2000/
>
> * To unsubscribe from this group, send an email to:
> lpc2000-unsubscribe@yahoogroups.com <mailto:lpc2000-
unsubscribe@yahoogroups.com?subject=Unsubscribe>
>
> * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service <http://docs.yahoo.com/info/terms/> .
>
>
>
>
> [Non-text portions of this message have been removed]Message
Re: Programming GNU hex files
2004-10-25 by dpbevin2k
Attachments
- No local attachments were found for this message.