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.
已解决! 转到解答。
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
Thank you @danielchen,
I have tested with OCRAM with above suggestion. I have configured OCRAM like below. It is 750KB in size.
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
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