cancel
Showing results for 
Search instead for 
Did you mean: 

Can we change changeToStartScreen be changed dynamically?

KNara.2
Associate III

Hi All,

I have a set of 10 screens in my project and I want 9th screen to be displayed as startup screen after performing a particular job say xyz as startup screen.

Lets say 9th screen shows the result of job xyz.

and job xyz results in reboot.

Is there a way to display 9th screen as startup screen only when job xyz is performed?

As of now I have set screen 1 as startup screen and that takes priority than screen 9.

 

Can changeToStartScreen() be changed dynamically?

How do I prevent screen 1 coming up as startup screen after reboot of performing job xyz?

Can changeToStartScreen() method be overwritten in model.cpp?

Thanks & Regards,

 

Please guide.

4 REPLIES 4
LouisB
ST Employee

Hello @KNara.2 ,

When you have a question, please don't mention other community members.
You can refer to that post Programatically choose startup screen - STMicroelectronics Community

BR,

Louis BOUDO
ST Software Developer | TouchGFX
GaetanGodart
ST Employee

Hello @KNara.2 ,

 

Do you really have to do your "particular job" in the screen 1? Can you tell us a bit more about this particular job is?

 

1) If you indeed really have to do this operation in screen one, please have a look at this thread to see how to choose which screen to go to based on a variable.

2) However, if you doing the operation inside screen 1 is not mandatory, you could do the operation in the Model.cpp, in main.c (before the TouchGFX taskEntry)or in frontendApplication.cpp and directly start at screen 9.

3) Also, you could perhaps do your operation in screen 1 and once the operation is finished call a function to switch to screen 9 without restarting the device.

4) Finally, could the operation be done by a bootloader or something similar that happens before the main tasks / functions?

 

Please tell me if one of these 4 options is suitable to your project's needs.

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)

The requirement is to display firmware upgrade result screen after upgrade....
Sequence diagram

Firmware upgrade-> reset->Result (of firmware upgrade screen) -> Startup screen.

After reset I'm reading the result of the upgrade from SBSFU and trying to enter result screen which is not happening...

Every time startup screen takes over.

Followed the solution mentioned in the thread that you pointed out and the UI freezes...Tried solution 2 and 3...It didnt work.....

Hello @KNara.2 ,

 

Ok, so indeed you cannot just do the operation in main.c or model.cpp.

 

How did you try to implement the solution in the thread?
You cannot just put "app.gotoScreen2 ()".
You first have to make sure that TouchGFX generates the function to go to your screen.
To do so, you could, in a random screen, just not the screen you want to go to, create an action, create an interactions where the action is the trigger and the action of the interaction is to change screen to the screen you want to go to.
This will make TouchGFX generate a function to go to that screen but it will never be called as long as you don't the action.
Now you can use the function to go to your screen.
You can find the generated function in gui_generated => src=> name of the screen where you created the interaction :

GaetanGodart_0-1740135708855.png

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)