Memory used in uIP IAR build for AT91SAM7X

baxsie wrote on Sunday, November 13, 2005:

The summary of the map file for the uIP_Demo_IAR_ARM7 shows:

21 480 bytes of CODE  memory
34 534 bytes of DATA  memory
  9 981 bytes of CONST memory

30K for code on a 256K flash part seems very reasonable. But the 34K of data for a 64K RAM part seems steep. Is there a reasonable way to reduce this requiement? How much is used by the kernal and how much is used by uIP?

Full map file here for reference:
I also built uIP_Demo_Rowley_ARM7, which seems to say 45K flash and 15K RAM, but I’m not sure I’m reading it right.

rtel wrote on Sunday, November 13, 2005:

The kernel requires RAM for the task stacks, as described in the Memory Management section of the API documentation.  The amount of RAM reserved for the kernel to use is defined by configTOTAL_HEAP_SIZE in FreeRTOSConfig.h.  This can be sized to whatever is appropriate for your application (how many tasks/queues/semaphores do you want to create?).  The default heap size is defined to provide enough heap to run all the demo tasks.  If you reduce the heap size then also remove some of the demo tasks.  Most true applications will not require so many tasks.  From the map file in your link you can see that the majority of RAM is going here.

The uIP memory usage is also configurable.  In particular the buffer it uses to receive and create IP packets can be set as low as 200 bytes (I think?), but the demo sizes this to be around 2K (again this is from memory so can be double checked).  This can be optimised for your system also.  From the map file in your link the uIP buffer is using much less RAM than the heap, but still, but total uIP RAM usage is still 3K (very small for a stack!).

Finally, again from the map file, there is 7.5K allocated to SAM7_EMAC.h.  This memory is used by the peripheral buffers - the RAM that the emac itself uses to pass data to and from the application.  The size and number of the Tx buffers is also configurable, but the Rx buffers are fixed.