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.23 #3

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

Conversation

karlp
Copy link
Contributor

@karlp karlp commented Oct 14, 2024

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, and will provide a fix there. (Filed, see micropython/micropython#16013

I believe this also fixes #2

Required patch:

$ git diff
diff --git a/ports/esp32/esp32_common.cmake b/ports/esp32/esp32_common.cmake index e928fb439..8ba868c20 100644
--- a/ports/esp32/esp32_common.cmake
+++ b/ports/esp32/esp32_common.cmake
@@ -153,7 +153,7 @@ idf_component_register(
         ${MICROPY_BOARD_DIR}
         ${CMAKE_BINARY_DIR}
     LDFRAGMENTS
-        linker.lf
+        ${MICROPY_PORT_DIR}/main_${IDF_TARGET}/linker.lf
     REQUIRES
         ${IDF_COMPONENTS}
 )

Tested with esp32 builds, and esp32-s3 builds and runtime tests.
Signed-off-by: Karl Palsson [email protected]

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, and will provide a fix
there.

Required patch:
$ git diff
diff --git a/ports/esp32/esp32_common.cmake b/ports/esp32/esp32_common.cmake
index e928fb439..8ba868c20 100644
--- a/ports/esp32/esp32_common.cmake
+++ b/ports/esp32/esp32_common.cmake
@@ -153,7 +153,7 @@ idf_component_register(
         ${MICROPY_BOARD_DIR}
         ${CMAKE_BINARY_DIR}
     LDFRAGMENTS
-        linker.lf
+        ${MICROPY_PORT_DIR}/main_${IDF_TARGET}/linker.lf
     REQUIRES
         ${IDF_COMPONENTS}
 )

Tested with esp32 builds, and esp32-s3 builds and runtime tests.
Signed-off-by: Karl Palsson <[email protected]>
@dpgeorge
Copy link
Member

Thanks for the contribution!

We will should wait until the patch to MicroPython is merged, so that the examples here build with the latest version.

@dpgeorge
Copy link
Member

As suggested in micropython/micropython#16013 I suggest we copy linker.lf here. That allows a custom board to provide a custom version of that if needed.

@karlp
Copy link
Contributor Author

karlp commented Oct 15, 2024

Thanks for the contribution!

We will should wait until the patch to MicroPython is merged, so that the examples here build with the latest version.

absolutely, wouldn't dream of it otherwise, but had to post it like this to have them connected, and show the whole picture

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.

Some bugfix suggestions for ESP32S3 boards
2 participants