Skip to content

Update to micropython 1.24.1#4

Open
karlp wants to merge 1 commit into
micropython:mainfrom
karlp:karl-v1241-only-single
Open

Update to micropython 1.24.1#4
karlp wants to merge 1 commit into
micropython:mainfrom
karlp:karl-v1241-only-single

Conversation

@karlp
Copy link
Copy Markdown
Contributor

@karlp karlp commented Jan 27, 2025

This requires handling the following upstream commits: decf8e6a8b all: Remove the "STATIC" macro and just use "static" instead. 27279e69b4 esp32: Add IDF-version-specific sdkconfig. and, importantly
acbdbcd95e esp32: Workaround IDF issue placing ISR ringbuf functions in IRAM

Replacing STATIC was easy. Adding the IDF version specific was just implemented as upstream.
However, the new linker.lf files are not in a path that is being searched properly. I believe this can only be fixed in micropython itself by providing a better file reference.

The suggested upstream fix is available here: micropython/micropython#16658 and is required for this patch.

This supersedes: #3 (it uses/relies on a different solution with upstream)

This requires handling the following upstream commits:
decf8e6a8b all: Remove the "STATIC" macro and just use "static" instead.
27279e69b4 esp32: Add IDF-version-specific sdkconfig.
and, importantly
acbdbcd95e  esp32: Workaround IDF issue placing ISR ringbuf functions in IRAM

Replacing STATIC was easy.  Adding the IDF version specific was just
implemented as upstream.
However, the new linker.lf files are not in a path that is being
searched properly. I believe this can only be fixed in micropython
itself by providing a better file reference.

The suggested upstream fix is available here: micropython/micropython#16658
and is _required_ for this patch.

Signed-off-by: Karl Palsson <karl.palsson@marel.com>
@karlp
Copy link
Copy Markdown
Contributor Author

karlp commented Jan 27, 2025

(Obviously, because this relies on a patched upstream, this patch can't be merged as is, the submodule SHA would be wrong, but I need to show this for reference)

@cnadler86
Copy link
Copy Markdown

Hi. Just one question: is this now the actual solution for 1.24.1 and ahead?

@karlp
Copy link
Copy Markdown
Contributor Author

karlp commented Mar 18, 2025

Well, upstream has been merged now, so this just needs the same patch, with an updated submodule SHA, but otherwise, yes. Of course, upstream hasn't done a release yet, so perhaps this just waits to 1.25? You can see here what to do if you need it before hand, but I don't think pointing the micropython-example-boards repo to an intermediate micropython "just some point on main" is really a great idea.

@cnadler86
Copy link
Copy Markdown

I followed the structure of the file while copying the linker into my main directory ans it start building my custom board with user module, but at about 75% of the build it throws an error:

[1172/1601] Generating ../../genhdr/qstr.i.last
FAILED: genhdr/qstr.i.last /home/runner/work/mp_esp_face_detector/mp_esp_face_detector/boards/build-ESP32_GENERIC_S3-FLASH_16M/genhdr/qstr.i.last 
/bin/sh esp-idf/main/CMakeFiles/qstr.i.last-93c470f.sh 4a5ce4d999cfdfc8
/home/runner/work/mp_esp_face_detector/mp_esp_face_detector/micropython/ports/esp32/machine_touchpad.c:39:2: error: #error "Unknown touch hardware version"
   39 | #error "Unknown touch hardware version"
      |  ^~~~~
Command '['/home/runner/.espressif/tools/xtensa-esp-elf/esp-14.2.0_20241119/xtensa-esp-elf/bin/xtensa-esp32s3-elf-gcc', '-E', '-I/home/runner/work/mp_esp_face_detector/mp_esp_face_detector/boards/build-ESP32_GENERIC_S3-FLASH_16M/config', '-I/home/runner/work/mp_esp_face_detector/mp_esp_face_detector/micropython', '-I/home/runner/work/mp_esp_face_detector/mp_esp_face_detector/micropython', '-I/home/runner/work/mp_esp_face_detector/mp_esp_face_detector/micropython/lib/berkeley-db-1.xx/include', '-I/home/runner/work/mp_esp_face_detector/mp_esp_face_detector/src', '-I/home/runner/work/mp_esp_face_detector/mp_esp_face_detector/micropython/lib/tinyusb/src', '-I/home/runner/work/mp_esp_face_detector/mp_esp_face_detector/micropython/shared/tinyusb', '-I/home/runner/work/mp_esp_face_detector/mp_esp_face_detector/micropython/ports/esp32', '-I/home/runner/work/mp_esp_face_detector/mp_esp_face_detector/boards/ESP32_GENERIC_S3', '-I/home/runner/work/mp_esp_face_detector/mp_esp_face_detector/boards/build-ESP32_GENERIC_S3-F

Building the whole thing with the board definition in the micropython tree works, but outside is not working. I am using IDF 5.4 and probably is a bug in the micropython/ports/esp32/machine_touchpad.c file, but I am not sure...

have you tested this with IDF 5.3 or 5.4?

@karlp
Copy link
Copy Markdown
Contributor Author

karlp commented Mar 18, 2025

I use 5.3.2 here. Note, the whole point of that upstream patch is so that you don't need to copy the linker fragment around, unless you're really needing special custom linker fragments. But, yes, clearly "unkonwn touch" is kinda out of scope of what I was doing here.

@cnadler86
Copy link
Copy Markdown

Thanks for the info. Actually the touch driver is standard in the build. Anyway, I will try to do the whole thing the other way around and start by this PR and then incorporate my custom definitions and module in here step by step.

@dpgeorge dpgeorge mentioned this pull request Mar 1, 2026
@dpgeorge
Copy link
Copy Markdown
Member

dpgeorge commented Mar 1, 2026

Sorry this got lost / never merged.

Actually, MicroPython v1.25.0 dropped the need for linker.lf altogether, so the fixes here wouldn't work with any release of MicroPython.

@karlp would you like to update this PR to work with MicroPython v1.25.0? I think it just requires removing the changes related to linker.lf, and updating the micropython submodule. (I can do that as part of the merge if you like.)

@dpgeorge
Copy link
Copy Markdown
Member

dpgeorge commented Mar 1, 2026

would you like to update this PR to work with MicroPython v1.25.0? I

Alternatively, this PR could be closed in favour of #5, it's up to you.

@karlp
Copy link
Copy Markdown
Contributor Author

karlp commented Mar 2, 2026

I'm updating this to 1.27, but... what versions of ESP-IDF are meant to be supported? esp_driver_touch_sens is a 5.5 driver only, is that expected that 1.27 should only work with 5.5x?

@Josverl
Copy link
Copy Markdown

Josverl commented Mar 2, 2026

#5 is already @ V1.27.0, so could rebase that on this PR if that helps

@dpgeorge
Copy link
Copy Markdown
Member

dpgeorge commented Mar 3, 2026

what versions of ESP-IDF are meant to be supported?

Currently the recommended version is 5.5.1. But with MicroPython 1.24.1 the IDF version was 5.2.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants