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.

MSP-Gang C# Example can not Build

Other Parts Discussed in Thread: MSP-GANG

HI

   I'm using MSP-Gang 1.2.5. there is a C# demo in installed dir  .

C:\Program Files (x86)\Texas Instruments\MSP-GANG\Examples\C#_MSP_DLL

   When I using Visual Studio 2015 open and upgrade the Solution, the project can not be Build.

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

public struct DATA_BUFFERS
    {
        byte[] SourceCode = new byte [DBUFFER_SIZE];   //source code from the file
        byte[] UsedCode = new byte [DBUFFER_SIZE];    //combined data (source code, serialization etc)
        byte[] CommonTx = new byte [DBUFFER_SIZE];    //data used to writing - the same data to all targets
        byte[][] GangTx = new byte [DBUFFER_SIZE][GANG_SIZE]; //selective data used to writing 
        byte[][] GangRx = new byte [DBUFFER_SIZE][GANG_SIZE]; //data read from all targets  
        byte[] Tmp = new byte [DBUFFER_SIZE];
        byte[][] JTAG_Passsword = new byte [2][JTAG_PASSW_LEN];
        byte[][] BSL_Passsword = new byte [2][BSL_PASSW_LEN];
        byte[] Flag_ScrCode = new byte [DBUFFER_SIZE];   //0 - empty  1-Code1, 2-Code2, 4-Appended Code in  SourceCode[x];
//                #define  CODE1_FLAG   1
//                #define  CODE2_FLAG   2
//                #define  APPEND_CODE_FLAG 4
        byte[] Flag_UsedCode = new byte [DBUFFER_SIZE];  //0 - empty  1-valid data  in  UsedCode[x];
        byte[] Flag_WrEn = new byte [DBUFFER_SIZE];   //0 - none  1-write/verify enable in FlashMem[x]
        byte[] Flag_EraseEn = new byte [DBUFFER_SIZE];   //0 - none  1-erase enable in FlashMem[x]
        byte[] Flag_RdEn = new byte [DBUFFER_SIZE];   //0 - none  1-read enable in FlashMem[x]
        byte[] Flag_Sp1 = new byte [DBUFFER_SIZE];    //spare
        byte[] Flag_Sp2 = new byte [DBUFFER_SIZE];    //spare
        byte[] Flag_Sp3 = new byte [DBUFFER_SIZE];    //
        byte[][] Flag_JTAG_Passw = new byte [2][JTAG_PASSW_LEN]; // [0][..]-password from code file;  [1][..]-password from password file
        byte[][] Flag_BSL_Passw = new byte [2][BSL_PASSW_LEN]; // [0][..]-password from code file;  [1][..]-password from password file
    }

-----

Every line show the exception:

Severity Code Description Project File Line Suppression State
Error CS0178 Invalid rank specifier: expected ',' or ']' SimpleMSP-GANG C:\Program Files (x86)\Texas Instruments\MSP-GANG\Examples\C#_MSP_DLL\MSP-GANG-Dll.cs 419 Active

  • Hi Kejian,

    I'm trying to install Visual Studio 2015 but need many hours, will reply you tomorrow.

    regards
    KC
  • Hi Kejian,

    The example code was developed under MS Visual C++ 2005, it's better to run with same version IDE. During the solution upgrade to 2015, there is possible some errors since the C# version too different.

    Here I made some code modification to make it pass the build but I still suggest you to use the same version C# as the example code used.

    public class DATA_BUFFERS
    {
    byte[] SourceCode = new byte [DatBufConst.DBUFFER_SIZE]; //source code from the file
    byte[] UsedCode = new byte [DatBufConst.DBUFFER_SIZE]; //combined data (source code, serialization etc)
    byte[] CommonTx = new byte [DatBufConst.DBUFFER_SIZE]; //data used to writing - the same data to all targets
    byte[,] GangTx = new byte [DatBufConst.DBUFFER_SIZE, GenericConstants.GANG_SIZE]; //selective data used to writing
    byte[,] GangRx = new byte [DatBufConst.DBUFFER_SIZE, GenericConstants.GANG_SIZE]; //data read from all targets
    byte[] Tmp = new byte [DatBufConst.DBUFFER_SIZE];
    byte[,] JTAG_Passsword = new byte [2,DatBufConst.JTAG_PASSW_LEN];
    byte[,] BSL_Passsword = new byte [2,DatBufConst.BSL_PASSW_LEN];
    byte[] Flag_ScrCode = new byte [DatBufConst.DBUFFER_SIZE]; //0 - empty 1-Code1, 2-Code2, 4-Appended Code in SourceCode[x];
    // #define CODE1_FLAG 1
    // #define CODE2_FLAG 2
    // #define APPEND_CODE_FLAG 4
    byte[] Flag_UsedCode = new byte [DatBufConst.DBUFFER_SIZE]; //0 - empty 1-valid data in UsedCode[x];
    byte[] Flag_WrEn = new byte [DatBufConst.DBUFFER_SIZE]; //0 - none 1-write/verify enable in FlashMem[x]
    byte[] Flag_EraseEn = new byte [DatBufConst.DBUFFER_SIZE]; //0 - none 1-erase enable in FlashMem[x]
    byte[] Flag_RdEn = new byte [DatBufConst.DBUFFER_SIZE]; //0 - none 1-read enable in FlashMem[x]
    byte[] Flag_Sp1 = new byte [DatBufConst.DBUFFER_SIZE]; //spare
    byte[] Flag_Sp2 = new byte [DatBufConst.DBUFFER_SIZE]; //spare
    byte[] Flag_Sp3 = new byte [DatBufConst.DBUFFER_SIZE]; //
    byte[,] Flag_JTAG_Passw = new byte [2, DatBufConst.JTAG_PASSW_LEN]; // [0][..]-password from code file; [1][..]-password from password file
    byte[,] Flag_BSL_Passw = new byte [2, DatBufConst.BSL_PASSW_LEN]; // [0][..]-password from code file; [1][..]-password from password file
    }
  • HI KC Xu

          The Program using Visual Studio 2015 can build now , but when running the program ,  the result was:

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

    MSPGANG_InitCom                Operation successful.
    MSPGANG_Default_Config         Operation successful.
    MSPGANG_Set_MCU_Name           Operation successful.
    MSPGANG_SetConfig(SetT)        Operation successful.
    MSPGANG_SetConfig(TarEn)       Operation successful.
    MSPGANG_Read_Code_File         Operation successful.
    MSPGANG_SelectImage            Operation successful.
    MSPGANG_CreateGangImage        Operation successful.
    MSPGANG_EraseImage             Operation successful.
    MSPGANG_LoadImage            ERROR 402: Selected Image is READ ONLY and cannot be reprogrammed.

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

    I'm using file  Demo_Fxxx.txt and the file is not read only .

    Lin Kejian

  • HI KC Xu




    The Program using Visual Studio 2015 can build now , but when running the program , the result was:


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


    MSPGANG_InitCom Operation successful.
    MSPGANG_Default_Config Operation successful.
    MSPGANG_Set_MCU_Name Operation successful.
    MSPGANG_SetConfig(SetT) Operation successful.
    MSPGANG_SetConfig(TarEn) Operation successful.
    MSPGANG_Read_Code_File Operation successful.
    MSPGANG_SelectImage Operation successful.
    MSPGANG_CreateGangImage Operation successful.
    MSPGANG_EraseImage Operation successful.
    MSPGANG_LoadImage ERROR 402: Selected Image is READ ONLY and cannot be reprogrammed.

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


    I'm using file Demo_Fxxx.txt and the file is not read only .




    Lin Kejian

**Attention** This is a public forum