Skip to content

Refactor/mpu manager#537

Merged
jorgesg82 merged 61 commits into
developmentfrom
refactor/MPUManager
Jan 22, 2026
Merged

Refactor/mpu manager#537
jorgesg82 merged 61 commits into
developmentfrom
refactor/MPUManager

Conversation

@FoniksFox
Copy link
Copy Markdown
Contributor

@FoniksFox FoniksFox commented Dec 13, 2025

Refactor of the MPU so that it works with the new compile-infrastructure.

You can inscribe any type, on any memory domain, with any alignment (up to 32B, since there's no meaning in going any further) cacheable or non-cacheable. The MPU module will calculate and allocate on compile-time all the memory required with the required offsets and everything, such that it even fails if you request too much memory (well, the linker script is the one that actually fails).

It still gives support to the legacy MPUManager.

It has a greater range of protection of the memory, so that you cannot access any memory that is not explicitly defined as accessible.

It dinamycally (in linking-time) allocates the necessary memory with the minimum padding possible so as to not waste any unnecessary memory.

The linker script has been changed to adapt to this new structure.

You need to delete the MPUManager::start() call from Runes to make this work (since this function no longer exists).

Other changes made in the Linker Script include:

  • Use DTCM (Data Tightly Coupled Memory) for Stack, Heap and Static
  • Allow the use of ITCM (Instruction Tightly Coupled Memory) by declaring a function as RAM_CODE (better performance)
  • Allow access to any memory region by either using an attribute or by requesting it to the MPU driver
  • Optimize MPU settings for better performance
  • Use Linker Script as only source of truth for the memory region start addresses and sizes
  • Move some symbols that had questionable placement to the new system

jorgesg82 and others added 25 commits November 30, 2025 13:57

This comment was marked as spam.

@FoniksFox FoniksFox changed the base branch from compile-infrastructure to development December 15, 2025 22:09
@FoniksFox FoniksFox marked this pull request as ready for review January 17, 2026 23:36
Comment thread Inc/HALAL/Models/MPU.hpp Outdated
Comment thread Inc/HALAL/Models/MPU.hpp
Comment thread Inc/HALAL/Models/MPU.hpp Outdated
Comment thread STM32H723ZGTX_FLASH.ld Outdated
Comment thread STM32H723ZGTX_FLASH.ld Outdated
Comment thread STM32H723ZGTX_RAM.ld Outdated
Comment thread STM32H723ZGTX_RAM.ld Outdated
@StefanCostea
Copy link
Copy Markdown
Member

Minor changes suggested, but overall looks very good, I would focus in merging this quicklu

StefanCostea
StefanCostea previously approved these changes Jan 18, 2026
Cantonplas
Cantonplas previously approved these changes Jan 20, 2026
Copy link
Copy Markdown
Contributor

@Cantonplas Cantonplas left a comment

Choose a reason for hiding this comment

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

LGTM

@FoniksFox FoniksFox mentioned this pull request Jan 21, 2026
Comment thread Inc/HALAL/Models/MPU.hpp Outdated
Comment thread Inc/HALAL/Models/MPU.hpp Outdated
victor-Lopez25
victor-Lopez25 previously approved these changes Jan 21, 2026
jorgesg82
jorgesg82 previously approved these changes Jan 22, 2026
@FoniksFox FoniksFox dismissed stale reviews from jorgesg82 and victor-Lopez25 via eb3be8f January 22, 2026 12:22
@jorgesg82 jorgesg82 merged commit bd05e1b into development Jan 22, 2026
13 checks passed
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.

6 participants