Re: [Fx2lib-devel] Linker Options
Status: Beta
Brought to you by:
mulicheng
From: Maarten B. <sou...@ds...> - 2010-01-27 23:13:14
|
Hi, See below. > --- On Wed, 1/27/10, Dennis Muhlestein <de...@ub...> wrote: > > I tried out a different firmware this last week that I hadn't used for a > > while and it took a bit to get it running. I ended up finding out that > > the usb jump table had been overwritten by the device descriptor. This > > specific firmware had a much larger device descriptor than the other > > firmware's I've created and the linker parameters needed to be > > adjusted. > > >The Makefile lets you do this fine, and that resolved my > > issue, but I'm wondering if anyone knows a way to make it > > so there is some type of warning that this is happening. > > > > Example: > > > > -Wl"-b DSCR_AREA=0x3e00" -Wl"-b INT2JT=0x3f00" > > > > Suppose the descriptor is more than 256 bytes and goes > > beyond 0x3f. Any way to produce some kind of error? > > > > The problem is more generic than that. Is there a way for the linker > to fail when two sections (which may be abs sections or not) overlap. > Setting the code/data etc sizes "--code-size" does protect against > relative code sections from overrunning the boundary, but there is no > protection for abs sections. > > > I think I remember using something like "--code-loc 0x0200 --code-size > 0x1200 --xram-loc 0x1400 --xram-size 0x0030" on the fx2. > > Then you have from 0 to 200 to use for your alignment fussy code. > .area interrupt_area(ABS) This area is overlaid (OVR) instead of concatenated (CON) by default for reasons of backward compatibility, but you may just as well give it the CON directive and the linker should warn about overlaps. Greets, Maarten |