This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
工具/软件:Code Composer Studio
您好!
我有以下定义的数组。 我使用的是 TM4C123器件。 我的 CCS 版本为 8.3.0.00009。 我的编译器版本为"TI v18.1.0.LTS [TI v18.1.4LTS]。 输出格式为 eabi (ELF)、小端字节序。
volatile uint16_t buff1[256] volatile uint16_t buff1[256]
我通过 ADC ISR 将值存储在其中。 这将获取一个样本并将其粘在 buff1中并将其递增。 我在每次中断时执行此操作、直到 buff1满、然后我开始填充 buff2并来回交替。 我的主循环等待缓冲区已满、并启动 DMA 通道以将其从 SPI 端口中写入。
我已将 CCS Build -> Arm Compiler -> Optimization 下项目属性中的优化提升到3级。 优化级别为0 -寄存器优化、速度与尺寸之间的折衷设置为3、浮点模式设置为严格。
现在、当我查看较大的数据集时、我看到在使用3级进行速度与尺寸折衷设置时出现了许多错误。 当我执行读取缓冲区的 if 语句时、这些错误似乎消失了。 当我将"速度优化与尺寸"返回到1时、我还会看到这些误差消失。
由于编译器优化设置、这些数组看起来会受到一些影响。 这是否可能实现、我将如何找出到底发生了什么?
虽然我不确定、但我猜其他变量也需要标记为易失性。 有关 易失性的这篇文章可能会有所帮助。 ISR 修改的任何内容都需要标记为"volatil"。
谢谢、此致、
乔治