How to increase ROM size for sky mote in Contiki-OS, cooja simulation?

此生再无相见时 提交于 2019-12-19 04:24:15

问题


I want to use sky mote in my Cooja simulation so that I can access the full functionality of the collect-view tool such as power readings.

However I have had to port extra libraries for my project so the size of the program far exceeds the memory provided by the sky-mote.

Cooja-mote can support the program size as it uses native system but it won't provide me with power readings in collect-view.

How can I increase the ROM & RAM size of sky-mote for Cooja simulation without loosing power measuring capabilities. Any help would be greatly appreciated.


回答1:


This answer may be somewhat late, but I still hope it can help anybody digging here.

If you are using msp430-gcc and contiki-ng project (may be similar to the old version contiki, I'm not sure), the MCU model is defined at the line 20 of contiki-ng/arch/platform/sky/Makefile.common by setting MCU=msp430f1611. And the link script of the model can be found at msp430/lib/ldscripts/msp430f1611/memory.x of msp430mcu package you installed.

So you will see the memory map of the model in the file, and the rom region starts at 0x4000 and ends at 0xffe0, which is ~40KiB long.

You can simply change the MCU model in Makefile.common to msp430f169 to get a ~60KiB ROM, howerver the RAM shrinks to 2KiB. Or you can change the memory map to whatever you like.

Unfortunately, since msp430 is a 16-bit MCU, you will never get a memory address more than 64KiB with the internal memory, i.e. the total capacity of ROM and RAM can never exceeds 64KiB even if without interupt vectors and peripherals.

Besides, you also need to modify code in mspsim to make cooja to fit the new memory layout as Johan Bregell says. Things you are probably most interested with are in tools/cooja/mspsim/se/sics/mspsim/config, which sets address, and cooja/mspsim/se/sics/mspsim/platform/sky/CC2420Node.java, which sets the chip model of CC2420.




回答2:


The simplest option is to use another mote instead of sky (48 kb ROM). Contiki supports few more msp430 architecture motes, such as Zolertia Z1 (96 kb ROM) and Wismote (up to 256 kb ROM).




回答3:


The definitions of the MCU the Sky mote is running on is in the folder contiki/tools/mpsim/se/sics/mpsim/ from here you should be able to modify the amount of memory avalible to the MCU if you know your way around Java.



来源:https://stackoverflow.com/questions/29107134/how-to-increase-rom-size-for-sky-mote-in-contiki-os-cooja-simulation

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!