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.

problem with an CC430F5137 and MSP-Gang.dll

Other Parts Discussed in Thread: CC430F5137, MSP-GANG

hi, i am trying to read from a CC430F5137 using the MSPGANG_Set_MCU_Name function and the MSPGANG_Interactive_DefReadTargets function, but when i try to name the MCU name this always reaturn error 

MSPGangSetMCUName                 CC430F5137  ERROR 344: Wrong target device connected !

does anyone had this same issue.

Any help will be great!

Andres G.

  • i have the same problem with the MSP-gang and i am using C language, this is a example of my code, i am using the example provided by TI:


    status = pMSPGangSetConfig(CFG_RETAIN_CAL_DATA_INDEX, 0);

    printf("MSPGangSetConfig(Cumulative_St) %20s", "Disable");
    status = pMSPGangSetConfig(CFG_TMP_CUMULATIVE_ST_EN, 0);
    Evaluate(status);

    printf("pMSPGangOpenTarget ");<=== here is where the error 23 is send.
    status = pMSPGangOpenTarget("Reading...");
    Evaluate(status);

    printf("pMSPGangInteractiveReadTargets %20s", " ");
    status = pMSPGangInteractiveReadTargets(0xFF);
    Evaluate(status);

    any suggestion it will be great!!!
  • solve this issue i am still in the battle to open a target. It is returning error 23 i am don't have a clue for the solution, just try to set all the settings but still same problem, any clue it will be great.
  • Hi Andres,

    I put your two requests into the same thread to make it easier for the community to view and help you. I'm sorry to hear of your difficulties getting this up and running and hope we can drive this to a quick conclusion. I have some initial troubleshooting questions to help narrow down the issue:

    1. To rule out a hardware connection issue, can you please tell me if you are able to read or program the device using the MSP-GANG GUI instead of the DLL? If so, then we'll know that it's just a problem with your C program, but if you can't access the device with the MSP-GANG GUI either, then it could likely be a hardware issue.
    2. Are you using a TI target board or your own custom board? If it is your own board, can you list the connections that you make for JTAG or SBW between the device and the MSP-GANG? Note that if you use SBW, then I think you will need to make the correct API call with SetConfig to set the communication type as SBW so that the MSP-GANG knows to use that instead of JTAG when trying to communicate with the device.
    3. Can you check that you have the latest version of the MSP-GANG software? The latest version is 1_02_05_00 software-dl.ti.com/.../index_FDS.html

    Regards,
    Katie
  • 1. To rule out a hardware connection issue, can you please tell me if you are able to read or program the device using the MSP-GANG GUI instead of the DLL? If so, then we'll know that it's just a problem with your C program, but if you can't access the device with the MSP-GANG GUI either, then it could likely be a hardware issue.

    A: The GUI is completely functional. Connection is fine. We can program the device using the DLL from Images in the programmer.

    The problem that i have is only with the C code, now does anyone had a problem with the .h file give it by TI, i had compiler error and had to comment a part of the code:

    //Don't create a mailbox without the magic numbers!
    /* TI_MSP432_CMD_MAILBOX()
    {
    mb_fields.MB_START = 0x0115ACF6;
    mb_fields.MB_END = 0x011E11D;
    mb_fields.CMD_FACTORY_RESET.ACK = 0xFFFFFFFF;
    mb_fields.CMD_FACTORY_RESET.reserved = 0xFFFFFFFF;
    mb_fields.CMD_JTAG_SWD_LOCK_SECEN.ACK = 0xFFFFFFFF;
    mb_fields.CMD_JTAG_SWD_LOCK_SECEN.reserved[0] = 0xFFFFFFFF;
    mb_fields.CMD_JTAG_SWD_LOCK_SECEN.reserved[1] = 0xFFFFFFFF;
    mb_fields.CMD_SEC_ZONEx_EN[0].ACK = 0xFFFFFFFF;
    mb_fields.CMD_SEC_ZONEx_EN[0].reserved[0] = 0xFFFFFFFF;
    mb_fields.CMD_SEC_ZONEx_EN[0].reserved[1] = 0xFFFFFFFF;
    mb_fields.CMD_SEC_ZONEx_EN[1].ACK = 0xFFFFFFFF;
    mb_fields.CMD_SEC_ZONEx_EN[1].reserved[0] = 0xFFFFFFFF;
    mb_fields.CMD_SEC_ZONEx_EN[1].reserved[1] = 0xFFFFFFFF;
    mb_fields.CMD_SEC_ZONEx_EN[2].ACK = 0xFFFFFFFF;
    mb_fields.CMD_SEC_ZONEx_EN[2].reserved[0] = 0xFFFFFFFF;
    mb_fields.CMD_SEC_ZONEx_EN[2].reserved[1] = 0xFFFFFFFF;
    mb_fields.CMD_SEC_ZONEx_EN[3].ACK = 0xFFFFFFFF;
    mb_fields.CMD_SEC_ZONEx_EN[3].reserved[0] = 0xFFFFFFFF;
    mb_fields.CMD_SEC_ZONEx_EN[3].reserved[1] = 0xFFFFFFFF;
    mb_fields.CMD_BSL_CONFIG.ACK = 0xFFFFFFFF;
    mb_fields.CMD_BSL_CONFIG.reserved[0] = 0xFFFFFFFF;
    mb_fields.CMD_BSL_CONFIG.reserved[1] = 0xFFFFFFFF;
    mb_fields.CMD_JTAG_SWD_LOCK_ENC_UPDATE.ACK = 0xFFFFFFFF;
    mb_fields.CMD_JTAG_SWD_LOCK_ENC_UPDATE.reserved = 0xFFFFFFFF;
    mb_fields.CMD_SEC_ZONEx_UPDATE[0].ACK = 0xFFFFFFFF;
    mb_fields.CMD_SEC_ZONEx_UPDATE[0].reserved = 0xFFFFFFFF;
    mb_fields.CMD_SEC_ZONEx_UPDATE[1].ACK = 0xFFFFFFFF;
    mb_fields.CMD_SEC_ZONEx_UPDATE[1].reserved = 0xFFFFFFFF;
    mb_fields.CMD_SEC_ZONEx_UPDATE[2].ACK = 0xFFFFFFFF;
    mb_fields.CMD_SEC_ZONEx_UPDATE[2].reserved = 0xFFFFFFFF;
    mb_fields.CMD_SEC_ZONEx_UPDATE[3].ACK = 0xFFFFFFFF;
    mb_fields.CMD_SEC_ZONEx_UPDATE[3].reserved = 0xFFFFFFFF;
    };*/

    Could be that my problem?


    2. Are you using a TI target board or your own custom board? If it is your own board, can you list the connections that you make for JTAG or SBW between the device and the MSP-GANG? Note that if you use SBW, then I think you will need to make the correct API call with SetConfig to set the communication type as SBW so that the MSP-GANG knows to use that instead of JTAG when trying to communicate with the device.

    A: we are using our own custom board, but we are able to program it through the GUI, we are making a SBW connection and i am setting that in the code:

    pMSPGangSetConfig(CFG_IO_INTERFACE, SBW_VIA_RST_BIT);
    pMSPGangSetConfig(CFG_INTERFACE, INTERFACE_SBW);


    3. Can you check that you have the latest version of the MSP-GANG software? The latest version is 1_02_05_0

    A: Yes, we have the latest version of MSP-GANG programmer.
  • Hi Andres,

    Thanks for the additional info!

    I see that you have set " pMSPGangSetConfig(CFG_IO_INTERFACE, SBW_VIA_RST_BIT);" In the GUI when it works to successfully connect and program, can you please show the setting under Setup > JTAG/SBW Interface? Under SBWDATA line selection, the GUI defaults to using via TDOI, which is the default SBW hardware connection on all of our target boards. If your GUI is set that way and it works that means your hardware also uses TDOI, and the line " pMSPGangSetConfig(CFG_IO_INTERFACE, SBW_VIA_RST_BIT);" would be setting it to use the wrong pin for the SBW connection. In that case, you should try removing this line or change it to be set as via TDOI.

    For your question about the mailbox, I don't think this should impact you if you comment it out because you are not using MSP432 - it would only matter if you plan on using your same C program with MSP432.

    Regards,
    Katie
  • already try to change the parameter to TDOI and no answer. I see also that if i run the MSPGANG_GetAPIStatus with GET_ACTIVE_TARGETS_MASK it returns:
    0x0,0x0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff

    and with GET_MCU_ID it returns:
    0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0

    I also try to read from the info memory and it always return same info:

    page 1
    0xff,0xff,0xfb,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff


    page 2
    0x1e,0xb8,0xd7,0x1b,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7b,0xf4,0xe9,0xf4,0x9e,0xf6,0xc3,0xf5,0x97,0xfc,0xe9,0xf4,0x52,0xf8,0x78,0xf7,0xe2,0xf6,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff
  • Hi Andres,

    GET_MCU_ID shows 0's if I have no devices connected, but also shows it if I call it before running main process. After calling main process, I am able to read it. So I don't think this is a good test for your original Set_MCU_name issue because you won't be able to read the ID successfully before running main process, which means setting the name.

    I still think that there is an issue somewhere in your setup - can you post the full sequence of commands and parameters that you call? In addition, can you include what are your hardware connections between the MSP-GANG JTAG header and your target device, including information on if the device should be powered from the MSP-GANG or powered from some other source?

    Regards,
    Katie
  • These are all the settings i am giving to the gang programmer before execute the open device function:

    pMSPGangSetConfig( CFG_SBW_SPEED, 0);

    pMSPGangSetConfig(CFG_VCC_SETTLE_TIME, 0);

    pMSPGangSetConfig(CFG_POWERTARGETEN, 1);

    pMSPGangSetConfig(CFG_READINFOA, 1);

    pMSPGangSetConfig(CFG_READINFOB, 1);

    pMSPGangSetConfig(CFG_READINFOC, 1);

    pMSPGangSetConfig(CFG_COPY_CFG_FROM_MEMORY_EN, 1);

    pMSPGangSetConfig(CFG_PROJECT_SOURCE, 0);

    pMSPGangSetConfig(CFG_USE_SCRIPT_FILE, 0);

    pMSPGangSetConfig(CFG_TARGET_EN_INDEX, TARGET_1_MASK);

    pMSPGangSetConfig(CFG_VCCINDEX, Vcc);

    pMSPGangSetConfig(CFG_VCCINDEX, 3300);

    pMSPGangSetConfig(CFG_VCC_SETTLE_TIME, 0);

    pMSPGangSetConfig(CFG_TMP_VCC_ONOFF, 1);

    pMSPGangSetConfig(CFG_JTAG_UNLOCK_EN, 0);

    pMSPGangSetConfig(CFG_SBW_SPEED, 0);

    pMSPGangSetTmpGANGConfig(CFG_TMP_GANG_MASK, TARGET_1_MASK);

    pMSPGangSetConfig(CFG_BSL_ENH_ENABLE, 0);

    pMSPGangSetConfig(CFG_IO_INTERFACE, SBW_VIA_TDOI_BIT);

    pMSPGangSetConfig(CFG_INTERFACE, INTERFACE_SBW);

    pMSPGangSetConfig(CFG_ICC_HI_EN, 0);

    pMSPGangSetConfig(CFG_BLOWFUSE, 0);

    pMSPGangSetConfig(CFG_RETAIN_CAL_DATA_INDEX, 0);
    pMSPGangSetConfig(CFG_TMP_CUMULATIVE_ST_EN, 0);
  • Hi Andres,

    If I load the DLL and then call pMSPGangInitCom and pMSPGangSetMCUName before doing the list of setConfig commands you have in your post, and then finally call pMSPGangOpenTarget, I do not get error 23. Do you still get this error if you call pMSPGangInitCom and pMSPGangSetMCUName with the correct name (exactly matching the string used in the MSP-GANG GUI, case-sensitive!), then your setConfig commands, before calling pMSPGangOpenTarget?

    Regards,
    Katie

  • Hi Katie, thanks for the reply, yes i am having the same problem:

    do you think it could be the gang programmer, there is a way to return it to default settings???

  • Hi andres,

    I've been having to test with another device because I don't have a CC430 available here. But I see that the way MSP-GANG GUI lists the device number is strange, having that "-" in it. Could you try without the "-", "CC430F5137"?

    I'm going to also ask our MSP-GANG software designer about why there is this dash in the name and if it is correct to have it for the DLL or not.

    Regards,
    Katie
  • I confirmed with the designer that the name "CC-430F5137" is actually correct. So that must not be the issue.

    Can you please post a list of what pin on the MSP-GANG is connected to what pin on the MSP430 device? This would help me to check if the configuration API calls you are making are matching up with your hardware. A screenshot of the settings you use in the MSP-GANG GUI under Setup > JTAG/SBW Interface when it works would also be helpful.
  • Hi Katie, sorry for my late answer, here is a picture of JTAG/SBW Interface:

    and here is  the list of what pin on the MSP-GANG is connected to what pin on the MSP430 device

  • Hi Andres,

    I'm not sure which pins on the CC430F5137 device those are because that device is only available in a 48-pin package - can you let me know what CC430 pin numbers those in the schematic correspond to?

    I can see the in the MSP-GANG GUI you are using SBW set to use RST instead of TDOI - can you please change the line in your DLL program to do pMSPGangSetConfig(CFG_IO_INTERFACE, SBW_VIA_RST_BIT); before you call open device and see if that helps?

    Finally, can you show me the selections you use on the MSP-GANG GUI main screen (just take a screenshot of the main screen for the MSP-GANG GUI configuration that works correctly for you, so that I can compare its settings to your script as well?) In particular I'm trying to check what you use in the GUI for Target's Power Supply and Interface Option on the main screen when the communication is working.

    Thanks for bearing with me through all of these questions - the DLL can be tricky to try to debug remotely when you don't have someone's code and board in front of you. I really appreciate all the information you are providing as it is really helpful.

    Regards,
    Katie
  • Hi Katie, sorry for send you incomplete information. Here is the missing info the pins we are using for test is 39 and for reset 40 :

    Plus the screenshot of the Gang programmer GUI:

  • The only difference I see between your script and the GUI is what I mentioned above about you need to use pMSPGangSetConfig(CFG_IO_INTERFACE, SBW_VIA_RST_BIT); before you call open device instead of setting it to TDOI if you want to match the GUI setting. Have you tried this recently?
    -Katie
  • Hi Andres,

    Were you able to resolve your issue? Is there more that we can do to help?

    Regards,
    Katie
  • We still have the issue, for the moment we are using the interface to communicate to the Gang programmer. I you have any clue it will be great,

    Andres G.

  • Can I see your latest sequence of commands for the DLL project that is still failing?

    Regards,
    Katie
  • this is the code we are using...

    DLLtest.c
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    /*
    * Copyright (c) 2003 - 2015 Texas Instruments Incorporated
    *
    * All rights reserved not granted herein.
    * Limited License.
    *
    * Texas Instruments Incorporated grants a world-wide, royalty-free,
    * non-exclusive license under copyrights and patents it now or hereafter
    * owns or controls to make, have made, use, import, offer to sell and sell ("Utilize")
    * this software subject to the terms herein. With respect to the foregoing patent
    *license, such license is granted solely to the extent that any such patent is necessary
    * to Utilize the software alone. The patent license shall not apply to any combinations which
    * include this software, other than combinations with devices manufactured by or for TI ("TI Devices").
    * No hardware patent is licensed hereunder.
    *
    * Redistributions must preserve existing copyright notices and reproduce this license (including the
    * above copyright notice and the disclaimer and (if applicable) source code license limitations below)
    * in the documentation and/or other materials provided with the distribution
    *
    * Redistribution and use in binary form, without modification, are permitted provided that the following
    * conditions are met:
    *
    * * No reverse engineering, decompilation, or disassembly of this software is permitted with respect
    * to any software provided in binary form.
    * * any redistribution and use are licensed by TI for use only with TI Devices.
    * * Nothing shall obligate TI to provide you with source code for the software licensed and provided
    * to you in object code.
    * If software source code is provided to you, modification and redistribution of the source code are permitted
    * provided that the following conditions are met:
    *
    * * any redistribution and use of the source code, including any resulting derivative works, are licensed by
    * TI for use only with TI Devices.
    * * any redistribution and use of any object code compiled from the source code and any resulting derivative
    * works, are licensed by TI for use only with TI Devices.
    *
    * Neither the name of Texas Instruments Incorporated nor the names of its suppliers may be used to endorse or
    * promote products derived from this software without specific prior written permission.
    *
    * DISCLAIMER.
    *
    * THIS SOFTWARE IS PROVIDED BY TI AND TI'S LICENSORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
    * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    * IN NO EVENT SHALL TI AND TI'S LICENSORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
    * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
    * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
    * POSSIBILITY OF SUCH DAMAGE.
    */
    //*****************************************************************
    /*========================================================================*\
    | |
    | DLLtest.c |
    | |
    | Application main |
    |--------------------------------------------------------------------------|
    | Project: MSP-Gang DLL: Application example in C language |
    | Developed using: MS Visual C++ 2008 |
    |--------------------------------------------------------------------------|
    | Author: PC |
    | Version: 1.0 |
    | Initial Version: 10/09/11 |
    | Last Change: 10/09/11 |
    |--------------------------------------------------------------------------|
    | Version history: |
    | 1.0 Initial version |
    |--------------------------------------------------------------------------|
    | Designed 2011 by Elprotronic Incorporated |
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Andres,

    Thank you so much for providing the full code - we now found your issue. When you are setting up the DLL functions, it looks like you have a typo that is causing your issue:

           //LONG WINAPI MSPGANG_SetConfig( LONG index, LONG data );
           pMSPGangSetConfig          = GetProcAddress(hDLL430, "MSPGANG_SetConfig");
    
           pMSPGangSetTmpGANGConfig= GetProcAddress(hDLL430, "MSPGANG_SetTmpGANG_Config");
           //LONG WINAPI MSPGANG_GetConfig( LONG index );
           pMSPGangSetConfig = GetProcAddress(hDLL430, "MSPGANG_GetConfig");
           //LONG WINAPI MSPGANG_Set_MCU_Name( LPTSTR name );
    

    As you can see, you have pMSPGangSetConfig defined a second time, instead of defining pMSPGangGetConfig. This typo means that pMSPGangSetConfig is really pointing to the MSPGANG_GetConfig function from the DLL (since the second definition will override the first one) so none of your device configuration is actually taking effect! If you fix the typo, I think all should work.

    Thanks for posting and I hope this resolves your issue!

    Regards,

    Katie

  • Hi Katie, first let me thank you for all the help with this matter, i can tell you that now we can read from the MSP-GANG. We apply the changes that you suggested and also add a line to enable power from the MSP-Gang, that solve our issues and allow us to read from the gang proggramer.

    Thanks,

    Andres G.

  • Hi Andres,

    This is great news! I'm glad you were able to get it working now. Please let me know if you run into further issues with the MSP-GANG.

    Regards,
    Katie

**Attention** This is a public forum