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.

[参考译文] TMS320F28379D:闪存 API 和看门狗

Guru**** 2540720 points


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

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1345489/tms320f28379d-flash-api-and-watchdog

器件型号:TMS320F28379D

我修改了 FLASH_programming_dcsm_CPU 示例(见附录) ,以进行额外的 Fapi_issueProgrammingCommand ()调用,然后是 ServiceDog  (),再是另一个 Fapi_issueProgrammingCommand ()调用。

    BufAddr[0] = 0x2;
    BufAddr[1] = 0x2;
    BufAddr[2] = 0x2;
    BufAddr[3] = 0x2;
    BufAddr[4] = 0x2;
    BufAddr[5] = 0x2;
    BufAddr[6] = 0x2;
    BufAddr[7] = 0x2;

    oReturnCheck = Fapi_issueProgrammingCommand((Uint32 *)0x82000,
                                                BufAddr,
                                                8,
                                                0,
                                                0,
                                                Fapi_DataOnly);

    if(oReturnCheck != Fapi_Status_Success)
    {
        Example_Error(oReturnCheck);
    }

    /* pet the watchdog */
    ServiceDog();


    BufAddr[0] = 0x3;
    BufAddr[1] = 0x3;
    BufAddr[2] = 0x3;
    BufAddr[3] = 0x3;
    BufAddr[4] = 0x3;
    BufAddr[5] = 0x3;
    BufAddr[6] = 0x3;
    BufAddr[7] = 0x3;

    oReturnCheck = Fapi_issueProgrammingCommand((Uint32 *)0x82000,
                                                BufAddr,
                                                8,
                                                0,
                                                0,
                                                Fapi_DataOnly);

    if(oReturnCheck != Fapi_Status_Success)
    {
        Example_Error(oReturnCheck);
    }

通过单步调试器并检查内存浏览器,我可以看到第一个 Fapi_issueProgrammingCommand()(第457行)更新了内存中的指定位置。

但第2个 Fapi_issueProgrammingCommand()(第482行)也返回 Fapi_Status_Success,但存储器位置仍包含第457行的值。

在维护看门狗后、我需要进行什么 API 调用?  我尝试使用"Fapi_initializeAPI ()"重新初始化 API、但这没有帮助。

谢谢!

e2e.ti.com/.../flash_5F00_programming_5F00_dcsm_5F00_cpu01.c

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

    尊敬的 Diane:

    您可能在看门狗处理之后遗漏了 EALLOW。  请检查。

    谢谢。此致、
    瓦姆西

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

    Vamsi、

    我在 ServiceDog ()之后添加了 EALLOW,但得到了相同的结果:

        oReturnCheck = Fapi_issueProgrammingCommand((Uint32 *)0x82000,
                                                    BufAddr,
                                                    8,
                                                    0,
                                                    0,
                                                    Fapi_DataOnly);
    
        if(oReturnCheck != Fapi_Status_Success)
        {
            Example_Error(oReturnCheck);
        }
    
        /* pet the watchdog */
        ServiceDog();
        EALLOW;
    
    
        BufAddr[0] = 0x3;
        BufAddr[1] = 0x3;
        BufAddr[2] = 0x3;
        BufAddr[3] = 0x3;
        BufAddr[4] = 0x3;
        BufAddr[5] = 0x3;
        BufAddr[6] = 0x3;
        BufAddr[7] = 0x3;
    
        oReturnCheck = Fapi_issueProgrammingCommand((Uint32 *)0x82000,
                                                    BufAddr,
                                                    8,
                                                    0,
                                                    0,
                                                    Fapi_DataOnly);
    
        if(oReturnCheck != Fapi_Status_Success)
        {
            Example_Error(oReturnCheck);
        }

    谢谢!

    Diane

    e2e.ti.com/.../4214.flash_5F00_programming_5F00_dcsm_5F00_cpu01.c

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

    Diane,

    在您的代码中执行编程命令之后、我看不到下面的等待循环。  此循环确保给定命令在继续执行下一条命令之前完成。


    //等待 FSM 完成编程操作。
    //
    while (Fapi_checkFsmForReady()== Fapi_Status_Fsm 52)
    {

    谢谢。此致、
    瓦姆西

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

    Vamsi、感谢您的帮助。

    我添加了建议的 while 循环、但仍能获得相同的行为(我将手动单步执行调试器、因此我猜想它可能很慢、足以 完成程序步骤):

        BufAddr[0] = 0x2;
        BufAddr[1] = 0x2;
        BufAddr[2] = 0x2;
        BufAddr[3] = 0x2;
        BufAddr[4] = 0x2;
        BufAddr[5] = 0x2;
        BufAddr[6] = 0x2;
        BufAddr[7] = 0x2;
    
        oReturnCheck = Fapi_issueProgrammingCommand((Uint32 *)0x82000,
                                                    BufAddr,
                                                    8,
                                                    0,
                                                    0,
                                                    Fapi_DataOnly);
    
        //
        // Wait until FSM is done with erase sector operation.
        //
        while (Fapi_checkFsmForReady() != Fapi_Status_FsmReady)
        {
        }
    
        if(oReturnCheck != Fapi_Status_Success)
        {
            Example_Error(oReturnCheck);
        }
    
        /* pet the watchdog */
        ServiceDog();
        EALLOW;
    
    
        BufAddr[0] = 0x3;
        BufAddr[1] = 0x3;
        BufAddr[2] = 0x3;
        BufAddr[3] = 0x3;
        BufAddr[4] = 0x3;
        BufAddr[5] = 0x3;
        BufAddr[6] = 0x3;
        BufAddr[7] = 0x3;
    
        oReturnCheck = Fapi_issueProgrammingCommand((Uint32 *)0x82000,
                                                    BufAddr,
                                                    8,
                                                    0,
                                                    0,
                                                    Fapi_DataOnly);
    
        //
        // Wait until FSM is done with erase sector operation.
        //
        while (Fapi_checkFsmForReady() != Fapi_Status_FsmReady)
        {
        }
    
        if(oReturnCheck != Fapi_Status_Success)
        {
            Example_Error(oReturnCheck);
        }

    e2e.ti.com/.../3175.flash_5F00_programming_5F00_dcsm_5F00_cpu01.c

    谢谢!

    Diane

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

    我认为不是 引起问题的看门狗。

    如果我对同一地址执行2个连续的程序命令、第二组值将不会存储:

        BufAddr[0] = 0x2;
        BufAddr[1] = 0x2;
        BufAddr[2] = 0x2;
        BufAddr[3] = 0x2;
        BufAddr[4] = 0x2;
        BufAddr[5] = 0x2;
        BufAddr[6] = 0x2;
        BufAddr[7] = 0x2;
    
        oReturnCheck = Fapi_issueProgrammingCommand((Uint32 *)0x82000,
                                                    BufAddr,
                                                    8,
                                                    0,
                                                    0,
                                                    Fapi_DataOnly);
    
        //
        // Wait until FSM is done with erase sector operation.
        //
        while (Fapi_checkFsmForReady() != Fapi_Status_FsmReady)
        {
        }
    
        if(oReturnCheck != Fapi_Status_Success)
        {
            Example_Error(oReturnCheck);
        }
    
    //    /* pet the watchdog */
    //    ServiceDog();
    //    EALLOW;
    
    
        BufAddr[0] = 0x3;
        BufAddr[1] = 0x3;
        BufAddr[2] = 0x3;
        BufAddr[3] = 0x3;
        BufAddr[4] = 0x3;
        BufAddr[5] = 0x3;
        BufAddr[6] = 0x3;
        BufAddr[7] = 0x3;
    
        oReturnCheck = Fapi_issueProgrammingCommand((Uint32 *)0x82000,
                                                    BufAddr,
                                                    8,
                                                    0,
                                                    0,
                                                    Fapi_DataOnly);
    
        //
        // Wait until FSM is done with erase sector operation.
        //
        while (Fapi_checkFsmForReady() != Fapi_Status_FsmReady)
        {
        }
    
        if(oReturnCheck != Fapi_Status_Success)
        {
            Example_Error(oReturnCheck);
        }

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

    尊敬的 Diane:

    0x2 --> 0x3涉及位从0变为1。

    使用 PROGRAM 命令无法将0更改为1。

    您需要发出擦除命令、以便将位从0更改为1。

    谢谢。此致、

    瓦姆西

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

    Vamsi、

    我试图提供一个简单的例子来说明我正在做什么、我的写入每次都在更改地址和值。

    没错、问题是在看门狗调用后缺少 EALLOW。

    感谢你的帮助。  

    Diane