Page 1 of 1
[STM32F411_Nucleo] Adding libraries to firmware
Posted: Tue Jul 18, 2017 12:54 pm
by PavloP
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?
Re: [STM32F411_Nucleo] Adding libraries to firmware
Posted: Thu Jul 20, 2017 7:56 am
by pythoncoder
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.
Re: [STM32F411_Nucleo] Adding libraries to firmware
Posted: Thu Jul 20, 2017 2:46 pm
by PavloP
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
Posted: Thu Jul 20, 2017 4:36 pm
by dhylands
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
Re: [STM32F411_Nucleo] Adding libraries to firmware
Posted: Tue Jan 02, 2018 9:36 am
by nikhiledutech
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.
edutech@edutech-desktop:~/nikhil/upython_stm/micropython/syn$ micropython -m upip install -p ~/syn micropython-uasyncio
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$ 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/
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.
So can you help me in installing uasyncio either with upip or pip utility.
Thanks

Re: [STM32F411_Nucleo] Adding libraries to firmware
Posted: Tue Jan 16, 2018 6:57 am
by swington
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.
Re: [STM32F411_Nucleo] Adding libraries to firmware
Posted: Fri Jan 19, 2018 1:14 pm
by bestazi
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
Re: [STM32F411_Nucleo] Adding libraries to firmware
Posted: Sat Jan 20, 2018 6:05 pm
by bestazi
Bump.
I need a solution to this problem
Thanks
-Bes
Re: [STM32F411_Nucleo] Adding libraries to firmware
Posted: Sun Jan 21, 2018 1:24 pm
by SpotlightKid
Which problem exactly?