Reply by nutleycottage August 5, 20082008-08-05
Hello,
>
> Hello everyone,
>
> I've run out of SRAM in one of my project on the LPC2366 so I intend
> to use the USB and Ethernet ram. I've figured out how to modify the
> flash_placement.xml file to create the sections and I can now use
> __attribute__ ((section(".enet"))) to place a variable in ethernet
RAM.
>
> This will work just fine, but since I will need to create a lot of
> variables in these sections I'd like to see if I can do it a bit
easier.
>
> Is there a way I can create a "block" of code where everything within
> that block is put in ethernet ram? I'd like to keep my code more
> readable by not having __attribute__ ((section(".enet"))) after every
> variable. I know I can set the data and zeroed section of a file to
> .enet, but I'd prefer to have more control over what goes where.

I don't know of one - you could use a macro to hide to nastiness.

>
> Also, Crossworks reports 0 bytes free in both USB and ethernet RAM
> even when no variables are placed there. How can I correct this so
> that I can now how much of this RAM I'm actually using?

Did you try using the memory usage window or the symbols browser window?

>
> Here is what I added to the flash_placement.xml file to create the new
> sections.
>
>
> > inputsections="*(.usb .usb.*) "/>
>
>
> > inputsections="*(.enet .enet.*) "/>
>

If you want to have the data initialised then you'll need to create
load and run sections. The load section is placed in flash and the run
section is placed in RAM. You'll need to modify the crt0.s startup
file to do the copying. There is some #if'd code in crt0.s that
handles bss1 and data1 which you should be able to use as an example.
Similarly if you want the data to be zeroed then you'll need to zero
the section.

Regards
Michael

>
> Thanks for the help.
>

An Engineer's Guide to the LPC2100 Series

Reply by drproton2003 August 4, 20082008-08-04
Hello everyone,

I've run out of SRAM in one of my project on the LPC2366 so I intend
to use the USB and Ethernet ram. I've figured out how to modify the
flash_placement.xml file to create the sections and I can now use
__attribute__ ((section(".enet"))) to place a variable in ethernet RAM.

This will work just fine, but since I will need to create a lot of
variables in these sections I'd like to see if I can do it a bit easier.

Is there a way I can create a "block" of code where everything within
that block is put in ethernet ram? I'd like to keep my code more
readable by not having __attribute__ ((section(".enet"))) after every
variable. I know I can set the data and zeroed section of a file to
.enet, but I'd prefer to have more control over what goes where.

Also, Crossworks reports 0 bytes free in both USB and ethernet RAM
even when no variables are placed there. How can I correct this so
that I can now how much of this RAM I'm actually using?

Here is what I added to the flash_placement.xml file to create the new
sections.


inputsections="*(.usb .usb.*) "/>


inputsections="*(.enet .enet.*) "/>


Thanks for the help.