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.

MSP430 FR5739 bootloader not working

Other Parts Discussed in Thread: MSP-EXP430FR5739, MSP430FR5739, MSP430F1612, MSP430G2553, MSP430G2231

Hi,

I am pretty new to using the bootloader with the MSP430. I have been trying to use the bootloader to program the MSP-EXP430FR5739 board with the BSL_Scripter. I've modified the example script to try to load on my own generated text file, but I am not able to get it working. I have read through the SLAU319 documentation, but still have several questions:

How do I enable a UART only bootstrap loader for the FR5739?
How do I determine what CRC to send?


Also, we ultimately plan on modifying the bootloader to use the pins UTXD1 and URXD1.

What modifications would I need to make to the hardware in order to make this work? - i.e. if I wanted to depopulate R6 and R7
What source code is available for this?

Thanks and regards,
Aiste

  • Aiste Guden said:

    ... I have been trying to use the bootloader to program the MSP-EXP430FR5739 board with the BSL_Scripter. ...

    Did that work?

    Aiste Guden said:

    ... I've modified the example script to try to load on my own generated text file, but I am not able to get it working. ...

    What modification did you make? Why did you modify it?

  • Unfortunately, it doesn't seem to have worked. My script is as follows:

    MODE 5xx USB
    RX_PASSWORD ff_pass.txt
    MASS_ERASE
    DELAY 1000
    RX_DATA_BLOCK MSP430FR57xx_01.txt
    SET_PC 0x8000

    And the output is:

    ------------------------------------------
    BSL Scripting application 1.06
    The local time is: 16:58 on 22.01.2013
    ------------------------------------------
    Initializing, Mode: 5xx USB: USB
    RX Password: DONE
    Mass Erase: DONE
    Waiting 1000 milliseconds DONE
    Writing MSP430FR57xx_01.txt to device: DONE
    Sending Set PC to 8000: SENT

    However, it doesn't seem to do anything. The board still runs the original software, rather than the text file I've tried to load onto it. Any idea what I may be doing wrong?

    Thanks,

    Aiste

  • Aiste,

    i think you selected the wrong mode. the BSL on MSP430FR5739 comes with UART based BSL, so you need to select 

    MODE 5xx COMYY (YY = COM PORT number).

    If you need some examples, the SLAA535A has an example script file for MSP-EXP430FR5739 development kit with the same MSP430FR5739 on board:

    http://www.ti.com/mcu/docs/litabsmultiplefilelist.tsp?sectionId=96&tabId=1502&literatureNumber=slaa535a&docCategoryId=1&familyId=342|Launchpad-Based

  • Hi Leo,

    Thanks for the reply. I've looked through the document and referred to the test scripts offered in the zip file. I used the following script:

    MODE 5xx COM8
    VERBOSE
    MASS_ERASE
    RX_PASSWORD
    RX_DATA_BLOCK BLINK_MSP430FR5739.txt
    RX_DATA_BLOCK BOR.txt

    The output was as following:

    ------------------------------------------
    BSL Scripting application 1.06
    The local time is: 10:15 on 23.01.2013
    ------------------------------------------
    Initializing, Mode: 5xx COM: COM8 DONE
    Verbose mode on
    Mass Erase:
    -------------------------------------------------
    [80] [01] [00] [15] [64] [a3] {ee}
    -------------------------------------------------
    FAIL(ee)
    RX Password:
    -------------------------------------------------
    [80] [21] [00] [11] [ff] [ff] [ff] [ff] [ff] [ff] [ff] [ff] [ff] [ff] [ff] [ff] [ff] [ff] [ff] [ff] [ff] [ff] [ff] [ff] [ff] [ff] [ff] [ff] [ff] [ff] [ff] [ff] [ff] [ff] [ff] [ff] [9e] [e6] {ee}
    -------------------------------------------------
    FAIL(ee)
    Writing BLINK_MSP430FR5739.txt to device:
    -------------------------------------------------
    [80] [f4] [00] [10] [00] [c2] [00] [00] [01] [02] [03] [04] [05] [06] [07] [08] [09] [0a] [0b] [0c] [0d] [0e] [0f] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [1a] [1b] [1c] [1d] [1e] [1f] [20] [21] [22] [23] [24] [25] [26] [27] [28] [29] [2a] [2b] [2c] [2d] [2e] [2f] [30] [31] [32] [33] [34] [35] [36] [37] [38] [39] [3a] [3b] [3c] [3d] [3e] [3f] [40] [41] [42] [43] [44] [45] [46] [47] [48] [49] [4a] [4b] [4c] [4d] [4e] [4f] [50] [51] [52] [53] [54] [55] [56] [57] [58] [59] [5a] [5b] [5c] [5d] [5e] [5f] [60] [61] [62] [63] [64] [65] [66] [67] [68] [69] [6a] [6b] [6c] [6d] [6e] [6f] [70] [71] [72] [73] [74] [75] [76] [77] [78] [79] [7a] [7b] [7c] [7d] [7e] [7f] [80] [81] [82] [83] [84] [85] [86] [87] [88] [89] [8a] [8b] [8c] [8d] [8e] [8f] [90] [91] [92] [93] [94] [95] [96] [97] [98] [99] [9a] [9b] [9c] [9d] [9e] [9f] [a0] [a1] [a2] [a3] [a4] [a5] [a6] [a7] [a8] [a9] [aa] [ab] [ac] [ad] [ae] [af] [b0] [b1] [b2] [b3] [b4] [b5] [b6] [b7] [b8] [b9] [ba] [bb] [bc] [bd] [be] [bf] [c0] [c1] [c2] [c3] [c4] [c5] [c6] [c7] [c8] [c9] [ca] [cb] [cc] [cd] [ce] [cf] [d0] [d1] [d2] [d3] [d4] [d5] [d6] [d7] [d8] [d9] [da] [db] [dc] [dd] [de] [df] [e0] [e1] [e2] [e3] [e4] [e5] [e6] [e7] [e8] [e9] [ea] [eb] [ec] [ed] [ee] [ef] [e7] [4b] {ee}
    -------------------------------------------------
    FAIL writing data block starting at c200
    Writing BOR.txt to device:
    -------------------------------------------------
    [80] [06] [00] [10] [20] [01] [00] [a5] [02] [5d] [a8] {ee}
    -------------------------------------------------
    FAIL writing data block starting at 0120


    The PDF talks about using a Launchpad MSP430 in order to interface with the BSL. Do I also need to purchase the launchpad in order to interface with the FR5739 BSL? 

    Also, it seems the password is the main issue in this script. How would I determine the correct password to load on?

    Thanks,

    Aiste

  • Aiste Guden said:
    How would I determine the correct password to load on?

    The password is part of the interrupt vector table. so the pasword depends on teh code currently loaded. If you knwo the code, you know th epassword. If you don't know the currently loaded code, you don't know the password. Great for securing the code from people who don't know it already.

    On flash based MSPs, a wrong password will mass-erase the content (and implicitely reset the pasword to 0xffffff...). At least on newer MSPs (oder ones jsut won't accept the password). A mass erase is possible without password in any case.

    However, the FR5xx chips don't have flash and therefore don't have a mass erase, so I don't know whether a wrong password or a mass erase command will simply fill the memory with 0xff or do nothing.

    But IIRC, you'll have to send a sync byte as very first action. I don't see one here.

    Aiste Guden said:
    Do I also need to purchase the launchpad in order to interface with the FR5739 BSL? 

    No. The LaunchPad is a convenient way to connect a MSP with serial BSL to a PC through USB. Almost cheaper than buying an USB/serial converter with TTL outputs. That's all. An option.

  • Jean-Michael,

    How do I send a sync byte through the BSL_Scripter? Or is there another means to do so?

    When updating firmware in the field, if we do not have access to the interrupt vector table, is there a means of initiating a mass erase with the FRAM chips?

    Thanks,

    Aiste

  • Aiste Guden said:
    How do I send a sync byte through the BSL_Scripter?

    After re-reading the docs, you actually do. It's the 0x80 that is sent before each commadn (and should be acknowledged by 0x90 before proceeding)
    So the scripter program does it for you already.

    Aiste Guden said:
    is there a means of initiating a mass erase with the FRAM chips?

    I actuall ydoN' tknow. The mass erase command is available without sending the password (as it resets the password implicitely by erasing everything, including the password). It will, however, also erase info memory and even protected info memory.
    For mass-erasingonly the main flash, the segmetn erase has to be called with address 0xa504 (no idea why this one). Of course this version requires the correct password.
    So if you store any calibration values or such in info memory, you really should know the password (that means, the installed firmware revision) of the device.

    For FRAM devices, I really don't know whether the mass erase command performs a similar action manually, as FRAM doesn't need to be erased before writing. I didn't find any information anywhere about FRAM and mass erase.

  • At this moment, I am still unable to load or erase data on the chip.

    When I try to connect in COM mode, the BSL_Scripter tells me my password fails, even though I put in the correct values of the interrupt vector table (currently, they are all 0xFFFF....). How can I go about debugging this issue?

  • Hi Aiste,

    what kind of BSL hardware interface you are using? Here are the list of some option you can use:

    http://processors.wiki.ti.com/index.php/BSL_(MSP430)#BSL_Hardware

    The hardware interface is needed to first invoke the BSL entry sequence at RST and TEST pins (see SLAU319 documentation), and also send the UART data.

  • Hi All, I thought I might step in and clear up a little confusion...

    Mass Erase:  The FRAM chips do erase their memory on an incorrect password.

    Sync Byte: The 0x80 is required for the 5/6xx devices, but do not expect an ACK back directly after it.  The ouput of your scripter is correct.

    Failure:  Your password isn't failing, the password command is (and all other commands)  From your output, I see 0xEE is being reported by the scripter.  This is what it uses when it hits a timeout.  So I suspect your script is correct, but the BSL is either not being invoked, or there is some other power/connection problem.

    Modification: The FRAM BSLs are in ROM and can not be modified.  You could use some of our existing BSL source (SLAA450) to make a BSL that runs out of FRAM, but there is still some vulnerability to failure there.

  • Hi Leo,

    At this moment, I was just trying to interface with the BSL through the standard USB connection on the board (MSP-EXP430FR5739). Is this sufficient as a hardware BSL interface, or do I need to get one of the options that are listed in the wiki?

    Thanks,

    Aiste

  • Leo Hendrawan said:
    what kind of BSL hardware interface you are using?

    THat's a good question that came in my mind too when reading about 'timeout' error.

    The application UART on EZ boards cannot be used. And when using the COM port of a FET, you're probably accessing the BSL of the MSP430F1612 that drives the FET.

    A separate serial port (or USB/serial port) is required. Or the LaunchPad and its applciaiton UART (together with the proper firmware) can act as interface and generate the required signals and forward the data from the PC.

  • Hi Aiste,

    you need an external hardware to be able to communicate with the BSL on MSP430FR5739 of the MSP-EXP430FR5739 board. The USB emulator can't invoke the BSL Entry Sequence for this purpose.

    The easiest way is to use the Launchpad (it's only $4.30) as described in the SLAA535A.

  • Hi Leo,

    I obtained an MSP-EXP430G2 Launchpad, but it seems that the processor is an msp430g2553, rather than msp430g2231. It seems that I have to change the timer register references, to account for the 2553 having multiple timers. Other than that, are the pin mappings on the board the same as referenced in slaa535a? Are there any other changes I need to make to the code in order to make it work correctly?

    Thanks,

    Aiste

  • Hi Leo,

    Thanks for the reference code. I've loaded it onto the Launchpad, and it seems to put the fr5739 into the bootloader mode, as both of the LEDs on the Launchpad are turned on. However, when I try to use the BSL_Scripter, it is unable to load firmware on to the fr5739. I've ensured that I'm connected to the correct COM port. Here's the script, followed by the output it gives me:

    MODE 5xx COM12
    RX_PASSWORD ff_pass.txt
    MASS_ERASE
    RX_DATA_BLOCK MSP430FR57xx_01.txt
    RX_DATA_BLOCK BOR.txt
    SET_PC 0xC200

    ------------------------------------------
    BSL Scripting application 1.06
    The local time is: 11:35 on 30.01.2013
    ------------------------------------------
    Initializing, Mode: 5xx COM: COM12 DONE
    RX Password: FAIL(ee)
    Mass Erase: FAIL(ee)
    Writing MSP430FR57xx_01.txt to device: FAIL writing data block starting at c200
    Writing BOR.txt to device: FAIL writing data block starting at 0120
    Sending Set PC to c200: SENT

    Can you please let me know what I may be doing wrong?

    Thanks,

    Aiste

  • "ee" as response still indicates a timeout. So the BSL is not reporting back in time for some reason.

    Apparently, the Launchpad puts the FR into BLS mode, but then the information from the PC isn't forwarded (or even received) by teh LaunchPad.

    Sure that COM12 is the right COM port?
    Are the RX/TX jumpers on the LaunchPad set properly?

  • It seems like the issue is a problem with my computer (USB drivers or otherwise). I retried the same setup on someone else's computer, and was able to successfully reprogram the FRAM board through the bootloader. 

    I'll open a new thread for that problem. Thanks for all the help!

  • I fixed the issue. For any future people who come across the problem:

    1. I deleted the file reference by the driver: C:\Windows\System32\drivers\usbser.sys

    2. Uninstalled the driver

    3. Downloaded the EZ430 / Launchpad UART driver from http://processors.wiki.ti.com/index.php/MSP_Debug_Stack, unzipped the file contents.

    4. Re-plugged the Launchpad into the USB port, select Update Driver in Device Manager, and link it to the unzipped folder. 

    5. My default port was COM12, but I changed it to a single-digit COM port. Then restart system. 

    As a note, I don't know why, but when I changed the port assignment back to COM12, the scripter stopped working. So I'm not sure why it only works with single-digit ports. I also am not completely which, if any steps besides Step 5 were actually necessary.

  • Aiste,

    glad to hear that it works now for you

    Aiste Guden said:

    As a note, I don't know why, but when I changed the port assignment back to COM12, the scripter stopped working. So I'm not sure why it only works with single-digit ports. I also am not completely which, if any steps besides Step 5 were actually necessary.

    Indeed, i forgot that this was a bug inside the BSL Scripter of SLAU319. Unfortunately since i am not the author of the document, i didn't know that it has been fixed. The BSL Scripter of SLAA535A should work with double digit COM PORT, but i think there is a problem if you want to connect to USB BSL.

**Attention** This is a public forum