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: TM4C1294 with Python

Part Number: EK-TM4C1294XL

Hello,

Is it possible to communicate with the TM4C1294 from Python?

I'm able to do the basic communication using this code:

import serial
import serial.tools.list_ports
ports = list(serial.tools.list_ports.comports())
for p in ports:
print(p)
ser = serial.Serial('COM6') # open first serial port
print (ser.portstr)

ser.write(b"hello")
ser.close()

And I get the following output:

COM6 - Stellaris Virtual Serial Port (COM6)
COM6

But, I'd like to replicate the examples from CCS, like the LED Blink code etc. It's all in C++, it works, but I'd like to use Python instead. Is that possible? Does TI have TIVA libraries in Python?

  • Gokul,
    You are talking about two different things here:
    - Communicate with TM4C1294 from a PC which is running some software written in Python: yes, it is possible - the example you added would send text bytes to a serial port, which can be connected to your Tiva board. On your Tiva MCU, you would need a program to do "something" with that text. For example, you could control the board leds to turn on or off, when receiving specific commands such as "LED1 OFF". But such program inside the Tiva MCU will be written in C (or eventually C++), and compiled specifically for such - just as the LED Blink program is done.
    - Write a program in Python and expect it to run on a Tiva MCU: no, it is not possible. What you would need is an ARM compiler for Python (such even exists), and arranged specifically for the Tiva chips. Technically not impossible, but I'll say that commercially it can't be done.
    Bruno
  • Hi Bruno,
    That makes sense. Thank you. So, using Python for this application is rules out.
    I'm trying to build a GUI based control for the TM4C1294. Do you have any recommendations for that?
  • Bruno Saraiva said:
    Technically not impossible, but I'll say that commercially it can't be done.

    You can find a Python implementation for another Cortex M4 there. But I would not call that "commercially competitive". Fine for experimenting and playing - like uCLinux on Cortex M4 ...

  • Hello Gokul,

    I would suggest something like Visual Studio for control applications. An example for the same is

    www.ti.com/.../spma074a.pdf

    where the UI source code is available along with the embedded firmware.