How to build a firmware with _thread module?

The official pyboard running MicroPython.
This is the reference design and main target board for MicroPython.
You can buy one at the store.
Target audience: Users with a pyboard.
Post Reply
shaoziyang
Posts: 261
Joined: Sun Apr 17, 2016 1:55 pm

How to build a firmware with _thread module?

Post by shaoziyang » Fri Jul 21, 2017 4:11 am

PYB has firmware with thread module, but how to build a custom firmware with _thread module?

Zhijiang XU
Posts: 1
Joined: Sat Oct 14, 2017 2:25 pm

Re: How to build a firmware with _thread module?

Post by Zhijiang XU » Mon Oct 16, 2017 3:08 am

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

User avatar
pythoncoder
Posts: 3506
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: How to build a firmware with _thread module?

Post by pythoncoder » Mon Oct 16, 2017 7:14 am

The preferred option for step 2 is

Code: Select all

make BOARD=PYBV10 clean
Peter Hinch

skylin008
Posts: 54
Joined: Wed Mar 11, 2015 6:21 am

Re: How to build a firmware with _thread module?

Post by skylin008 » Sat Apr 28, 2018 7:52 am

@ 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!

Post Reply