cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with 12-Lead ECG Waveform Plotting and GUI Implementation on STM32

smj-11
Associate III

Dear STMicroelectronics Support Team,

I am currently working on a project using an STM32 microcontroller where I need to display a 12-lead ECG waveform. The display layout is configured in a 3x4 grid format, along with an R-1 waveform shrink. I have implemented an RTOS for managing the GUI rendering and data handling efficiently.

For the GUI, I am using the TouchGFX framework and have integrated dynamic graphs to plot the 12-lead ECG waveforms in real-time. The ECG module communicates with the STM32 via UART using interrupts to handle data reception.

However, I am facing issues with accurately plotting the ECG waveforms on the screen. The waveform representation seems to shrink or misalign, particularly in the R-1 section. Despite configuring tasks with adequate priorities and stack sizes for the GUI and ECG data, and ensuring the refresh rate is set to 4 ms, I am unable to achieve a stable display.

Could you please provide guidance on optimizing the dynamic graph display using TouchGFX or recommend any specific configurations in the STM32 settings that could resolve this issue? Any advice on fine-tuning the integration between the RTOS, UART, and TouchGFX would also be highly appreciated.

Your support and insights would be greatly valued.

Thank you.

28 REPLIES 28

Yes, I did plot the logged data, and it confirms that the issue I’m reporting—specifically the inconsistent peaks and the overall shape not meeting expectations—persists. The logged data shows the expected peaks, but when rendered in the dynamic graph, these discrepancies appear.

GaetanGodart
ST Employee

Thank you for the extra information.

 

Could you share a set of data that creates the issue so I can try to reproduce it.

 

The issue happens only on the bottom graph?
Not on the 1st, 2nd or 3rd graph?
If so, what happens when you try to plot the data from the dataset that creates the issue on graph 1, 2 or 3?

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)

The issue happens across all 13 dynamic graphs, not just the bottom one. So, it’s not limited to a particular graph or position.

I’m using a UART ECG module to receive data, and I think it might be a timing issue. When I plot broader waves like square or sine waves, they appear smooth. But as the frequency increases, the shape of the waves starts to change, leading to the same inconsistent peaks and distorted waveforms.

Do you have a picture of this behavior?

When you increase the frequency what do you do?

  1. Do you only increase the frequency of the data fetch and keep the display at 4ms, so sometimes it will not add a data point to the graph?
  2. Do you increase the frequency of the data fetch and increase the refresh rate of the screen?
  3. Do you keep the data fetch at at the same speed and increase the refresh rate of the screen only?

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)

Now maybe i understand your issue. Seems class graph have some missconfig scale or x visible range values. Then some added plot can be skipped... Too you dont show how and where you addpoints from queue. Show your code parts and check X ranges point count...

Hi Gaetan,

What I did was fetch the data every 4ms and plotted it on the display at the same rate.

Let me know if you'd like more details or if there are any adjustments you recommend!

Hello @smj-11 ,

 

Could you share with us a data set that creates the issue so that I can try to test that dataset and try to reproduce the issue.
As far as I know, I am not aware of limitation on the dynamic graph widget, but I will investigate.

Could you also share the settings used for your dynamic graphs widgets (the side bar on the right) so I can check that everything is fine with your settings.

 

Finally, I want to double check how you managed your display. You say it refreshes every 4ms right?
So if you add a handleTickEvent function, it will be called 250 times per seconds right? Can you check that?

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)

50 Hz is 20 milliseconds 

So 5 groups of samples scrolled in per screen refresh. 

Gonna need to find some sharper cats to work on this..

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..