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 programmer: how to blow fuse programmatically

Other Parts Discussed in Thread: MSP430F2274, MSP430G2553

Hi!

I flash MSP430F2274 with MSP-GANG over sbw succesfully:

MSPGANG_API.SelectImage(0x80);

MSPGANG_API.MainProcess(1000);

Then i have to test the MCU. And if the test is ok, then i would like to blow the fuse.

How can i blow the fuse in c#?

Are there any fast alternatives that can be automated? Running bat file with MSP-Gang.exe -prj blowfuse.mspgangproj lasts 4 seconds to only open the program (blowing fuse excluded), which is too long.

Any help would be appreciated

Gorazd

  • Hi Gorazd,

    You are using C# with the MSP-GANG.dll for your main programming and testing, correct? But then you separately call a .bat file to have the MSP-GANG executable open a project file and then blow the fuse after the testing?

    I can think of a couple of different ways to blow the fuse as part of your C# program using the MSP-GANG dll that you are already using.

    Option 1.
    I think that you should be able to use the command MSPGANG_SetTmpGANG_Config(CFG_TMP_TASK_MASK, CONNECT_TASK_BIT | SECURE_TASK_BIT) , where CFG_TMP_TASK_MASK = 4, CONNECT_TASK_BIT = 0x1 and SECURE_TASK_BIT = 0x20 to mask the current image tasks to be performed to only perform the secure task. See section 4.2.36 MSPGANG_SetTmpGANG_Config and section 3.5.3.3 the section on CFG_TMP_TASK_MASK for more details. Then I think you have to call Main Process again to get the tasks to execute, but it will only connect and then secure the device this time, instead of doing all the programming.

    Option 2.
    I think you could save a 2nd MSPGANG image that just is set up for blowing the fuse, then use the APIs to select that image and execute it using main process.

    I hope that this points you in the right direction.

    Regards,
    Katie

  • gorazd kovacic said:

    Are there any fast alternatives that can be automated? Running bat file with MSP-Gang.exe -prj blowfuse.mspgangproj lasts 4 seconds to only open the program (blowing fuse excluded), which is too long.

    My flasher is up to 4 times faster than MSP-Gang and PC side is open source with direct CDC (open) interface with flasher without dll's / layers. So there is possibility for any kind of customization without introducing any delays.

    C:\msp430>flash -f test_msp430g2553.txt -e -w -v

    File: "test_msp430g2553.txt"
    Address: 0C000  Words: 8192
    Size: 16384 bytes

    Found SBW+ at COM27

    Get Device
    # JTID Fuse Device Proc
    0  89   OK   2553  0060
    1  89   OK   2955  00A0
    2  89   OK   2553  0060
    4  89   OK   F227  5040
    5  89   OK   2955  00A0
    6  89   OK   F227  80A0
    7  89   OK   2955  00A0

    Erase
    Time: 32 ms

    Write
    Time: 339 ms  Speed: 47,1 KB/s

    Verify
    Time: 87 ms  Speed: 182,6 KB/s

    Release Device

    Total Time: 515 ms

    C:\msp430>

  • Thank you Katie. This helped.

    Ill go with option 2 (with an empty .hex and memory option with update only)

    I should read the status byte right after calling MainProcess, like this, right?

    unsafe
    {
    byte[] arr_tmp = new byte[8000];

    fixed (byte *tmp = &arr_tmp[0])
    {
    status2 = MSPGANG_API.GetProgressStatus(tmp);
    Console.WriteLine("status byte: " + tmp[15].ToString());
    }
    }

  • I think you should use GetProgressStatus just like you do with your normal main process programming, to determine if everything went correctly. You can check the secure task bit in the finished tasks mask and then the secured gang mask. See http://www.ti.com/lit/pdf/slau358 p. 104 4.2.42 MSPGANG_GetProgressStatus.

    Regards,

    Katie

**Attention** This is a public forum