uploaded 2 months ago
This component helps to use MicroPython as an ESP-IDF component.


# MicroPython Helper

[![Component Registry](](

In some cases, developers may wish to integrate MicroPython into existing ESP-related projects as an ESP-IDF component, rather than developing it as standalone ESP32 firmware. This component facilitates the use of MicroPython within the ESP-IDF framework.

In this component, the original MicroPython is integrated without any modifications. This allows for the full utilization of the build logic, code, and configurations, with only minimal modifications made outside of MicroPython itself.

All features and use cases should be exactly the same as in the original MicroPython.

## How to use?

This component is distributed via [IDF component manager]( Just add `idf_component.yml` file to your main component with the following content:

## IDF Component Manager Manifest File
  mr9you/micropython-helper: "~1.22.1"

Or simply run:

``` add-dependency "micropython-helper"

In the CMakeLists.txt file at the top level of your application, you need to add the following code before including IDF's project.cmake:

    set(MICROPY_HELPER_DIR ${CMAKE_CURRENT_SOURCE_DIR}/managed_components/mr9you__micropython-helper)


At this stage, the `micropython-helper` component is not downloaded by the IDF component manager, so this part of the code will not take effect. To ensure its effectiveness, you need to run ` set-target esp32s3`, or select any other target you intend to use. This will prompt the download of the micropython-helper component, allowing you to use the original command, such as ` -D MICROPY_BOARD=ESP32_GENERIC_S3 build`. Please ensure to address this issue accordingly.


## 1.22.1

- Initial version based on [micropython v1.22.1](

readme of std_mpy example

                                        # Standard MicroPython Firmware

This example utilizes `micropython-helper` to build standard MicroPython firmware. There are two ways to initiate the MicroPython service. One option is to simply call the `mpy_startup` function, which functions similarly to MicroPython's `app_main`. The other approach involves manually starting up MicroPython, in which case, you may wish to integrate some of your proprietary logic.

For the build process, the following points should be noted:

1. The `CMakeLists.txt` file at the top level of this project is slightly different from the normal example's `CMakeLists.txt`.
2. It is necessary to `run set-target esp32s3` or choose another target before building the firmware.
3. After completing step 2, you can run ` -D MICROPY_BOARD=ESP32_GENERIC_S3` build to build the firmware.
4. To simplify the command, you may first `export MICROPY_BOARD=ESP32_GENERIC_S3`, and then run any other `` command, such as ` menuconfig`, ` build`, ` flash monitor`, etc.

For any other information about MicroPython itself, please refer to [MicroPython Documentation](


License: MIT

To add this component to your project, run: add-dependency "mr9you/micropython-helper^1.22.1"

or download archive


  • espressif/esp_tinyusb ~1.0.0
  • espressif/mdns ~1.1.0
  • ESP-IDF >=5.0.4
  • Examples:


    more details

    To create a project from this example, run: create-project-from-example "mr9you/micropython-helper^1.22.1:std_mpy"

    or download archive


    • Downloaded in total
      Downloaded in total 8 times
    • Downloaded this version
      This version: 8 times


    mr9you/micropython-helper version: 1.22.1