Skip to content

Fix MPU wrapper macro mapping for ARMv8M ports#1419

Merged
rawalexe merged 2 commits into
FreeRTOS:mainfrom
aggarg:armv8m_mpu
May 30, 2026
Merged

Fix MPU wrapper macro mapping for ARMv8M ports#1419
rawalexe merged 2 commits into
FreeRTOS:mainfrom
aggarg:armv8m_mpu

Conversation

@aggarg

@aggarg aggarg commented May 23, 2026

Copy link
Copy Markdown
Member

Description

Remove #include "mpu_wrappers.h" from portmacrocommon.h. The header was being included before portUSING_MPU_WRAPPERS is defined, which prevented the pre-processor macro mapping of FreeRTOS APIs to their MPU_ variants and broke unprivileged tasks.

Move the vPortConfigureInterruptPriorities() declaration from portmacrocommon.h into port.c since it relies on the PRIVILEGED_FUNCTION attribute defined via mpu_wrappers.h.

Test Steps

Tested using FreeRTOS/Demo/CORTEX_MPU_M33F_NTZ_Nordic_NRF9160_SES demo.

Checklist:

  • I have tested my changes. No regression in existing tests.
  • [NA] I have modified and/or added unit-tests to cover the code changes in this Pull Request.

Related Issue

NA

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Remove #include "mpu_wrappers.h" from portmacrocommon.h. The header was
being included before portUSING_MPU_WRAPPERS is defined, which prevented
the pre-processor macro mapping of FreeRTOS APIs to their MPU_ variants
and broke unprivileged tasks.

Move the vPortConfigureInterruptPriorities() declaration from
portmacrocommon.h into port.c since it relies on the PRIVILEGED_FUNCTION
attribute defined via mpu_wrappers.h.

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
@sonarqubecloud

Copy link
Copy Markdown

@rawalexe rawalexe merged commit d877cd5 into FreeRTOS:main May 30, 2026
17 checks passed
@aggarg aggarg deleted the armv8m_mpu branch May 30, 2026 07:07
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.

3 participants