2025-06-01 10:44 PM
I'm currently working with the STM32F429IIT6 and using the LTDC to continuously output an image via parallel RGB + control signals. The image I'm trying to display is 854x480 pixels in 24-bit RGB888 format. The LTDC clock is running at 10.56 MHz.
According to ST’s Application Note AN4861, I am using the internal frame buffer to send parallel RGB signals along with synchronization signals to the LCD. The total image size is:
854 x 480 x 24-bit = ~1.2 MB,
which fits comfortably within the STM32F429’s 2MB Flash memory.
My actual image is very simple — it consists of one horizontal line (854 x 24-bit) that repeats identically for all 480 lines. So, in theory, I only need one line of data and could repeat it 480 times on the display.
However, the standard LTDC configuration in STM32Cube sets FBStartAddress to point to a full-frame buffer (854 x 480 x 24-bit). This results in a lot of redundant memory usage.
Is it possible to configure the LTDC to reuse the same single line of pixel data repeatedly for all vertical lines, in order to save memory? In other words, can I update only one line (854 pixels) and have the LTDC read it cyclically for all 480 lines?
Or is there another memory-efficient way to achieve this with the LTDC?
Additionally, I cannot change the current hardware setup, and using FMC or external RAM is not an option in my case. So I'm looking for a software-only solution to this problem.
I also considered storing a single image line (854 x 24-bit) in Flash memory, and then using software to repeatedly copy it to a frame buffer area to construct the full image in RAM. However, this approach is not feasible either, because writing to Flash takes too long — approximately 50 seconds, which is unacceptable for my application.
Thanks in advance for your support!
2025-06-01 11:04 PM
Setting LTDC_LxCFBLR.CFBP = 0 will probably result in what you want to achieve.
Cube/HAL is not intended to do anything out of ordinary, so you will need to program the registers directly.
JW
2025-06-01 11:30 PM
I saw some suggestions saying to set LTDC_LxCFBLR.CFBP = 0.
Does that mean the controller will fetch pixels from the Frame Buffer Start Address until it reaches the Line data size (854 x 24-bit), and then stop at 0?
Also, since I'm using the HAL library, is it possible to reset or reinitialize this value inside a Line Interrupt (LTDC Line Event Callback) to simulate a repeated single line?
Alternatively, is there any example or reference code showing how to directly program the LTDC registers without using the HAL functions?
/******************** Bit definition for LTDC_LxCFBAR register **************/
#define LTDC_LxCFBAR_CFBADD_Pos (0U)
#define LTDC_LxCFBAR_CFBADD_Msk (0xFFFFFFFFUL << LTDC_LxCFBAR_CFBADD_Pos) /*!< 0xFFFFFFFF */
#define LTDC_LxCFBAR_CFBADD LTDC_LxCFBAR_CFBADD_Msk /*!< Color Frame Buffer Start Address */
/******************** Bit definition for LTDC_LxCFBLR register **************/
#define LTDC_LxCFBLR_CFBLL_Pos (0U)
#define LTDC_LxCFBLR_CFBLL_Msk (0x1FFFUL << LTDC_LxCFBLR_CFBLL_Pos) /*!< 0x00001FFF */
#define LTDC_LxCFBLR_CFBLL LTDC_LxCFBLR_CFBLL_Msk /*!< Color Frame Buffer Line Length */
#define LTDC_LxCFBLR_CFBP_Pos (16U)
#define LTDC_LxCFBLR_CFBP_Msk (0x1FFFUL << LTDC_LxCFBLR_CFBP_Pos) /*!< 0x1FFF0000 */
#define LTDC_LxCFBLR_CFBP LTDC_LxCFBLR_CFBP_Msk /*!< Color Frame Buffer Pitch in bytes */
JDK
2025-06-01 11:39 PM
> Does that mean the controller will fetch pixels from the Frame Buffer Start Address until it reaches the Line data size (854 x 24-bit), and then stop at 0?
No.
The controller is supposed to first read into its internal address register the image start address from LTDC_LxCFBAR at the top left of the screen, i.e. after vertical retrace; then for each line read and output pixels given by LTDC_LxCFBLR.CFBLL (which has to be +3 to the actual number of pixels), and at the end of each line increment the internal address register by LTDC_LxCFBLR.CFBP.
> Also, since I'm using the HAL library, is it possible to reset or reinitialize this value inside a Line Interrupt (LTDC Line Event Callback) to simulate a repeated single line?
There's no point to do this, the LTDC_LxCFBLR.CFBP won't change during the LTDC operation.
> Alternatively, is there any example or reference code showing how to directly program the LTDC registers without using the HAL functions?
Cube/HAL is open source, so it's a prime example code which uses direct LTDC registers programming.
JW
2025-06-02 12:59 AM
I'm trying to save RAM by storing only one line (854 x 24bits) data, and then using CFBP = 0 to make LTDC repeat that single line across the whole screen.
I have a questions
1. The controller is supposed to first read into its internal address register the image start address from LTDC_LxCFBAR at the top left of the screen, i.e. after vertical retrace; then for each line read and output pixels given by LTDC_LxCFBLR.CFBLL (which has to be +3 to the actual number of pixels), and at the end of each line increment the internal address register by LTDC_LxCFBLR.CFBP.
2. There's no point to do this, the LTDC_LxCFBLR.CFBP won't change during the LTDC operation.
> I think you says LTDC still tries to move next line after finishing each row. It adds the CFBP value to the current address internally.
> Then it can't update CFBP or CFBAR in real time (Line Interrupt?) and expect LTDC to follow it immediately?
2025-06-02 3:43 AM
I did not test this, but why don't you simply try it?
JW