Is it possible, IDE with debugger for dev. of VT100 TUI code

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
Post Reply
mroussel
Posts: 7
Joined: Fri Nov 23, 2018 6:08 pm
Location: Montreal, Quebec, Canada

Is it possible, IDE with debugger for dev. of VT100 TUI code

Post by mroussel » Wed Feb 17, 2021 3:15 am

Hi all,
So this is what I am trying to do

I want to write micropython code for a target board , (I can do this)
my code will interact with user via a VT100 TUI type user interface (I can do this , yes I found the tools and modules)

the question :
The thing I can not figure out, is how (or what) IDE will allow me to develop my code.... that is , write the code send it to the target ... now the important part .... and step and trace my code as it is displaying a VT100? (all on same principal serial connection to target)

I am in the impression that most IDEs uses the "terminal/shell" to interact with target sending data and parsing the step and trace stuff coming back thus making it impossible to split this data in yet another path for the VT100

I am guessing that I should use a second serial connection on target and send this to my terminal emulator?

Some IDEs offer a plotter window (again this is parsed data from principal serial connection from target)
in same fashion do some offer the terminal window (parsed data)?

thanks

martin

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: Is it possible, IDE with debugger for dev. of VT100 TUI code

Post by jimmo » Wed Feb 17, 2021 3:39 am

mroussel wrote:
Wed Feb 17, 2021 3:15 am
The thing I can not figure out, is how (or what) IDE will allow me to develop my code.... that is , write the code send it to the target
You can use any IDE you like to develop the code, but very few have MicroPython-specific functionality.

The most actively developed one that I know of is Thonny (and the author is quite active in these forums)

I just use a regular text editor (Sublime) and then use a terminal to run tools to talk to the MicroPython board. Mainly I use pyboard.py (see http://docs.micropython.org/en/latest/r ... rd.py.html) and more recently mpr (see https://github.com/micropython/micropython/pull/6375), but also rshell (https://github.com/dhylands/rshell) is very good and popular.

For your particular scenario, MicroPython does not support a step-by-step debugger (like gdb for gcc, or pdb for CPython). It would be a truly wonderful feature, but it's just too much overhead for a "micro" runtime.

So probably your best bet is to use print() to trace your code, but in order to not mess with the VT100 interface, you should send the print output to a different serial port. MicroPython recently added support for multiple USB VCPs on STM32 (so this means you can have two shells running on the same device over one USB connection).

The other thing I would investigate is whether you can do most of your development in regular Python (and then you have access to fancy IDEs and pdb etc), and just stub out the device-specific bits while you get the rest of the program working.

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: Is it possible, IDE with debugger for dev. of VT100 TUI code

Post by dhylands » Wed Feb 17, 2021 3:43 am

There is no ability to step and trace code on the Micropython.

I'd recommend that you debug your code for generating the VT100 stuff on the PC using CPython and debugging tools for CPython. Then run your code under MicroPython. This is what I normally do for code wihch doesn't need particular hardware available on your micropython board.

When running on the board, you can open a serial port and send debug messages out the serial port while sending your VT100 codes out the USB REPL.

Post Reply