cancel
Showing results for 
Search instead for 
Did you mean: 

I am currently facing the issue with continuously displaying UART data on LCD using TouchGFX

MPath.4
Associate II

I am currently working on the STM32H750VB custom board where 16 bpp RGB LCD Interface is used. After sending the data for couple of times successfully on the LCD screen, it stops displaying the data. On debugging, I found out that it gets stuck on configASSERT( pxQueue->uxItemSize == 0 ) called from xQueueSemaphoreTake(). 

As I am new to freertos and TouchGFX, can you please provide me the insight to find the root cause?

24 REPLIES 24
JTP1
Lead

Hello

Seems that you are just defining pointer to your structure

 

 uart_Data *uart_Struct;

 

but never allocate memory for it ?

Thats maybe to root cause of your problems. You can add the memory allocation or just make it static by removing '*' on both declaration (main.c and model.cpp).

then probably this line on model.cpp

 

if (osMessageQueueGet(uartQueueHandle, &uart_Model[10], 0, 0) == osOK)
should be
if (osMessageQueueGet(uartQueueHandle, &uart_Model, 0, 0) == osOK)
or 
if (osMessageQueueGet(uartQueueHandle, uart_Model, 0, 0) == osOK)
depending how you will improve the uart_model- stucture declaration

 

Maybe this helps you forward :thumbs_up:

Okk thank you @JTP1 

I try it and get back to you later.

 

Hello @JTP1

I tried what you said without using '*' but it didn't work the problem remains the same.

I send you the flow of it I hope it will help you to understand the problem.

semaphore_issue.png

Hello. Could you now publish your latest main.c, main.h and model.cpp ?

Ok, I send you the link.

https://we.tl/t-HdqA1zeMkX  

JTP1
Lead

Hello. Test with these, I little bit fix to stucture handling on put and get queue. And remove continuos initializing of HAL_UARTEx_ReceiveToIdle_IT at DefaultTask. Since I cant run your code it cannot be verified it 100%.

If its still hanging, try to comment out putting messages to queue, retrieving from queue etc until you find which operation is causing the problem. Your principle of using queue's should work fine since I build as practice a simple serial terminal on the TGFX which shows received strings from uart with queue from main.c. It also sends some test strings from UI button handler to model and then to other os process with TX queue.

I tried commenting out  the queues messages and  check it using debug the problem remains the same and please check the Semaphore once .I send you my project again.

https://we.tl/t-Ry6AUdzmPa 

MM..1
Chief III

Try start over. 1.Is your code real multithread? 2. Is your MCU real multicore? 3.Is your data uart used only on screen show? usw...

Real use of queues semaphores is required only when your 1. YES 2. YES ...

If i good rememmber UART examples use model get queue data and ISR send queue data. Here cn exist two situation A. Your buff between two model gets is ok filled B. is overflowed

Try STM32 UART Ring Buffer using DMA and IDLE Line - YouTube

 

Hello

Seems that your framebuffer needs 768 000 byte (800x480x2 byte(16 bit)) and you have place is it 512Kbyte area in SRAM (starting from 0x24000000) so its overflowing. Maybe you could reduce Y resolution so that it fits in 512 K and see does it help to the lock ups.(or use partial framebuffer or reduce color count to 256).

I have already reduced my Y resolution. My framebuffer size is(800x300x2 byte(16 bit))  so it comes in the range of 512Kbyte. Even I tried to make the resolution size very small but it did not help.