-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lvgl display buffer to internal RAM #3
Comments
You should set the address manually. See the driver as reference: lv_port_stm32h745i_disco/CM7/Core/Src/Lvgl_Porting/lvgl_port_lcd.c Lines 69 to 71 in 88e342b
|
That's what I tried, see my code above. Unfortunately, this causes the program to crash or freeze, see attached picture. In addition I have a problem with the lv_demo_music, see following link: |
It seems like a missing caching invalidation. |
What would be the procedure to solve this? I would appreciate any hints, I'm beginner here.. Thank you |
I'm also not an expert but here is a recent discussion about it: |
@epikao See the sample code for my complete STM32F769I-DISCO LVGL demo. |
Ok, hm, but it looks this is already done that way, see code below. lv_port_stm32h745i_disco/CM7/Core/Src/Lvgl_Porting/lvgl_port_lcd.c
|
True, copying in-memory image area to another memory area, or directly to a device interface, can be done in many ways. E.g. |
I think your way is pretty the same... so I still not know where from I have the issues mentioned above :-( ... |
I do not know either, but calling |
The core issue is this: DMA(2D) and LTDC interface do not use DCache so you want to make sure physical memory has current byte values after bytes are copied or before - if you copy with DMA. That is why you need to flush (clean) cached values. |
thank you for your explanation, I changed as code below, but still the same issue as shown in the link below. Interestingly, I don't have this problem with the other LVGL demos.
and here the copy function:
|
Make sure you pass SCB_CleanDCache_by_Addr() the length of the input buffer, compare with my example. |
However, I port the H745 port to H750... and with except of the internal flash memory there are not much differences, so I'm a little bit surprised that this port and the music player seems to work with H745 but not with H750... I adjusted the code of H745 port as code see below, but without success. Adjusted code according F769:
your code:
|
see video link below about the strange effect (only with music demo): |
|
you do the same, or not? => LCD_BPP
You mean just copy your whole FlushBufferStart function? |
Not correct, see how LCD_BPP is defined and commented
Correct, try both version |
It seems that only some parts of the screen draw incorrectly so maybe one more thing: |
your function without using DMA2D works :-)
phuu, how can I test this? |
Google it up or find on Stackoverflow. |
I don't understand much, the buffer addresses are set as following.
|
Just find |
Since I just found an interesting issue in some other code, resulting in a similar screen glitch;
It seems like it is actually possible to start DMA2D setup for the new transfer while the previous one is still running. |
just tried, this makes it worse. I do not have the H745 board, @ahmetalperenbulut , can you confirm whether the music demo runs properly? |
That is probably not causing a problem in your case, but I have to admit that I found a bug in my code and posted a fix yesterday. |
sorry for the late reply: |
Several days ago I have modified my example significantly. I am wondering if it would work as well. |
@tdjastrzebski https://drive.google.com/file/d/1opsjLjmEKbEB-URVqQ8h3O4TYHjki96O/view?usp=share_link EDIT: I did not implement your MPU-config and timer call for task_handler and lv_tick (task_handler still in the loop, and lv_tick over systick and MPU-config is from H750 stm examples) |
Yes, basically problem is solved, LVGL works with STM32H750 DK now, but it doesn't matter which driver I use, the framerate is always at 7-20FPS (at animation), with h7b3 ported lvgl driver the framerate is between 14 and 20 FPS. |
I would give it a try, but there can be other factors too, e.g. CPU clock speed. DMA2D dos not help with animations, but blending only. |
ok will try it next week, but I not really believe that this is the problem. On following video (certified lvgl board, stm32h7b3i) the framerate with the music-demo is always at >30fps max. fCPU STM32H750 is 480MHz, and H7b3i is 280MHz... so I think CPU clock speed can't be the reason... (I use standard/stm example system clock setup)
Yes, but this 864Kbyte are splitted, not contigous, so my question is how to get it contigous.. |
This is an interesting question because I thought of using H750 MPU myself. |
hmm, are your sure it cannot, see reply in following link from user JPeac.1 ? Reason is, that I want use STM32H750 based on a customized board for bigger displays as for examble 1024x600, or maybe also 1280x800... So my question is, what is better for high framerate? Big internal AXI SRAM as H7b3i (but lower fCPU) or higher fCPU as H750 but because of low internal AXI SRAM use external SDRAM.... |
I am not sure, to be sure I would have to test it, but that is what RM0433, p.104, Table 3. Bus-master-to-bus-slave interconnect seems to be clearly saying. See 2.1.6 Bus master peripherals as well. |
Yes, I think up to a resolution of 1024x600 and with 16bit color depth the U-variant could make sense, because then you can store the two GUI drawing buffers + the frame buffer all in the internal RAM. BTW: Regarding 32bit pixel format - are the last 8bit (alpha) used at all? If not, I think a lot of memory is wasted here just to achieve a higher color depth... |
You are correct, the last Alpha byte is not used. I did not bother to optimize it since it is just a demo. |
In my opinion , the MPU should be used to set the memory area where the data is cached to a non-cacheable property so that there are no consistency issues |
Hello
Is it possible to move the lvgl display buffer to the internal buffer as code below? What do I have to change more ( because just change this does not work for me)?
thank you
The text was updated successfully, but these errors were encountered: