RT1052 SDRAM noncache area read speed is very slow

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

RT1052 SDRAM noncache area read speed is very slow

203 Views
qq240997293
Contributor I

Premise Description:

1. Define the beginning of 0x81800000 of SDRAM, and the area with size 0x00800000 is noncache area. In this noncache area, the DISPLAY memory area of LCD is also in this area.

2. If the chinese fire RT1052 development board is used, the system clock is 528000000

qq240997293_0-1652487007018.png

The SEMC peripherals clock is 198000000

qq240997293_1-1652487026616.png

3. The MPU configuration is as follows:

qq240997293_2-1652487050424.png

 

Problem Description:

I used several ways of reading and writing data, test reading and writing speed.

1. Copy from frame 1 in noncache to frame 2 in noncache using memcpy, which takes 69.6ms;

2. Copying a frame from a cacheable array to a noncache array using memcpy takes 16.2ms.

3. Using memcpy to copy data from frames ① in nonCache to an array of one frame in Cacheable (70.0ms).

4. Use memset to write all frames in noncache area as 0x55, which takes 5.8ms;

 

Why is reading data from nonCache so time-consuming?

I've also tried copying data using *(Uint32_t *) and two for loops and it's actually slower than memcpy.

Shouldn't a 32-bit system read and write at 32 bits be the fastest?

Since this area is video memory, you can't use cacheable to do this because when I tested it again, the overall speed was faster, but the graphics were cluttered with abnormal pixels.

Copying data using DMA is still slow.

 

Attached is the project I use to test SDRAM reading and writing.

0 Kudos
0 Replies