timex-sinclair-projects/TS-Pico

Stream messages/data to a host computer (Thonny)

Opened this issue · 6 comments

Some commands are sending the Pico into an unknown state that is perceived as lock-up.

As a means of seeing what's happening in real time on the Pico, we may want to consider streaming most data/messages to a connected host that's running Thonny, via USB.

https://forums.raspberrypi.com/viewtopic.php?t=365745

A potential cure would be adding a new line that dumps everythig being logged onto the serial port as well. Will try and let you know

I tried this "quick and dirty" method, and unfortunately it disrupts SD Card operation, mainly at boot. I will try a different approach and let you know.

Recent Beta branch commit now uses global variable log_to_serial to send all debug info to console instead of logfile.

This reminds me of a thought I had in the shower this morning: the only thing I can think of that's writing to the SD card is the log file.

What if we did the log file on the internal flash and, once it gets to a certain size, append it to the log file on the SD card? The question I don't have an answer for yet, is when that appending happens :)

The log file isn't stored in the SD card exactly for that reason. It is stored up to 64K on the Flash, and when those 64K are used up, a new file is created. So in any moment in time, we can have a current log of up to 64k, plus a past log of 64k

We could move the previous log to the SD Card, but I feel that to be somewhat overkill. Actually, as part of the initialization, we could move both logfiles to the SD card. Might take some seconds, though.

Let's discuss this. Sincerely,

Ricardo.

Ok, that's my misunderstanding. You're one step ahead of me. :)