Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to micropython 1.24.1 #4

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

karlp
Copy link
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 <[email protected]>
@karlp
Copy link
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

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

@karlp
Copy link
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

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
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

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.

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.

2 participants