REPL not-accepting chars but does accept CNTRL-d/c

The official pyboard running MicroPython.
This is the reference design and main target board for MicroPython.
You can buy one at the store.
Target audience: Users with a pyboard.
Post Reply
jbeaulieu
Posts: 2
Joined: Sun May 08, 2016 3:47 am

REPL not-accepting chars but does accept CNTRL-d/c

Post by jbeaulieu » Sun May 08, 2016 3:59 am

I am running PyBoard 1.1 with 5/8/16 firmware (1.8.21). If I unplug the pyboard and plug it back in my program runs (blinks blue light continuously). I will press CNTRL-C to exit out and get the REPL prompt. I can work in the prompt for about 5 minutes and then it no longer accepts characters. I can however from this point press CNTRL-D and my program re-starts. I can press CNTRL-C and see it stop. However, I never get the REPL prompt back or the ability to enter normal characters. I can CNTRL-D/C all day long and restart my program.

This happens at 9600, 57600 and 115200 baud. I have uninstalled and reloaded drive a couple times. I am on Windows 7. I have tried three different terminal programs (Putty, TeraTerm, Realterm). Reproducable regardless of settings or terminal program

The blinky light program runs great :)

If I unplug the board and plug it back in I can CNTRL-C to exit the program and get the REPL >>> prompt for 5 more minutes.

Any Ideas?

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

Re: REPL not-accepting chars but does accept CNTRL-d/c

Post by dhylands » Sun May 08, 2016 7:38 pm

Can you post your program?

Your interrupt handlers are still running after you hit Control-C. You could install a handler which catches the Control-C (KeyboardInterrupt), and uninstalls the interrupt handlers before returning to the REPL.

If you do Control-C immediately followed by Control-D does it work for more than 5 minutes?

jbeaulieu
Posts: 2
Joined: Sun May 08, 2016 3:47 am

Re: REPL not-accepting chars but does accept CNTRL-d/c

Post by jbeaulieu » Sun May 08, 2016 8:04 pm

It is a pretty complex program:

import time
led=pyb.LED(4)
while True:
led.on()
time.sleep(.1)
led.off()
time.sleep(.1)

Once the chars are no longer accepted I can only do CNTRL-C/D which seem to work as expected stopping the program than reset. I never get the >>> prompt back.

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: REPL not-accepting chars but does accept CNTRL-d/c

Post by Roberthh » Fri May 13, 2016 7:54 pm

Where did you put your little program,
main.py
boot.py
or another file, which is called by one of the above? I cannot reproduce your observation.

Post Reply