2019580_en-US

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

2019580_en-US

2019580_en-US

Configuring memory protection unit (MPU) in i.MX RT1040

Hello,

I am trying to enable the MPU for RT1040 and configure a couple of sections of the RAM as non-executable. I am unable to find the relevant document / example code to be able to configure the MPU for this chip. From this link https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/TEE-for-ARM-Cortex-M7-based-MCU/td-p/1753242, I got information about the “tee_fault” example in “SDK_2_16_000_MIMXRT1160-EVK” and learned about the McuXpresso Config TEE tool. But this tool is not supported for RT1040.

So, my questions are:

  1. How do I configure the MPU for RT1040 processor?
  2. Are there any example code / documentation which I can refer to?

Thanks

Re: Configuring memory protection unit (MPU) in i.MX RT1040Thank you. I think I can proceed with these references.Re: Configuring memory protection unit (MPU) in i.MX RT1040

Hi @rd24 

- Firstly, I would like to share the dedicated application note about the cache system that includes the L1 cache, memory
types, attributes and MPU (Memory Protection Unit) https://www.nxp.com/docs/en/application-note/AN12042.pdf

- There are no any dedictaed examples about MPU feature, but you can understand from below sample code in many examples.

https://github.com/nxp-mcuxpresso/mcux-sdk-examples/blob/52b428258efda7d5bd8a2ace2195ca828356743a/ev... 


    MPU->RBAR = ARM_MPU_RBAR(7, 0x80000000U);
    MPU->RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 0, 1, 1, 1, 0, ARM_MPU_REGION_SIZE_32MB);
    /* Enable MPU */
    ARM_MPU_Enable(MPU_CTRL_PRIVDEFENA_Msk | MPU_CTRL_HFNMIENA_Msk);

Re: Configuring memory protection unit (MPU) in i.MX RT1040

Hi @Sam_Gao,

Thanks for your quick reply. I have checked the BOARD_ConfigMPU() function from the hello_world example and understood the MPU configurations. I understand that after configuring and enabling the MPU, if an access is made to a region without the right permissions a MemManage fault is raised. Is there a handler for the MemManage fault? Is there an example code which demonstrates this scenario?

Thanks

Re: Configuring memory protection unit (MPU) in i.MX RT1040

Hi @rd24 

1. About SDK of I.MX RT1040, please download from https://mcuxpresso.nxp.com/en/builder?hw=MIMXRT1040-EVK which supports our nxp.com/i.mxrt EVK board for reference.

2. About MPU configuration, you can refer anyone of examples (e.g, helloworld) in source/xx.c

reference code like below, `BOARD_ConfigMPU` function is for configration when doing init board hardware.

int main(void)
{
    char ch;

    /* Init board hardware. */
    BOARD_ConfigMPU();
    BOARD_InitBootPins();
    BOARD_InitBootClocks();
    BOARD_InitDebugConsole();

    /* Just enable the trace clock, leave coresight initialization to IDE debugger */
    SystemCoreClockUpdate();
    CLOCK_EnableClock(kCLOCK_Trace);

    PRINTF("hello world\r\n");

タグ(1)
評価なし
バージョン履歴
最終更新日:
‎11-21-2025 12:15 PM
更新者: