Skip to content

nrf pca10056 - control C will not break out of loop #1021

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jerryneedell opened this issue Jul 13, 2018 · 14 comments
Closed

nrf pca10056 - control C will not break out of loop #1021

jerryneedell opened this issue Jul 13, 2018 · 14 comments
Assignees
Milestone

Comments

@jerryneedell
Copy link
Collaborator

jerryneedell commented Jul 13, 2018

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.

@arturo182
Copy link
Collaborator

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

@hathach
Copy link
Member

hathach commented Jul 13, 2018

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

@arturo182
Copy link
Collaborator

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

@jerryneedell
Copy link
Collaborator Author

I am using screen in Linux Ubuntu 16.04

@hathach
Copy link
Member

hathach commented Jul 13, 2018

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

PS: That is lots of Linux :D

@jerryneedell
Copy link
Collaborator Author

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

@hathach
Copy link
Member

hathach commented Jul 13, 2018

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

@jerryneedell
Copy link
Collaborator Author

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

@jerryneedell
Copy link
Collaborator Author

or even 4

@hathach
Copy link
Member

hathach commented Jul 13, 2018

@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.

@jerryneedell
Copy link
Collaborator Author

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

@sommersoft
Copy link

@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:
#698

Mention it as a possible place to look.

@hathach
Copy link
Member

hathach commented Jul 13, 2018

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.

@hathach
Copy link
Member

hathach commented Jul 13, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants