memory alignment issue when usb stack and vit demo used together

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

memory alignment issue when usb stack and vit demo used together

Jump to solution
2,701 Views
ganzo
Contributor II

I'm facing memory alignment issue when VIT demo and USB msd stack used together on freertos with SDRAM as main memory. It is either one or another works depending on the memory configuration. Does anybody face same issue? I also couldn't find decription about USE_SDRAM definition.

Labels (1)
0 Kudos
1 Solution
2,678 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi ganzo:

If you run USB stack on SDRAM,  some key structures should be put to non-cached memory.  Please refer to below link for more details.

https://community.nxp.com/t5/i-MX-RT-Knowledge-Base/Using-NonCached-Memory-on-i-MXRT/ta-p/1183369

 

Regards

Daniel

 

View solution in original post

0 Kudos
2 Replies
2,664 Views
ganzo
Contributor II

Thank you @danielchen,

I have tested with OCRAM with above suggestion. I have configured OCRAM like below. It is 750KB in size.

ganzo_1-1638235873605.png

 

ganzo_0-1638235581210.png

Inside the board/board.c file. region 6 setting changed like below.

    /* Region 6 setting: Memory with Normal type, not shareable, outer/inner write back */

//    MPU->RBAR = ARM_MPU_RBAR(6, 0x20200000U);

//    MPU->RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 0, 0, 1, 1, 0, ARM_MPU_REGION_SIZE_1MB);

to

MPU->RBAR = ARM_MPU_RBAR(6, 0x20240000U);

MPU->RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 1, 0, 0, 0, 0, ARM_MPU_REGION_SIZE_1MB);

After that, USB stack is working. I can see the USB thumb drive is mounted. I have little concern about above code. OCRAM size is 750KB. Above code only possible in size of 256KB, 512KB, 1MB. Will that be okay?

Ganzo

0 Kudos
2,679 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi ganzo:

If you run USB stack on SDRAM,  some key structures should be put to non-cached memory.  Please refer to below link for more details.

https://community.nxp.com/t5/i-MX-RT-Knowledge-Base/Using-NonCached-Memory-on-i-MXRT/ta-p/1183369

 

Regards

Daniel

 

0 Kudos