Page 1 of 1

How to build a firmware with _thread module?

Posted: Fri Jul 21, 2017 4:11 am
by shaoziyang
PYB has firmware with thread module, but how to build a custom firmware with _thread module?

Re: How to build a firmware with _thread module?

Posted: Mon Oct 16, 2017 3:08 am
by Zhijiang XU
1. cd stmhal
2. rm -rf build-PYBV10
3. modify stmhal/mpconfigport.h file
#define MICROPY_PY_THREAD (1)
4. make BOARD=PYBV10 V=1

Re: How to build a firmware with _thread module?

Posted: Mon Oct 16, 2017 7:14 am
by pythoncoder
The preferred option for step 2 is

Code: Select all

make BOARD=PYBV10 clean

Re: How to build a firmware with _thread module?

Posted: Sat Apr 28, 2018 7:52 am
by skylin008
@ pythoncoder ,I had modified the py/mpconfig.h file

Code: Select all

#ifndef MICROPY_PY_THREAD
#define MICROPY_PY_THREAD (1)
#endif
and ports/stm32/mpconfigport.h file

Code: Select all

#ifndef MICROPY_PY_THREAD
#define MICROPY_PY_THREAD           (1)
#endif
But when build

Code: Select all

make BOARD=PYBLITEV10 V=1
show as error information
In file included from ../py/mpstate.h:32:0,
from ../py/mpstate.c:27:
../py/mpthread.h:36:26: fatal error: mpthreadport.h: No such file or directory
compilation terminated.
../py/mkrules.mk:47: recipe for target 'build/py/mpstate.o' failed
make[1]: *** [build/py/mpstate.o] Error 1
make[1]: Leaving directory '/home/phonelink/micropython/mpy-cross'
../../py/mkrules.mk:104: recipe for target '../../mpy-cross/mpy-cross' failed
make: *** [../../mpy-cross/mpy-cross] Error 2
How to solve this issue.Thanks advance!