Funny bar fill issues

I’m unclear if this is a bug, or probably a bug in my code. I have 12 240x240 screens, it mostly works ok, except that one random screen(meaning a different one after reboot) will quit fully refreshing a part of the bar, or at least it is filling it with some other color.

Device is STM32F769NIH with 32MB external sdram. The buffer is located in sdram.

Code is large, not sure about posting a wall of code. Any ideas where to look, or any particular code I should show here?

I’m somewhat familiar with STM32F7, so I might be able to help. Are you using the CPU cache and/or DMA2D?

Are you filling the bar with local variables? Maybe some variable is un initialized.

I’m using the CPU cache, but for the buffer I’m giving to lgvl it is sdram set up as uncached in the MPU. The driver DMA’s it out via SPI bus. I’ll be doing more digging, but the memory debugging window reflects what is getting sent to the screen. I have the buffer set up slightly large so that it doesn’t true double buffer, as I want selective updates due to the SPI bottleneck.

In your original picture I do see a sliver of the green bar’s fill present on the far left. It’s as though it skips sending a chunk for some reason. You’re using version 6.1, right?

Yes, its version 6.1.1

I didn’t send a very good picture. It gets about 1 pixel on a line, then skips about 10 lines, then finishes at the bottom with a pixel off of a complete line.

Are you using an operating system on the device? There might be a concurrency issue somewhere.

I am. However, lvgl is called from a single thread.

Okay; that shouldn’t be an issue then.

My problem is my driver I guess. I am calculating length like this–

uint32_t len = ((x1 - x0) * (y1 - y0)) * 2;

which is wrong I guess, because x1=2,y1=44,x2=15,y2=195 should be calculated to 4256 rather than the presently calculated 3926.

I could be wrong, but shouldn’t it be x1 - x0 + 1 and y1 - y0 + 1, if you are looking for the width and height?

Yes, thats right.