Page 1 of 1

Best way to write complex code STM32FDIC

Posted: Sun Aug 02, 2015 11:21 pm
by sajulios
Hi team

When writing code with micropython and debugging it, which would be the best way, from your experience , to do it?

I have read that it can be done in two ways ,write an script and then load it to they pyboard using pyboard.py or use an SD card.

But, if you do this how can you debug your programs?
Is there a way to get printf's messages on the REPL window?
How can I execute my code (in a file on my lap or on the SD card) from the REPL window so that I can view the printf debug messages?, is this possible?

Thanks

Re: Best way to write complex code STM32FDIC

Posted: Mon Aug 03, 2015 1:38 am
by dhylands
When debugging, I don't use main.py.

Instead, I copy my files to the pyboard's filesystem (these days I use rshell: https://github.com/dhylands/upy-shell/t ... ter/rshell) and then from the REPL, I do import myscript (where the file is called myscript.py). Then I get to see all of the error messages on the REPL.

pyboard.py is good for small, single-file stuff, but I use the REPL for larger stuff. Then when I'm happy, I'll add an import myscript.py to main.py.

rshell is still a bit rough around the edges, but I'll definitely be making improvements.