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.

[参考译文] CCS/TMS320F2.8377万S:使用DSS擦除选定的闪存扇区

Guru**** 2484615 points
Other Parts Discussed in Thread: CCSTUDIO

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

https://e2e.ti.com/support/tools/code-composer-studio-group/ccs/f/code-composer-studio-forum/617509/ccs-tms320f28377s-erase-selected-sectors-of-flash-using-dss

部件号:TMS320F2.8377万S
主题中讨论的其他部件: CCStudio

工具/软件:Code Composer Studio

下面是我目前为止的脚本快照:

debugSession = debugServer.openSession("*","*";
debugSession.flash.options.setString("FlashEraseSelection","仅限选定部门");
debugSession.flash.options.setNumeric("FlashSPLLIMULT",19);
debugSession.flash.options.setString("FlashSPLLFMULT","0 [0]");
debugSession.flash.options.setString("FlashSYSDIVSEL","0 [/1]");

.....

debugSession.flash.erase();

我在API文档中注意到以下注意事项

“ 使用mySession.flash.options.printOptions() API查找您的设备的确切字符串”,我不太确定如何使用此函数。  

如何指定要擦除的扇区?  

谢谢

Rashmy

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

    您好,Rashmy,

    Rashmy Parimi 说:
    ” 使用mySession.flash.options.printOptions() API"查找您的设备的确切字符串,我不太确定如何使用此函数。  [/引述]

    只需将呼叫添加到脚本中。 这将打印设备的所有可用选项及其相关字符串。

    debugSession.flash.options.printOptions(".*");

    我附上了我的输出。

    /cfs/file/__key/communityserver-discussions-组件文件/81/flash_5F00_options_5F00_f2.8377万.txt

    如何指定要擦除的扇区?  [/引述]

    如果查看printOptions输出,可以看到:

    单选按钮选项:
       ID:FlashEraseSelection
       名称:TMS320C28XX.Flash设置.Erase设置。
       值:整个闪存
       选择:
           整个闪存
           仅必要扇区(用于程序加载)
           仅限选定的扇区
    布尔选项:
       ID:FlashC28Bank0Sector0
       名称:TMS320C28XX.Flash设置.Erase设置.Sector A (0x8万 - 0x81FFF)
       值:TRUE
    布尔选项:
       ID:FlashC28Bank0Sector1.
       名称:TMS320C28XX.Flash Settings.Erase Settings.Sector B (0x8.2万 - 0x83FFF)
       值:TRUE
    布尔选项:
       ID:FlashC28Bank0Sector2.
       名称:TMS320C28XX.Flash Settings.Erase Settings.Sector C (0x8.4万 - 0x85FFF)
       值:TRUE

    ....

    因此,仅擦除前两个扇区的示例如下所示:

    仅限session.flash.options.setString("FlashEraseSelection","Selected扇区");

    session.flash.options.setBoolean("FlashC28Bank0Sector0",true);
    session.flash.options.setBoolean("FlashC28Bank0Sector1",true);
    session.flash.options.setBoolean("FlashC28Bank0Sector2",false);
    session.flash.options.setBoolean("FlashC28Bank0Sector3",false);
    session.flash.options.setBoolean("FlashC28Bank0Sector4",false);
    session.flash.options.setBoolean("FlashC28Bank0Sector5",false);
    session.flash.options.setBoolean("FlashC28Bank0Sector6",false);
    session.flash.options.setBoolean("FlashC28Bank0Sector7",false);
    session.flash.options.setBoolean("FlashC28Bank0Sector8",false);
    session.flash.options.setBoolean("FlashC28Bank0Sector9",false);
    session.flash.options.setBoolean("FlashC28Bank0Sector10",false);
    session.flash.options.setBoolean("FlashC28Bank0Sector11",false);
    session.flash.options.setBoolean("FlashC28Bank0Sector12",false);
    session.flash.options.setBoolean("FlashC28Bank0Sector13",false);

    session.flash.erase();

    谢谢

    KI

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

    感谢您的回复,KI。 但是我收到此错误" Target is not connected or does not support current Flash operation (目标未连接或不支持当前闪存操作)"。 ",表示session.flash.erase()行。 API是否不支持 TMS320F2.8377万S的擦除?

    谢谢

    Rashmy

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    它应该起作用。 我用我的F2.8377万S LaunchPad试用了它。 您的目标是否确实已连接? 我可以看到您的脚本的其余部分吗?

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

    我的目标已连接,我尝试从目标配置文件测试连接,结果成功。 我能够使用CCS IDE进行闪存。 但是我的脚本不能按预期工作。 下面是我的脚本的其余部分。

    //导入DSS软件包  
    ImportPackage(Packages.com.ti.debug.engine.scripting)
    ImportPackage(Packages.com.ti.ccstudio.scripting.environment)
    ImportPackage(Packages.java.lang)

    //可配置参数
    VAR deviceCCXMLFile ="../TMS320F2.8377万S.CCXML";
    //var programToLoad ="../DSP_2.8377万_4_jointmodule.out ";
    VAR programToLoad ="../DSP_2.8377万_jointmodule.bin";

    //创建脚本环境对象  
    VAR脚本= ScriptingEnvironment.instance();

    //创建调试服务器
    VAR debugServer = script.getServer(“DebugServer.1”);

    //设置设备CCXML
    debugServer.setConfig (deviceCCXMLFile);

    //打开调试会话
    debugSession = debugServer.openSession("*","*";
    debugSession.flash.options.setString("FlashEraseSelection","仅限选定部门");
    打印(debugSession.flash.options.getString ("FlashEraseSelection)");
    debugSession.flash.options.setNumeric("FlashSPLLIMULT",19);
    debugSession.flash.options.setString("FlashSPLLFMULT","0 [0]");
    debugSession.flash.options.setString("FlashSYSDIVSEL","0 [/1]");
    //debugSession.flash.options.printOptions(".*");
    debugSession.flash.options.setBoolean("FlashC28Bank0Sector0",false);
    debugSession.flash.options.setBoolean("FlashC28Bank0Sector1",false);
    debugSession.flash.options.setBoolean("FlashC28Bank0Sector2",false);
    debugSession.flash.options.setBoolean("FlashC28Bank0Sector3",false);
    debugSession.flash.options.setBoolean("FlashC28Bank0Sector4",false);
    debugSession.flash.options.setBoolean("FlashC28Bank0Sector5",false);
    debugSession.flash.options.setBoolean("FlashC28Bank0Sector6",false);
    debugSession.flash.options.setBoolean("FlashC28Bank0Sector7",false);
    debugSession.flash.options.setBoolean("FlashC28Bank0Sector8",true);
    debugSession.flash.options.setBoolean("FlashC28Bank0Sector9",true);
    debugSession.flash.options.setBoolean("FlashC28Bank0Sector10",true);
    debugSession.flash.options.setBoolean("FlashC28Bank0Sector11",false);
    debugSession.flash.options.setBoolean("FlashC28Bank0Sector12",false);
    debugSession.flash.options.setBoolean("FlashC28Bank0Sector13",false);
    debugSession.flash.erase();


    //连接到目标
    debugSession.target.connect();

    //加载程序
    debugSession.memory.loadBinaryProgram( programToLoad,0xB0000);
    //debugSession.memory.loadProgram( programToLoad);

    //运行程序
    debugSession.target.run();

    //断开与目标的连接
    debugSession.target.disconnect();

    debugSession.Terminate();
    debugServer.stop();

    如果我错过了什么,请告诉我。

    Rashmy

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

    Rashmy Parimi 说:

    debugSession.flash.erase();


    //连接到目标
    debugSession.target.connect();

    [/引述]

    您的目标连接呼叫将在您的呼叫后发出,以擦除闪存。 您需要先连接到目标,然后才能尝试擦除闪存

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