I’ve flashed other boards (e.g. Himax) previously but I’m stumbling at the gate to flash a Sony Spresense board. I’ve confirmed that the mainboard is working properly by running a select few Arduino example sketches. Unfortunately, I cannot flash the Spresense mainboard using the instructions for the board. The output in my terminal window from running the flash script is:
$ ./flash_linux.sh
Checking Python dependencies...
Checking Python dependencies OK
Flashing board...
Using device /dev/ttyUSB0
>>> Install files ...
install -b 921600
Install /home/reza/Downloads/IoT/Spresense/sony-spresense/edge_impulse_firmware.spk
|0%-----------------------------50%------------------------------100%|
Traceback (most recent call last):
File "/home/reza/Downloads/IoT/Spresense/sony-spresense/flash_writer.py", line 716, in <module>
sys.exit(main())
File "/home/reza/Downloads/IoT/Spresense/sony-spresense/flash_writer.py", line 684, in main
writer.install_files(ConfigArgs.PACKAGE_NAME, "install")
File "/home/reza/Downloads/IoT/Spresense/sony-spresense/flash_writer.py", line 592, in install_files
modem.send(bin)
File "/home/reza/Downloads/IoT/Spresense/sony-spresense/xmodem.py", line 532, in send
if isinstance(callback, collections.Callable):
AttributeError: module 'collections' has no attribute 'Callable'
$
The folder has the following files:
$ ls
edge_impulse_firmware.spk flash_mac.command flash_writer.py xmodem.py
flash_linux.sh flash_windows.bat __pycache__
$
What are the steps that I can undertake to resolve the AttributeError message? Thanks.
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ModuleNotFoundError: No module named 'encodings'
It would be helpful to know if this issue (probably Python version related) will be assigned to someone for a fix. If not, please let me know so that I can fry other fish. Understand there may other higher priority tasks that supersede the resolution of this issue for a single time constrained user. Thanks.
I just tried with my env (Python 3.7) and it worked.
Checking Python dependencies...
WARNING: You are using pip version 22.0.4; however, version 22.2.1 is available.
You should consider upgrading via the '/Users/luisomoreau/.pyenv/versions/3.7.10/bin/python3 -m pip install --upgrade pip' command.
WARNING: You are using pip version 22.0.4; however, version 22.2.1 is available.
You should consider upgrading via the '/Users/luisomoreau/.pyenv/versions/3.7.10/bin/python3 -m pip install --upgrade pip' command.
Checking Python dependencies OK
Flashing board...
Using device /dev/cu.usbserial-141120
>>> Install files ...
install -b 115200
Install /Users/luisomoreau/Downloads/sony-spresense (2)/edge_impulse_firmware.spk
|0%-----------------------------50%------------------------------100%|
######################################################################
410880 bytes loaded.
Package validation is OK.
Saving package to "nuttx"
updater# sync
updater# Restarting the board ...
reboot
Flashed your Sony Spresense development board.
To set up your development with Edge Impulse, run 'edge-impulse-daemon'
To run your impulse on your development board, run 'edge-impulse-run-impulse'
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.
Deleting expired sessions... 2 completed.
[Process completed]
Do you have a python version manager so you can try with Pyton 3.7?
From python version 3.10 the collection package removed deprecate call to collections.Callable() We’ve addressed the issue and this will be soon in production.