Skip to content

Update to micropython 1.23 - #3

Closed
karlp wants to merge 1 commit into
micropython:mainfrom
karlp:karl-v123-updates
Closed

Update to micropython 1.23#3
karlp wants to merge 1 commit into
micropython:mainfrom
karlp:karl-v123-updates

Conversation

@karlp

@karlp karlp commented Oct 14, 2024

Copy link
Copy Markdown
Contributor

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 karlp@tweak.au

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 <karlp@tweak.au>
@dpgeorge

Copy link
Copy Markdown
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
Copy Markdown
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

karlp commented Oct 15, 2024

Copy link
Copy Markdown
Contributor Author

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

@dpgeorge

dpgeorge commented Mar 1, 2026

Copy link
Copy Markdown
Member

Closing in favour of #4.

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