|
From: Muller J. <jjm...@su...> - 2005-07-04 09:20:13
|
OK, with a little further investigation I noticed the following:
My firmware can grow up to 19844 bytes. If I add a simple instruction,
e.g LED1=3DON, the Cypress EZ-USB FX fails to enumerate, although it =
seems
that the main() firmware loop is functioning.=20
I checked the .map and .mem files. I am not linking to any of the
reserved memory spaces. The only difference between the two cases is
that the code segment grew by 2 bytes, as expected.
The enumeration error is probably caused by the USB interrupts not
occuring. I noticed that during the firmware download process, another
two bytes (of value 0x22) is written to internal RAM at address 0x0.
This overwrites my assembly interrupt vector table that I link to
address 0x0. I placed this interrupt table here, because SDCC relocates
its own generated vector table to the start of the code segment (my code
segment starts at 0x2000). If I manually edit the hex record file to
remove this last record, everything works fine again. Now the big
question is why SDCC does this? A bug? Any ideas?=20
Last record in the c code of the hex file:
2,
0x0,
0,
{0x22,0x22}=20
-----Original Message-----
From: sdc...@li...
[mailto:sdc...@li...] On Behalf Of Ernst
Bachmann
Sent: 01 July 2005 03:49 PM
To: sdc...@li...
Subject: Re: [Sdcc-user] code fails if it reaches certain size?
Hi,
On Friday 01 July 2005 15:31, Muller Jaco <jjm...@su...> wrote:
> My firmware code is growing, and is working fine until its size=20
> reaches about 19000 bytes. The code is running on an EZ-USB FX
microcontroller.
> As soon as the size reaches this limit, the device cannot be=20
> enumerated (firmware not working..) Below this limit, the firmware can
> be relocated anyware in external RAM without any problems. I am=20
> avoiding the memory areas of the EZ-USB used for buffer registers.
>
> The firmare size will grow beyond 19000 bytes, as I still need to=20
> implement more functions. I am completely baffled and don't even know=20
> where to start tracing the bug - does anyone have any idea where the=20
> problem could be? As far as I know, there is no code size limit in
SDCC.
My guess would be that your code somewhere overlaps with the endpoint
buffers, making renumeration fail cause the buffers are filled with your
code.
But since those Buffers start at 0x7B40, there should be enough space
below for your code.
The EZUSB Chips also remap those buffers into a second memory area, but
IIRC those would be at arround 0x2... so I guess you deactivated that
already
Maybe check the memory map as generated by the linker for overlap with
some of the usb buffers?
Luckily my project's firmware still fits in an AN2131SC without
additional external ram, so I never looked closely at availabe memory
areas.
Greetings
/Ernst
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. =
http://ads.osdn.com/?ad_id=3D7477&alloc_id=3D16492&op=3Dclick
_______________________________________________
Sdcc-user mailing list
Sdc...@li...
https://lists.sourceforge.net/lists/listinfo/sdcc-user
|