This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Prefetch abort with MPU

Other Parts Discussed in Thread: TMS570LS3137
Hello,
I'm using a TMS570LS3137 with CCS 5.5.0.00077 and Compiler v5.1.4.
I have a (for me) strange problem with the MPU. In the first screenshot you can see the prefetch abort with instruction fault Status 0xD (permission) at address 0x00078060 (this is in the restore context part of FreeRTOS)
But if I add or remove code before 0x78060 (so the restore context code moves to another address, even if the new code doesn't execute) the software is running without any aborts. Also if I activate compiler optimisation the software runs.
What can be the reason for this strange behaviour.
Thanks
BR
Christian
  • Hello Christian,

    I have forwarded your question to one of our MPU experts. They will reply to your questions soon.

  • Hi,

    I have additional informations for that Point.
    Here is the code which sets the default MPU Setting which is valid for every task:


    prvMpuDisable();

    prvMpuSetRegion(0, 0x00000000, portMPU_SIZE_4MB | portMPU_REGION_ENABLE, portMPU_REGION_READ_ONLY | portMPU_REGION_CACHEABLE_BUFFERABLE);

    prvMpuSetRegion(1, 0x80000000, portMPU_SIZE_8MB | portMPU_REGION_ENABLE, portMPU_REGION_PRIVILEGED_READ_WRITE_USER_READ_ONLY | portMPU_REGION_CACHEABLE_BUFFERABLE);

    prvMpuSetRegion(2, 0x08000000, portMPU_SIZE_256KB | portMPU_REGION_ENABLE, portMPU_REGION_PRIVILEGED_READ_WRITE_USER_READ_ONLY | portMPU_REGION_CACHEABLE_BUFFERABLE);

    prvMpuSetRegion(3, 0xFC000000, portMPU_SIZE_64MB | portMPU_REGION_ENABLE, portMPU_REGION_PRIVILEGED_READ_WRITE_USER_READ_ONLY | portMPU_REGION_EXECUTE_NEVER | portMPU_REGION_DEVICE);

    prvMpuSetRegion(11, 0xF0000000, portMPU_SIZE_8MB | portMPU_REGION_ENABLE, portMPU_REGION_PRIVILEGED_READ_WRITE | portMPU_REGION_EXECUTE_NEVER | portMPU_REGION_DEVICE);

    prvMpuEnable();


    If I exchange the settings for region 0 and 11 the software runs fine.
    This can be the solution but I want to understand why the MPU behaves like this?

    BR
    Christian