cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H743VIT6 internal RAM artifact while using it as framebuffer.

Emre2blue
Associate II

hello everyone. I've bought a board from WeAct Studio and I've successfully configured LVDC it to show a constant 16 bit image from Flash . My LCD is round and 480x480 RGB666. pixel clocks and everything is spot on. there is no image artifacts nor image shifts on the LCD.  I put an image to a web site and generated some buffer like 

const uint16_t image_data_480x480x16[230400] = {0x2345,,,,,, };

I use the code like this : 

pLayerCfg.FBStartAdress = uint32_t) &image_data_480x480x16;

and it shows beautifully,

 

Before I say the problem,  I have a full framebuffer and a test code is like that.

 

// Define LCD dimensions

#define LCD_WIDTH 480

#define LCD_HEIGHT 480

#define FBSize LCD_WIDTH * LCD_HEIGHT

#define MemSetFrameSize FBSize * sizeof(uint16_t)

 

// Define framebuffer

uint16_t framebuffer[FBSize];

 

void clearFramebuffer() {

// Set all pixels to black (color: 0x0000)

for (int i = 0; i < FBSize; i++) { framebuffer[i] = 0x0000; }

}

 

void FillFramebuffer(uint16_t color) {

for (int i = 0; i < FBSize; i++) { framebuffer[i] = color; }

}

 

and in the static void MX_LTDC_Init(void) function the framebuffer address is :

 

pLayerCfg.FBStartAdress = (uint32_t) &framebuffer;

 

The problem is this. When I want to fill the framebuffer with lets say RED or BLUE or any data.

I see artifacts on the screen. And its all random. Sometimes its like it did not set the values on some random addresses.

 

while(1)

{

HAL_Delay(500);

CopyBuffer(image_data_480x480x16);

HAL_Delay(500);

FillFramebuffer ( 0x0000 );

}

 

in this test I should see an image and black screen right ??? But after FillFrameBuffer I can see some of the old image parts

like I it skipped the for loop for some addresses.

 

I hope I could tell my problem to you. English is not my native language.I don't think it is about the LVDC unit.

the buffer is on RAM_D1 which is 512KB and there is no other variable on the program. This is pure LCDsetup and one image test program.

 

I think I could not make a proper configuration on CORTEX_M7 Area,

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Seems you have a data coherency issue. No need to disable the Dcache as it can impact the performance of your application. All you need is either to disable the cache for the frame buffer using MPU or doing cache maintenance. So please refer to the AN4849 especially the section 3.2: 

https://www.st.com/resource/en/application_note/an4839-level-1-cache-on-stm32f7-series-and-stm32h7-series-stmicroelectronics.pdf

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

View solution in original post

2 REPLIES 2
Emre2blue
Associate II

I'm sorry I'm new to H7xx and I think I've solved the problem with disabling the "CPU DCache". "CPU ICache" is still enabled and "MPU Control Mode" is set to "MPU NOT USED" 

Seems you have a data coherency issue. No need to disable the Dcache as it can impact the performance of your application. All you need is either to disable the cache for the frame buffer using MPU or doing cache maintenance. So please refer to the AN4849 especially the section 3.2: 

https://www.st.com/resource/en/application_note/an4839-level-1-cache-on-stm32f7-series-and-stm32h7-series-stmicroelectronics.pdf

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.