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.

MSP430F5529: python-msp430-tools BSL Error

Part Number: MSP430F5529

Hi Gary, apologies for the delayed response. Covid has affected all our development. Hope you are well and safe.

We have tried "python -m msp430.bsl5.uart -eErw ClubMasterV4_8.txt" but get the same Protocol Error. The issue is strange because it only occur when we invoke the BSL in the firmware - see my original definition of the error:-

"The error only occurs in Linux command line and only if the BSL is invoked by software. We are able to flash the device successfully if we invoke the BSL with hardware (pulling up the PUR pin on power-up) using command line in Linux. We are also able to flash the device using the Python_Firmware_UpgraderGUI in Windows for both a software or a hardware invocation of the BSL."

Kind Regards

Warren

  • Hi Warren

    I have try use the bsl5 in win10 but failed due to can't find the folder pywinusb. Have you try it in the win10 before? 

    This is the error I get

    I am seek the help from other people now.

    By the way, you can also try the BSL Scripter to use the command line to download a image by the USB

    More information http://www.ti.com/lit/ug/slau655g/slau655g.pdf?&ts=1589187669687 

  • Thanks for the response Gary

    1. I tried using bsl5 on Windows10pro some time ago, but also could not get it to work. I will try this again.
    2. Thanks for the link on the BSL Scripter - I will review this and see if this is an alternative solution.
  • Good Afternoon Gary

    I managed to flash a device using Python masp430.bsl5 in command line. I had to copy Python_Firmware_Upgrader files (see below files) to the Python directory to work - would not work by just adding Python directory to the path even after restarting my machine.

    Also, I had to download Python-2.7.18. Could not get it to work on the latest Python-3.8. Please see successful programming below:-

    Programming in Linux still remains an issue.

  • Hi Warren

    I have successfully download the image with WIN10 with the command similar with yours. 

    For your problem that just the software invoke BSL not work problem. 

    Does the image you download with software invoke code include the USB function?

    Best regards

    Gary

  • Hi Warren

    Any update from your side?

    Can you share me your software invoke project ?

    I have create a software invoke project and test on my win10 PC and works well with bsl5. You can try it with your Linux PC

    0245.msp430fr599x_ta0_01.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--,BSD_EX
    * Copyright (c) 2015, Texas Instruments Incorporated
    * All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
    *
    * * Redistributions of source code must retain the above copyright
    * notice, this list of conditions and the following disclaimer.
    *
    * * Redistributions in binary form must reproduce the above copyright
    * notice, this list of conditions and the following disclaimer in the
    * documentation and/or other materials provided with the distribution.
    *
    * * Neither the name of Texas Instruments Incorporated nor the names of
    * its contributors may be used to endorse or promote products derived
    * from this software without specific prior written permission.
    *
    * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 THE COPYRIGHT OWNER OR
    * CONTRIBUTORS 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.
    *
    *******************************************************************************
    *
    * MSP430 CODE EXAMPLE DISCLAIMER
    *
    * MSP430 code examples are self-contained low-level programs that typically
    * demonstrate a single peripheral function or device feature in a highly
    * concise manner. For this the code may rely on the device's power-on default
    * register values and settings such as the clock configuration and care must
    * be taken when combining code from several examples to avoid potential side
    * effects. Also see www.ti.com/grace for a GUI- and www.ti.com/msp430ware
    * for an API functional library-approach to peripheral configuration.
    *
    * --/COPYRIGHT--*/
    //******************************************************************************
    // MSP430FR5x9x Demo - Timer0_A3, Toggle P1.0, CCR0 Cont Mode ISR, DCO SMCLK
    //
    // Description: Toggle P1.0 using software and TA_0 ISR. Timer0_A is
    // configured for continuous mode, thus the timer overflows when TAR counts
    // to CCR0. In this example, CCR0 is loaded with 50000.
    // ACLK = n/a, MCLK = SMCLK = TACLK = default DCO = ~1MHz
    //
    // MSP430FR5994
    // ---------------
    // /|\| |
    // | | |
    // --|RST |
    // | |
    // | P1.0|-->LED
    //
    // William Goh
    // Texas Instruments Inc.
    // October 2015
    // Built with IAR Embedded Workbench V6.30 & Code Composer Studio V6.1
    //******************************************************************************
    #include <msp430.h>
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    This is the image file 

    MSP430F5529_Software_BSL_USB.txt
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    @4400
    4F 14 F2 F0 EF 00 1C 02 32 C2 03 43 3F 40 00 10
    4F 13 4B 16 00 13 81 00 00 44 B1 13 6E 00 0C 43
    B1 13 00 00 1C 43 B1 13 68 00 32 D0 10 00 FD 3F
    03 43 D2 E3 02 02 00 13
    @ffd2
    2A 44 2A 44 2A 44 2A 44 2A 44 2A 44 00 44 2A 44
    2A 44 2A 44 2A 44 2A 44 32 44 2A 44 2A 44 2A 44
    2A 44 2A 44 2A 44 2A 44 2A 44 2A 44 16 44 B2 40
    80 5A 5C 01 D2 D3 04 02 D2 C3 02 02 0D 14 3D 40
    2E 82 1D 83 FE 23 0D 16 00 3C 0D 14 3D 40 2E 82
    1D 83 FE 23 0D 16 00 3C F2 D0 10 00 06 02 F2 D0
    10 00 02 02 F2 D0 10 00 18 02 F2 F0 EF 00 1C 02
    F2 D0 10 00 1A 02 B2 40 10 00 42 03 B2 40 50 C3
    52 03 B2 40 14 02 40 03 03 43 32 D0 18 00 03 43
    03 43 0C 43 10 01 03 43 FF 3F 03 43 1C 43 10 01
    q
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Hi Gary


    We unfortunately have not managed to get this to work in Linux yet, but I have managed to get it working in Windows10 - works fine. Please see firmware running on the MSP430 below to invoke the firmware update - I have left this in context, but only the last two lines of code are applicable.

    case(FLASHUPDATE):
                    if (cmState==ACTIVE){
                    FlashUpdateResponse[5] = FLASHUP_ACTIVE;
                    crc = 0x37+Ver+FLASHUP_ACTIVE;
                    FlashUpdateResponse[10] = crc;
                    cdcSendDataInBackground(FlashUpdateResponse, 11, CDC0_INTFNUM, 1000);
                    S1_LED_ON;
                    S2_LED_ON;
                    SPRAY1_OFF;
                    SPRAY2_OFF;
                    Delay_ms(500);
                    _disable_interrupt();  // disable interrupts globally
                    ((void (*)())0x1000)();
                    }
                break;

    I am not sure I understand your firmware - there is no invocation of the BSL in the code that I can see. Am I missing something?

    Kind Regards

    Warren

  • Hi Warren

    Sorry attached the wrong code there please try this one

    MSP430F55xx_ta0_02.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--,BSD_EX
    * Copyright (c) 2012, Texas Instruments Incorporated
    * All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
    *
    * * Redistributions of source code must retain the above copyright
    * notice, this list of conditions and the following disclaimer.
    *
    * * Redistributions in binary form must reproduce the above copyright
    * notice, this list of conditions and the following disclaimer in the
    * documentation and/or other materials provided with the distribution.
    *
    * * Neither the name of Texas Instruments Incorporated nor the names of
    * its contributors may be used to endorse or promote products derived
    * from this software without specific prior written permission.
    *
    * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 THE COPYRIGHT OWNER OR
    * CONTRIBUTORS 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.
    *
    *******************************************************************************
    *
    * MSP430 CODE EXAMPLE DISCLAIMER
    *
    * MSP430 code examples are self-contained low-level programs that typically
    * demonstrate a single peripheral function or device feature in a highly
    * concise manner. For this the code may rely on the device's power-on default
    * register values and settings such as the clock configuration and care must
    * be taken when combining code from several examples to avoid potential side
    * effects. Also see www.ti.com/grace for a GUI- and www.ti.com/msp430ware
    * for an API functional library-approach to peripheral configuration.
    *
    * --/COPYRIGHT--*/
    //******************************************************************************
    // MSP430F552x Demo - Timer0_A5, Toggle P1.0, CCR0 Up Mode ISR, DCO SMCLK
    //
    // Description: Toggle P1.0 using software and TA_1 ISR. Timer1_A is
    // configured for up mode, thus the timer overflows when TAR counts
    // to CCR0. In this example, CCR0 is loaded with 50000.
    // ACLK = n/a, MCLK = SMCLK = TACLK = default DCO ~1.045MHz
    //
    // MSP430F552x
    // ---------------
    // /|\| |
    // | | |
    // --|RST |
    // | |
    // | P1.0|-->LED
    //
    // Bhargavi Nisarga
    // Texas Instruments Inc.
    // April 2009
    // Built with CCSv4 and IAR Embedded Workbench Version: 4.21
    //******************************************************************************
    #include <msp430.h>
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    By the way, what's the Linux version do you use?

    Gary

**Attention** This is a public forum