简体   繁体   English

Msp430 上的 RAM 内存不足

[英]Out of RAM Memory on Msp430

I ran out of RAM on my MSP430 because I am getting this message;我的 MSP430 上的 RAM 用完了,因为我收到了这条消息;

Error[e16]: Segment DATA16_Z (size: 0x638 align: 0x1) is too long for segment definition. At least 0x44 more bytes needed. The problem occurred while  
processing the segment placement command "-Z(DATA)DATA16_I,DATA16_Z,DATA16_N=0200-_SYS_RAM_END", where at the moment of placement  
the available memory ranges were "CODE:20b-7ff" 
   Reserved ranges relevant to this placement: 
   200-7ff              DATA16_I 
Error while running Linker 

So I found that the problem is due to these static variables within one of my functions;所以我发现问题出在我的一个函数中的这些静态变量;

  static float circularBufferTemp[CIRC_BUFF_WIDTH_SCH3] = {0};
  static float circularBufferHumi[CIRC_BUFF_WIDTH_SCH3] = {0};
  static UCHAR indexMeasTemp = 0;
  static UCHAR indexMeasHumi = 0;

Now the question is;现在的问题是; How can I avoid this problem considering that I have to save those variables inside that function every time it is called by my application code?考虑到每次应用程序代码调用该函数时我都必须将这些变量保存在该函数中,我该如何避免这个问题?

You may consider:你可以考虑:

  • Compress your data.压缩您的数据。 As your data are sensor data you might consider, for instance, to save deltas instead of full values.由于您的数据是传感器数据,因此您可能会考虑保存增量而不是完整值。
  • Reduce buffer and increase frequence of data processing.减少缓冲区并增加数据处理的频率。
  • Depending of your application you can consider to use flash and/or fram.根据您的应用程序,您可以考虑使用闪存和/或帧。 Erasing is slow but writing is not that slow.擦除速度很慢,但写入速度没有那么慢。 Erase operation usually can be carried on asynchronously.擦除操作通常可以异步进行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM