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.

Sharing TXD/RXD pins of FT232 chip for Debugging and Programming a msp430f5438a via an USB port.

Other Parts Discussed in Thread: MSP430F5438A, LM3S811

Dear all,

I would like to debugging and programming a msp430f5438a via an USB port using FT232RL chip with the following pins configuration.

FT232RL <-> MSP430

    TXD -> BSL-RX-P1.2(pin 19)

    RXD <- BSL-TX-P1.1(pin 18)

    RTS -> TEST(pin 91)

    DTR -> RST(pin 96)

    TXD -> UART0-RX(pin 54)

    RXD <- UART0-TX(pin 53)

My question is if The USB-UART bridge can be used for two operations: programming-BSL and debugging-UART0. Then, can I share the pins TXD and RXD of FT232RL?

I do not want to run the UART-debug at the same time that the BSL programming. First, I want to program with BSL pins. After that, I want to debug the firmware with UART-pins.

But, I am not know if the firmware is running and debugging via UART, when the BSL-process starts to program the msp430, maybe can the UART-debugging interrupt the BSL process?

Otherwise, first the BSL entry sequence via RTS/DTR stops the running firmaware and also the debugging before BSL-process starts the firmware sending via BSL pins?

Best regards,

Rafa.

  • Suspect not - or at least not easily/quickly.

    FTDI has a chip specifically targeting your objective.  (used on the old Stellaris LM3S811 EVK)

    This chip enables a "single" USB connection to achieve both JTAG programming and independent UART -> USB operation. 

    (from memory - believe this is FT2232 (FTDI site surely lists/reveals)  May be possible to purchase this as a built/tested board...

  • Your scheme will work.

    When you invoke the BSL entry sequence via DTR & RTS correctly, (a) F5438A will reset, hence pins 18, 19, 53, and 54 are all digital input, (b) F5438A will run the BSL code which does set up and use pins 18 and 19, it does ignore pins 53 and 54.

    When you reset F5438A without invoking BSL entry sequence via DTR & RTS, (a) F5438A will also reset, hence pins 18, 19, 53, and 54 are all digital input, (b) F5438A will run the code pointed by the reset vector at 0xFFFE-0xFFFF. This code should set up and use either the pair 18 & 19 or the pair 53 and 54 and ignore the other pair.

    -- OCY

  • By the way, I assumed that you use the word "debug" in a general sense. To use CCS, IAR, etc. to "debug" is out of the question.

  • Have not used MSP430 in past 8+ years - but can report that the earlier mentioned "Stellaris LM3S811 EVK" did/does not permit direct JTAG nor SWD access to the MCU.  So - even having multiple "J-Links" (JTAG probe) - they are not usable - this board.  (unless one indulges in time/effort of "ugly HW hack."

    Now - via a single USB cable (PC to this EVK) - under IAR - we were/are able to both debug, program and exercise the MCU's UART.

    FTDI invested in the development of this 2 channel device (again enables single USB cable/connection to realize both debug/program and UART-USB transfer.)   And - along w/FTDI's effort - LMI team chose this 2 channel device over the less expensive single channel one. 

    My suspicion remains that this "dual channel" device is far better suited for poster's application - and being a more general solution - may see future reuse...

  • old_cow_yellow said:
    When you invoke the BSL entry sequence via DTR & RTS correctly, (a) F5438A will reset

    I would point out that in silicon revisions of MSP430F5438A affected by errata SYS10 (see SLAZ057), BSL entry via DTR/RTS is unfeasible as it is subject to specific (strict) timing requirements that the USB chain cannot guarantee.

    Regards,

    Peppe

  • Piergiuseppe Tundo said:
    I would point out that in silicon revisions of MSP430F5438A affected by errata SYS10 (see SLAZ057)[...]

    SYS10 only applies to devices up to rev.E and rev.G. In rev.F and rev.H (IIRC available since 01/2012) this has been fixed.
    So yes, on older parts, it is next to impossible to enter the BSL through an USB->ser converter. But all currently sold parts should work.

  • Earlier this year we bought tens of MSP430F5438A from DigiKey and all parts were of revision 'E'.

    Regards,

    Peppe

  • Hi Pak,

    I have used the configuration of the USB-RS232 converter, but the mspdebug 0.21 command fails with the following error:

    $ mspdebug -d /dev/ttyUSB0 --long-password flash-bsl

    flash_bsl: incorrect response header received
    flash_bsl_erase: no response
    flash_bsl_unlock: warning: erase failed
    flash_bsl: incorrect response header received
    flash_bsl_unlock: error receiving password response

    Do you know the reason of this error??

    Best regards,

    Rafa.

  • Many of your would be helpers (none here acknowledged - even briefly) may be less than "thrilled" to rise to your aid - future requests...  Seven posts rose to your aid - and met with silence...

    Back-channel response to Pak - and that private commo - provides no aid/comfort to follow-on forum readers.

    Jens' excellent sign-off guide highlights the import of "shared forum contributions" - benefitting many.  His is the true spirit of any forum - back-channel (i.e. private) is not!

  • Dear CB1,

    My intention is not to break the spirit of the forum,  I will share my contributions to the forum, when I have something to provide the readers.

    Until today, I had not the electrical circuit to test the configuration mentioned in this thread. 

    When I achieve a working circuit to program and debug the msp430f5438a, I will send the final configuration to the forum.

    Best Regards,

    Rafa.

  • Dear Rafa,

    Thank you - this is all well/good - but was unknown by those rising to your aid.  Perhaps simple - "thanks guys - working on this - later..." improves...

    As you know, "dead-end" - failure to close the loop - unwelcome in control theory - & learning forum as well...

  • Dear forum,

    I have detected a problem in the shared USB-UART converter for msp430f5438a. During the debugging via UART-pins(54,53), the PC-software can block the msp430f5438a if PC-software changes the DTR line which is connected to the RST pin of the micro, that generates the reset of the micro. Therefore, PC-software must only use the TX and RX lines to guarantee the debugging via shared USB-UART converter. 

    I am working to support the BSL programming via the shared USB-UART converter, I will inform about the progress. 

    Best regards,

    Rafa.

  • RAFAEL MARIN said:
    Therefore, PC-software must only use the TX and RX lines to guarantee the debugging via shared USB-UART converter. 

    Right. Or you put a jumper on the board that needs to be bridged for BSL operation. Or you use a special BSL cable, and the normal one won't route the additional signals, or the BSL cable has an internal bridge that enables the RST line forwarding by an external gate, or, or, or...

  • Thanks Jens-Michael, your proposal would be a good solution.

    Best regards, Rafa.

  • RAFAEL MARIN said:
    ... Therefore, PC-software must only use the TX and RX lines to guarantee the debugging via shared USB-UART converter.  ...

    When you do not want to reset the MSP, you need to hold the DTR signal in a state that does not reset your MSP. You may want to drive DTR in the other state when you do want to reset.

    The DTR signal act like a reset button for the MSP. Do not push it unintentionally.

  • Hi old_cow_yellow,

    I am agreed with you, my problem was that PC-debug application changes DTR signal. I needed to modify the application for holding the DTR line to avoid the reset of micro. 

    Best regards, Rafa.

  • Dear forum,

    I have achieved to program and debug the micro msp430f5438a using the sharing USB-UART circuit with the following configuration of FT232RL chip.

    FT232RL <-> MSP430

        TXD -> BSL-RX-P1.2(pin 19)

        RXD <- BSL-TX-P1.1(pin 18)

        RTS -> TEST(pin 91)

        DTR -> RST(pin 96)

        TXD -> UART0-RX(pin 54)

        RXD <- UART0-TX(pin 53)

    I have used the mspdebug library for programming the micro via Flash-BSL. In addition, I included a simple application for resetting via RST line and debugging via UART-pins. Here you have the command lines for each action:

    # Programming MSP430 via Flash-BSL:

    mspdebug -jd /dev/ttyUSB0 --long-password flash-bsl "prog blink-sender.ihex"

    # Debugging MSP430 via UART-port at 115200 Baud-rate:

    mspdebug -jd /dev/ttyUSB0 debug

    # Reset MSP430 via RST pin:

    mspdebug -jd /dev/ttyUSB0 reset

    Thanks very much your help and time.  :-)

    Cheers, Rafa.

**Attention** This is a public forum