2021-04-13 07:16 AM
I am using STM32F429zi micro and MPU (Memory Protection Unit) module. When I individually protect blocks it's working but when I enable complete background region protection it's throwing hard fault.
static void protectBackgroundRegion(void)
{
// Configure Region 0 to catch invalid pointer references
MPU->RNR = mpuBackgroundRegion;
MPU->RBAR = 0x00000000UL; //0x0800C000UL; //
MPU->RASR =
MPU_NO_EXECUTABLE |
(mpuRegion_NoAccess << MPU_RASR_AP_Pos) |
(0 << MPU_RASR_TEX_Pos) |
MPU_CACHEABLE |
MPU_SHAREABLE |
(0 << MPU_RASR_SRD_Pos) |
(mpuRegionSize4Gb << MPU_RASR_SIZE_Pos) |
(1 << MPU_RASR_ENABLE_Pos);
}
2021-04-13 09:44 AM
So maybe you forget some other region that should be let alone (core registers... ) What are your other regions? What address causes the fault?
2021-06-21 11:51 AM
Thanks Pavel for responding, attached is screenshot when it hits fault. I hope it helps.