Skip to main content
IB.1
Associate III
January 13, 2021
Question

Touch GFX dynamic Graph widget crash the application

  • January 13, 2021
  • 20 replies
  • 5064 views

Hello Touch GFX Guys.

Hardware: STM32H7B3I development board

Software: Touch GFX designer 4.16

STM Cube IDE 1.5.0

We are trying to experiment with "dynamic graph" widget and experiencing some problems .

After adding widget on the screen follow code is generated

 dataGraph1.setScale(1);
 dataGraph1.setPosition(10, 10, 380, 180);
 dataGraph1.setGraphAreaMargin(0, 0, 0, 0);
 dataGraph1.setGraphAreaPadding(0, 0, 0, 0);
 dataGraph1.setGraphRangeY(0, 100);
 
 dataGraph1Line1.setScale(1);
 dataGraph1Line1Painter.setColor(touchgfx::Color::getColorFrom24BitRGB(20, 151, 197));
 dataGraph1Line1.setPainter(dataGraph1Line1Painter);
 dataGraph1Line1.setLineWidth(2);
 dataGraph1.addGraphElement(dataGraph1Line1);
 
 dataGraph1.addDataPoint(6.40222585735995f);
 ........
 dataGraph1.addDataPoint(15.6299816028386f);
 dataGraph1.addDataPoint(9.83211034085783f);
 dataGraph1.addDataPoint(10.0465691581937f);

Once we run the application code is crushing. if we comment

dataGraph1.addGraphElement(dataGraph1Line1);

and all follow lines:

dataGraph1.addDataPoint(9.83211034085783f);

application is running but obviously no graph :)

We do not have any functions in the code to update graph yet...

We tried to set in CANVAS BUFFER "Overwrite default buffer size " to 7200 bytes

but no luck.

Please advise if anything else we can do to overcome this problem, or any other information we can provide.

Thank you for all your help and support

Regards,

i

This topic has been closed for replies.

20 replies

Alexandre RENOUX
Visitor II
January 14, 2021

Hello IB.1,

Does it crash also on the simulator ?

Where do you write these lines of code ?

Could you share the folder TouchGFX/gui and the .touchgfx file ?

/Alexandre

IB.1
IB.1Author
Associate III
January 14, 2021

Hi Alexandre,

Thank you for the reply.

  1. when I tried to run on simulator I am getting message "failed"
  2. <screenName>ViewBase.cpp
  3. files attached

Thank you,

Regards,

I

IB.1
IB.1Author
Associate III
January 14, 2021

Hi Alexandre,

here the Gui archive

Thank you

Alexandre RENOUX
Visitor II
January 15, 2021

Hello IB.1,

In the end what you gave me is not enough. I would need the entire project. BUT before that I would like you to do the following :

  • Enclose the content of the failed message. When you have issues with your project, the first thing you need to do is enclose the actual error so that we can have a better understanding of why it complains.
  • Clean your project by trying to do only the UI without any board (so just the simulator) and see if it works. Then if it works you can switch to the board. But if the simulator is not running, there's a high chance of the board not working either. I see you have several screens. Only keep the necessary ones. It's very important that you narrow the possibilities for us to answer as easily as possible.

/Alexandre

IB.1
IB.1Author
Associate III
January 15, 2021

Hi Alexandre,

Thank you for the hint to use simulator.

I looked at the simulator messages and it comes down that I have added "#include main.h" it triggers follow error:

 gui/src/workingvc_screen/WorkingVCView.cpp:4:10: fatal error: main.h: No such file or directory
 
 #include "main.h"

But, when I compile code using STM32IDE everything compiles like a charm. Therefore question what I have,:

How we can add search path to Touch GFX project?

Thank you

IB

Alexandre RENOUX
Visitor II
January 18, 2021

Hello IB.1,

You can add additional include paths in the Makefile situated in TouchGFX/simulator/gcc/ folder. The simulator is not linked to any hardware so it does not know about main.c/.h files.

Also, for better coding habits, if not already done, you should encapsulate #include "main.h" like below ?

extern "C"
{
#include "main.h"
}

/Alexandre

IB.1
IB.1Author
Associate III
January 16, 2021

Hi Alexandre,

I have tried something else:

I have created test project, with single screen.

If I place "text box" I can see text on simulator and "hardware" works fine

Next,

I replaced "text box" with "dynamic graph" simulator works but hardware crashed.

Please advise.

Thank you,

I

Alexandre RENOUX
Visitor II
January 18, 2021

Hello IB.1,

Saying "hardware crashed. Please advise" is unfortunately not enough. Please debug and enclose the debug info like the call stack to see where it hangs exactly.

I don't have an H7B3-DK board with me currently but I'll try when I'll get my hands on one.

So you confirm, you simply added a dynamic graph to a single screen UI and this made the board crash ?

Thank you in advance for the precisions,

/Alexandre

IB.1
IB.1Author
Associate III
January 18, 2021

Hi Alexandre,

Thank you for your replay. I did try step debug., and crash happen when executing

 osKernelStart(); Please see screenshot bellow.

Please advise what else we can try.

Than you,

I

0693W000007BZlvQAG.jpg

Alexandre RENOUX
Visitor II
January 20, 2021

Hello IB.1,

I finally got my hands on a H7B3-DK board and I don't see any issue with the graph.

Here is what I did :

  • Open TouchGFX Designer 4.16, select H7B3-DK and the Dynamic Graph UI example
  • Generate code
  • Run target -> works perfectly
  • Then open project with CubeIDE 1.5.0, build, download and debug -> works also perfectly

Please try these steps with your board to see if it works. Also I suggest you to compare this project with yours and see what differs and why.

/Alexandre

IB.1
IB.1Author
Associate III
January 20, 2021

Hi Alexandre,

I have checked example and it works.

let me see what is difference between example project and mine.

Thank you,

i

IB.1
IB.1Author
Associate III
January 20, 2021

Hi Alexandre,

Thank you for your suggestion. We did try it and works...

When compare Touch GFX code to mine we noticed fundamental difference:

in CubeMX -> TouchGFX configuration, see screenshot bellow for the reference

in application generated by touchGFX "buffer location" is selected "By Allocation"

What we are doing: selecting "By address", also address setting what we are using are in screenshot.

we have configure SDRAM following this tutorial:

https://www.youtube.com/watch?v=XnSg3UJfSFc

if (in our code) switch in cubeMX TouchGFX Configuration buffer location to "by allocation" we can see the graph;

but if we use "by address" application crashed.

Please advise,

Thank you,

I

0693W000007C5GQQA0.jpg 

Alexandre RENOUX
Visitor II
January 21, 2021

Hello IB.1,

The difference between your project and the one generated by TouchGFX is that the Application Template uses the internal RAM for the framebuffers.

Usually

  • If you use internal RAM for framebuffers -> By allocation (the linker will put the framebuffers wherever he wants following the rules you set in the linker file)
  • If you use external RAM for framebuffers -> By address (you arbitrarily specify the location of the framebuffers)

But if I understand correctly you are using the external RAM so by address should be fine. But maybe when you select by Allocation it allocates the framebuffers in Internal RAM which makes it work with a graph. Could you enclose your linker file ?

If by using the external RAM, By address does not work, I suspect your RAM config to be a bit off. Graph is using a canvas buffer that is allocated in the RAM. Maybe there's some conflict but that's just a guess.

/Alexandre

IB.1
IB.1Author
Associate III
January 21, 2021

Hi Alexandre,

Thank you for your reply. Please find attached linker file. I did modify linker file to include "framebuffer section". Apparently it still crashing with or without modification.

Please note that I have to change file extension from "ld" to "txt" to keep forum happy.

Please advise

Thank you for all your help and support.

I.