cancel
Showing results for 
Search instead for 
Did you mean: 

Simulator crashes while Target runs. TGFX 23.0

MNema.1
Associate II

Hello! 
I have a problem with simulator. When switching between screens (no animation) simulator crashes. The finalizeTransition function returns, after that the application ticks one time, and then crashes. Everything is executed normally on the target though.

I recently switched to TouchGFX 23.0 Can it be somehow related?
Any advice on how to fix the simulator?

1 ACCEPTED SOLUTION

Accepted Solutions

Thank you for your project.
I can see that without using "graph.setGraphRangeY(0, 100);", there will be a division by zero in the "canvas\CRWUtil.hpp" which causes the simulator to crash. This also happens on the board, however, the division is not caught by the board and you have to enable the DIV_0_TRP trap in the CCR register to catch it. By enabling that, you will see that the application will face a hard fault and won't go to the screen with the graph.

It is always a good practice to make sure the simulator can run fine before running the application on the target.


I hope I have answered your question, don't hesitate to ask more

Mohammad MORADI
ST Software Developer | TouchGFX

View solution in original post

5 REPLIES 5

Hello @MNema.1 ,

You can use the Visual Studio project that is generated by the TouchGFX Designer to run the simulator and debug it. You can find the project (Application.sln) under simulator -> msvs folder.
Simulator folderSimulator folder

It is worth mentioning that you need to generate code first to have the project created.

I hope this helps you

Mohammad MORADI
ST Software Developer | TouchGFX

Thank you for the reply, I think I found out what the problem was. 
On the view I was switching to, I had a graph. When I was setting it up in the view's constructor, I didn't call setGraphRangeY before adding Y Axis Grid to the graph. So this topic maybe concerns graphs more than simulator. Unfortunately, I can't set another label to the topic.

The confusing part was that the code ran on target without any problems, i.e. I didn't have to call setGraphRangeY before adding the grid. But it was the simulator that crashed when I was switching to the view with the graph on. 

Oh okay,
Can I get some code snippets or a small sample of the project to investigate the issue?

Mohammad MORADI
ST Software Developer | TouchGFX
Sure. 
I tried to extract this and create a separate snippet for F746DISCO (sorry for a bit messy look).
After touching white box on the start screen, the app should switch to another screen.
It does that on the target, but not in simulator. That was confusing.
 
If you uncomment this row in the constructor of ScreenWithGraph:
//graph.setGraphRangeY(0, 100);
it will switch to that screen in simulator as well.

Thank you for your project.
I can see that without using "graph.setGraphRangeY(0, 100);", there will be a division by zero in the "canvas\CRWUtil.hpp" which causes the simulator to crash. This also happens on the board, however, the division is not caught by the board and you have to enable the DIV_0_TRP trap in the CCR register to catch it. By enabling that, you will see that the application will face a hard fault and won't go to the screen with the graph.

It is always a good practice to make sure the simulator can run fine before running the application on the target.


I hope I have answered your question, don't hesitate to ask more

Mohammad MORADI
ST Software Developer | TouchGFX