Re: Looking for solution to place data in code segment



<torsten.bitterlich@xxxxxxxxxxxxxx> wrote in message
news:1164894517.187076.208730@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi there,

I'm programming a x86 microcontroller. It's basicly a 80186. the
application is programmed with c using a derivate from the Borland c
compiler version 5. The application is loaded by the controller from
an
serial flash via spi. The startup code for my programm then copies
preinitialised data from the code segment to a data segment. It
assumes
to have seperate memory for program code (flash, rom) and data
(memory). But in my application all is in memory. So this step is
rather unnessecary and wastes a lot of memory. Does anybody know how I
can avoid this? I think there should be serveral possibilities. I
guess
I could output the preininialised data directly to the data segment,
but i don't know how to thell this the locator tool. I also could
place
the data in code segment, but my c compiler does not allow this. So
any
help would by highly appreachiated!

Thanks in advance,

Torsten

Let the locator believe that it is running from flash but set the
address of the flash to be in RAM. Set the data area to start after
that. There should be a switch somewhere fairly obvious to prevent it
copying the code into the data area on startup.



.



Relevant Pages

  • Re: 8051: writing to memory in the program
    ... Non-volatile memory. ... (typically FLASH or EEPROM, ... Interrupts need to be disabled while programming if there are ISRs ... This problem disappears, of course, if you have both FLASH and EEPROM ...
    (comp.arch.embedded)
  • Re: Looking for solution to place data in code segment
    ... But I see no way to tell the locator, ... serial flash via spi. ... to have seperate memory for program code ... the data in code segment, but my c compiler does not allow this. ...
    (comp.arch.embedded)
  • Looking for solution to place data in code segment
    ... I'm programming a x86 microcontroller. ... to have seperate memory for program code ... the data in code segment, but my c compiler does not allow this. ...
    (comp.arch.embedded)
  • My little project.
    ... I can do the programming no problem, its the hardware I'm not sure ... I'm thinking that for an interface to the LEDs, ... to handle updating the memory with moderate math capabilities. ... and a way to easily program the flash ...
    (sci.electronics.design)
  • Re: Requesting advice how to clean up C code for validating string represents integer
    ... technical definition of a programming language) which in ordinary ... usage has a "wide variety of exact meanings in many walks of life", ... whether some random set of memory cells in a C core image, ... north-west relative to the rest of the Bay Area. ...
    (comp.lang.c)