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.

EK-TM4C1294XL: connecting to the chip using FTDI cable (from pc USB to the chip's UART0)

Part Number: EK-TM4C1294XL
Other Parts Discussed in Thread: TM4C1294NCPDT, EK-TM4C129EXL

how can i use this cable (usb one side -> GND,VCC,TX,RX another side) to connect to the board's uart 0?

is there a way to directly connect it or do i need soldering?

Thanks.

  • just to further explain what i'm trying to achieve:
    my goal is to be able to program the TM4129 EMCPDTI3 chip directly from my pc with an FTDI cable (through UART0). at my final circuit i am going to do this from another circuit (not the PC). is it possible to achieve with the launchpad evaluation kit? do i need special soldering?

    an expected outcome to programming the chip in such way is that after i upload a program without a boot loader, i won't be able to upload again using such a connection - only from the microusb input.
  • Hello Liran,

    You say "this cable" but don't provide a part number or image, so I can't say for sure if you need to solder or not. If you have female headers on the UART side of the pins you should be able to plug them in, otherwise yes soldering is likely required.

    My understanding is you will use the UART boot loader (either via Flash boot loader or ROM boot loader) to download firmware via FTDI and then the firmware itself won't have a boot loader so it's a one time program method? If so, you should be able to achieve this with the LaunchPad, you just need to be sure the UART communication sent over properly invokes the boot loader.
  •  Thanks. the FTDI cable has one side regular USB connection and the other side 4 wires - VCC, GND, Tx and Rx - all males soldered to the launchpad board the following way:

    Vcc (Red) -> 5v

    GND (Black) -> GND

    Tx (Green) -> PA1 (pin 76)

    Rx (White)-> PA0 (pins 74)

    what i'm trying to do now is add code to the blinky program make and it send some data every few seconds over UART0. i'm using this cable and coding a client pc application to open the serial com port to read the data - just to make sure that the communication is working over UART0.

    when i'm connecting the device with the cable, the device is recognized but with an error - see attached file. is this ok (currently the uploaded design is the original blinky example)?

  • Hello Liran,

    Have you downloaded and installed the driver from Prolific's site? www.prolific.com.tw/.../ShowProduct.aspx

    USB to UART bridges generally need a driver installed to correctly enumerate.

    You also need to flip the Green and White pins. You want to connect the TX of your FTDI to the RX of the TM4C and vice versa. PA1 is the UART TX and PA0 is the UART RX, so you need to flip those connections.

    For Vcc, I would double check the datasheet or product sheet for the device to ensure it wants 5V and not 3.3V if you haven't yet verified that.

    Make those adjustments and see if you can get the expected operation going.
  • Thanks a lot! the driver + Tx/Rx cable did the trick :)
  • after installing the driver, i can see the device is ok - "prolific usb to serial". i tried executing "PL2303_CheckChipVersion_v1006.exe" which came with the driver with the correct com port and got a good response:

    what i'm trying to do now is program the chip using the flasher tool with blink bin image through UART to make sure that the process works:

    when i try "program", i get the following error:

    i tried doing this after programming the chip through regular microusb connection with boot_demo1, boot_demo2 and boot_serial examples - none of them worked.

    what  am i doing wrong here?

  • Hello Liran,

    Let's check if the issue is from the UART end or the boot loader code end. If you Flash erase the device, see if it will allow you to go into the boot loader then. By flash erasing, you will prompt the ROM boot loader to be invoked and if you can then connect to it, we know the issue is on the Flash boot loader firmware.
  • i'm not sure i got it. i did the following (from USB port):

    and after that trying to program through UART?

    Thanks.

  • Hello Liran,

    Correct. After doing that, go back to the Manual Configuration option, select the Serial UART option, and fill in the details on baud rate etc. and then see if that will connect properly.

    Also make sure the COM port is properly configured for the right baud speed via device manager.
  • well, i changed the com port to 115200 (it was 9600):

    and did the erase again with these settings:

    and i'm still getting the error:

    however, i believe the communication is ok with the cable since by running the driver test app as i did before (PL2303_CheckChipVersion_v1006.exe) produces a good response:

    what do you think?

  • in addition to the test utility, i programmed the chip with "uart_echo" example and i'm able to receive the bytes i'm sending from my windows app so, the cable seems fine - just the bootloader program isn't working.

  • Hello Liran,

    Sorry for the delay, I was out on Friday.

    I think your setup should be fine and I agree that UART communication seems to be fine. I know the bootloader as a process to get invoked so I am wondering if there is something about using the FTDI which is preventing that from occurring properly. I wouldn't think so.

    I did find a USB to UART FTDI cable from another vendor, so I can hook it onto one of my LaunchPad's and do some tests myself, so I'll plan to do that tomorrow and see what I can uncover that way.
  • Thanks! i appreciate it.

    One more change i made worth mentioning as you might come across too:
    I had a strange issue with the prolific COM port - sometimes if i disconnected/reconnected the cable or put the computer to sleep and woke it up, it was recognized with an error (an exclamation mark near the COM port in computer management).
    i did some reading, and found that this might be a non stable voltages issue, so i am now using a "USB to UART" adapter of this type:

    www.ebay.com/.../310511987503

    The drivers were taken from here:
    www.silabs.com/.../usb-to-uart-bridge-vcp-drivers

    The problem of the COM port is now solved with this and i am able to disconnect/reconnect with no issues, however all previously described problems are still the same - the "uart_echo" example is working fine, but the flasher fails with same configurations.

    I'll wait for your updates - thanks again :)
  • Hi Liran,

    Okay thanks for the info. I am actually quite familiar with Silabs USB to UART. I supported an EVM which used the CP2102. I think the cable I found will work the same way as both of yours, so hopefully that will uncover what is going on.
  • ok great. i just tried to use the console flash utility and got the same error:
    ---------------------------------
    c:\ti\TivaWare_C_Series-2.1.3.156\tools\bin>sflash.exe c:\safeshoot\blinky_slow.bin -p 0x4000 -c 7 -b 115200 -d -s 252

    Application : c:\safeshoot\blinky_slow.bin
    Program Address: 0x4000
    COM Port: \\.\COM7
    Baud Rate: 115200
    Erasing Flash:
    Failed to Send Download Command
    ---------------------------------
    i tried it after flash erase after that with "boot_demo1" and after that with "boot_demo2" - same failure with all programs.

    The source code for this utility is included so it will help me a lot with my implementations after we solve this issue.

  • Hello Liran,

    I was able to download code via boot loader with my FTDI cable. Here are the steps I have taken.

    1) Validated FTDI cable functionality by testing uart_echo
    2) Importing "boot_serial" example from TivaWare for the EK-TM4C1294XL LaunchPad which is default configured for UART0.
    3) Build and flashed "boot_serial" to LaunchPad
    4) Connect to LMFlash with Serial (UART)
    4a) Verified the setting for Baud Rate is 115200 (also ensured Device manager was confirmed for 115200 Baud)
    4b) Kept transfer size set to 60 (default) and "Disable Auto Baud Support" checked
    5) Went to program tab and browsed to an example for TM4C1294NCPDT (in this case, I imported and compiled "blinky" in CCS)
    6) Clicked Program. LMFlash downloaded the program with no issues, reporting back that Programming was Completed.
  • Hey Ralph.

    I closed all projects and reopened them, and did all the steps you described + setting the start address of the uploaded image to 0x4000 and it seems to be working fine now with the boot_serial project.

    Thanks!

  • Hi again Ralph.

    After finally getting it programmable through UART, i implemented the upload protocol in C# and tried to upload a bin file while debugging the C# side application when boot_serial is programmed into the chip.

    i'm not sure that this is the cause, but i cannot upload any more bin files using LM flasher from UART - only from USB which also means i cannot do this from my C# application.

    i uploaded the uart_echo program and it is working fine - i am able to receive back the bytes i send through UART, but then after doing the following (previous steps):
    entire flash erase
    programming the chip with "TivaWare_C_Series-2.1.3.156\examples\boards\ek-tm4c129exl\boot_serial\ccs\Debug\boot_serial.bin"
    changing configuration to manual (UART) again with same previous configuration
    trying to program "TivaWare_C_Series-2.1.3.156\examples\boards\ek-tm4c129exl\blinky\ccs\Debug\blinky.bin"
    i get the same error as before on "Program" button press.

    any idea?

    another thing i checked:

    i can see the following definition for Tx/Rx of uart in "TivaWare_C_Series-2.1.3.156\boot_loader\bl_uart.h"

        //*****************************************************************************
        //
        // This defines the UART receive pin that is being used by the boot loader.
        //
        //*****************************************************************************
        #define UART_RX                 (1 << UART_RXPIN_POS)
        #define UART_RX_PCTL            (UART_RXPIN_PCTL << (4 * UART_RXPIN_POS))

        //*****************************************************************************
        //
        // This defines the UART transmit pin that is being used by the boot loader.
        //
        //*****************************************************************************
        #define UART_TX                 (1 << UART_TXPIN_POS)
        #define UART_TX_PCTL            (UART_TXPIN_PCTL << (4 * UART_TXPIN_POS))

    is this right? does it set the PA0 and PA1 pins as Tx/Rx?

    BTW - is there a way to debug boot_serial? it doesn't have a "main" and it would be a good thing if i can BP on the UARTSend/UARTReceive calls of the bootloader.

    Thanks

  • Hello Liran,

    Regarding the question on bL_uart.h, if you look at the #define list at the top of the file you can see that the UART is mapped to UART0_BASE and Pins A0/A1, so yes that is right.

    I haven't debugged the boot loader before, so I am not sure, but as far as putting a BP on those calls you should in theory be able to do that in the bl_packet.c file. The functions SendData, FlushData, and ReceiveData are macro'd to the functions of the boot loader you are using, so for UART those functions will point to:

    #ifdef UART_ENABLE_UPDATE
    #define SendData                UARTSend
    #define FlushData               UARTFlush
    #define ReceiveData             UARTReceive
    #endif

    Regarding why the boot loader issue returned from you, I am afraid I don't have a lot of offer, as it sounds to be an issue with either your order of operations or perhaps some issue with compiling and downloading the code.

  • Hi Ralph.

    i finally found the issue why i couldn't upload through UART after flashing boot_serial.bin - i have to check "Reset MCU after program" to make it work. as i'm coming from arduino world, i didn't know that it doesn't restart at the end of the programming - this problem is finally solved.

    however - i have a few questions:

    1. when i upload the boot_demo1 by clicking on it and then -> debug, the led starts to blink, but if i disconnect the device's power cables (powering off) and then reconnect them, the led does not blink - why? isn't the program supposed to start the same way on power off/power on?

    2. sometimes projects are not becoming active when i click on them, for example - i cannot make boot_demo2 active (see picture 2 to see how i open it and 3 - as it's not becoming active after clicking it) - why is that? if i try to open only the nested boot_demo2/ccs folder it using  "open project from file system" -> it can be made active but it won't compile.

    3. i cannot make boot_serial active so i cannot debug it - see picture 1 (i've noticed it has no main.c?).

    i've created a fresh new project for the chip and implemented blinky with it to see what project changes i need to make it work and it is working fine. the next step is to add the bootloader code to this project to make it both blink and listen for programming from UART, but i need a working example which i can debug in order to understand what i need to implement in my project.

    boot_demo1 is working strange as i described in q1, but even if i try to upload a program after pressing SW1 (right after debug->start) it won't load and present the regular communication error.


    Thanks

  • Hello Liran,

    It doesn't look like your pictures loaded correctly.
  • sorry - attached now:

  • Hello Liran,

    It looks like there isn't a target_config.ccxml file associated with those projects.

    I don't import projects during the method you are picturing, instead I use the drop down menu titled "Project" and then select "Import CCS Projects..." That usually works well but every once in a while it won't select the .ccxml as an "Active" file, so you have right click it and find the "Set as Active Target Configuration" option.
  • thanks - with the import it DOES load ok.

    what about issue 1?
    ---
    1. when i upload the boot_demo1 by clicking on it and then -> debug, the led starts to blink, but if i disconnect the device's power cables (powering off) and then reconnect them, the led does not blink - why? isn't the program supposed to start the same way on power off/power on?
    ---
    the upload to the board from code composer is done through "Debug" - right? am i doing this wrong?

    i believe the expected behavior to be whenever i power off/power on, the blink should start and wait for SW1 press.
  • The behavior of debugging a project vs loading a compiled image with LM flasher seems different:

    from Code Composer studio, "blinky" is active -> pressing "Debug" and then "Resume" buttons -> result is that the led starts to blink
    power off/power on the chip - the led blinks - this is great.

    from LM flasher application:
    1. "Reset MCU after program" checked, address 0x0, configuration quick set to TM4C1294XL Launchpad, port: JTAG (uploading through USB)
    2. program the device with "c:\Users\Developer\workspace_v7\boot_serial\Debug\boot_serial.bin" (same folder used for the project)
    3. program is successful
    4. in LM flasher - change to manual configuration (UART setting)
    5. select image "c:\Users\Developer\workspace_v7\blinky\Debug\blinky.bin"
    6. program address 0x4000, "Reset MCU after program" checked
    7. "Program" button -> success.
    8. no LED is blinking

    i tried power off/on the device and still - no blinking. what can be the reason for that? is 0x4000 the right address to program it?

  • Hello Liran,

    Did you change the APP_BASE in the .cmd file for blinky to be at address 0x4000 and also adjust the code length to properly reflect the new range?

    #define APP_BASE 0x00004000
    #define RAM_BASE 0x20000000
    
    /* System memory map */
    
    MEMORY
    {
        /* Application stored in and executes from internal flash */
        FLASH (RX) : origin = APP_BASE, length = 0x000fc000
        /* Application uses internal RAM for data */
        SRAM (RWX) : origin = 0x20000000, length = 0x00040000
    }

    If not then likely what happened is CCS was overwriting your boot loader so it didn't seem to be as much of a problem but in LMFlash you weren't able to load the program properly.

    Note that the above code comes from the .cmd file of our boot_demo1 example.

  • that did it - thx! :)
  • Many here - about to call for the 'Slaughter Rule' (as thread has expanded  to 3 forum pages - 28 'back-forth') - really hope that ('that did it') proves (at last) true!

    Thread's title 'Connecting to the chip using FTDI cable'  -  bears 'LITTLE' relation (to be kind) - to the ever meandering postings - found (near) endlessly - herein...   (at minimum - as Ralph so often does - the thread should have been (properly) CHOPPED - into 'properly Subjected'  -  forum entries.

    We're glad that poster has (hopefully) succeeded - yet 'so tired' of seeing  (boring & inaccurate) 'FTDI Cable' - splash across the forum on an (almost) daily basis!

  • That's a good point, however - this entire flow is related to just one subject - making it possible for the bootloader code to be used in another project. the subject of this thread should definitely change, but i believe this is all related to just one.

    another important thing to consider is that chopping it to different threads would require explaining the entire flow from the beginning in order to make support understand what was the cause for the current issue.

    finally - i believe that the main goal of the support team is to help and solve issues for people who use your products and you don't have to track all posts - i suggest you just skip it. there will probably be more questions related in this thread.

    Thanks.
  • Liran Sorani said:
    i suggest you just skip it.

    That's a bit difficult to do - as the (errant Subject Line) proves SO LONG - that it overflows into TWO LINES!       Is it REALLY necessary - that we be (endlessly) reminded - that the FTDI cable (flows) - between PC's USB & MCU's UART?    (you CAN edit that Subject Line - reducing its impact...)

    BTW - I'm a user-specifier (yet achieve (some) notable  volume device Sales for this vendor) - and believe that any such 'multi-subject thread' borders upon the 'unsearchable' - and 'exhausts those' - who may (otherwise) benefit from SEVERAL of the POINTS WELL MADE - by both YOU - and the vendor...    

    (Slaughter Rules exist ... for GOOD REASON!)      And multiple forum users have PM'ed me - requesting some 'relief' - from this ongoing (very slight FTDI involving) thread.     (Have you considered that such repetition (signalling great difficulty/confusion) - may prove UNFAIR - thus  NOT be appreciated - by FTDI?     Should that  fact - NOT enter your consciousness?)

  • i am taking your remarks - now working with a new thread for every issue - thanks.
  • Thank you - FTDI is a long-standing client of (& supplier to) my group. 

    Our experience is that their various USB products are clearly, 'TOP CABIN!'         Thus - when their 'brand'  -  so regularly  appears (>30 postings) w/in a 'troubled forum thread' - that 'cannot be good!'    Especially when their product has been proven - by both vendor agent & poster - completely 'blameless!'

    I was asked to 'assist' (due to my long history, here) - your cooperation IS much appreciated...