building PYBv1.1 binary double FP + threading
building PYBv1.1 binary double FP + threading
I have found the binaries for the PYBv1.1 which include threading and double floating points in the downloads section on the micropython website.
However I'm wanting to be able to build the binaries myself and am have a bit of trouble with it.
Can anyone help or provide the required Makefile/configuration etc changes required to get these features to build.
Thanks
However I'm wanting to be able to build the binaries myself and am have a bit of trouble with it.
Can anyone help or provide the required Makefile/configuration etc changes required to get these features to build.
Thanks
-
- Posts: 463
- Joined: Wed Apr 08, 2015 5:19 am
Re: building PYBv1.1 binary double FP + threading
Enabling these options is not documented in the READMEs in the repo, AFAIK. Enabling double floats should be the MICROPY_FLOAT_IMPL=double define and threads MICROPY_PY_THREAD=1.
Never tried it myself though.
Never tried it myself though.
Re: building PYBv1.1 binary double FP + threading
All options that can set set or unset are defined in py/mpconfig.h. This file also defines the default values.
-
- Posts: 463
- Joined: Wed Apr 08, 2015 5:19 am
Re: building PYBv1.1 binary double FP + threading
When I try to compile the firmware for the Pyboard V1.1 with double floats and thread module, using the command line in ports/stm32 and setting #define MICROPY_PY_THREAD (1) in py/mpconfig.h:
I get the following error:
What is the correct way to enable the thread module?
Code: Select all
LC_ALL=C make BOARD=PYBV11 MICROPY_FLOAT_IMPL=double V=1
Code: Select all
CC ../py/mpstate.c
gcc -I. -I.. -Ibuild -Wall -Werror -Wpointer-arith -Wuninitialized -std=gnu99 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -Os -fdata-sections -ffunction-sections -fno-asynchronous-unwind-tables -c -MD -o build/py/mpstate.o ../py/mpstate.c
In file included from ../py/mpstate.h:32:0,
from ../py/mpstate.c:27:
../py/mpthread.h:36:10: fatal error: mpthreadport.h: No such file or directory
#include <mpthreadport.h>
^~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [../py/mkrules.mk:47: build/py/mpstate.o] Error 1
make[1]: Leaving directory '/home/chris/work/micropython/micropython-mine/mpy-cross'
make: *** [../../py/mkrules.mk:107: ../../mpy-cross/mpy-cross] Error 2
Re: building PYBv1.1 binary double FP + threading
This isn't like merely setting a MACRO to 1.SpotlightKid wrote: ↑Thu Nov 30, 2017 3:02 pmWhen I try to compile the firmware for the Pyboard V1.1 with double floats and thread module, using the command line in ports/stm32 and setting #define MICROPY_PY_THREAD (1) in py/mpconfig.h:
I get the following error:Code: Select all
LC_ALL=C make BOARD=PYBV11 MICROPY_FLOAT_IMPL=double V=1
What is the correct way to enable the thread module?Code: Select all
CC ../py/mpstate.c gcc -I. -I.. -Ibuild -Wall -Werror -Wpointer-arith -Wuninitialized -std=gnu99 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -Os -fdata-sections -ffunction-sections -fno-asynchronous-unwind-tables -c -MD -o build/py/mpstate.o ../py/mpstate.c In file included from ../py/mpstate.h:32:0, from ../py/mpstate.c:27: ../py/mpthread.h:36:10: fatal error: mpthreadport.h: No such file or directory #include <mpthreadport.h> ^~~~~~~~~~~~~~~~ compilation terminated. make[1]: *** [../py/mkrules.mk:47: build/py/mpstate.o] Error 1 make[1]: Leaving directory '/home/chris/work/micropython/micropython-mine/mpy-cross' make: *** [../../py/mkrules.mk:107: ../../mpy-cross/mpy-cross] Error 2
First of all, there's reason why the header is called mpthreadport.h: threading is very OS specific and even possibly hardware specific. If you search for one of the functions in mpthread.h like mp_thread_start(), you'll see it is defined in three different ports: cc3200, stm32, unix.
Furthermore, if you drill down further, you'll see that in the stm32, the port is specifically for FreeRTOS i.e. unless you're using FreeRTOS on the stm32, the "stm32 port for threading" is not usable to you.
Assuming you're running FreeRTOS, to make the BUILD work, you have to defined MICROPY_PY_THREAD as 1 in mpconfigport.h (or mpconfig.h) which it looks like you've done since you got the include error.
mpthreadport.h is located in \ports\stm32\
If you launch `make` from that directory,
Last edited by jickster on Fri Dec 01, 2017 4:58 pm, edited 1 time in total.
-
- Posts: 463
- Joined: Wed Apr 08, 2015 5:19 am
Re: building PYBv1.1 binary double FP + threading
Allright, I'll wait, until this more mature and documented.This isn't like merely setting a MACRO to 1.
Re: building PYBv1.1 binary double FP + threading
You'll be waiting awhile for it to be documented.SpotlightKid wrote: ↑Fri Dec 01, 2017 12:25 amAllright, I'll wait, until this more mature and documented.This isn't like merely setting a MACRO to 1.
The hallmark of open source projects is lack of documentation. I'm not joking.
Furthermore, it's not about documentation. As I mentioned, you have to provide a port for your own OS/HW combination.
-
- Posts: 463
- Joined: Wed Apr 08, 2015 5:19 am
Re: building PYBv1.1 binary double FP + threading
The question remains then, how were these compiled:
Code: Select all
standard: v1.9.3-72-gbb047558 (latest) ; v1.9.3 ; v1.9.2 ; v1.9.1 ; v1.9 ; v1.8.7 ;
double FP: v1.9.3-72-gbb047558 (latest) ; v1.9.3 ; v1.9.2 ;
threading: v1.9.3-72-gbb047558 (latest) ; v1.9.3 ; v1.9.2 ;
double FP + threading: v1.9.3-72-gbb047558 (latest) ; v1.9.3 ; v1.9.2 ;
network: v1.9.3-72-gbb047558 (latest) ; v1.9.3 ; v1.9.2 ; v1.9.1 ; v1.9 ; v1.8.7 ;
Re: building PYBv1.1 binary double FP + threading
Have you verified the threading build is actually multithreaded?SpotlightKid wrote: ↑Fri Dec 01, 2017 5:03 pmThe question remains then, how were these compiled:
Code: Select all
standard: v1.9.3-72-gbb047558 (latest) ; v1.9.3 ; v1.9.2 ; v1.9.1 ; v1.9 ; v1.8.7 ; double FP: v1.9.3-72-gbb047558 (latest) ; v1.9.3 ; v1.9.2 ; threading: v1.9.3-72-gbb047558 (latest) ; v1.9.3 ; v1.9.2 ; double FP + threading: v1.9.3-72-gbb047558 (latest) ; v1.9.3 ; v1.9.2 ; network: v1.9.3-72-gbb047558 (latest) ; v1.9.3 ; v1.9.2 ; v1.9.1 ; v1.9 ; v1.8.7 ;
It could be that there's just emtpy stubs for the threading API.