Skip to main content
canbu22
Associate III
December 6, 2018
Solved

Is high speed waveform display feature possible in TouchGFX?

  • December 6, 2018
  • 26 replies
  • 6339 views

Is there a template or a sample application that one can use to develop fast running waveform display feature in TouchGFX? (such as that of a oscilloscope waveform display and not a static or slow speed 1-dim graph display)

if not any suggestions? ..thanks..

This topic has been closed for replies.
Best answer by Martin KJELDSEN

Hi canbu,

Could you define what you mean by fast-running? How large of a display and how large of a wave-form are we talking about? It's definitely possible, but depending on your needs, this may require a custom Widget that draws directly into the framebuffer; Something we've done for customers in the past to deliver specialized waveform/graph screens. We have examples of how to do standard graphs, but these are antialiased "Canvas" objects while drawing pixels straight into the framebuffer using interpolation could be faster.

Edit: Here's a simple application that shows how to use the Canvas Graph.

http://sw-center.st.com/touchgfx/TouchGFX/Community/GraphApplication.zip

Let me know!

Best regards,

Martin

26 replies

Martin KJELDSEN
Martin KJELDSENBest answer
Principal III
December 21, 2018

Hi canbu,

Could you define what you mean by fast-running? How large of a display and how large of a wave-form are we talking about? It's definitely possible, but depending on your needs, this may require a custom Widget that draws directly into the framebuffer; Something we've done for customers in the past to deliver specialized waveform/graph screens. We have examples of how to do standard graphs, but these are antialiased "Canvas" objects while drawing pixels straight into the framebuffer using interpolation could be faster.

Edit: Here's a simple application that shows how to use the Canvas Graph.

http://sw-center.st.com/touchgfx/TouchGFX/Community/GraphApplication.zip

Let me know!

Best regards,

Martin

Dejan Nedeljkovic
Associate III
April 1, 2020

Hi @Martin KJELDSEN​ 

Is this GraphApplication also working with TouchGFX 4.12.3 or 4.13.0?

Regards

Dejan

canbu22
canbu22Author
Associate III
December 22, 2018

Hi Martin,

Thanks for the follow-up.

What I'm referring here is just a simple display of a waveform on a TFT or similar LCD display of size say 720x480 pixels that of any smart phone or even smaller sizes (similar to that you find STM32F746 Discovery Kit's LCD)

For example, we might want to display the live spectrum of an audio signal using an FFT and plot the Frequency Vs Magnitude using TouchGFX's canvas. This has to be live meaning continuously update the display waveform without any flickers or tearing, may be using double frame buffer scheme.

(see the attached snapshot of a similar live waveform display captured on a smartphone)

Since many STM32F4 & F7 devices have TFT LCD controllers as well as ChromeART 2D DMA capabilities, I'm sure it should be quite easy to implement these functionalities like how a Graphics Processor does.

I don't see any sample project implementing some thing like this using double frame buffering scheme in a STM32F4/F7 discovery kit (with reference to example projects by TouchGFX).

Would be great to have such a sample application using these schemes in TouchGFX say for a STM32F746 Discovery kit.

Regards

Martin KJELDSEN
Principal III
January 2, 2019

Hi,

You probably won't see any sample projects like this, no. I have an example here on how to make a Graph using the Canvas widget. This would make the application a bit more memory intensive. i could share it with you if you're interested.

As far as DMA goes, using DMA for this kind of application would result in a lot of very small DMA operations and it might not be worth it - but i haven't done any measurements.

RCair
Visitor II
February 17, 2019

Hi Martin,

Could you to send for me too?

cmelo.raul@gmail.com

canbu22
canbu22Author
Associate III
January 10, 2019

Thanks for the update.

Appreciate if you could share your canvas example that you mentioned here..

(if you prefer to send privately, you may send to me at canbu22@yahoo.com)

ASch
Visitor II
April 3, 2019

Martin,

Could you to send for me too?

alessandrasch96@gmail.com

canbu22
canbu22Author
Associate III
April 4, 2019

FYI :

don't know reasons, but I have n't yet received any of these example codes or app notes as mentioned here.

Martin KJELDSEN
Principal III
April 4, 2019

Hi @canbu22​,

Sorry for the wait. It slipped my mind. Here is a simple graph application.

http://sw-center.st.com/touchgfx/TouchGFX/Community/GraphApplication.zip

Best regards,

Martin

canbu22
canbu22Author
Associate III
April 4, 2019

Thanks Martin..very much appreciate it..

Martin KJELDSEN
Principal III
April 8, 2019

No problem! :)

LalalandAudio
Associate III
September 14, 2019

Yes, this is something I need as well , have there been any developments on this ?

In fact I need the STM exclusively to show various audio . Scopes, waveforms analysers etc.

Martin KJELDSEN
Principal III
September 16, 2019

Did you try it and see if it suits your needs? There's a graph application example somewhere in this thread.

/Martin

LalalandAudio
Associate III
September 16, 2019

I dont have the Eval board yet so I cannot test it , simulator will not run it and obviously it would have no input.

BO55
Visitor II
March 15, 2020

Any chance the example can be updated to TouchGFX Designer 4.13.0?

I'm Using STM32CubeIDE and it would be very nice to have a graph that runs on a Discovery Board.

IB.1
Associate III
April 13, 2020

Hello @Martin KJELDSEN​ 

we are trying to port example what you posted a year ago to the current development environment:

Hardware STM32F746 Discovery board

Software: STM32 Cube IDE 1.3.0

Touch GFX 4.13.0

What we done so far:

  1. copy and paste

abstartcGraph. cpp/hpp

Graph.cpp/hpp

GraphLine. cpp/hpp

to:

touchGFX\gui\include\gui\common\ <header Files>

and

touchGFX\gui\src\common\ <Source Files>

2. Create simple touch GFX screen with background image from the example (I am referring here to the example what you share a year ago )

3. Code compiles and runs fine ie we can see background image on the screen

4. As soon as we add "Graph" variable in <ScrrenName>View.hpp file application compiles fine but once we try to run, application halts and we see "garbage" on the screen

#ifndef VC1VIEW_HPP
#define VC1VIEW_HPP
 
#include <gui_generated/vc1_screen/VC1ViewBase.hpp>
#include <gui/vc1_screen/VC1Presenter.hpp>
#include <gui/common/Graph.hpp>
 
class VC1View : public VC1ViewBase
{
public:
 VC1View();
 virtual ~VC1View() {}
 virtual void setupScreen();
 virtual void tearDownScreen();
 virtual void handleTickEvent();
protected:
 int tickCounter;
 Graph graph;			// this line makes application crash 
};
 
#endif // VC1VIEW_HPP

Any word of advise how to address that or if there is chance to get newer example? Please advise at your earliest convince.

Thank you for your support...

Regards,

IB

Martin KJELDSEN
Principal III
April 14, 2020

The Graph requires a canvas buffer. Verify that you've set one. I think it's done in main.cpp in that example i posted.

/Martin