2023-12-21 03:13 AM
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?
Solved! Go to Solution.
2023-12-27 02:43 AM
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
2023-12-21 04:19 AM
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.
It is worth mentioning that you need to generate code first to have the project created.
I hope this helps you
2023-12-21 08:31 AM
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.
2023-12-22 03:51 AM
Oh okay,
Can I get some code snippets or a small sample of the project to investigate the issue?
2023-12-22 06:21 AM - edited 2023-12-22 06:23 AM
2023-12-27 02:43 AM
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