stm32 thread

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
bellad
Posts: 83
Joined: Tue May 14, 2019 1:47 pm

stm32 thread

Post by bellad » Mon Jun 08, 2020 8:01 am

Hello,
i cannot see
import _thread
for stm32 while it exists in esp32
why ?
the stm32 is not multithread ?
thank

DJShadow1966
Posts: 57
Joined: Sun Jun 23, 2019 4:55 am
Location: Gateshead, Tyne and Wear

Re: stm32 thread

Post by DJShadow1966 » Mon Jun 08, 2020 9:03 am

Hello

The reason it isnt there is by default it is not enabled.

If you edit the mpconfigport.h in the folder ports/stm32 and search for Thread

Code: Select all

#ifndef MICROPY_PY_THREAD
#define MICROPY_PY_THREAD           (0)
#endif

needs to be changed to

#ifndef MICROPY_PY_THREAD
#define MICROPY_PY_THREAD           (1)
#endif

Then your will need to recompile for the board you are using.

Regards Mike

bellad
Posts: 83
Joined: Tue May 14, 2019 1:47 pm

Re: stm32 thread

Post by bellad » Mon Jun 08, 2020 9:20 am

thank you , but just with activ thread and compile , i can use import _tread ?

DJShadow1966
Posts: 57
Joined: Sun Jun 23, 2019 4:55 am
Location: Gateshead, Tyne and Wear

Re: stm32 thread

Post by DJShadow1966 » Mon Jun 08, 2020 9:30 am

Hello

Yes that is correct make the change and rebuild the firmware and upload to the device I use it myself on a STM board.

Regards Mike

bellad
Posts: 83
Joined: Tue May 14, 2019 1:47 pm

Re: stm32 thread

Post by bellad » Mon Jun 08, 2020 9:34 am

thank's Mike

i have STM32F407VET6 Black Board , can i abuse your kindness and you ask of sharing the firmware
Regards Dom

DJShadow1966
Posts: 57
Joined: Sun Jun 23, 2019 4:55 am
Location: Gateshead, Tyne and Wear

Re: stm32 thread

Post by DJShadow1966 » Mon Jun 08, 2020 12:38 pm

Hello

I have the same board as you, hang on will not let me attach the file.

Regards Mike

bellad
Posts: 83
Joined: Tue May 14, 2019 1:47 pm

Re: stm32 thread

Post by bellad » Mon Jun 08, 2020 12:40 pm

ok , thank , it's possible on share cloud ( google drive ... )

DJShadow1966
Posts: 57
Joined: Sun Jun 23, 2019 4:55 am
Location: Gateshead, Tyne and Wear

Re: stm32 thread

Post by DJShadow1966 » Mon Jun 08, 2020 12:44 pm


bellad
Posts: 83
Joined: Tue May 14, 2019 1:47 pm

Re: stm32 thread

Post by bellad » Mon Jun 08, 2020 12:47 pm

hello,
thank you so much

I did not find a tutorial to compile a stm32
and I admit I'm not comfortable with that

thanks again

Dom

DJShadow1966
Posts: 57
Joined: Sun Jun 23, 2019 4:55 am
Location: Gateshead, Tyne and Wear

Re: stm32 thread

Post by DJShadow1966 » Mon Jun 08, 2020 12:51 pm

Hello Dom

Too be honest I have been in IT for 39 years now and use to work with Mainframes and Linux a lot, so I have a linux box which is configured to compile firmware for many uPython projects.

Regards Mike

Post Reply