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.

[参考译文] TMS320F28035:在闪存中加载闪存编程示例

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

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1498270/tms320f28035-load-the-flash-programming-example-in-flash

器件型号:TMS320F28035

工具/软件:

您好 Champ、

我尝试 在闪存中加载闪存编程示例(RAM.2803x_API)、以便该示例可以从闪存运行、然后在运行时在 Example_Flash 中执行闪存操作。

但是、将 闪存链接器 cmd 文件(F28035.cmd)添加到工程中并将 memcpy 和 InitFlash ()包含在 main 中、代码似乎无法在闪存中正常运行。

此外、 该 pragma 最初附带了#pragma CODE_SECTION (Example_Call FlashAPI"、"ramfuncs");

我是否错过了任何配置、以便在开始时将示例载入闪存?

此致、

Johnny

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

    您好 Champ、

    有没有机会在这里输入一些信息?

    此致、

    Johnny

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

    您好 Champ、

    对此有何评论?

    期待您的支持。

    此致、

    Johnny

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

    Johnny

    本机示例应包含正确的.cmd 文件:Example_Flash 28035_ROM_API.cmd。  此文件中的关键加上与"常规"命令相比、添加了"ramfunc"段、如下所示:

     ramfuncs            : LOAD = FLASHA, 
                             RUN = PRAML0, 
                             LOAD_START(_RamfuncsLoadStart),
                             LOAD_END(_RamfuncsLoadEnd),
                             RUN_START(_RamfuncsRunStart),
                             PAGE = 0

    在 main.c 文件"RAM.2803x_API.c"中增加了两个与仅 Example_Flash 代码相比的附加代码、即 RAM.Copy 函数调用(将代码从闪存复制到 Example_Mem)和#pragma CODE_SECTION ()、它们被插入在我们要从 RAM 运行的函数之前。

    void Example_MemCopy(Uint16 *SourceAddr, Uint16* SourceEndAddr, Uint16* DestAddr)
    {
        while(SourceAddr < SourceEndAddr)
        { 
           *DestAddr++ = *SourceAddr++;
        }
        return;
    }
    
    #pragma CODE_SECTION(Example_Error,"ramfuncs");
    void Example_Error(Uint16 Status)
    {
    
    //  Error code will be in the AL register. 
        asm("    ESTOP0");
        asm("    SB 0, UNC");
    }
    etc

    此致、

    Matthew