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
MM..1
Chief II

Yes porch numbers is one point , but your schematc is RGB666 or 18bit LTDC interface. You can config it and framebuffer RGB565 or RGB888.

Hello,

The back porch and front porch are supposed to be on the LCD datasheet. I don't think you can find them elsewhere. It's quite strange that you cannot find these values.

Or else if you have code examples of this screen being used, you can refer to that as the values should be the same.

/Alexandre

Hello,

TIM6 is necessary to maintain the stability of the app. This way both the HAL and the OS don't use the same timebase.

TIM6 is for HAL while SysTick is for the OS (here FreeRTOS).

/Alexandre

@Alexandre RENOUX​  I am attaching 2 different datasheet of LCD. Can you please check ?

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

MM..1
Chief II

In datasheet X043DTLT is all polarity and timing porch info on page 9.

Yes In software I am sending low on R2,B2 lines. Basically I want to saved size of external flash and RAM so choosing RGB565.

​@MM..1​   Thanks for replay. Actually I am first time working on LCD so kinda confused.

I checked page 9, but there data is in CLK(HZ) but I need to mention it in pixels for horizontal and lines for vertical. Can you please help me understand it?

0693W000001sgkDQAQ.jpg

0693W000001sgkIQAQ.jpg

0693W000001sgkSQAQ.jpg

Hello,

I looked at the two datasheet and I don't seem to find any relevant info for porch for the 5'' screen 800*480.

On the other hand, like MM..1 mentioned, the screen with a resolution of 480*272px has a table regarding that.

You can see that Horizontal display period = 480 and Vertical display period = 272 which matches the resolution.

Therefore I guess that :

Horizontal front porch is 2 pixels

Horizontal Back porch is 2 pixels

An same for vertical.

Horizontal Synchronization in CubeMX would correspond to Horizontal pulse width and same for Vertical.

/Alexandre

Thanks @Alexandre RENOUX​ , So you are saying below is correct data for 480*272 ?

0693W000001sgoAQAQ.jpg

My input clock is 9.6 to LCD, but these values ate for 9MHZ. 0693W000001sgoKQAQ.jpg

Also CLK, pixels , lines are same unit?