From: SourceForge.net <no...@so...> - 2004-01-20 07:40:49
|
Bugs item #880197, was opened at 2004-01-19 16:50 Message generated for change (Comment added) made by epetrich You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=880197&group_id=599 Category: msc51(8051) target >Group: fixed >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Michael Broxton (mbroxton) >Assigned to: Erik Petrich (epetrich) Summary: Unable to write to code memory using a pointer? Initial Comment: When compiling the attached test code using the following command: /usr/local/bin/sdcc -I. --model-large -c test.c I receive the following error: test.c:32: error: FATAL Compiler Internal Error in file 'gen.c' line number '8381' : genPointerSet: illegal pointer type Contact Author with source code This error occurs whenever I attempt to write to code memory using a (unsigned char code *) pointer, as I do in line 28 of this file. (Side question -- Is this the same as a (code unsigned char *) pointer??) Is it possible to write to flash memory using sdcc? Is this a bug or an unemplemented feature? I'm developing on a Cygnal Systems 8051 core microcontroller, which has 32Kb of rewritable internal flash memory for its code space. SDCC Version info: SDCC : mcs51/gbz80/z80/avr/ds390/pic14/pic16/TININative/ xa51/ds400/hc08 2.3.6 (01/06/04) (UNIX) Thanks for your help, Michael ---------------------------------------------------------------------- >Comment By: Erik Petrich (epetrich) Date: 2004-01-20 01:40 Message: Logged In: YES user_id=635249 With src/SDCCast.c 1.213, the compiler can now catch writes via a code pointer cast. Take a look at : http://www.silabs.com/products/pdf/an129rev2_1.pdf From the application note it appears that when writes to flash are enabled, writes to xdata space are rerouted to flash instead. Because of this, you'll want to make sure all of your local variables are in the data space rather than xdata space when writes to flash are enabled. ---------------------------------------------------------------------- Comment By: Erik Petrich (epetrich) Date: 2004-01-19 17:19 Message: Logged In: YES user_id=635249 A standard 8051 has no instruction to write to code space, so the code generator is at a complete loss as to how to implement your request; thus the fatal internal error. You will need to check your microcontroller's data sheet for more information on how they implemented writes to the flash memory. The bug we need to fix is to catch this with a reasonable error message before the code generator chokes on it. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=880197&group_id=599 |