如何将数据添加到闪存段搞砸了一个程序的时机? [英] How can adding data to a segment in flash memory screw up a program's timing?

查看:122
本文介绍了如何将数据添加到闪存段搞砸了一个程序的时机?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有嵌入式应用的大循环在10KHz运行的实时性。它运行在配置为启动从闪存TI的TMS320C。我最近增加了一个初始化数组到一个源文件,一下子定时搞砸了的(在某种程度上过于复杂,很好地解释 - 基本上是一个串行端口写不再按时完成)

I have a real-time embedded app with the major cycle running at 10KHz. It runs on a TI TMS320C configured to boot from flash. I recently added an initialized array to a source file, and all of a sudden the timing is screwed up (in a way too complex to explain well - essentially a serial port write is no longer completing on time.)

关于这个事情难不倒我:

The things about this that baffle me:


  • 我的甚至没有访问新的数据,只是声明了一个初始化数组。

  • 这是大小依赖 - 这个问题只出现如果数组> 40个字

  • 我知道我不是在链接映射四溢的任何数据段。

  • 有没有数据缓存,所以它不是由于破坏缓存一致性。

如何简单地增加闪光灯的.cinit段的大小会影响你的code的时机任何想法?

Any ideas on how simply increasing the size of the .cinit segment in flash can affect the timing of your code?

附加信息:结果
我认为也许是code移动了,但它是从数据良好分离。我通过内存映射,所有code链段之前和之后的错误有相同地址的验证。我也证实,没有任何段都充满 - 在地图上更改的唯一地址在.cinit段屈指可数。这部分包含用来初始化RAM变量(如我的数组)的数据值。它不应该永远的main()被调用后进行访问。

Additional Info:
I considered that maybe the code had moved, but it is well-separated from the data. I verified through the memory map that all the code segements have the same addresses before and after the bug. I also verified that none of the segments are full - The only addresses that change in the map are a handful in the .cinit section. That section contains data values used to initialize variables in ram (like my array). It shouldn't ever be accessed after main() is called.

推荐答案

我的怀疑将指向你的数据/ code和底层介质/内存之间的取向变化。添加到您的数据会改变内存的位置在堆(取决于内存模型),并可能把你的code跨越页面边界闪存设备上造成延迟这是以前没有的。

My suspicions would point to a change in alignment between your data/code and the underlying media/memory. Adding to your data would change the locations of memory in your heap (depending on the memory model) and might put your code across a 'page' boundary on the flash device causing latency which was not there before.

这篇关于如何将数据添加到闪存段搞砸了一个程序的时机?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆