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

MSPGANG_ReadImageBlock

MSPGANG_ReadImageBlock reads the header from the selected image memory. A maximum of 254 bytes can be read. Access to the remaining image memory (up to 512KB) is blocked.

Syntax

LONG MSPGANG_ReadImageBlock(LONG addr, LONG size, void *lpData)

Arguments

LONG address
LONG size
void *lpData Pointer to byte buffer where the result is saved

Result

LONG Error code

Data Format

union _IMAGE_HEADER { BYTE bytes[IMAGE_HEADER_SIZE]; WORD words[IMAGE_HEADER_SIZE/2]; struct { WORD own_PSA; WORD global_PSA; BYTE year; BYTE month; BYTE day; BYTE hour; BYTE min; BYTE sec; #define GLOBAL_PSA_START_OFFSET 10 // down - covered by global_PSA ---- #define SHORT_ID_2BYTE_OFFSET 10 WORD shortID; #define CHUNKS_NO_2BYTE_OFFSET 12 WORD chunks; #define IMAGE_DATA_2BYTE_OFFSET 14 WORD image_data_offset; #define GLOBAL_SIZE_4BYTE_OFFSET 16 DWORD size; //global_size; WORD ID_rev; //20 BYTE ID_name[HEADER_ID_SIZE]; //22 DWORD DLL_ver; //32 #define HEADER_COMMENT_ADDR 36 char comment[SCRIPT_TEXT_SIZE]; WORD used_tasks_mask; //52 BYTE Interface; //54 type (JTAG, SBW, BSL), speed(Fast, Med, Slow) BYTE GangMask; //55 BYTE Vcc_PowerEn; //56 BYTE Icc_HiEn; //57 WORD Vcc_mV; //58 WORD min_Vcc_mV; //60 WORD max_Vcc_mV; //62 WORD RST_time_ms; //64 WORD RST_release_ms; //66 BYTE InfoA_Erase_En; //68 BYTE BSL_Erase_En_mask; //69 BYTE SecureDev_En; //70 BYTE DCO_Flags; //71 #define DCO_RETAIN_EN 0x01 #define DCO_VALIDATION_EN 0x02 #define DCO_RECAL_EN 0x04 #define DCO_ONE_CONSTANTS 0x08 BYTE IO_cfg; //72 #define SBW_VIA_RST_BIT 0x01 BYTE MemoryOption; //73 for GUI only - for displaying used memory option. No impact in firmware BYTE InterfaceSpeed; //74 for GUI only - for displaying used speeds (JTAG/SBW/CJTAG/BSL). No impact in firmware BYTE VccSettleTime; //75 settle time *20ms BYTE JTAG_unlockEn : 1; //76 BYTE HasLockedInfoA : 1; BYTE HasAutoEraseInBSL : 1; BYTE BSL_X_type : 1; BYTE spare_flag4 : 1; BYTE spare_flag5 : 1; BYTE spare_flag6 : 1; BYTE spare_flag7 : 1; BYTE ClrSegments; //77 MSP432 // #define MSP432_CLR_LOCKING_INFOA_BIT 0x01 // #define MSP432_CLR_LOCKING_BSL_BIT 0x02 BYTE BSL_1st_Passw; //78 //BYTE free[112-78]; }prg; struct { BYTE offset[IMAGE_HEADER_CTRL_OFFSET]; //offset 112 BYTE flags; //0x70 #define IMAGE_LOCK 0x10 //must be the same bit as in LOCK_LD_PRJ BYTE sp1; //0x71 BYTE sp2; //0x72 BYTE sp3; //0x73 BYTE sp4; //0x74 BYTE sp5; //0x75 BYTE sp6; //0x76 BYTE sp7; //0x77 BYTE sp8; //0x78 BYTE sp9; //0x79 BYTE sp10; //0x7A BYTE sp11; //0x7B BYTE sp12; //0x7C BYTE sp13; //0x7D BYTE sp14; //0x7E BYTE sp15; //0x7F }ctrl; struct { BYTE offset[IMAGE_HEADER_SIZE/2]; char MCU_name[SCRIPT_MCU_NAME_SIZE]; //0 WORD Id[2]; //16 WORD SubId[2]; //20 WORD MainEraseMode; //24 WORD minPVcc; //26 WORD RAM_size; //28 WORD SubIDAddr; //30 BYTE FRAM; //32 //#define FRAM_NONE 0 //#define FRAM_ASIC 1 //#define FRAM_MSPXV2_57 2 //#define FRAM_APOLLO 3 //#define FRAM_MSPXV2_59 4 // --- one byte BYTE DefaultDCO : 1; //33 BYTE ASIC : 1; BYTE MPU : 1; BYTE JTAG_Passw : 1; BYTE BSLprogrammable : 1; BYTE JTAG_Unlockable : 1; BYTE BSL_16B_passw : 1; BYTE F1_80 : 1; //spare // --- one byte BYTE TestPin; //34 BYTE CpuX; //35 BYTE Quick_W :1; //36 BYTE Quick_R :1; BYTE Quick_W_bug :1; BYTE Quick_0x08 :1; BYTE Quick_0x10 :1; BYTE Quick_0x20 :1; BYTE Quick_0x40 :1; BYTE Quick_0x80 :1; BYTE FastFlash; //37 BYTE EnhVerify; //38 BYTE JTAG; //39 BYTE SpyBiWire; //40 BYTE Marginal; //41 BYTE F5xx; //42 BYTE MCU_Group; //43 WORD RAM_addr; //44 BYTE SYS_CLK; //46 used for F5xx and up //#define STANDARD 0 - for compatibility #define Xv2_PLL 1 //as standard before #define HF_8MHz 2 //FRAM FR57xx #define HF_1MHz 3 //Apollo #define HF2_8MHz 4 //FRAM FR58xx, FR59xx #define Xv2_PLL_G60XX 5 #define DCO_16384HZ 6 //i2xxx BYTE InfoA_type; //47 //#define STANDARD 0 - for compatibility #define I2XX_1K 1 //i2xxx 1K - 0x1000-0x13FF BYTE FLASH_Type; //48 //#define STANDARD 0 - for compatibility #define SEGMENT_1K 1 //i2xxx 1K flash segment size #define FLASH_SEGM_2K 2 #define FLASH_SEGM_4K 4 #define FLASH_SEGM_8K 8 #define FLASH_SEGM_16K 16 #define FLASH_SEGM_32K 32 BYTE Secure_Type; //49 //#define STANDARD 0 - for compatibility #define SUC 1 //i2xxx BYTE Map; //50 BYTE SysClkDiv2; //51 BYTE NMI_to_addr; //52 #define NMI_TO_ADDR_NOT_SUPPORTED 0x80 BYTE FW_type; //53 #define FAMILY_XMS432P401 21 //XSP432P401 Rev-B obsolete - not supported #define FAMILY_MSP432P401 22 #define FAMILY_MSP432P4111 23 #define FAMILY_MSP432 21 BYTE MCU_Type; //54 #define MSP430F 0x01 //or can be 0 #define CC_RF_BIT_ID 0x10 #define MSP_FR_BIT_ID 0x20 #define MSP432_BIT_ID 0x80 BYTE free_1; //55 BYTE free_2; //56 BYTE free_3; //57 WORD Id2[2]; //58 BYTE free_4; //62 // BYTE free[128-48]; }device; };