Circuitpython: nrf pca10056 - control C will not break out of loop

Created on 13 Jul 2018  路  14Comments  路  Source: adafruit/circuitpython

After loading current master to pca10056 board (via MSC! ) control-C does not break out of a while True: loop

>>> while True:
...     pass
...     
...     
... 

cannot break out with control- c

Same result with a while loop in a script:

import board
import digitalio
import time

led = digitalio.DigitalInOut(board.P0_13)
led.direction = digitalio.Direction.OUTPUT

while True:
    led.value = True
    time.sleep(0.5)
    led.value = False
    time.sleep(0.5)

Blink works fine, but can't break out

Control-C does work OK at the REPL just to clear input.

bug nrf52

Most helpful comment

@jerryneedell ah I see, after the 4th CR, it is hanged there. Sorry, I am not familiar with cp at all :( . Let's me check, may be while the loop() is runing ,and the background task that handle usb transfer is not executed.

All 14 comments

Any hunches @hathach before I dive in too deep? ;)

quick check on linux with minicom does seems to work. @jerryneedell which OS and terminal you are using

Adafruit CircuitPython 3.0.0-rc.0-148-gbfe14ff-dirty on 2018-07-13; PCA10056 with nRF52840

>>> 

>>> while True:

...     pass

...     

>>> 1+1

I'm also using Linux (Mint) and minicom and it doesn't work for me either :/

I am using screen in Linux Ubuntu 16.04

I am on ubuntu 16.04 as well. Let's me test with screen

PS: That is lots of Linux :D

I tried minicom under Ubuntu 16.04 and it did not work for me. :-(

Hmm, screen works with me if I just typed the above while True: then press Ctrl +C. Thing is getting werid !!!

Though if I go into paste mode and execute, I couldn't Ctrl+C to terminate it anymore. Is it standard behavior or bug as well

  1. Ctrl +E to go into paste mode,
  2. paste your blinky loop.
  3. Then Ctrl + D to run.

PS: I also find out a bug with paste mode, where some character is missing as well. Working on the fix for that

@hathach did you enter enough "returns" to get into the While loop? I thought 3 were needed after the pass

or even 4

@jerryneedell ah I see, after the 4th CR, it is hanged there. Sorry, I am not familiar with cp at all :( . Let's me check, may be while the loop() is runing ,and the background task that handle usb transfer is not executed.

Whew! Glad we are all seeing the same thing -- thanks!

@hathach,

PS: I also find out a bug with paste mode, where some character is missing as well. Working on the fix for that

We had a similar problem in SAMD land. Here was the fix:
https://github.com/adafruit/circuitpython/pull/698

Mention it as a possible place to look.

Update: got it, the usb cdc doesn't scan and call mp_keyboard_interrupt() by now. Will try to find a way to add it in.

@sommersoft ah thanks, that will be very helpful :D

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dhalbert picture dhalbert  路  122Comments

ladyada picture ladyada  路  51Comments

No1089 picture No1089  路  31Comments

tannewt picture tannewt  路  41Comments

kattni picture kattni  路  49Comments