Call native functions from mpy C extension.

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
Alexander
Posts: 2
Joined: Sun Jul 03, 2022 1:54 pm

Call native functions from mpy C extension.

Post by Alexander » Sun Jul 03, 2022 2:48 pm

Hi, i wrote C extension how to described in topic https://docs.micropython.org/en/latest/ ... atmod.html.
After, i built it under esp32 architecture 'make ARCH=xtensawin'.
It work fine, but i need call esp32-idf functions inside my extension. For example read/write to UART(https://docs.espressif.com/projects/esp ... /uart.html).
When i build micropython binary from source with my extension inside as in examples/usercmodule(https://docs.micropython.org/en/latest/ ... dules.html) i can call esp32-idf native functions. It is work because micropython src already include esp32-idf framework dependency.
But rebuild and reload micropython binary spend many time, it is more easy and fast working with mpy.
My question, it is possible call ESP-IDF framework functions inside *.mpy C extension?

Thank you very much for attention to my question! :)

Christian Walther
Posts: 169
Joined: Fri Aug 19, 2016 11:55 am

Re: Call native functions from mpy C extension.

Post by Christian Walther » Sun Jul 03, 2022 7:46 pm

Unless I missed any recent developments, the answer is no. This has been discussed and solutions prototyped over the years, I believe the latest part is in pull request #5711. Someone else might know more.

Alexander
Posts: 2
Joined: Sun Jul 03, 2022 1:54 pm

Re: Call native functions from mpy C extension.

Post by Alexander » Sun Jul 03, 2022 9:46 pm

Christian Walther wrote:
Sun Jul 03, 2022 7:46 pm
Unless I missed any recent developments, the answer is no. This has been discussed and solutions prototyped over the years, I believe the latest part is in pull request #5711. Someone else might know more.
Thank you very match Christian, you save many of my time.

Post Reply