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.

MSP430F5239: I2C custom BSL for MSP430F5239

Part Number: MSP430F5239
Other Parts Discussed in Thread: USB2ANY, MSP430F5229, MSP-FET

Hi,

Introduction:

I am using MSP430F5239 and my system requires an I2C BSL for upgrading the firmware in the field. We figured out that the default BSL in this device is timer based UART and we would need to flash a custom BSL before shipping it to our customers.

Progress so far:

To create a custom BSL, we planned to use,  "MSP430BSL_1_01_00_01" provided as a reference.( CCS_v7_MSP430F522x_I2C project to be more specific.)

We figured out that "Lite FET-Pro430" was the best software to load BSL. Before starting to change the BSL project for our MSP430 device, we decided to give a shot with the default build provided with CCS_v7_MSP430F522x_I2C. To confirm if BSL was loaded correctly and is running, we sent I2C some write commands with slave address 0x48, and we saw MSP430 respond. So, we are pretty sure that we have got the BSL loaded correctly. 

Is there any better suggestions that you recommend us to follow in the above steps?

Main problem:

Our next step was to load our final application binary using BSL. we came across command lime mode of BSL scripter for PC based loading, using FET Programmer.

BSL-Scripter.exe -n 5xx -i [COM26,I2C,100000] -b -w RTOSDemo.txt -v -z [SET_PC,0x4400]

We were getting an error stating, "The communication protocol chosen is not available for the chosen Family!". So we decided to look for alternate methods and came across "SimpleLink Host for MSP430 UART BSL". (Embedded programming solutions for BSL). We found host implementations only for UART and not for I2C.

Please let us know how can we proceed further. Also please share if there are any other host firmware implemented using I2C with MSP430F5229(the one used in USB2ANY)

Thanks in advance

  • Hello Raja,

    What is the HW connection between the MSP and your PC? Is it an MSP-FET or MSPBSL-ROCKET?

    Let's continue below to help figure out your BSL communication issue, but I do want to point out is an easier way to get both your application and BSL image onto the device. I would recommend compiling both your BSL and your application images separately, then manually combining the binary image (the .txt file). This should work and is easy to do for most situations as the BSL and application areas do not overlap. Then you can program the combined image onto your device at the same time. This should save you programming time and steps while in production.

    To help with the BSLScritper usage, I would recommend placing your commands into a script file and run the script via the command line. This way you get a printout of every step the BSLScripter tries. You can also turn on VERBOSE on the script to get extra debug information. You can then take screenshots or copy the text here so we can debug.
  • Hi Jace,

    Thanks for your suggestion of bundling both BSL and application FW as a single .txt file.

    HW connection currently used  is MSP-FET.  But our final solution would required an embedded system to upload code via BSL (another MSP430 device - MSP430F5239). Since, we are not using the default BSL and updating it with custom BSL, we dont want both the sides (host and devices) to be untested.

    Testing the custom I2C BSL with BSL Scripter and MSP-FET would be our first step. Once the custom BSL is tested to work well, we would need to start with Host implantation to load FW via BSL.

    When testing with BSLScripter, we got the below error:

    Error: The communication protocol chosen is not available for the chosen Family!

    I feel BSL scripter only supports loading using default BSL of all families. is there a way to workaround it ?

  • Hello Raja,

    I've conferred with our Tools time and it does seem that the BSL-Scripter won't validate use of I2C protocol in regards to F5xx devices. This has been added as a feature request for future release. In the meantime, you can use the FRxx designator in your script as these devices do validate the I2C protocol and they use the same protocol and invoke sequence as the F5xx devices.
  • I followed the suggestion that you had mentioned and below is the error i got.

    "unknown ack value"

    lnk_msp430f5229_bsl.txt
    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) 2017, 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. */
    /* ============================================================================ */
    /******************************************************************************/
    /* lnk_msp430f5229.cmd - LINKER COMMAND FILE FOR LINKING MSP430F5229 PROGRAMS */
    /* */
    /* Usage: lnk430 <obj files...> -o <out file> -m <map file> lnk.cmd */
    /* cl430 <src files...> -z -o <out file> -m <map file> lnk.cmd */
    /* */
    /*----------------------------------------------------------------------------*/
    /* These linker options are for command line linking only. For IDE linking, */
    /* you should set your linker options in Project Properties */
    /* -c LINK USING C CONVENTIONS */
    /* -stack 0x0100 SOFTWARE STACK SIZE */
    /* -heap 0x0100 HEAP AREA SIZE */
    /* */
    /*----------------------------------------------------------------------------*/
    /* Version: 1.204 */
    /*----------------------------------------------------------------------------*/
    /****************************************************************************/
    /* Specify the system memory map */
    /****************************************************************************/
    MEMORY
    {
    SFR : origin = 0x0000, length = 0x0010
    PERIPHERALS_8BIT : origin = 0x0010, length = 0x00F0
    PERIPHERALS_16BIT : origin = 0x0100, length = 0x0100
    RAM : origin = 0x2400, length = 0x2000
    INFOA : origin = 0x1980, length = 0x0080
    INFOB : origin = 0x1900, length = 0x0080
    INFOC : origin = 0x1880, length = 0x0080
    INFOD : origin = 0x1800, length = 0x0080
    ZAREA : origin = 0x1000, length = 0x0010
    BSL430_VERSION_VENDOR : origin = 0x1010, length = 0x0001
    BSL430_VERSION_CI : origin = 0x1011, length = 0x0001
    BSL430_VERSION_API : origin = 0x1012, length = 0x0001
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    I am also attaching the attaching the BSL binary file, Password file used and the .cmd used for building custom BSL.

    Note: I am using the same cmd file provided for MSP430F5229 to create the binary for MSP430F5239 as well.

    MSP430F522x_I2C.txt
    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
    @1010
    00 08 08 94
    @1042
    81 00 00 44 B0 13 8C 44 0C 93 02 24 B0 13 F0 16
    0C 43 B0 13 24 13 1C 43 B0 13 98 44 32 D0 10 00
    FD 3F 03 43 F1 03 1F 43 00 18 5F 52 10 26 2E 00
    10 26 5C 4E 03 00 0D 43 B0 13 1C 44 2E 00 10 26
    5E 4E 02 00 0C DE B0 13 1C 44 6E 4F 0C DE 2B 00
    10 26 6E 4B 3E 80 10 00 3E 90 0C 00 85 2C 5E 06
    4E 0E 4E 0D 00 18 50 4E AC 10 DC 11 00 00 8A 11
    00 00 54 11 00 00 3A 11 00 00 AA 11 00 00 D4 11
    00 00 00 11 00 00 DC 10 00 00 CA 11 00 00 BA 11
    00 00 AA 11 00 00 B6 11 00 00 B2 90 A5 A5 1A 26
    3C 20 0F 18 4D 5D 00 18 4D DC 4D 13 0C 43 B0 13
    EE 11 CF 4C 01 00 2C 43 B0 13 44 16 75 3C B0 13
    FE 11 CF 01 B0 13 9C 16 2C 92 11 24 B0 13 0E 12
    FF 40 3A 00 00 00 B0 13 0E 12 EF 41 01 00 B0 13
    0E 12 DF 41 01 00 02 00 3C 40 03 00 E5 3F B0 13
    EE 11 EF 42 01 00 DF 3F B2 90 A5 A5 1A 26 0D 20
    3F 40 10 00 1F F2 44 01 1F 52 1C 26 3F 50 40 00
    18 3C B2 90 A5 A5 1A 26 02 24 2C 42 C8 3F 92 42
    1C 26 44 01 2F 43 1F 52 1C 26 82 4F 40 01 0F 18
    4D 5D 00 18 4D DC CD 43 00 00 3F 40 10 00 1F 52
    1C 26 82 4F 44 01 B2 3F CC 0F B0 13 8A 17 4C 93
    05 20 B0 13 EE 11 CF 43 01 00 AD 3F B0 13 EE 11
    FF 40 05 00 01 00 A7 3F B0 13 EE 11 FF 40 07 00
    01 00 A1 3F 5F 43 12 3C 8F 00 10 10 0C 4F 0F 19
    4F 10 0D 4F 2E 42 02 3C B0 13 FE 11 B0 13 D8 14
    0B 3C B0 13 3E 44 4C 4C 8A 3F 4F 43 2E 42 00 18
    5E 52 10 26 B0 13 D0 15 E1 03 10 01 B0 13 0E 12
    FF 40 3B 00 00 00 B0 13 0E 12 10 01 5F 4B 04 00
    5E 4B 05 00 47 18 0E 5E 0E DF 10 01 2F 00 14 26
    10 01 5F 42 0E 26 F2 40 55 00 0F 26 F2 40 55 00
    00 24 B0 13 1A 13 82 93 22 26 0E 20 7F 90 80 00
    6B 24 F2 40 51 00 0F 26 F2 40 51 00 00 24 E2 43
    1E 26 B0 13 1A 13 10 01 92 93 22 26 5A 24 A2 93
    22 26 3A 24 1E 42 22 26 1E 82 18 26 3E 90 03 00
    2F 24 2E 92 26 20 4F 4F 47 18 0F 5F 82 DF 20 26
    1D 42 20 26 B2 43 54 01 82 93 18 26 09 24 8E 00
    0A 25 0F 43 F2 4E 52 01 1F 53 1F 92 18 26 FA 2B
    82 9D 54 01 07 24 F2 40 52 00 0F 26 F2 40 52 00
    00 24 CD 3F C2 43 0F 26 C2 43 00 24 D2 43 1E 26
    C8 3F 1E 42 22 26 3E 80 03 00 CE 4F 0A 25 24 3C
    4F 4F 82 4F 20 26 20 3C 4F 4F 47 18 0F 5F 82 DF
    18 26 82 93 18 26 08 20 F2 40 53 00 0F 26 F2 40
    53 00 00 24 B0 13 10 13 B2 90 05 01 18 26 0C 28
    F2 40 54 00 0F 26 F2 40 54 00 00 24 B0 13 10 13
    03 3C 4F 4F 82 4F 18 26 92 53 22 26 10 01 B0 13
    1A 13 E2 43 1E 26 10 01 92 43 24 26 82 43 26 26
    10 01 0F 41 3F 80 00 24 0E 4F CF 0E AF 00 FE 23
    8F 43 00 00 FF 03 FE 03 0E 93 FA 23 82 43 1A 26
    B2 40 00 A5 1C 26 F2 40 A5 00 21 01 92 C3 30 01
    C2 43 21 01 00 18 F2 40 0A 25 10 26 00 18 F2 40
    04 24 14 26 82 43 22 26 B2 40 33 02 68 01 82 43
    60 01 B2 40 40 00 62 01 82 43 6A 01 B2 40 3C 20
    64 01 F2 D0 06 00 2B 02 D2 D3 20 06 F2 40 07 00
    21 06 B2 40 48 00 30 06 D2 C3 20 06 F2 D0 0F 00
    3C 06 C2 43 1E 26 1F 42 3E 06 3F 80 06 00 1C 24
    2F 82 14 24 2F 83 1C 20 92 92 24 26 26 26 06 28
    82 43 24 26 F2 40 55 00 2E 06 12 3C 1F 42 26 26
    D2 4F 00 24 2E 06 92 53 26 26 0A 3C D2 42 2C 06
    0E 26 B0 13 14 12 04 3C 82 43 26 26 82 43 22 26
    C2 93 1E 26 D8 27 5F 42 1E 26 1F B3 D2 27 B0 13
    66 10 CF 3F 03 43 6A 14 CB 0C 1F 42 18 26 2F 82
    C9 0F 0A 43 09 5B 0A 6D C7 0B C6 0D C8 07 CC 06
    08 5F 0C 63 06 9C 05 28 02 20 07 98 02 28 0C 43
    50 3C 18 43 08 FB 08 93 26 20 C5 07 CC 06 05 8F
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    1325.pass32_default.txt
    Fullscreen
    1
    2
    3
    4
    @FFE0
    5E 10 5E 10 5E 10 FF FF 5E 10 5E 10 5E 10 5E 10
    5E 10 5E 10 5E 10 5E 10 5E 10 5E 10 5E 10 42 10
    q
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Raja,

    After your mode command, can you add the VERBOSE command as well?

    One thing that i think might be happening. By using the default password file, you are assuming the device has been gone through a mass erase. So the steps above are actually mass erasing the device as the "default" password supplied is a wrong password. (you sometimes get ab Unknown ACK value error when mass erasing.) the BSL is still locked at this point, so the RX_DATA_BLOCK command will not work. Try repeating the RX_Password command so that you give it a wrong, then default password to unlock the device.

    As an extra precaution, don't use the 400kHz for I2C at this time and step down to 100kHz until you get good communication. Also take a look at the I2C lines with an O-scope and logic analyzer to make sure that communication is solid. What pullup resistors are you using for I2C?
  • Hi Jace,
    You were correct. There was a mass erase that was happening.

    But I figured out the BSL example code supplied was using the main memory location as well (in addition to BSL space). So a mass erase was causing the BSL to malfunction. I was able to reduce the size of BSL by removing few features and able to fit BSL within the 2KB BSL space. I am able to load the my application firmware now.

    Thanks for your prompt support.

**Attention** This is a public forum