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.

MSPGANG programming using commandline/dll

Other Parts Discussed in Thread: CC430F5137

I am trying to program six (6) cc430F5137 processers in production using sbw (via rst).  I need to fully automate the process and have a log file created with the programming status.  Is there a command line driven MSPGANG software or simple examples to use the dll to setup and program these processors?

  • Hi Jonathan,

    Have you seen the MSP-GANG programmer? There is a software download on the product page for the programmer. In addtion to the basic GUI it has for programming, in the installation folder under "examples" it includes some Visual Studio C/C++ examples of using the DLL to automate custom programming via the MSP-GANG, to give you full control and customization of your settings.

    You may also want to see the MSP-GANG user's guide www.ti.com/lit/pdf/slau358 which includes more information about other options you could use for automating your programming.

    Hope this helps get you started!

    Regards,

    Katie

  • I took a look at the documents.  I am working with labwindows (ansi C).  I receiving link errors.  Can the msp-gang be controllled via the db9 rs-232 port to start/stop and determine if the programming was successful?

  • Jonathan Kuczwaj said:

    I took a look at the documents.  I am working with labwindows (ansi C).  I receiving link errors.  Can the msp-gang be controllled via the db9 rs-232 port to start/stop and determine if the programming was successful?

    Yes, the MSP-GANG can be controlled via the USB or serial port, without use of the DLL - it just doesn't provide you as many options as the DLL (though you don't need these extra DLL features if you just want to be able to trigger programming and check the status of the programming). For your reference of the commands that you can use from the USB or RS-232 connection, please see Chapter 3 - this will describe what you can do when using this method. Note that some commands are labeled "Do not use" - these are commands that the MSP-GANG GUI uses but it isn't recommended for you to use them on your own (you should not need them anyway - they are primarily for updating the MSP-GANG firmware itself).

    If I were you what I would do is this:

    1. Using the MSP-GANG GUI software, configure the programmer for all of the settings you are going to want for your programming (which targets are enabled, SBW vs JTAG vs BSL used, programming voltage and how it's supplied, the binary file that you want to load, etc).

    2. Once you've tested programming using this configuration and know that it's all set the way you'd like, follow the steps in section 2.1.6 of the MSP-GANG user's guide to create and save the current configuration as an image in the MSP-GANG internal memory (select "Save to image")

    3. Now that the image is saved into the MSP-GANG memory, you no longer need the GUI, so close it. Now using a terminal program like Docklight, HyperTerminal, or PuTTY, you should be able to connect to the COM port that the MSP-GANG has enumerated on. See section 3.2 for the default serial communication setup (9600 baud, 1 start bit, 8 data bits, even parity, 1 stop bit). Note that if possible it is best to use the USB interface for the serial communication as it is much faster.

    4. Now following the protocol outlined in section 3 (make note of the data frame structure), you can do a sequence of commands like this:

    • SYNC/"Hello" command (required at beginning)
    • Select Baud Rate command (to increase baud rate for faster programming)
    • Select Image (to choose the image that you loaded into the MSP-GANG memory earlier using the GUI, and select it to be used for programming)
    • Main Process (this performs the actual programming according to the image you selected)
    • now you will poll the Get Progress Status command until it indicates that the Main Process is complete (byte 6 will become an ACK instead of In Progress - see user's guide 3.5.2.10). Get Progress Status will also return any errors that were encountered during programming

    Instead of using a terminal software to send the commands, you could use any coding environment that allows you to access COM ports, and write a program to send and handle the above commands automatically.

    I hope this helps make clear a programming process that should allow you to program and detect errors all by controlling the MSP-GANG over the COM port, even without use of the MSP-GANG DLL.

    Regards,

    Katie

  • I am using teraterm on the rs-232 port

    settings 9600, 8 data, even parity 1 stop, flow control none.  I send an 0xd and receive a 90.  How to I run the image on the programmer?

  • Hi Jonathan,

    You received 90 (an ACK) which is good. So now you need to send the Select Image command to select the correct image that you saved into image memory.

    On p. 53 of the MSP-GANG user's guide you'll see a table that shows the data frame structure for each command. You should also see the detailed description of the Select Image Command on p. 58. You'll see that the Select Image Command format is:

    Tx -> 3E 50 4 4 A1 0 0 0 CKL CKH

    Rx -> 90 (ACK)

    Where A1 should be changed to the # corresponding to which image you want to select (0-15), and CKL and CKH correspond to the command checksum. The checksum calculation is explained on p. 54. In my case, the image I wanted was the very first one in the image memory, so I would send A1 = 0:  3E 50 04 04 00 00 00 00 C5 AB

    You should receive a 90 as an ACK if everything is correct.

    Now just do the same thing for the other commands: Main Process (see section 3.5.3.2), to which you should receive a B0 "in progress" response, and then finally send the Get Progress Status command (see section 3.5.2.10) which should give you back a bunch of information about the result of the programming, any errors that occurred, etc. You should keep sending GetProgressStatus until it returns a 90 (ACK) in byte 6 - see the user's guide for more details.

    I hope this helps!

    Regards,

    Katie

  • I made some progress.  I can set the image and run the main process.  How do I verify each programming slot passed programming?  I see there is an 0xA5 command which returns

    80a55010b09030011100000000000630100000965726173696e672d496e666f0000 - in process
    80a56020b09030011100000000000630100000c65726173696e672d4d61696e0000 - complete

    it is unclear which byte indicates what slot programmed/verified correctly.  Currently I am only connected to slot 1

     

  • Hi Jonathan,

    I don't think that second line you posted was complete yet. It's a little hard to read with all the bytes together, but the "b0 90" I think is from the bytes for Status and then Ack (see byte 6 and 7 on p. 57). The 90 is the Ack, but the b0 is actually the byte for the current status. b0 = in progress. You should see this change to a 90 after you poll the command a few times, so you'll see a "9090" in there.

    Once the command returns with this complete status, you can look at the masks in bytes 10-17 which will tell you which targets completed which stages of the programming process. For example, byte 15 is the "Programmed gang mask". Each bit of the byte corresponds to the targets 1-8 connected to the MSP-GANG. If you only have a target on socket 1, you'll expect this byte to contain 0x01 on successful programming. If you had all 8 targets connected and saw 0xF7 in there for example, you'd know that the 4th target didn't program correctly.

    Further, a good byte to check first is byte 24 "error number" - this will be 0 if there's no errors and will contain a number if there was some problem with the programming. You can then see the list of errors on p. 41 to see all of the different possible error codes you might see from the MSP-GANG.

    I hope this helps make things clearer..

    Regards,

    Katie

    .

  • I'm almost there. I am receiving error code 63 but the programming process appears to be working. Any suggestions?

  • Hi Jonathan,

    It looks like on p. 41 of the MSP-GANG user's guide, error 63 is "target not open". Did you previously program your part and blow the fuse maybe? I'm not sure what settings you used when you made your image so it's a little hard to know.

    -Katie

**Attention** This is a public forum