cancel
Showing results for 
Search instead for 
Did you mean: 

How to change language and remain in the new selected language in TouchGFX?

BK C.2
Associate II

It is possible to change the language in TouchGFX.

But I have a question regarding language.

Suppose we have two languages English(GB) and German. And GB is the selected language. And on one of the screen we give a button and when clicked the language is changed into German. But when we try to simulate again the language will again be GB. Is it possible to remain in german language after pressing the button.

Simply if we change language , is it possible to make the language as selected language so that when we restart the same language will be shown rather than GB. So that when we change langauge everything will be chnaged and we need not to chnage language everytime we restart.

Thank you in advance:)

4 REPLIES 4
Peter BENSCH
ST Employee

Welcome, @BK C.2​, to the community!

To save a setting beyond a power-on reset, you have to store it somewhere in a non-volatile memory. This could be in the battery-buffered VBAT domain (note: volatile, depending on battery presence), in the internal flash or in external memory such as EEPROM. However, all of the above methods are outside of TouchGFX and would have to be handled at the backend MCU level, with the respective data being passed through TouchGFX and read/stored via model-view-presenter.

Does it answer your question?

Regards

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
BK C.2
Associate II

Thank you so much Peter for your answer.

I forgot to mention that I am using STM32F746G Discovery board. I did all the simulation on the TouchGFX and flashed it on Discovery board. I did some modification on some code in my gui on STM32CubeIDE but I didn't find a way how to make language saved after reset. As there are lots of file which cannot be modified I didnot understand how to do it.

It would be great help.

Thank you so much :)

Kind regards

KC

Peter BENSCH
ST Employee

As I said, you can't do this directly with TouchGFX itself, you have to store this information somewhere non-volatile. This is similar to accessing a hardware button or the RTC, which TouchGFX (currently) cannot do directly either and is typically done in the user code of main.c.

Unfortunately, the VBAT pin on the STM32F746G-DISCOVERY is permanently connected to VDD and thus can no longer be connected to a battery or capacitor. When using VBAT, only buffering of the voice information over the lifetime of the energy source would be possible anyway (therefore volatile).

So your only option is to store this data in Flash (not easy, especially for beginners), or to connect a small external EEPROM via I2C or SPI and write a routine for the language information that is called by the model in TouchGFX.

For EEPROM emulation, you can use examples from the repository, e.g.:

  • Projects\STM32746G-Discovery\Applications\EEPROM\EEPROM_Emulation

for the I2C routines you could adapt and use the repository example:

  • Projects\STM32756G_EVAL\Examples\I2C\I2C_EEPROM

(the repository can be found in your firmware installation folder)

For integration into TouchGFX you should have a look at the help pages for Backend Communication.

Hope this helps?

Regards

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
BK C.2
Associate II

Thank you so much.

I will try to do it.

Kind regards

KC