Other Parts Discussed in Thread: SYSBIOS
Tool/software: Code Composer Studio
Hi guys,
i am working with microcontroller tm4c129encpdt, and trying to use MPU(memory protection unit), i want to protect 2 parts f ram memory and 1 part of Flash.
the problem is i do not know what is wrong in my configuration that immediately goes to mpu fault or it crash when i run the project.
i read lots of MPU documentation but coudl not find the answer. the problem happens when in switchfxn(),when i want to change configuration:
[code]
void mySwitchFxn(ti_sysbios_knl_Task_Handle from, ti_sysbios_knl_Task_Handle to)
{
uint32_t pointerSwich = (*(to)).fxn;
if( (pointerSwich >= 0x000b5800) && (pointerSwich < (0x000b5800 + 0x3e800))) //Flash area
{
MPURegionSet(1, 0x2003fe0c,
MPU_RGN_SIZE_512B |
MPU_RGN_PERM_EXEC |
MPU_RGN_PERM_PRV_RW_USR_RW |
MPU_RGN_ENABLE);
MPURegionSet(0, 0x40040020,
MPU_RGN_SIZE_32B |
MPU_RGN_PERM_EXEC |
MPU_RGN_PERM_PRV_RW_USR_RW |
MPU_RGN_ENABLE);
}
else
{
MPURegionSet(1, 0x2003fe0c,
MPU_RGN_SIZE_512B |
MPU_RGN_PERM_EXEC |
MPU_RGN_PERM_PRV_RO_USR_RO |
MPU_RGN_ENABLE);
MPURegionSet(0, 0x40040020, //----------->> here i have to protect just 25 byte
MPU_RGN_SIZE_32B |
MPU_RGN_PERM_EXEC |
MPU_RGN_PERM_PRV_RO_USR_RO |
MPU_SUB_RGN_DISABLE_7 |
MPU_RGN_ENABLE);
}
}
[/code]