Reduzing Memory consumption: Smaller Vector Tables

I want to reduce the memory consumption to NuttX in the stm32f103-minimum board to get external SPI NOR Flash with SmartFS and USB Serial Console at same time.

After mount the SmartFS partition I will have only 808 bytes of RAM:

nsh> free
 total used free largest
Mem: 17536 15352 2184 2184
nsh> mksmartfs /dev/smart0p1
nsh> free
 total used free largest
Mem: 17536 15352 2184 2184
nsh> mount -t smartfs /dev/smart0p1 /mnt
nsh> free
 total used free largest
Mem: 17536 16728 808 808
nsh>

Analyzing which features are consumpting more RAM I notice the interruption vector table is the using more than 600 bytes:

$ arm-none-eabi-nm --print-size --size-sort --radix dec -C nuttx | grep ' [DdBb] ' | tail -20
536873088 00000008 B g_sigpendingirqaction
536873096 00000008 B g_sigpendingirqsignal
536873104 00000008 B g_sigpendingsignal
536872252 00000008 B g_waitingforsemaphore
536872280 00000008 B g_waitingforsignal
536873124 00000008 B g_wdactivelist
536873112 00000008 B g_wdfreelist
536872436 00000016 B g_hpwork
536873296 00000028 B g_spawn_parms
536871024 00000028 d g_spi1dev
536871860 00000028 b g_syslog_dev
536870912 00000092 d g_usart1priv
536871764 00000096 b g_wdpool
536872288 00000128 B g_pidhash
536873132 00000164 B g_mmheap
536871564 00000188 b g_idletcb
536871308 00000256 b g_usart1rxbuffer
536871052 00000256 b g_usart1txbuffer
536871888 00000328 b g_usbdev
536872452 00000608 B g_irqvector

Fortunately there is an option to reduce it:

http://www.nuttx.org/doku.php?id=wiki:howtos:smallvectors

Keep tuned!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s