Skip to main content
Associate III
December 30, 2024
Question

Confused about MPU region config for STM32H5

  • December 30, 2024
  • 3 replies
  • 850 views

I'm trying to set up a MPU region to block out DCACHE from my SDMMC1 peripheral but I notice whenever a region is activiated in CubeMX, the "region start" field will not let me type any hex value in. Some red text below says that region start must ALWAYS be 0x0. So my quesitons are:

 

1) If region start must always be 0x0, WHY is it a text field that I can enter something into?

2) Why must a region always start at 0x0? The region I want to block out from the DCACHE does not start at 0x0... I looked at some config documents for other chips (the example was an F7 i believe), and the MPU config allowed typing any hex value into the region start. I'm wondering if there's a bug here? Or maybe I just don't understand the H5 MPU enough.

3 replies

TDK
Super User
December 31, 2024

Set the limit address first to the end of the region, then set the base address to the start.

Solved: Re: Assistance requested for setting up MPU via Cu... - STMicroelectronics Community

 

If that still doesn't work, please attach the IOC in question. Works here:

TDK_0-1735606652974.png

 

"If you feel a post has answered your question, please click ""Accept as Solution""."
ST Employee
December 31, 2024

Hello @devinw 

As explained by @TDK, to modify the base address, it is necessary to first change the value of the MPU region limit address, which is a logical requirement, so, the base address should be a value between [0x00  Limit address]. 

However, as this seems to be confusing for some people, I have submitted an internal ticket (Ticket 199463) for STM32CubeMX team in order to update the initial warning message to clearly state that the value of the MPU region limit address must be changed first in order to modify the base address. 

Thank you! 

 

devinwAuthor
Associate III
December 31, 2024

Ahhhh, got it. Yeah, that is a bit awkward. I would think, allowing one to type the base address first, and then just have the limit address turn red and say "invalid" or something until you type a value larger than base would be a little more intuitive.

 

I can see why you did it that way though. It just didn't even occur to me to try the limit address first. Doh!