From: Muller J. <jjm...@su...> - 2004-09-21 06:22:34
|
Hi =20 I have a very small test program for a EZ-USB FX that switches a LED on. If I compile the code using "sdcc --code-loc 0x0000 firmware.c", everything works fine. I would like to run the code segment from external memory, eg. "sdcc --code-loc 0x4000 firmware.c", but this doesn't work. It only works when the code starts at 0x000. =20 If I look at the .map and .mem files, everything looks like I expected it to be (the code segment starts at 0x4000 instead of 0x0000). Is there something else that I need to look at? =20 Thanks =20 =20 =20 |
From: Alex F. <al...@dn...> - 2004-09-21 18:10:09
|
Hello Muller, I didn't think the EZ-USB had memory up in that area. Are you using ext= ernal=20 memory? Check the memory map of the chip. I thought the internal code/da= ta=20 memory only went up to 0x13BF. regards, Alex --=20 Alex Faveluke --...@dn... Systems Design Engineer Dynalink 503.682.9008 On Monday 20 September 2004 23:22, "Muller Jaco wrote: > Hi > > I have a very small test program for a EZ-USB FX that switches a LED on= =2E > If I compile the code using "sdcc --code-loc 0x0000 firmware.c", > everything works fine. I would like to run the code segment from > external memory, eg. "sdcc --code-loc 0x4000 firmware.c", but this > doesn't work. It only works when the code starts at 0x000. > > If I look at the .map and .mem files, everything looks like I expected > it to be (the code segment starts at 0x4000 instead of 0x0000). Is ther= e > something else that I need to look at? > > Thanks |
From: Erik P. <epe...@iv...> - 2004-09-21 20:48:10
|
On Tue, 21 Sep 2004, Muller Jaco <jjm...@su...> wrote: > I have a very small test program for a EZ-USB FX that switches a LED on. > If I compile the code using "sdcc --code-loc 0x0000 firmware.c", > everything works fine. I would like to run the code segment from > external memory, eg. "sdcc --code-loc 0x4000 firmware.c", but this > doesn't work. It only works when the code starts at 0x000. > > If I look at the .map and .mem files, everything looks like I expected > it to be (the code segment starts at 0x4000 instead of 0x0000). Is there > something else that I need to look at? You can put the code at a different location, but the processor will still start execution at 0x0000. To solve this in the project I worked on, I took advantage of the EZ-USB FX's I2C EEPROM feature. Besides loading configuration data from the EEPROM, the FX can also automatically load a program from the EEPROM into the code RAM. Instead of loading my entire program from the EEPROM, I used it to load the 3 bytes needed for an ljmp instruction that would jump to the starting address of my external flash chip. Alternatively, you can tie the EA pin high and decode your external code memory chip at location 0x0000. The disadvantage is that the built-in 8K of RAM is no longer available for code (it becomes xdata only); this may or may not be a problem depending on your application. Erik |