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.

CCSv4 flash programming with debug server API

Hi,

I'm trying to load several programs into MSP430 internal flash through an MSP-FET430UIF using the deburserver API.

The problem is I cannot activate the "Retain Unchange memory" programmatically. It seems that the call to:

"debugSession.options.setString("MSP430DownloadOptions", "Retain unchanged memory");" 

does nothing ( my simplified java application source code is included below).

Program1.out uses memory range 0x8000-0x8FFF and program2.out is linked above 0x9000 . The application works fine, i.e. successfully loads the .out files into flash. However at the end of the execution, the MSP430's flash memory range 0x8000-0x8FFF is filled with "FF" bytes. If I stop the program just before the loading of program2.out, I can see that program1.out is well loaded in range 0x8000-0x8FFF.

Thanks for your help; this is very critical.

{

dssScriptEnv = ScriptingEnvironment.instance();

 

 

debugServer = (DebugServer) dssScriptEnv.getServer("DebugServer.1");

debugServer.setConfig(scenario.getCPUConfigFile());

 

debugSession = debugServer.openSession("*", "*");

 

debugSession.options.setBoolean("RemoveDebugStateAtConnect", false);

debugSession.options.setBoolean("AutoRunToLabelOnReset", false);

debugSession.options.setBoolean("AutoRunToLabelOnRestart", false);

debugSession.options.setBoolean("AllowInterruptsWhenHalted", false);

debugSession.options.setString("MSP430DownloadOptions", "Retain unchanged memory");

 

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

 

debugSession.target.connect();

 

debugSession.memory.loadProgram("program1.out");

debugSession.memory.loadProgram("program2.out");

 

debugSession.terminate();

}

  • Hi dive,

    Can you check to see if the MSP430DownloadOptions property is being set properly? You can add a line like:

    val = activeDS.options.getString("MSP430DownloadOptions")

    And check the value of "val" to see if it is set to the right value. If it is, then that option is not being propagated to the debugger properly/

    Thanks

    ki

  • Hi ki,

    Thanks for the suggestion. I've already done this. The option is correctly set to the right value, however the "loadprogram" method doesn't care.

    dive

  • When you explicitly set it in the ' Windows->Preferences->CCS->Debug->Debugger Options->MSP430' dialog or right-clicking on the board in the 'Debug' view and selecting 'Edit <board name->Target->MSP430 Properties' dialog, does it behave properly? I just want to confrom firm that it is only setting via DSS API is where the issue lies.

    Thanks

    ki

  • Yes it does work fine using the IDE.

    Thank you.

    dive.

  • Thanks for confirming this. It looks like MSP430 options set for the current debug session are not being respected. I will file a bug for this issue.

    ki

  • I don't know how long it will take for TI to fix this bug, so would you have a workaround to suggest such as:

     - merge the two .out files I want to load: how to do that?

     - or use another method of the API: I've tried loadCoff without success. Any hint on this.

     

    Anyway thank you for your support.

  • I've got news: it seems that in beta 5, the "retain unchanged memory" options does not work in the IDE.

    Is there something wrong with my .out file?

     

  • To be clear: the options worked in previous versions but there has been a regression in beta 5?

  • This is what I was checking... It does not work on beta 4 as well. I'm getting confused because I know this feature has worked one day.

    Unfortunately I haven't kept older releases so I cannot says when the regression occured.

    Do you think there can be borken configuration files somewhere? I've always reinstalled new beta relases in separate folders as instructed, but migrated the same projects across beta versions.

    I will try to recreate new basic projects from scratch to see if this occurs again.

    FYI here below are extracts of the .map linker output for program 1 and program 2, in case I missed something... I'm expecting that memory range 0x8000-0x8FFF is preserved when I load program 2

    Thank you.

    dive.

     

    PROGRAM 1:

     

    MEMORY CONFIGURATION

     

             name            origin    length      used     unused   attr    fill

    ----------------------  --------  ---------  --------  --------  ----  --------

      SFR                   00000000   00000010  00000000  00000010  RWIX

      PERIPHERALS_8BIT      00000010   000000f0  00000000  000000f0  RWIX

      PERIPHERALS_16BIT     00000100   00000100  00000000  00000100  RWIX

      RAM                   00000200   00000800  0000072c  000000d4  RWIX

      INFOD                 00001000   00000040  00000000  00000040  RWIX

      INFOC                 00001040   00000040  00000000  00000040  RWIX

      INFOB                 00001080   00000040  00000000  00000040  RWIX

      INFOA                 000010c0   00000040  00000000  00000040  RWIX

      FLASH_1               00008000   00000080  0000005c  00000024  RWIX

      FLASH                 00008080   00000f80  00000e36  0000014a  RWIX

      INT00                 0000ffe0   00000002  00000000  00000002  RWIX

      INT01                 0000ffe2   00000002  00000000  00000002  RWIX

      INT02                 0000ffe4   00000002  00000000  00000002  RWIX

      INT03                 0000ffe6   00000002  00000000  00000002  RWIX

      INT04                 0000ffe8   00000002  00000000  00000002  RWIX

      INT05                 0000ffea   00000002  00000000  00000002  RWIX

      INT06                 0000ffec   00000002  00000002  00000000  RWIX

      INT07                 0000ffee   00000002  00000002  00000000  RWIX

      INT08                 0000fff0   00000002  00000002  00000000  RWIX

      INT09                 0000fff2   00000002  00000002  00000000  RWIX

      INT10                 0000fff4   00000002  00000002  00000000  RWIX

      INT11                 0000fff6   00000002  00000002  00000000  RWIX

      INT12                 0000fff8   00000002  00000002  00000000  RWIX

      INT13                 0000fffa   00000002  00000002  00000000  RWIX

      INT14                 0000fffc   00000002  00000002  00000000  RWIX

      RESET                 0000fffe   00000002  00000002  00000000  RWIX

     

     

    PROGRAM 2:

    MEMORY CONFIGURATION

     

             name            origin    length      used     unused   attr    fill

    ----------------------  --------  ---------  --------  --------  ----  --------

      SFR                   00000000   00000010  00000000  00000010  RWIX

      PERIPHERALS_8BIT      00000010   000000f0  00000000  000000f0  RWIX

      PERIPHERALS_16BIT     00000100   00000100  00000000  00000100  RWIX

      RAM                   00000200   00000800  00000590  00000270  RWIX

      INFOD                 00001000   00000040  00000000  00000040  RWIX

      INFOC                 00001040   00000040  00000000  00000040  RWIX

      INFOB                 00001080   00000040  00000000  00000040  RWIX

      INFOA                 000010c0   00000040  00000000  00000040  RWIX

      FLASH_APP             00009000   00006fde  0000152c  00005ab2  RWIX

      INT00                 0000ffe0   00000002  00000000  00000002  RWIX

      INT01                 0000ffe2   00000002  00000000  00000002  RWIX

      INT02                 0000ffe4   00000002  00000002  00000000  RWIX

      INT03                 0000ffe6   00000002  00000002  00000000  RWIX

      INT04                 0000ffe8   00000002  00000000  00000002  RWIX

      INT05                 0000ffea   00000002  00000000  00000002  RWIX

      INT06                 0000ffec   00000002  00000002  00000000  RWIX

      INT07                 0000ffee   00000002  00000002  00000000  RWIX

      INT08                 0000fff0   00000002  00000002  00000000  RWIX

      INT09                 0000fff2   00000002  00000002  00000000  RWIX

      INT10                 0000fff4   00000002  00000002  00000000  RWIX

      INT11                 0000fff6   00000002  00000002  00000000  RWIX

      INT12                 0000fff8   00000002  00000002  00000000  RWIX

      INT13                 0000fffa   00000002  00000002  00000000  RWIX

      INT14                 0000fffc   00000002  00000002  00000000  RWIX

      RESET                 0000fffe   00000002  00000002  00000000  RWIX

  • OK, I've created two new projects, the first executable linked at address 0x8000, the other one at 0x9000.

    I've got the same issue with the CCSv4 beta 5 in the IDE so the issue is not related to the project configuration.

    dive.

  • You should be able to migrate project between versions.

    In any case it looks like that option is broken in general in beta 5.

    ki

  • dive,

    Have you tried setting it in both in the global settings (Windows->Properties) and also launch setteings (right-click in debug view and select 'edit <target>)?

    thanks

    ki

  • Yes I tried both. No success....

  • Hi dive,

    Thanks for trying. I think I can reproduce this issue. I also found some unusual behavior with the memory view which confuses things even more. I will keep you posted

    Thanks

    ki

  • That's great. I appreciate your support.

    dive.

  • Both issues have been addressed in CCSv4.0 release:

    SDSCM00032273 Memory View does not refresh properly on MSP430 targets
    SDSCM00032271 MSP430 Download Option settings are not respected