Search found 28 matches

by mosi
Mon Oct 13, 2014 12:12 am
Forum: General Discussion and Questions
Topic: Controlling the micropython repl from Python with PySerial
Replies: 6
Views: 6638

Re: Controlling the micropython repl from Python with PySeri

I am trying to imlpement serial protocol form PC to pyboard as well. Here are my intermediate findings: 1) RAW REPL console is started with Ctrl+d (translate that into bytes) and finished with Ctrl+b (works like Enter in normal REPL) 2) on my mac in other embedded projects, usually \n does not cut i...
by mosi
Mon Oct 13, 2014 12:06 am
Forum: General Discussion and Questions
Topic: Good work flow methods
Replies: 10
Views: 12094

Re: Good work flow methods

Thank you for hints.

This is a question of "how to debug with breakpoints".

Minicom, screen or serial tools are not going to cut it., moreover, the REPL freezes because of a code bug, which is hard to reproduce, because random.

Does anybody debug C / micropython code with breakpoints ?
by mosi
Thu Oct 09, 2014 7:07 pm
Forum: General Discussion and Questions
Topic: Good work flow methods
Replies: 10
Views: 12094

Re: Good work flow methods

My pyboard v3 with current code causes the following: REPL "freezes" when in minicom serial terminal on mac and becomes unresponsive. It happens randomly, from 1 minute to 3 hours range. It happens in all serial console tools. The only solution is to close the serial port and re-open, sometimes hard...
by mosi
Wed Oct 08, 2014 11:17 pm
Forum: MicroPython pyboard
Topic: How to safely power off from REPL?
Replies: 1
Views: 3371

How to safely power off from REPL?

Hi, I would like to aggressively power off the board with the USER button. The plan: - pressing USR button resets the board - press&hold for 2 seconds powers off the board When a pin is activated, external IC cuts-off the main power to processor. The issue: SDcard is still plugged in and the OS comp...
by mosi
Tue Oct 07, 2014 6:22 pm
Forum: Development of MicroPython
Topic: garbage collector free memory strange?
Replies: 6
Views: 7308

Re: garbage collector free memory strange?

Does it mean the garbage collector should be active from the start? I usually check free memory with: import pyb pyb.info() However, after each REPL command, the free memory decreases, until "Out of Memory". Tried to solve this with garbage collector and it works only in manual mode: import gc # low...
by mosi
Tue Oct 07, 2014 11:28 am
Forum: Development of MicroPython
Topic: pyb.Switch() Memory Error External Interrupt
Replies: 7
Views: 8820

Re: pyb.Switch() Memory Error External Interrupt

Thank you,
great answer, I will try not to code at 3am again.

Will dig deeper into interrupt handling and callbacks.
by mosi
Tue Oct 07, 2014 12:30 am
Forum: Development of MicroPython
Topic: garbage collector free memory strange?
Replies: 6
Views: 7308

garbage collector free memory strange?

Can someone confirm this behavior, or is it just me?

Code: Select all

>>> import gc
>>> gc.enable()
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> gc.mem_free()
FATAL: uncaught exception 804b09c

FATAL ERROR:

This comes after having 260 lines of code in main.py, so maybe it is just my implementation...

Thank you.
by mosi
Tue Oct 07, 2014 12:19 am
Forum: Development of MicroPython
Topic: pyb.Switch() Memory Error External Interrupt
Replies: 7
Views: 8820

pyb.Switch() Memory Error External Interrupt

Any idea where I might start searching for an error in this code? sw = pyb.Switch() def BTN_callback(): pyb.udelay(4000) pyb.LED(1).toggle sw.callback(BTN_callback) >>> Uncaught exception in ExtInt interrupt handler line 0 MemoryError: sw.callback(lambda: does work, however, what if one wants to imp...