timex-sinclair-projects / TS-Pico

A modern file storage system and development platform for the Timex/Sinclair 2068.
5 stars 1 forks source link

Stream messages/data to a host computer (Thonny) #13

Open factus10 opened 1 month ago

factus10 commented 1 month ago

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

rcalcagno commented 1 month ago

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

rcalcagno commented 1 month ago

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.

rcalcagno commented 1 month ago

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

factus10 commented 1 month ago

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 :)

rcalcagno commented 1 month ago

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.

factus10 commented 1 month ago

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