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.

[参考译文] TMS320F28062:闪存编程示例中的错误

Guru**** 2390730 points
Other Parts Discussed in Thread: C2000WARE
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1407047/tms320f28062-bug-in-the-flash-programming-example

器件型号:TMS320F28062
Thread 中讨论的其他器件:C2000WARE

工具与软件:

您好!

我发现闪存编程示例有一个错误。

在以下源文件中:C:\ti\c2000\C2000Ware_5_02_00_00\device_support\f2806x\examples\c28\flash_programming\c806x_api.c Example_Flash  

有:

#define  WORDS_IN_FLASH_BUFFER 0x100       // Programming data buffer, Words
Uint16  Buffer[WORDS_IN_FLASH_BUFFER];
[...]

Flash_ptr = Sector[1].StartAddr;
Length = 0x400; //<------    HERE IS THE BUG !!!
Status = Flash_Program(Flash_ptr,Buffer,Length,&FlashStatus);
if(Status != STATUS_SUCCESS) 
{
    Example_Error(Status);
}

Status = Flash_Verify(Flash_ptr,Buffer,Length,&FlashStatus);
if(Status != STATUS_SUCCESS) 
{
    Example_Error(Status);
}            

缓冲区大小为0x100个字、并且已在引用的代码部分之前正确初始化。
遗憾的是、编程大小(如果为0x400)会增加缓冲区的大小、并将一些意外内容编程到闪存中。

在该验证意外失败后、由于 缓冲器后面存储器的内容发生更改。  

从静态分析点来看、这是对未定义存储器的使用。

如何解决此问题:

   将值从0x400更改为符号 WORD_IN_FLASH_BUFFER

此致、

Piotr Romaniuk

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Piotr:

    感谢您发现此问题并提供解决方案。 将跟踪此问题、并针对未来的版本相应地更新示例。

    此致!

    Charles