2025-12-08 8:23 AM - last edited on 2025-12-08 8:33 AM by Andrew Neil
HI all i have been working with LTDC to drive an external RGB parallel display . i made it working by placing the framebuffer inside internal RAM . i got output with good update speed. but when i try to incoperate FREERTOS with this project the output is gone . any one encountered such issues like this , any solution for this now? ;)
2025-12-08 8:31 AM - edited 2025-12-08 8:31 AM
An RTOS (any RTOS) is not really something that you can just bolt-on to an existing project - it is a fundamental change to the project architecture.
You'll need to do some debugging to find why your code is not working ...
2025-12-09 1:54 AM
Hello @b1aze
When using FreeRTOS, it is essential to ensure that all peripheral interrupts are assigned a priority that is equal to or lower than (i.e., numerically higher than) the value specified by configMAX_SYSCALL_INTERRUPT_PRIORITY. Therefore, the priorities of the LTDC and DMA interrupts should be configured to levels that comply with this requirement to maintain system stability and proper FreeRTOS operation.
2025-12-09 8:51 AM
Hi guys thanks for the response , right now all i know is that LTDC is being initialized , beacuse in my code
starting address of internal RAM is given to LTDC and LTDC seems to read from the RAM , before RTOS i get full display output, but after output i get this scrambled red color on the screen , so without LTDC or clock signal i wouldn't have got anything on the display. so my assumption is that something is happeing with priority timing or my framebuffer is being scrambled somehow . whats your thoughts or ideas.
2025-12-09 9:19 AM
Please see How to insert source code - not as an image.
2025-12-09 10:06 AM
H7 isnt game for kids. Show your reservation for framebuffer in linker RAM 0x24000000 etc.
2025-12-09 11:26 PM
This is from linker script
.framebuffer (NOLOAD) :
{
. = ALIGN(32);
KEEP(*(.framebuffer))
. = ALIGN(32) ;
}>RAMand in my code for frame buffer this
__attribute__((section(".framebuffer"),aligned(32))) uint16_t framebuffer[LCD_WIDTH * LCD_HEIGHT];
lv_color_t lvgl_buf[LCD_WIDTH * LVGL_BUF_SIZE];
lv_disp_draw_buf_t drawbuf;
lv_disp_drv_t dispdrv;
void init_lvgl(void)
{
lv_disp_draw_buf_init(&drawbuf, lvgl_buf,lvgl_buf, LCD_WIDTH * LVGL_BUF_SIZE);
/* Initialize display driver */
lv_disp_drv_init(&dispdrv);
dispdrv.hor_res = LCD_WIDTH;
dispdrv.ver_res = LCD_HEIGHT;
dispdrv.flush_cb = flush_cb;
dispdrv.draw_buf = &drawbuf;
dispdrv.full_refresh = 0 ;
dispdrv.direct_mode = 0 ;
lv_disp_drv_register(&dispdrv);
}
static void flush_cb(lv_disp_drv_t*disp, const lv_area_t *area, lv_color_t* px_map)
{
uint32_t w = (area->x2 - area->x1 + 1);
uint32_t h = (area->y2 - area->y1 + 1);
uint16_t *dst = framebuffer + area->y1 * disp->hor_res + area->x1;
uint16_t *src=(uint16_t *)px_map;
//HAL_DMA2D_Start(&hdma2d,*(src),*(dst),w,h);
for (uint32_t y = 0; y < h; y++) {
//HAL_DMA2D_Start();
memcpy(dst, src, w * sizeof(uint16_t));
dst += disp->hor_res;
src += w;
}
lv_disp_flush_ready(disp);
}this is it . ask if you need anything
2025-12-10 2:13 AM
Still not show 0x24000000 and framebuffer ... LTDC
2025-12-10 8:03 PM
This is my linker script and i declared my framebuffer like this in main.c file
__attribute__((section(".framebuffer"),aligned(32))) uint16_t framebuffer[LCD_WIDTH * LCD_HEIGHT];
lv_color_t lvgl_buf[LCD_WIDTH * LVGL_BUF_SIZE];this is it nothing else i done for frmabuffer. and inside the LTDC i gave the RAM start address
pLayerCfg.FBStartAdress = 0x24000000;
/* Entry Point */
ENTRY(Reset_Handler)
/* Highest address of the user mode stack */
_estack = ORIGIN(RAM) + LENGTH(RAM); /* end of RAM */
/* Generate a link error if heap and stack don't fit into RAM */
_Min_Heap_Size = 0x200; /* required amount of heap */
_Min_Stack_Size = 0x400; /* required amount of stack */
/* Specify the memory areas */
MEMORY
{
ITCMRAM (xrw) : ORIGIN = 0x00000000, LENGTH = 64K
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 2048K
DTCMRAM1 (xrw) : ORIGIN = 0x20000000, LENGTH = 64K
DTCMRAM2 (xrw) : ORIGIN = 0x20010000, LENGTH = 64K
RAM (xrw) : ORIGIN = 0x24000000, LENGTH = 1024K
RAM_CD (xrw) : ORIGIN = 0x30000000, LENGTH = 128K
RAM_SRD (xrw) : ORIGIN = 0x38000000, LENGTH = 32K
}
/* Define output sections */
SECTIONS
{
/* The startup code goes first into FLASH */
.framebuffer (NOLOAD) :
{
. = ALIGN(32);
KEEP(*(.framebuffer))
. = ALIGN(32) ;
}>RAM
.isr_vector :
{
. = ALIGN(4);
KEEP(*(.isr_vector)) /* Startup code */
. = ALIGN(4);
} >FLASH
/* The program code and other data goes into FLASH */
.text :
{
. = ALIGN(4);
*(.text) /* .text sections (code) */
*(.text*) /* .text* sections (code) */
*(.glue_7) /* glue arm to thumb code */
*(.glue_7t) /* glue thumb to arm code */
*(.eh_frame)
KEEP (*(.init))
KEEP (*(.fini))
. = ALIGN(4);
_etext = .; /* define a global symbols at end of code */
} >FLASH