Process of building binaries is confusing

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
rorokoko
Posts: 3
Joined: Wed Jan 20, 2021 8:30 am

Process of building binaries is confusing

Post by rorokoko » Sat May 01, 2021 3:08 am

HI guys! I started using the new build of Micropython library, and am confused with the process of building binaries. In the previous versions of the project, it was straightforward but the process does not seem to be working.
A typical use case, step-by-step is as follows:
1, Add changes or add a file the modules folder with the 'ports/esp32 folder.
2, 'make deploy', and the changes in the modules that I want to freeze get built into the new binary file that gets created and gets flashed into the board.

In the newer micropython project that i downloaded from github, the process doesn't seem to be working. After making changes to the modules, I run make deploy, but the changes are not detected and older binary gets reflashed into the board. What could be causing this?

User avatar
karfas
Posts: 193
Joined: Sat Jan 16, 2021 12:53 pm
Location: Vienna, Austria

Re: Process of building binaries is confusing

Post by karfas » Sat May 01, 2021 12:43 pm

The 'make' interface to the new CMake build system is only partial implemented.

I also had (different) problems building with make and switched to call CMake through idf.py (found in your ESP-IDF installation).
Even this approach sometimes requires to completely remove the ports/esp32/build directory (I can't remember the exact curcumstances).

Part of my (specific) build script:

Code: Select all

defs="$defs -D MICROPY_BOARD_DIR=$BOARD_DIR"     # absolute path to (e.g.) ports/esp32/boards/GENERIC
defs="$defs -D MICROPY_BOARD=$BOARD"                     # e.g. "GENERIC"
# defs="$defs -D CMAKE_BINARY_DIR=$BUILD_DIR"       # does not work

case "$cmd" in
    deploy) idf.py $defs build
            idf.py $defs flash
	    ;;
    *) 	    idf.py $defs "$cmd"
	    ;;
esac
A few hours of debugging might save you from minutes of reading the documentation! :D
My repositories: https://github.com/karfas

Post Reply