Hello everybody,
I'm making first steps with uPython on STM32F411 Nucleo board and I think it's simple and great. But I met one problem that I can't solve - threading, that has locked heap. For dynamic type language this is just..not right. I've found few workarounds on this forum, but I also found a bunch of libraries to implement async into micropython. All manuals for those libraries recommend to install with micropython-pip. As far as I understand this method won't work on the STM board. Could you advise me how to add custom micropython libraries(like uasyncio) to clean micropython build?
[STM32F411_Nucleo] Adding libraries to firmware
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: [STM32F411_Nucleo] Adding libraries to firmware
The way I do it is to install the library to the Unix build using upip. The library files can then be found in ~/.micropython/lib, from where they can be copied to your board.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: [STM32F411_Nucleo] Adding libraries to firmware
I don't quite understand how can I copy files to the board directly. The only way I see - as a custom module of my program. I run my code on board via pyboard tool
Re: [STM32F411_Nucleo] Adding libraries to firmware
Yeah - the stm32f411 nucleo doesn't expose the USB connector, so you typically use the REPL over UART.
You can either use a tool like rshell (https://github.com/dhylands/rshell), or you can write a python script which writes the appropriate stuff to the file system and executes that via pyboard.py (rshell uses this technique and is built on top of pyboard,py).
Note that if you do use rshell over a UART, ensure that you use --buffer-size=30
You can either use a tool like rshell (https://github.com/dhylands/rshell), or you can write a python script which writes the appropriate stuff to the file system and executes that via pyboard.py (rshell uses this technique and is built on top of pyboard,py).
Note that if you do use rshell over a UART, ensure that you use --buffer-size=30
-
- Posts: 118
- Joined: Wed Dec 27, 2017 8:52 am
Re: [STM32F411_Nucleo] Adding libraries to firmware
Whenever i followed this link https://github.com/peterhinch/micropyth ... UTORIAL.md to install uasyncio .
But in this command micropython -m upip install -p ~/syn micropython-uasyncio i get error of micropython command not found.
So can you help me in installing uasyncio either with upip or pip utility.
Thanks
But in this command micropython -m upip install -p ~/syn micropython-uasyncio i get error of micropython command not found.
I tried to install with the help of pip utility. And here is the output which i get in the terminal.edutech@edutech-desktop:~/nikhil/upython_stm/micropython/syn$ micropython -m upip install -p ~/syn micropython-uasyncio
micropython: command not found
I am currently using Ubuntu 14.04. So how to install this without error ? I tried to follow document, but their its not mentioned properly how to install it. A single command is given with creating a folder ~/sys.edutech@edutech-desktop:~/nikhil/upython_stm/micropython/syn$ pip install micropython-uasyncio
Collecting micropython-uasyncio
Downloading micropython-uasyncio-1.4.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-0W1VQO/micropython-uasyncio/setup.py", line 7, in <module>
import optimize_upip
ImportError: No module named optimize_upip
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-0W1VQO/micropython-uasyncio/
So can you help me in installing uasyncio either with upip or pip utility.
Thanks
Re: [STM32F411_Nucleo] Adding libraries to firmware
Usually when getting an error like "command not found" the first thing that you could do is make sure that the program, that you are trying to run is accessible from the system PATH variable perspective. I used to stumble upon the same problem - I compiled the micropython in some directory and I didn't add this directory path to the PATH variable. So maybe try that and share the results.
From what I understand, you cannot successfully install micropython-lib packages using pip.
From what I understand, you cannot successfully install micropython-lib packages using pip.
Re: [STM32F411_Nucleo] Adding libraries to firmware
Since you're running an executable in the current working directory, you should prefix it with ./. So for your program run it as ./a.out.
I'm right?
Thanks in advance.
-Besi
I'm right?
Thanks in advance.
-Besi
Re: [STM32F411_Nucleo] Adding libraries to firmware
Bump.
I need a solution to this problem
Thanks
-Bes
I need a solution to this problem
Thanks
-Bes
"Let us sacrifice our today so that our children can have a better tomorrow."Bestay
-
- Posts: 463
- Joined: Wed Apr 08, 2015 5:19 am
Re: [STM32F411_Nucleo] Adding libraries to firmware
Which problem exactly?