Change RAM partitions and remove SDRAM in imxrt1064

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

Change RAM partitions and remove SDRAM in imxrt1064

Jump to solution
1,738 Views
Davidino
Contributor IV

Goodmorning,

For my test, I'm using imxrt1064-evk demo board and the SDK version is 2.9.1 (Manifest version is 3.8.0).

I write you since I need to expand the DTC ram to 256k, reduce the OCRAM RAM memory to 128k and, since in our custom board hasn't the external SDRAM, eliminate the BOARD SDRAM and NCACHE_REGION. Overall I want DTC: 256k, ITC: 128k and OCRAM: (512k+)128k.

I've followed the guide https://community.nxp.com/t5/i-MX-RT/How-to-reconfigure-the-flexRAM-on-i-mxRT-1062-using-MCUXpresso/...

The changes that I made concern the ResetISR() function contained in startup_mimxrt1064.c, the MCU settings, the BOARD_ConfigMPU() function in board.c, the fsl_flexspi_nor_boot.c file shown in attachment.

I have got some questions:

  1. Is it correct?
  2. In function resetISR, in register IOMUXC_GPR_GPR17, I load 0x5AAFFAA5 instead of 0xaaaaff55. In my opinion, if I mean to apply these changes to eFuses, 0x5AAFFAA5 (01011010101011111111101010100101) is correct while 0xaaaaff55 is not.
  3. In my project, I need to control motor PWMs and, among the several peripherals, an USB host cdc. I notice that if I comment out the function BOARD_ConfigMPU() the program works better. Can you explain me?

Thank you in advance for your help.

Best Regards,

Davidino

Tags (1)
0 Kudos
1 Solution
1,701 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hello Davidino, 

Is it correct?
Yes, these steps are correct. There's one additional step that I forgot to mention in my community document. Besides these changes, you also need to reallocate the stack pointer to the beginning of the DTC memory. I'm working on adding this to the document. In the meanwhile, please refer to the following community thread where I mentioned how to achieve this.
Solved: Re: FLEXRAM configuration - NXP Community

In function resetISR, in register IOMUXC_GPR_GPR17, I load 0x5AAFFAA5 instead of 0xaaaaff55. In my opinion, if I mean to apply these changes to eFuses, 0x5AAFFAA5 (01011010101011111111101010100101) is correct while 0xaaaaff55 is not.
Yes, this configuration seems to be correct since you can also apply it through the fuses once you confirm that your application is working fine.

In my project, I need to control motor PWMs and, among the several peripherals, an USB host cdc. I notice that if I comment out the function BOARD_ConfigMPU() the program works better. Can you explain me?
What do you mean when you said that your program works better? Could you please elaborate a little bit more on this? 

Regards,
Victor 

View solution in original post

2 Replies
1,702 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hello Davidino, 

Is it correct?
Yes, these steps are correct. There's one additional step that I forgot to mention in my community document. Besides these changes, you also need to reallocate the stack pointer to the beginning of the DTC memory. I'm working on adding this to the document. In the meanwhile, please refer to the following community thread where I mentioned how to achieve this.
Solved: Re: FLEXRAM configuration - NXP Community

In function resetISR, in register IOMUXC_GPR_GPR17, I load 0x5AAFFAA5 instead of 0xaaaaff55. In my opinion, if I mean to apply these changes to eFuses, 0x5AAFFAA5 (01011010101011111111101010100101) is correct while 0xaaaaff55 is not.
Yes, this configuration seems to be correct since you can also apply it through the fuses once you confirm that your application is working fine.

In my project, I need to control motor PWMs and, among the several peripherals, an USB host cdc. I notice that if I comment out the function BOARD_ConfigMPU() the program works better. Can you explain me?
What do you mean when you said that your program works better? Could you please elaborate a little bit more on this? 

Regards,
Victor 

1,693 Views
Davidino
Contributor IV

Hello victorjimenez,

thank you very much. Concerning the procedure I changed stack region and location as shown in attachment. Then I added the following instructions in startup_mimxrt1064.c

"LDR R0, =0x20001fff\n" // load initial value to stack pointer into R0
"MSR MSP,R0\n" // re-initialize stack pointer by new value

About the last point, I try to explain better.

I toggle a gpio inside the interrupt of each PWM channel. The interrupt that I use is VAL1 with priority 0 (the maximum). With an oscilloscope I can monitor both leds and pwm waveforms.

If see that the gpio toogles exactly in correspondence with the falling edge of the waveform, it means that the program works well. But if gpios toggle with a delay compared to the waveform, the program doesn't works well because interrupts triggered are delayed for some reason (such as disableGlobalIRQ and enableGlobalIRQ used in usbHost code).

This topic can be considered closed but I need more support to optimize my code. Can you help me with this thread: https://community.nxp.com/t5/i-MX-Processors/Relocate-vector-table-to-ITCM/m-p/1302456#M176414

Thank you.

0 Kudos