Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Merged fixes for zephyr 4.0 #16879

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

Merged
merged 4 commits into from
Apr 29, 2025

Conversation

laodzu
Copy link
Contributor

@laodzu laodzu commented Mar 8, 2025

Summary

Consolidated fixes to support all upstream Zephyr versions, i.e. v3.7 (LTS), v4.0 and main. This is a consolidation of two different attempts:

The commits clearly explain the reason for the changes with links to the original commits. The patches were tested with an SD card and a QSPI flash system.

Testing

I tested the patches on all currently supported Zephyr versions, i.e. v3.7, v4.0 and top-of-tree v4.1.0-269-gdf5318479b9 on two boards:

mimxrt1060_evk
frdm_mcxn947

On the mimxrt1060 I tested the SD support by injecting -DCONFIG_DISK_ACCESS=y into the build. I did not change the default configuration as this hangs when no SD card is discovered and so people should only enable it if they want to use such a system.

For the frdm_mcxn947 I added a device tree overlay and a config fragment to enable the functionality out of the box as the flash is always present, and I did not see any slowdown with the functionality.

Copy link

codecov bot commented Mar 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.54%. Comparing base (6406afb) to head (3c8d1b1).
Report is 4 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #16879   +/-   ##
=======================================
  Coverage   98.54%   98.54%           
=======================================
  Files         169      169           
  Lines       21890    21890           
=======================================
  Hits        21572    21572           
  Misses        318      318           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

github-actions bot commented Mar 8, 2025

Code size report:

   bare-arm:    +0 +0.000% 
minimal x86:    +0 +0.000% 
   unix x64:    +0 +0.000% standard
      stm32:    +0 +0.000% PYBV10
     mimxrt:    +0 +0.000% TEENSY40
        rp2:    +0 +0.000% RPI_PICO_W
       samd:    +0 +0.000% ADAFRUIT_ITSYBITSY_M4_EXPRESS
  qemu rv32:    +0 +0.000% VIRT_RV32

@laodzu laodzu force-pushed the merged-fixes-for-zephyr-4.0 branch from 91f5764 to 4212023 Compare March 8, 2025 15:01
@laodzu laodzu mentioned this pull request Mar 8, 2025
@ThinkTransit
Copy link
Contributor

Tested on the nrf9151dk and nrf5340dk, both compile and run ok.

MicroPython 421202388 on 2025-03-10; zephyr-nrf9151dk with nrf9151
Type "help()" for more information.
>>> 
MicroPython 421202388 on 2025-03-10; zephyr-nrf5340dk with nrf5340
Type "help()" for more information.
>>>

@laodzu
Copy link
Contributor Author

laodzu commented Mar 10, 2025

Hi Patrick, thanks for testing, much appreciated! I actually just compile tested your #16878 and also saw that it works, but it throws the intentional warning about the missing erase block size in the device tree. Looking deeper into this, I now think that this should be solved differently than what I do in this patch. We should strive to get rid of the second parameters for the FlashArea creator altogether.

So I think with the "speed" of the PRs, I will retract the changes related to flash_map and for the introduction of the frdm_mcxn947 board. Hopefully this will allow this PR to be merged faster, and then we can all build on the result.

What do you think?

@ThinkTransit
Copy link
Contributor

Hi Detlev,
Yes I think it makes sense to split the frdm_mcxn947 board definition into it's own PR and leave this one just for V4 upgrade.

@laodzu laodzu force-pushed the merged-fixes-for-zephyr-4.0 branch from 4212023 to 6a5cd0a Compare March 10, 2025 14:43
@laodzu
Copy link
Contributor Author

laodzu commented Mar 10, 2025

Ok, I just force-pushed the reduced patch set with the minimal patches to allow us to move forward. The CI again has a failure for "unix port / coverage_32bit". I saw this pop in and out for no apparent reason, so I think this test is not working correctly and not related to the changes here anyway.

So I think if this PR is merged, this would be a good base for a few other pending PRs, so I am looking forward to feedback!

laodzu and others added 4 commits April 29, 2025 23:00
The (deprecated) kconfig option NET_SOCKETS_POSIX_NAMES was removed in
commit abad505bdeed6102061767f45acd63323973f564 so remove it from our
configuration.

As the option has been deprecated longer, this also works for v3.7 and
v4.0 the other still supported versions.

Signed-off-by: Detlev Zundel <[email protected]>
Commit 1b6e0f64796dfd6f86a8679ea6d24e1fca1e63a8 for Zephyr v4.0.0
changed the function "thread_analyzer_print" to require a cpu argument
and allow thread analysis on each cpu separately. The argument is
ignored when THREAD_ANALYZER_AUTO_SEPARATE_CORES=n which is the
default on single core machines.

Promote this change to the MicroPython zephyr module.

Signed-off-by: Detlev Zundel <[email protected]>
Signed-off-by: Maureen Helm <[email protected]>
Commit 07a8e3253a2d8a2076c9c83c4ed4158fa3fbb2a2 removes
CONFIG_MMC_VOLUME_NAME from the Kconfig space. Instead we need to use
the device tree to find the "disk-name" property of "zephyr,mmc-disk"
devices.

Signed-off-by: Detlev Zundel <[email protected]>
Updates the Zephyr port build instructions. The CI is updated to use
Zephyr docker image 0.27.4, SDK 0.17.0 and the latest Zephyr release
tag.

Tested on max32690fthr and frdm_k64f.

Signed-off-by: Maureen Helm <[email protected]>
Signed-off-by: Detlev Zundel <[email protected]>
@dpgeorge dpgeorge force-pushed the merged-fixes-for-zephyr-4.0 branch from 6a5cd0a to 3c8d1b1 Compare April 29, 2025 13:46
Copy link
Member

@dpgeorge dpgeorge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks everyone who contributed to this and tested it. Sorry it took some time to get to, I needed to get MicroPython v1.25.0 out the door (and that's now done).

I agree that it would be good to support both the 3.7 LTS release of Zephyr, as well as keep up to date with the latest release (which now looks like 4.1.0). So this PR fits that well!

I tested on a frdm_k64f and it works well (no regressions running the test suite).

@dpgeorge dpgeorge merged commit 3c8d1b1 into micropython:master Apr 29, 2025
62 of 67 checks passed
@jonnor
Copy link
Contributor

jonnor commented Apr 29, 2025

Super work everyone! Thank you so much! This is already gearing up for a very interesting 1.26 :)

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

Successfully merging this pull request may close these issues.

6 participants