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.

TM4C129XL w/ Linux UART on boot problems

Other Parts Discussed in Thread: ENERGIA

Hi all,

I'm having a very specific issue using the TM4C129XL with an embedded Linux system. I have set the board to transmit data on UART0 (Serial.print in energia.) This works fine if the board is powered on or plugged in AFTER the Linux system has booted up. But, if the linux system is powered up with this dev board plugged in, no data is received on ttyACM0 until the dev board is power cycled. I replicated this issue on my laptop as well.

I have tried other UART devices (arduino) and they do not have this issue with the same system and kernel modules. Does anyone have some insight as to what is going on? I need this board to be able to start and function with no user intervention. I could use some a relay to ensure the board powers on after the linux system but would prefer a software fix!


Thanks!

  • I don't have any experience with energia, but I think it is less relevant here.

    IMHO the problem is the other side, the PC. I know of other PCs (e.g. one I personally own ) which does not boot up with non-bootable USB media plugged in at power-up. And this does not relate to Linux, as Windows neither starts up.

    My suggestion would be to generally disable USB as boot medium in the BIOS.

  • Hello Daniel,

    Can you check to see if the Linux device has properly mounted the com channel from the TM4C129x when it is plugged in at power up? Perhaps there is something blocking the virtual com port device driver or it isn't recognized at startup when it is plugged in. Another thought is to try a board reset instead of a power cycle to see if it also clears the issue (not as a solution but as debug). This would tell you if perhaps there is an issue with glitching or random state changes at the com port during power cycling.
  • Can you check to see if the Linux device has properly mounted the com channel from the TM4C129x when it is plugged in at power up?

    If I understood the OP correctly, the underlying assumption is incorrect. At the time of startup, there is no OS (i.e. no Linux) running yet. The BIOS code scans all (possible) boot devices in given order for boot blocks and bootable operating systems. IMHO the issue is in the USB driver of the BIOS.

  • com port mounts at /dev/ttyACM0. I can echo characters to the MCU but receive nothing. Tried software reset of the MCU and that fixes things only if MCU baud rate is at 9600. Unloading and reloading the kernal module doesn't fix it either. Seems like only a power cycle of the MCU works...

  • Would this be the case for any UART device? An arduino work fine in the same situation....
  • Hello Daniel,

    Can you explain what you mean by you can "echo data on the MCU?"

    My understanding of the issue is/was you cannot receive or transmit data from/to the TM4C when the Linux system is power cycled with the TM4C board connected. is this correct? 

    Perhaps it would be good to clarify what is working and what is not.

    Linux System Rx from TM4C Yes/No?

    Linux System Tx to TM4C yes/no?

    Linux system to other MCU boards yes. Correct?

    The one variable that I am having an issue with is the energia drivers. These are not ones that I am familiar with so if this is an energia drivers issue, perhaps it would be best answered in the energia forums. However, if it is a HW issue with TM4C this is the correct forum for those types of issues.

    By chance, could you make use of the echo example provided in the TivaWare examples to check if it also has similar issues. i.e., when this program is running, any character received should be returned via Tx of the TM4C. You should be able to set this and validate the SW is working with a PC before trying it with your Linux system.

  • Daniel,

    Some additional points to check based on a conversation with an associate about your issue:

    1.) Have you tried this same process with a windows based PC to see if you see similar issues? - This is just as a level set to see that there are no issues with the TM4C board.

    2.) Have you confirmed that you are seeing matching baud rates when the Linux device boots up? - This is to make sure initialization is happening as you expect it to be. If, as f.m. states, there is an issue with the BIOS trying to boot from the USB port, it could cause the Linux device to hang.

    3.) Have you monitored Tx and Rx signals between the two boards during the power cycle and once powered and attempting to communicate? - This should show if there are extraneous signals/glitches/noise on the line when you go through the power cycle with the Linux device. If there is glitching on these pins it might be possible that you are seeing a latch up or something similar on the pins. This is especially true if the signals are being driven outside of the spec limits.
  • Linux System Rx from TM4C Yes/No?

    No

    Linux System Tx to TM4C yes/no?

    Yes

    Linux system to other MCU boards yes. Correct?

    Yes

    1.) Have you tried this same process with a windows based PC to see if you see similar issues? - This is just as a level set to see that there are no issues with the TM4C board.

    I'll try this

    2.) Have you confirmed that you are seeing matching baud rates when the Linux device boots up? - This is to make sure initialization is happening as you expect it to be. If, as f.m. states, there is an issue with the BIOS trying to boot from the USB port, it could cause the Linux device to hang.


    Linux device boots fine and has correct baud rate set for the com port

    3.) Have you monitored Tx and Rx signals between the two boards during the power cycle and once powered and attempting to communicate? - This should show if there are extraneous signals/glitches/noise on the line when you go through the power cycle with the Linux device. If there is glitching on these pins it might be possible that you are seeing a latch up or something similar on the pins. This is especially true if the signals are being driven outside of the spec limits.


    I'll try this as well.

     

    Thanks!

  • Would this be the case for any UART device? An arduino work fine in the same situation....

    That issue is a combination of a bug (or bugs) in the PC BIOS and the behavior of the connected USB device. The USB device is the symptom, triggering the incorrect behavior. Some devices (like your Arduino) may not.

    In a correct PC BIOS, no USB device which does:

    • not have the mass storage profile implemented
    • has the mass storage profile implemented, but does not contain a valid boot block

    will ever trigger such incorrect behavior as you observed.

    Turn off boot from USB, or you will not really get rid of this problem. Or update the PC BIOS ...