2024-03-16 08:26 AM
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,
Solved! Go to Solution.
2024-03-16 01:10 PM - edited 2024-03-16 01:11 PM
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:
2024-03-16 12:26 PM
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"
2024-03-16 01:10 PM - edited 2024-03-16 01:11 PM
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: