Page 1 of 2

stm32 thread

Posted: Mon Jun 08, 2020 8:01 am
by bellad
Hello,
i cannot see
import _thread
for stm32 while it exists in esp32
why ?
the stm32 is not multithread ?
thank

Re: stm32 thread

Posted: Mon Jun 08, 2020 9:03 am
by DJShadow1966
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

Re: stm32 thread

Posted: Mon Jun 08, 2020 9:20 am
by bellad
thank you , but just with activ thread and compile , i can use import _tread ?

Re: stm32 thread

Posted: Mon Jun 08, 2020 9:30 am
by DJShadow1966
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

Re: stm32 thread

Posted: Mon Jun 08, 2020 9:34 am
by bellad
thank's Mike

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

Re: stm32 thread

Posted: Mon Jun 08, 2020 12:38 pm
by DJShadow1966
Hello

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

Regards Mike

Re: stm32 thread

Posted: Mon Jun 08, 2020 12:40 pm
by bellad
ok , thank , it's possible on share cloud ( google drive ... )

Re: stm32 thread

Posted: Mon Jun 08, 2020 12:44 pm
by DJShadow1966

Re: stm32 thread

Posted: Mon Jun 08, 2020 12:47 pm
by bellad
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

Re: stm32 thread

Posted: Mon Jun 08, 2020 12:51 pm
by DJShadow1966
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