SLAU358Q September   2011  – October 2019

 

  1.   Read This First
    1.     If You Need Assistance
    2.     Trademarks
    3.     Related Documentation From Texas Instruments
    4.     FCC and CE Compliance
  2. 1Introduction
    1. 1.1 Software Installation
    2. 1.2 Driver Installation
    3. 1.3 Hardware Installation
  3. 2Operation
    1. 2.1 Programming MSP Flash Devices Using the MSP Gang Programmer
      1. 2.1.1  Programming Using Interactive Mode
        1. 2.1.1.1 GO
        2. 2.1.1.2 Erase
        3. 2.1.1.3 Blank Check
        4. 2.1.1.4 Program
        5. 2.1.1.5 Verify
        6. 2.1.1.6 Read
      2. 2.1.2  Programming From Image
      3. 2.1.3  Programming From Script
        1. 2.1.3.1 Script Limitations
        2. 2.1.3.2 Command Syntax
        3. 2.1.3.3 Instructions
      4. 2.1.4  Programming in Standalone Mode
      5. 2.1.5  Memory Setup for GO, Erase, Program, Verify, and Read
        1. 2.1.5.1 Writing and Reading BSL Flash Sectors in the MSP430F5xx and MSP430F6xx MCUs
      6. 2.1.6  Secure Device Setup and Memory Protection
      7. 2.1.7  Programming MCU With IP Encapsulated Segment
      8. 2.1.8  Serialization
      9. 2.1.9  Creating and Using Images
      10. 2.1.10 Programming From Image File
      11. 2.1.11 Programming From SD Card
      12. 2.1.12 File Extensions
      13. 2.1.13 Checksum Calculation
      14. 2.1.14 Commands Combined With the Executable File
    2. 2.2 Data Viewers
    3. 2.3 Status Messages
    4. 2.4 Self Test
    5. 2.5 Label
    6. 2.6 Preferences
      1. 2.6.1 USB ID Number
      2. 2.6.2 COM Port
      3. 2.6.3 LCD Contrast
      4. 2.6.4 Checksum – Gang430 Standard
    7. 2.7 Benchmarks
      1. 2.7.1 Benchmarks for MSP430F5xx
      2. 2.7.2 Benchmarks for MSP430FR5xx
      3. 2.7.3 Benchmarks for MSP430F2xx
      4. 2.7.4 Benchmarks for MSP432P401R
  4. 3Firmware
    1. 3.1 Commands
    2. 3.2 Firmware Interface Protocol
    3. 3.3 Synchronization Sequence
    4. 3.4 Command Messages
      1. 3.4.1 Frame Structure
      2. 3.4.2 Checksum
    5. 3.5 Detailed Description of Commands
      1. 3.5.1 General
      2. 3.5.2 Commands Supported by the BOOT Loader
        1. 3.5.2.1  "Hello" Command
        2. 3.5.2.2  Boot Commands Disable
        3. 3.5.2.3  Boot Commands Enable
        4. 3.5.2.4  Get Diagnostic Command
        5. 3.5.2.5  Select Baud Rate Command
        6. 3.5.2.6  Erase Firmware Command
        7. 3.5.2.7  Load Firmware Command
        8. 3.5.2.8  Exit from Firmware Update Command
        9. 3.5.2.9  Get Label Command
        10. 3.5.2.10 Get Progress Status
      3. 3.5.3 Commands Supported by Application Firmware
        1. 3.5.3.1 Select Image Command
        2. 3.5.3.2 Main Process Command
        3. 3.5.3.3 Set Temporary Configuration in MSP-GANG Command
        4. 3.5.3.4 Get Selected Status Command
        5. 3.5.3.5 Read From Gang Data Buffer Command
        6. 3.5.3.6 Write to Gang Data Buffer Command
      4. 3.5.4 API Firmware Commands That Should Not be Used
        1. 3.5.4.1  Interactive Process Command
        2. 3.5.4.2  Erase Image Command
        3. 3.5.4.3  Read Info Memory From MSP-GANG Command
        4. 3.5.4.4  Write to MSP-GANG Info Memory Command
        5. 3.5.4.5  Verify Access Key Command
        6. 3.5.4.6  Write to Image Block Command
        7. 3.5.4.7  Verify Image Check Sum Command
        8. 3.5.4.8  Read Image Header Command
        9. 3.5.4.9  Disable API Interrupts Command
        10. 3.5.4.10 Display Message on LCD Display Command
        11. 3.5.4.11 Set IO State Command
  5. 4Dynamic Link Library for MSP-GANG Programmer
    1. 4.1 Gang430.dll Wrapper Description
    2. 4.2 MSP-GANG.dll Description
      1. 4.2.1  MSPGANG_GetDataBuffers_ptr
      2. 4.2.2  MSPGANG_SetGangBuffer, MSPGANG_GetGangBuffer
      3. 4.2.3  MSPGANG_GetDevice
      4. 4.2.4  MSPGANG_LoadFirmware
      5. 4.2.5  MSPGANG_InitCom
      6. 4.2.6  MSPGANG_ReleaseCom
      7. 4.2.7  MSPGANG_GetErrorString
      8. 4.2.8  MSPGANG_SelectBaudrate
      9. 4.2.9  MSPGANG_GetDiagnostic
      10. 4.2.10 MSPGANG_MainProcess
      11. 4.2.11 MSPGANG_InteractiveProcess
      12. 4.2.12 MSPGANG_Interactive_Open_Target_Device
      13. 4.2.13 MSPGANG_Interactive_Close_Target_Device
      14. 4.2.14 MSPGANG_Interactive_DefReadTargets
      15. 4.2.15 MSPGANG_Interactive_ReadTargets
      16. 4.2.16 MSPGANG_Interactive_ReadBytes
      17. 4.2.17 MSPGANG_Interactive_WriteWord_to_RAM
      18. 4.2.18 MSPGANG_Interactive_WriteByte_to_RAM
      19. 4.2.19 MSPGANG_Interactive_WriteBytes_to_RAM
      20. 4.2.20 MSPGANG_Interactive_WriteBytes_to_FLASH
      21. 4.2.21 MSPGANG_Interactive_Copy_Gang_Buffer_to_RAM
      22. 4.2.22 MSPGANG_Interactive_Copy_Gang_Buffer_to_FLASH
      23. 4.2.23 MSPGANG_Interactive_EraseSectors
      24. 4.2.24 MSPGANG_Interactive_BlankCheck
      25. 4.2.25 MSPGANG_Interactive_DCO_Test
      26. 4.2.26 MSPGANG_SelectImage
      27. 4.2.27 MSPGANG_EraseImage
      28. 4.2.28 MSPGANG_CreateGangImage
      29. 4.2.29 MSPGANG_LoadImageBlock
      30. 4.2.30 MSPGANG_VerifyPSAImageBlock
      31. 4.2.31 MSPGANG_ReadImageBlock
      32. 4.2.32 MSPGANG_Read_Code_File
      33. 4.2.33 MSPGANG_Save_Config, MSPGANG_Load_Config, MSPGANG_Default_Config
      34. 4.2.34 MSPGANG_SetConfig, MSPGANG_GetConfig
      35. 4.2.35 MSPGANG_GetNameConfig, MSPGANG_SetNameConfig
      36. 4.2.36 MSPGANG_SetTmpGANG_Config
      37. 4.2.37 MSPGANG_GetLabel
      38. 4.2.38 MSPGANG_GetInfoMemory, MSPGANG_SetInfoMemory
      39. 4.2.39 MSPGANG_Get_qty_MCU_Type, MSPGANG_Set_MCU_Type, MSPGANG_Get_MCU_TypeName, MSPGANG_Get_qty_MCU_Family, MSPGANG_Get_MCU_FamilyName, MSPGANG_Get_MCU_Name
      40. 4.2.40 MSPGANG_Set_MCU_Name
      41. 4.2.41 MSPGANG_HW_devices
      42. 4.2.42 MSPGANG_GetProgressStatus
      43. 4.2.43 MSPGANG_GetAPIStatus
      44. 4.2.44 MSPGANG_Set_IO_State
      45. 4.2.45 MSPGANG_Convert_Address
      46. 4.2.46 MSPGANG_Memory_Header_text
      47. 4.2.47 MSPGANG_Interactive_ClrLockedDevice
      48. 4.2.48 MSPGANG_Get_Code_Info
      49. 4.2.49 MSPGANG_MakeSound
      50. 4.2.50 MSPGANG_CallBack_ProgressBar
      51. 4.2.51 MSPGANG_GetPCHardwareFingerprint
      52. 4.2.52 MSPGANG_Flash_valid_addr
  6. 5Schematics
    1. 5.1 Schematics
  7. 6Frequently Asked Questions
    1. 6.1 Question: Why does device init, connect, or programming fail?
    2. 6.2 Question: Can I use single wires for connection between MSP-GANG and target device?
    3. 6.3 Question: How to serialize parts?
    4. 6.4 Question: How to have parts run after programming?
    5. 6.5 Question: What are possible reasons for the part to fail Verify step?
  8.   Revision History

Instructions

MESSAGE – Message declaration. Contents must be placed between quotes below a message declaration. Maximum of 50 content lines. Example:

MESSAGE "Hello." "This is my script."

GUIMSGBOX setting – Enable or disable pop-up message boxes in the GUI (warning and errors). Setting can be either ENABLE or DISABLE.

IFGUIMSGBOXPRESS option – Apply the option when a message box created by GUI is generated. Option can be OK or CANCEL.

MESSAGEBOX type – Create a pop-up message box with buttons. Contents must be placed between quotes below message declaration. Maximum of 50 content lines. Message box types are:

  • OK – One button: OK.
  • OKCANCEL – Two buttons: OK and CANCEL
  • YESNO – Two buttons: YES and NO
  • YESNOCANCEL – Three buttons: YES, NO, and CANCEL
  • Example:

MESSAGE YESNOCANCEL "You have three choices:" "Press yes, no, or cancel."

GOTO label – Jump to instruction immediately following the label.

SLEEP number – Pause a number of milliseconds, between 1 and 100000.

F_LOADPASSWORDFILE filename – Load JTAG password file. Provide a full path and filename.

F_FROMIMAGEMODE – Switch to Image mode.

CALL label – Call procedure starting at the instruction immediately following the label. Stack saves return address.

RETURN – Return from CALL.

IF condition operation – Test condition and if true then perform operation. The condition can be one of the following:

  • BUTTONOK – OK button is pressed in the message box.
  • BUTTONYES – YES button is pressed in the message box.
  • BUTTONNO – NO button is pressed in the message box.
  • BUTTONCANCEL – CANCEL button is pressed in the message box.
  • DONE – Previous process (for example, GO or Read File) finished successfully.
  • FAILED – Previous process (for example, GO or Read File) failed.

The operation can be one of the following:

  • GOTO label
  • CALL label SLEEP number – Pause a number of milliseconds, between 1 and 100000.

F_LOADCFGFILE filename – Load configuration file. Provide a full path and filename.

F_LOADCODEFILE filename – Load code file. Provide a full path and filename.

F_APPENDCODEFILE filename – Append code file. Provide a full path and file name.

F_VCCOFF – Turn VCC OFF from programming adapter to target device.

F_VCCON – Turn VCC ON from programming adapter to target device.

NOTE

VCC from FPA must be enabled first using configuration file.

F_VCCINMV – Set VCC in mV, between 1800 to 3600 in steps of 100 mV.

F_RESET – Perform RESET function from main dialog screen.

F_GO – Perform GO function from main dialog screen.

F_ERASEFLASH – Perform ERASE FLASH function from main dialog screen.

F_BLANKCHECK – Perform BLANK CHECK function from main dialog screen.

F_WRITEFLASH – Perform WRITE FLASH function from main dialog screen.

F_VERIFYFLASH – Perform VERIFY FLASH function from main dialog screen.

F_BLOWFUSE – Perform BLOW FUSE function from main dialog screen.

NOTE

Blows fuse regardless of enable option.

If the BLOW FUSE command is used, then the security fuse is blown even if the Blow Security Fuse enable option is disabled.

F_SETIMAGENUMBER number – Choose image number between 1 and 96 from MSP Gang Programmer internal memory.

F_INTERACTIVEMODE – Switch to Interactive mode.

NOTE

The execution result can be saved in the result file. Contents of the file can be used by the application software if required. The result can be saved in the new file or append to the existing file. Following script line commands can be used for specifying the result file:

F_NEWRESULTFILENAME – Provide a full path and name of the result file.

F_APPENDRESULTFILENAME – Provide a full path and name of the file where the result should be appended.

F_COMMENTTOFILE – Add a comment at the beginning of the result stream.

F_RESULTTOFILE – Save result to the result file specified by F_NEWRESULTFILENAME or F_APPENDRESULTFILENAME. The following data is saved:

Finished task mask: HHHH (16 bits task mask) Cumulative target mask: HH (8 bits target mask - 0x01-target-1,.. 0x80-target-8); Requested target mask: HH (8 bits target mask - 0x01-target-1,.. 0x80-target-8); Connected target mask: HH (8 bits target mask - 0x01-target-1,.. 0x80-target-8); Erased target mask: HH (8 bits target mask - 0x01-target-1,.. 0x80-target-8); Blank Check target mask: HH (8 bits target mask - 0x01-target-1,.. 0x80-target-8); Programmed target mask: HH (8 bits target mask - 0x01-target-1,.. 0x80-target-8); Verified target mask: HH (8 bits target mask - 0x01-target-1,.. 0x80-target-8); Secured target mask: HH (8 bits target mask - 0x01-target-1,.. 0x80-target-8); error_no: error number VTIO in mV: VTio in mV Vcc Error target mask: HH (8 bits target mask - 0x01-target-1,.. 0x80-target-8); Vcc Cumulative Err mask: HH (8 bits target mask - 0x01-target-1,.. 0x80-target-8); JTAG Init target mask: HH (8 bits target mask - 0x01-target-1,.. 0x80-target-8); Already Secured mask: HH (8 bits target mask - 0x01-target-1,.. 0x80-target-8); Wrong MCU ID mask: HH (8 bits target mask - 0x01-target-1,.. 0x80-target-8);

TRACEOFF – Disable tracing.

TRACEON – Enable tracing and log to the Trace-Scr.txt file in the current working directory. This option is useful for debugging. The trace file contains the sequence of all executed commands from the script file annotated with line numbers. Line numbers are counted without empty lines and without lines containing only comments.

END – End of script.

The following example script executes this sequence of commands:

  1. Label START is created.
  2. VCC from programmer to target device is turned OFF.
  3. Message box notifies the user of VCC setting and asks for permission to proceed with buttons OK and CANCEL. The program halts here until a button is pressed.
  4. If CANCEL was pressed then GOTO finish label (ends the script).
  5. If CANCEL was not pressed (in this case this implies that OK was pressed) then load configuration file test-A.g430cfg to the MSP Gang Programmer. Configuration file test-A.cfg should be prepared before running this script using Interactive mode.
  6. Message box asks the user to proceed. The program halts until OK is pressed.
  7. The MSP Gang Programmer programs the target device using the GO function.
  8. Message box asks the user if the test succeeded giving a YES or NO choice.
  9. If NO was pressed then GOTO START label (start of script).
  10. If NO was not pressed (in this case this implies that YES was pressed) then load configuration file finalcode.g430cfg to the MSP Gang Programmer.
  11. The MSP Gang Programmer programs the target device using the GO function. The new configuration changes the code file.
  12. Script jumps to the beginning using GOTO START. This can be used to wait for the next target device to be connected.
  13. Label finish is created.
  14. Script ends.
;===================================================== ; Script file - demo program ;----------------------------------------------------- >START F_VCCOFF MESSAGEBOX OKCANCEL "VCC if OFF now. Connect the test board." "When ready press the button:" " " "OK - to test the board" "CANCEL - to exit from program" IF BUTTONCANCEL GOTO finish ; use file name and FULL PATH or relative path to MSP-Gang.dll file location F_LOADCFGFILE Examples\Script\test.mspgangproj MESSAGEBOX OK "Press OK to download the test program." F_GO MESSAGEBOX YESNO "Press YES when the test finished successfully." "Press NO when the test failed." IF BUTTONNO GOTO START ; use file name and FULL PATH or relative path to MSP-Gang.dll file location F_LOADCFGFILE Examples\Script\finalcode.mspgangproj F_GO ; wait min 0.5 s before turning Vcc ON again SLEEP 500 F_VCCON SLEEP 10000 GOTO START >finish END ;=======================================================