cancel
Showing results for 
Search instead for 
Did you mean: 

Display flickering STM32F746

Hello, I am using STM32F746 with FMC SDRAM, QSPI flash, DMA2D. I observed my display is flicking. You can check video using below link.

https://drive.google.com/file/d/1j3uyyHWHlFO-fGW23RI33Iyos6meYaB-/view?usp=sharing

Any suggestions for solving this issue.

I am using custom board with MCU 746 with below software with version :

  • Touchgfx 4.15.0
  • CubeMX 5.4.0
  • IDE : System workbench for STM32

Thanks

32 REPLIES 32

@Alexandre RENOUX​  @EEuge​ 

I updated both touch gfx and stm32cubmx. I am using stmcube Ide now.

During compilation I am getting 2 _sbrk function. One in syacall.c and another in sysmem.c . Don't know which should I use.

syacall.c :

addr_t _sbrk(int incr)
{
	extern char end asm("end");
	static char *heap_end;
	char *prev_heap_end;
 
	if (heap_end == 0)
		heap_end = &end;
 
	prev_heap_end = heap_end;
	if (heap_end + incr > stack_ptr)
	{
//		write(1, "Heap and stack collision\n", 25);
//		abort();
		errno = ENOMEM;
		return (caddr_t) -1;
	}
 
	heap_end += incr;
 
	return (caddr_t) prev_heap_end;
}

sysmem.c

void *_sbrk(ptrdiff_t incr)

{

 extern uint8_t _end; /* Symbol defined in the linker script */

 extern uint8_t _estack; /* Symbol defined in the linker script */

 extern uint32_t _Min_Stack_Size; /* Symbol defined in the linker script */

 const uint32_t stack_limit = (uint32_t)&_estack - (uint32_t)&_Min_Stack_Size;

 const uint8_t *max_heap = (uint8_t *)stack_limit;

 uint8_t *prev_heap_end;

 /* Initialize heap end at first call */

 if (NULL == __sbrk_heap_end)

 {

  __sbrk_heap_end = &_end;

 }

 /* Protect heap from growing into the reserved MSP stack */

 if (__sbrk_heap_end + incr > max_heap)

 {

  errno = ENOMEM;

  return (void *)-1;

 }

 prev_heap_end = __sbrk_heap_end;

 __sbrk_heap_end += incr;

 return (void *)prev_heap_end;

}

Also frameBuf, It should got to external RAM so i create a session in linker and place it like below:

MEMORY

{

 RAM  (xrw)  : ORIGIN = 0x20000000,  LENGTH = 320K

 FLASH  (rx)  : ORIGIN = 0x8000000,  LENGTH = 1024K

 EXRAM (rx)  : ORIGIN = 0x20000000, LENGTH = 8M

}

 ExtFlashSection :

 {

. = ALIGN(4);

*(TouchGFX_Framebuffer TouchGFX_Framebuffer.*)

  . = ALIGN(4);

 } >EXRAM

but also this big wouldn't fit in 8MB. Something seems wrong. I am using RGB565.

0693W000006HYhWQAW.png  

Also in new code i can't find below functions. Do I need to add it manually ?

/* Initialise the graphical hardware */

 GRAPHICS_HW_Init();

 /* Initialise the graphical stack engine */

 GRAPHICS_Init();

@Alexandre RENOUX​ 

Hello, I am testing the code but now its going for hard fault post prvPortStartFirstTask().

0693W000006He1RQAS.pngI checked fault register CFSR value, its 0x400.

Thanks

Hello,

Did you refer to the F746-DISCO Application Template ? I feel like so many things can be wrong in your code so I suggest you to start fresh from the F746-DISCO Application template and modify the parts that are necessary (from what I can see your project is very similar to the F746-DISCO so I believe only a few things need to be changed). What's your display interface ? If it is LTDC, then just modifying the LTDC settings in CubeMX should be sufficient.

/Alexandre

YES, Its LTDC interface. My chip package is different than discovery board.

0693W000006HflGQAS.jpg@Alexandre RENOUX​ @EEuge​ 

I successfully updated to latest version but still display only get hanged like above image after soometimes, STM is working fine. When I Reset disp pin of display (out of 40 pin) , display starts working again.

Any suggestions from your side?

Hi,

If you based yourself upon the F746-DISCO Application Template and when debugging, the STM is working correctly while the display freezes, then maybe the problem is your display. In this case, you need to contact the display provider because this is outside the scope of ST.

/Alexandre

@Alexandre RENOUX​ 

Hi, It seems like some setting issue to me. Attaching one video. Please see if this can guess any thing.

https://drive.google.com/file/d/1aHzFAm7nPRnVgXYCEWYI4O2yCz6481Zk/view?usp=sharing

Also one doubt, For updating display we send data mode.cpp -> presenter.cpp -> view.cpp and we passed data in function input. Suppose rather than sending function input, if I just send void in all functions and in view.cpp function use some global variable of other file to update display. Is this fine?

Thanks

@Alexandre RENOUX​  I created one thread related to issue. Please check.

https://community.st.com/s/question/0D53W00000TpEyoSAF/stm32-resetting-after-adding-touchgfx-task-in-freertos

I see, you didn't followed my advise?

  1. lockDMAToFrontPorch(false); set it to true!