[SOLVED][STM32] Including C Libraries

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
Post Reply
danny_h
Posts: 8
Joined: Wed Apr 03, 2019 8:10 am

[SOLVED][STM32] Including C Libraries

Post by danny_h » Wed Apr 03, 2019 8:43 am

Hey there,

is it possible to include C libraries in MicroPython on a STM32 NUCLEO board?
I already found a lot of threads dealing with this topic but most answers were like 'Better look for CPython libraries'. Still could be that I missed a thread where somebody already solved this.

My problem is that I'd need to use some already existing C files and it would take an insane amount of time to re-write them in MicroPython.
The only thing I found was a video of Damien George including a C file in MicroPython by changing some things in the mpconfigport.h file and in the makefile:
https://www.youtube.com/watch?v=tqvn_JFdLDY
But I think he does it on the Pyboard.

Is this the only way to do it? And has anyone done this on a STM32 board before?
Last edited by danny_h on Wed Jul 17, 2019 8:15 am, edited 2 times in total.

User avatar
marfis
Posts: 198
Joined: Fri Oct 31, 2014 10:29 am
Location: Zurich / Switzerland

Re: [STM32] Including C Libraries

Post by marfis » Wed Apr 03, 2019 10:27 pm

https://docs.micropython.org/en/latest/ ... dules.html

has an example for an external C module and how it can be specified using make options so it lives outside the main repository,

danny_h
Posts: 8
Joined: Wed Apr 03, 2019 8:10 am

Re: [STM32] Including C Libraries

Post by danny_h » Tue Apr 09, 2019 6:40 am

Looks like I actually missed it. Thank you!

Post Reply