cancel
Showing results for 
Search instead for 
Did you mean: 

Code is getting stuck at vPortRaiseBASEPRI after using Touchgfx

Hello, I have created one basic project with STM32F746ZG and touchgfx. When I ran my code, In starting only its getting stuck at freeRTOS function vPortRaiseBASEPRI. After debug I found that code asserted at below line of function xQueueSemaphoreTake of queue.c.

/* Check this really is a semaphore, in which case the item size will be

0. */

configASSERT( pxQueue->uxItemSize == 0 );

This function is getting called by OSWrapper.cpp function tryTakeFrameBufferSemaphore. Here we are trying to take Semaphore "frame_buffer_sem". So in simple words value of frame_buffer_sem. uxItemSize is odd like 480.

0693W000001sSfFQAU.jpg

When I debug more, I found during initialization(OSWrappers::initialize) of Semaphore has all correct values but seems like after sometime its getting all data corrupted.

I am really not sure how heap memory is getting corrupted as I just generated code from touchgfx and STM32CubeMX. My heap size is 32768 bytes.

Below are the screen shot of memory allocated for Semaphore "frame_buffer_sem"

After Initializing:

0693W000001sSdwQAE.jpg

At function tryTakeFrameBufferSemaphore call:

0693W000001sSf4QAE.jpg

Note : 0x200004c0  is address of Semaphore "frame_buffer_sem" .

Clearly heap data is getting corrupted.

Below is the stack level

0693W000001sSfOQAU.jpg

Any help?

33 REPLIES 33

Hello,

CLK, lines, pixels are not the same. Look at the tiny note under the table. But there's relation between a cycle and a line or pixel.

Anyway, from my understanding I think your CubeMX settings are correct.

I don't think 9.6 MHz instead of 9 MHz will make a difference. But you can still try to change it if you see that it does not work.

/Alexandre

Helllo, If CLK, lines, pixels value is not same , than why using same value mentioned at datasheet is correct ? For example Horizontal front porch  is mentioned as 2CLK and we are also addding 2 pixels at setting in CubeMX.

Please elaborate.

MM..1
Chief III

9,6M / 525px / 286ln = around 64Hz refresh then next critical info is polarity of sync and clock for LCD as i say on page 9 is graph signal too.

 hltdc.Init.HSPolarity = LTDC_HSPOLARITY_AL;

 hltdc.Init.VSPolarity = LTDC_VSPOLARITY_AL;

 hltdc.Init.DEPolarity = LTDC_DEPOLARITY_AL;

 hltdc.Init.PCPolarity = LTDC_PCPOLARITY_IPC;

only my example you need set your polarity.

And when your MCU is slow or ram ... try half of 9,6MHz as ltdc clock maybe 4,8

I think 64Hz i need to set somewhere in Touchgfx but unable to find correct location, Can you help ?

Also in Touchfgfx I need to set LCD RESET PIN XRES but there is reset pin in LCD.

0693W000001sh1sQAA.jpg

Thanks

@Alexandre RENOUX​ 

Also in Touchfgfx I need to set LCD RESET PIN XRES but there is reset pin in LCD. Can you suggest.

0693W000001sjQzQAI.jpg

@Alexandre RENOUX​  did you get the chance to check ?

MM..1
Chief III

When you dont have reset on LCD simply set unused port pin here.

ok, Also above we was discussing to add display refresh as 64Hz, but unable to find correct location in touchgfx setting Can you help ?

Hello,

As MM..1 said, the LCD-TFT clock at 9,6 MHz indicates already that the LTDC will try to transfer the framebuffer to the screen at 64 Hz (called display refresh in you sentence).

If you want to change the display refresh, changing this value should be enough.

/Alexandre

Hello,

What version of CubeMX are you using ?

TouchGFX is now an additional software, you shouldn't have GRAPHICS in the Middleware tab anymore.

Please use the newest version 5.6.1 (6.0.0 is coming in a couple of weeks)

/Alexandre