MIMXRT1170 SEMC ,SDRAM ,MPU

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MIMXRT1170 SEMC ,SDRAM ,MPU

Jump to solution
736 Views
Charindu_Abeysekara
Contributor II

just clarify I'm referring to an example code to access SDRAM through MIMXRT1107 in the code it configure MPU in a following a sequence: disable d cache, cache present ,disable i cache, and Icache present and then access the region 9 setting , since im a fresher can someone please explain why there are following a procedure like above to configure MPU? (i have referred the referance mannual as well , but i didnt found anything )

0 Kudos
Reply
1 Solution
723 Views
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @Charindu_Abeysekara ,

Thanks for your interest in NXP MIMXRT series!

MPU can divide the memory into different areas and set different access rights and attributes for each area. Through reasonable configuration of MPU, critical memory areas can be protected from illegal access, thus improving system security and stability.

The steps followed in this code to configure the MPU are as follows.

  1. Disable (D-Cache) and (I-Cache). This is because if the cache is still open when configuring MPU, it may cause data inconsistency between the cache and memory, which may lead to unpredictable consequences. Therefore, it is better to disable them before configuring MPU.
  2. Disable the MPU. before reconfiguring the MPU, you need to disable it first.
  3. Configure the MPU settings for Region 9. The memory type, access rights, and other attributes of this region are set here. 
  4. After the configuration is completed, turn on the MPU to make it take effect.
  5. If caches were previously disabled, re-enable them here.

This rigorous configuration process is to ensure that when accessing critical memory areas, the expected memory properties and access rights are followed, preventing potential safety hazards or anomalies.

Best regards,
Gavin

View solution in original post

2 Replies
724 Views
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @Charindu_Abeysekara ,

Thanks for your interest in NXP MIMXRT series!

MPU can divide the memory into different areas and set different access rights and attributes for each area. Through reasonable configuration of MPU, critical memory areas can be protected from illegal access, thus improving system security and stability.

The steps followed in this code to configure the MPU are as follows.

  1. Disable (D-Cache) and (I-Cache). This is because if the cache is still open when configuring MPU, it may cause data inconsistency between the cache and memory, which may lead to unpredictable consequences. Therefore, it is better to disable them before configuring MPU.
  2. Disable the MPU. before reconfiguring the MPU, you need to disable it first.
  3. Configure the MPU settings for Region 9. The memory type, access rights, and other attributes of this region are set here. 
  4. After the configuration is completed, turn on the MPU to make it take effect.
  5. If caches were previously disabled, re-enable them here.

This rigorous configuration process is to ensure that when accessing critical memory areas, the expected memory properties and access rights are followed, preventing potential safety hazards or anomalies.

Best regards,
Gavin

720 Views
Charindu_Abeysekara
Contributor II
Thanks in advance
0 Kudos
Reply