STM32H7 | MPUs in dual cores
Hello @ all,
I'm dealing with a project with stm32H755 MCU, as you know it is made of two cores: cortex-M7 and cortex-M4. Keeping in mind I'm using a few peripherals, among which FDCAN, SPI and most importantly lwIP/ETH, I'm trying to put together all the informations I've found online and tested regarding MPUs. I'm going to underline the fact that there are not many, if any, documents regarding MPUS in dual cores, how they should be set and what rules are to be applied.
Let me explain, I suppose that if one of the cores is using a portion of the memory for specific reasons and such area must not be accessed by the other core, I believe i should set the same areas under MPU protection, with access allowed for the core using that memory and without access for the core that won't. Is it correct? On the opposite, should I set only for the core using that memory and the other will "know" automatically not to access that memory area?
I have found many references to the MPU focusing on disabling all accesses to external memories:
MPU_InitStruct.Enable = MPU_REGION_ENABLE;
MPU_InitStruct.BaseAddress = 0x00;
MPU_InitStruct.Size = MPU_REGION_SIZE_4GB;
MPU_InitStruct.AccessPermission = MPU_REGION_NO_ACCESS;
MPU_InitStruct.IsBufferable = MPU_ACCESS_NOT_BUFFERABLE;
MPU_InitStruct.IsCacheable = MPU_ACCESS_NOT_CACHEABLE;
MPU_InitStruct.IsShareable = MPU_ACCESS_SHAREABLE;
MPU_InitStruct.Number = MPU_REGION_NUMBER0;
MPU_InitStruct.TypeExtField = MPU_TEX_LEVEL0;
MPU_InitStruct.SubRegionDisable = 0x87;
MPU_InitStruct.DisableExec = MPU_INSTRUCTION_ACCESS_DISABLE;
It is often recommended as default. Is it to be placed in both cores? Just in M7 is fine?
Is it useful only in certain conditions but not recommened in others?
I have read the AN4838 but it doesn't explain how to approach MPUs for dual cores.
Thanks in advance for the support everyone!
Zack
