How to upload (.mpy) files to ROM #12496
-
Hi,
Thank you in advance for your help, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
@sir-user The documentation is here You need to make your own board definition (start by copying ESP32_GENERIC), and then you can adapt the manifest file as described there. |
Beta Was this translation helpful? Give feedback.
-
This is a little write-up about custom-building MicroPython firmware.
These are my files: mpconfigboard.cmake
mpconfigboard.h
sdkconfig.board
manifest.py
To save memory you may need to disable some standard Python libraries and C modules. Here I choose to disable "asyncio". I also exclude "help", "webrepl", "usb", "lan", etc. by modifying "mpconfigport.h" and "esp32_common.cmake". The build script is simple, and saves you having to write cmds on the terminal lines #!/bin/bash
export PATH="$HOME/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
echo "=========================================================="
echo "Setting up for esp32 build"
echo "Using esp-idf-511"
export IDF_PATH="$HOME/disk/esp/esp-idf-511"
export IDF_TARGET="esp32"
source $IDF_PATH/export.sh
# ESP32
cp mpconfigport.h-STD mpconfigport.h
cp esp32_common.cmake-STD esp32_common.cmake
make V=1 BOARD=ESP32 MICROPY_VFS_LFS2=1
echo "==========================================================" As you can see, I'm compiling my firmware with ESP-IDF V5.1.1, and it seems to build and run OK. The MicroPython build process and flags are constantly changing. You may need to modify the above files as they become necessary. Hope this helps and good luck! |
Beta Was this translation helpful? Give feedback.
This is a little write-up about custom-building MicroPython firmware.
This is how I do it on a Linux Mint PC. It may not be the right or best way to do it, but it works for me.
Create a new directory to store your modules
$ mkdir extra
Create a new board
$ cp -r ESP32_GENERIC ESP32
Edits:
Customise your build. Save original and edited files: