contiki-os / contiki

The official git repository for Contiki, the open source OS for the Internet of Things
http://www.contiki-os.org/
Other
3.71k stars 2.58k forks source link

msp430-gcc upgrade #2304

Open junyang28 opened 7 years ago

junyang28 commented 7 years ago

I can't compile the tsch-rpl for sky mote because of the limited ROM/RAM in this device. Can someone tell me how to upgrade msp430-gcc from 4.6.3 to 4.7.2 and solve the compilation problem?

alexrayne commented 7 years ago

not eoung ROM cant be solved by gcc upgrade. ive build tsch-rpl minimalistic fro cc1310 - it acupies abut 50k ROM, and 12k RAM. for 16bit cc430, it goes about half sizes - 25k ROM and 6k RAM.

so looks that you have not enough RAM. this can be reduced by:

1) turning PT-threads scheduler events buffer with less size,

2) set less TSCH buffers, and queues sizes.

look PR #2278 for a few more turnings on TSCH:

alexrayne commented 7 years ago

also current TSCH requires framer 802154. it eats more space too. migrating to native rime chamelion frames - also can help reduce RAM usage. but it need a lot of work.

junyang28 commented 7 years ago

Thank you so much. I'll try to tune the code in order to accommodate the size of ROM/RAM in sky mote.

alexrayne commented 7 years ago

you`re have to strong redesign tsch memory usage; 1) turnoff tsch log - it ocupy 512bytes by default 2) tsch links pool - maybe it better to turn size for exact limits you need, or maybe better replace it by static allocated links 3) tsch queues - takes about 1-2k for, my platform. imho, not a problem to reduce it twice. 4) MEMB pool is not eficient storage - it use array of free flags, instead use bitmask. waste of memory not very much, but sufficient for your 4kB

knaggita commented 7 years ago

These are some of the ways I found for tuning the code in order to accommodate the size of ROM/RAM in sky mote. https://naggitakeziah.wordpress.com/2017/08/07/memory-optimization-in-z1-and-sky-motes/