Skip to content

Fix MPU wrapper macro mapping for ARMv8M ports#1419

Open
aggarg wants to merge 1 commit into
FreeRTOS:mainfrom
aggarg:armv8m_mpu
Open

Fix MPU wrapper macro mapping for ARMv8M ports#1419
aggarg wants to merge 1 commit into
FreeRTOS:mainfrom
aggarg:armv8m_mpu

Conversation

@aggarg
Copy link
Copy Markdown
Member

@aggarg aggarg commented May 23, 2026

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

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.

1 participant