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.

[参考译文] TMS320F280041:写入闪存时发生故障

Guru**** 2526980 points


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

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1174298/tms320f280041-failure-occurred-when-i-wrote-into-flash

器件型号:TMS320F280041

大家好、

问题1.  当  我将8个字写入 地址0x8443c 时、出现异常。

         u32FlashAddr = APP_TESTADDR;//地址:0x8443c
         oReturnCheck = fapi_issueProgrammingCommand (((uint32 *) u32FlashAddr、u16FlasshDat、8、0、0、Fapi_AutoEccGeneration); // 写入8个字时出现异常。

当我写入闪存时、返回了"Fapi_Error_AppincorrectDataBufferLength "。

但当我在同一地址中写入4个字时、一切都进展顺利。        

        oReturnCheck = fapi_issueProgrammingCommand (((uint32 *) u32FlashAddr、u16FlasshDat、4、0、0、Fapi_AutoEccGeneration);//当4个字写入同一地址时一切正常。

当我在另一个地址中写入8个字时、一切都很好。 为什么?

        u32FlashAddr = APP_TESTADDR;//地址:0x84438
        oReturnCheck = fapi_issueProgrammingCommand (((uint32 *) u32FlashAddr、u16FlasshDat、8、0、0、Fapi_AutoEccGeneration); //当8个字写入另一个地址时,一切运行良好。

问题2: 当地址0x85008~0x8DFFF 之间写入多个字时、所有字 都可以写入 这些地址、一切都很顺利。

          oReturnCheck = fapi_issueProgrammingCommand (((uint32 *) u32FlashAddr、u16FlasshDat、4、0、0、Fapi_AutoEccGeneration);
          while (fapi_checkFsmForReady ()= fapi_Status_FsmBusy);  //写入没有任何问题。

最后一个字 应该写入0x85000、但我发现它没有写入该地址、但返回的状态位是正确的。 为什么不将其写入该地址? 代码如下:


          u32FlashAddr = APP_TESTADDR;//0x85000
          oReturnCheck = fapi_issueProgrammingCommand (((uint32 *) u32FlashAddr、u16FlasshDat、1、0、0、Fapi_AutoEccGeneration);
          while (fapi_checkFsmForReady ()= fapi_Status_FsmBusy);//未将其写入地址。

当参数"Fapi_AutoEccGeneration" 被"Fapi_DataOnly"替换时、它可以成功写入地址、但当我读取闪存数据时发生异常中断。 代码如下所示。

        u16Value =(*(uint16 *)(app_check_ADDR));

为什么会发生这种情况? 请为我提供解决方案吗?

此致、

凯瑟琳