DTCM i.MXRT 1052 configuration

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

DTCM i.MXRT 1052 configuration

1,832 Views
davidrozenski
Contributor I

Dear All,

I am using MIMXRT1050-EVK and would like to configure DTCM for 512 Kb at the first place of my software, I did the following : 

 

___writeMemory32(0x400AC040, 0x80000000); //IOMUXC_GPR_GPR16
___writeMemory32(0x400AC044, 0xAAAAAAAA);

 

but I get hardfault on the second line, any advise about this ?

 

I call these 2 lines just after clock init.

 

Regards

David

0 Kudos
Reply
5 Replies

1,120 Views
jay_heng
NXP Employee
NXP Employee

Best practice is to configure FlexRAM in Reset_Handler as below:

__iomux_gpr16_adr     EQU  0x400AC040
__iomux_gpr17_adr     EQU  0x400AC044

__flexram_bank_cfg    EQU  0xAAAAAAAA

Reset_Hanlder
    CPSID I                     ;关闭全局中断
    LDR R0,=__iomux_gpr17_adr
    MOV32 R1,__flexram_bank_cfg
    STR R1,[R0]
    LDR R0,=__iomux_gpr16_adr
    LDR R1,[R0]
    ORR R1,R1,#4
    STR R1,[R0]

 

0 Kudos
Reply

1,121 Views
jay_heng
NXP Employee
NXP Employee

Note that you need to configure IOMUXC_GPR_GPR17 before IOMUXC_GPR_GPR16, and why you configure IOMUXC_GPR_GPR16 as 0x80000000? it should be 0x00200007.

___writeMemory32(0x400AC044, 0xAAAAAAAA);//IOMUXC_GPR_GPR17

___writeMemory32(0x400AC040, 0x00200007); //IOMUXC_GPR_GPR16

0 Kudos
Reply

1,123 Views
jay_heng
NXP Employee
NXP Employee

As RT1050 only contains 512KB FlexRAM, not other dedicated OCRAM, so your application .data/.bss sections have to be resided in FlexRAM region.

In this case, you need to put FlexRAM configuration code before .data/.bss init process of your application, or there will be hardfault. because .data/.bss will be damaged after FlexRAM configuration.

0 Kudos
Reply

1,130 Views
ofirvn
Contributor I

do you have sample code or application node also for RT1166 and RT1172?

0 Kudos
Reply

1,603 Views
igorpadykov
NXP Employee
NXP Employee

Hi David

for configuration examples one can look at sect.2.1.1.2. Runtime

configuration AN12077 Using the i.MX RT FlexRAM
https://www.nxp.com/docs/en/application-note/AN12077.pdf

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply