nrf52840 DK PCA10056 (could not enter raw REPL)

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
Post Reply
M.Ridwan
Posts: 9
Joined: Mon Aug 24, 2020 2:03 pm

nrf52840 DK PCA10056 (could not enter raw REPL)

Post by M.Ridwan » Tue Aug 25, 2020 12:53 pm

Dear Colleagues,
I want to copy the Python Script in nrf52840 DK PCA10056 by using Zephyr Port and I am using the method as given in the link http://docs.micropython.org/en/v1.12/re ... rd.py.html and I am getting the following error:

python3 pyboard.py --device /dev/ttyACM0 light.py
b'>>> \r\n>'
could not enter raw repl


Please Advise.

federico
Posts: 34
Joined: Tue Feb 07, 2017 11:34 pm

Re: nrf52840 DK PCA10056 (could not enter raw REPL)

Post by federico » Sun Aug 30, 2020 10:28 am

I don't know if the following trial will solve your problem, anyway give it an chance.

I suggest the following trial involving the substitution of your pyboard.py ( after a safety backup of the same)

Why ?
Please, read from:
https://bigl.es/microcontroller-monday-wemos-w600-pico/

pyboard.py - this version can be download from:

https://drive.google.com/file/d/1qCvD3Z ... sp=sharing


"I got an error stating that ampy could not enter a raw repl and this caused the application to exit
..................
..............
And then copied the new pyboard.py file from my Downloads directory to the ampy directory.
" etc..

federico
Posts: 34
Joined: Tue Feb 07, 2017 11:34 pm

Re: nrf52840 DK PCA10056 (could not enter raw REPL)

Post by federico » Tue Sep 01, 2020 1:43 am

This is the involved method :
def enter_raw_repl(self)

where the changes are commented
enter_raw_repl.png
def enter_raw_repl(self)
enter_raw_repl.png (162.17 KiB) Viewed 4783 times

federico
Posts: 34
Joined: Tue Feb 07, 2017 11:34 pm

Re: nrf52840 DK PCA10056 (could not enter raw REPL)

Post by federico » Tue Sep 01, 2020 9:00 pm

From the attachment 1,2,3,4,5 we have a practical demonstration about the results of interaction with an W600-PICO board, by an unchanged pyboard.py and an changed one.
The traceback says that the problem arise from the enter_raw_repl method defined in the class Pyboard ( line 192 of pyboard.py).
Attachments
4_ampy_w60x_get.PNG
get
4_ampy_w60x_get.PNG (52.06 KiB) Viewed 4762 times
3_ampy_w60x_changed_pyboard.PNG
changed pyboard.py
3_ampy_w60x_changed_pyboard.PNG (74.2 KiB) Viewed 4762 times
2_pyboard_py_changes.PNG
pyboard enter_raw_repl changes
2_pyboard_py_changes.PNG (91.6 KiB) Viewed 4762 times
1_ampy_w60x_pyboard_unchanged.PNG
result with unchanged pyboard.py
1_ampy_w60x_pyboard_unchanged.PNG (95.68 KiB) Viewed 4762 times

federico
Posts: 34
Joined: Tue Feb 07, 2017 11:34 pm

Re: nrf52840 DK PCA10056 (could not enter raw REPL)

Post by federico » Wed Sep 02, 2020 1:23 am

We have from the following address the correct syntax to copy a file to the board:

https://docs.micropython.org/en/latest/ ... rd.py.html

The cp command uses a ssh-like convention for referring to local and remote files. Any path starting with a : will be interpreted as on the device, otherwise it will be local. So:

$ pyboard.py --device /dev/ttyACM0 -f cp main.py :main.py

will copy main.py from the current directory on the PC to a file named main.py on the device. The filename can be omitted, e.g.:

$ pyboard.py --device /dev/ttyACM0 -f cp main.py :

is equivalent to the above.

Your is :
python3 pyboard.py --device /dev/ttyACM0 light.py 

federico
Posts: 34
Joined: Tue Feb 07, 2017 11:34 pm

Re: nrf52840 DK PCA10056 (could not enter raw REPL)

Post by federico » Wed Sep 02, 2020 7:56 pm

I have upgraded my pyboard.py version with the last one on github ( doesn't require the ampy support) - I newly have changed the enter_raw_repl() in the Pyboard class and simulated your requirement as from the attachment - without any problem -
pyboard_last_copy_light_py.PNG
pyboard.py last version
pyboard_last_copy_light_py.PNG (87.59 KiB) Viewed 4724 times

Post Reply