cancel
Showing results for 
Search instead for 
Did you mean: 

Confused about MPU region config for STM32H5

devinw
Associate III

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 3
TDK
Guru

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".
Sarra.S
ST Employee

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! 

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

devinw
Associate III

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!