cancel
Showing results for 
Search instead for 
Did you mean: 

TouchGFX App runs with debugger connected, won't run stand-alone?

KMill
Senior

I'm working on my first TouchGFX app on an STM32F746G-DISCOVERY board.

The app builds, loads and runs fine using STm32CubeIDE. I can test my app and all looks good.

However if I power-down and back up, the UI loads on the screen, but nothing is working. It does not respond to any touches.

Am I missing something?

13 REPLIES 13
MM..1
Chief III

Add to your code some led blink and see if code runs or hang. Display with memory still show image if mcu for example hardfault...

KMill
Senior

Thanks - the code is running. For example if I load the "Washing Machine" demo from TouchGFX Designer, then the splash screen shows, and it changes to the machine-demo after some idle time, and then back to the splash-screen.

The bubbles on the splash screen are animating normally.

This project also will run and interact normally if I "run as STM32 Application" from the toolbar, but when re-booted later it's like the touch-sensor is not operating.

KMill
Senior

I have found the solution.

In STM32ToucController.cpp in the generated code I found this:

static void I2Cx_Error(I2C_HandleTypeDef* i2c_handler, uint8_t Addr)
{
    /* De-initialize the I2C communication bus */
    HAL_I2C_DeInit(i2c_handler);
 
    /* Re-Initialize the I2C communication bus */
    //I2Cx_Init(i2c_handler);
}

Which I changed to:

static void I2Cx_Error(I2C_HandleTypeDef* i2c_handler, uint8_t Addr)
{
    /* De-initialize the I2C communication bus */
    HAL_I2C_DeInit(i2c_handler);
 
    /* Re-Initialize the I2C communication bus */
    //I2Cx_Init(i2c_handler);
    HAL_I2C_Init(i2c_handler);
}

And now the app works perfectly after a reboot.

I guess the touch controller is maybe starting up slower than the app can handle without the error handling.

Hi,

Thank you for sharing your solution, I will forward it to the team in charge of TouchGFX Board Setups :thumbs_up:

/Romain

Hello KMill,

Thanks for reporting this issue. We'll investigate more on that and patch it as soon as possible. I'll get back to you when I'll have more info about it.

/Osman

Osman SOYKURT
ST Software Developer | TouchGFX
Osman SOYKURT
ST Employee

Hi again KMill,

I've tried on my side but couldn't reproduce this issue. Which version of the TBS do you use? Also, which version of TouchGFX Designer and STM32CubeIDE do you use? What's the revision of your board ?

If you have a scenario to reproduce the issue, please tell me.

/Osman

Osman SOYKURT
ST Software Developer | TouchGFX

Hi Osman

I have the STM32F746-Discovery board, revision C.

[DK32F746$CU2]

I'm using v4.20.0 of Touch Designer

STM32CubeIDE V1.10.1 Build 12716

STM32Cube FW_F7 V1.17.0,

STMCubeMX Version 6.6.1

To reproduce the issue, start TouchDesigner, select any of the Example projects for this board, (for example Animated button), generate the files, then open the project in STM32CubeIDE, build the project, then Run As STM32 C/C++ Application

The application will load onto the board and run perfctly.

Now Quit from STM32CubeIDE, and reset the board using the black button on the rear. (Or remove the USB power and re-power it).

Now the application will start, but the touch screen is unresponsive.

By adding the line :

HAL_I2C_Init(i2c_handler);

And rebuild / reflash... then the Application will load and run perfectly everytime.

It looks (just a guess) like the touch sensor is not starting up first time? Or I2C is somehow failing at first startup? Maybe I have a faulty board? Nothing else has ever been attached to my Dicovery kit, and I do take all appropriate anti-static precautions.

Hello KMill,

Thanks for the scenario to reproduce the issue. I'm also using a C revision of this board. However, I still couldn't reproduce it.

I've also tried to migrate my project firmware version to use the latest one as you (with STM32CubeMX), and nothing unexpected, my app still works on my board after resetting it.

Could you try to open STM32CubeProgrammer, connect your board, click on the "Firmware upgrade" button, and try again?

This reminds me another thread from few months ago, the solution was to put some HAL_Delay(100) in the main.c, right before calling MX_I2C3_Init()

Maybe it will work for you as well?

/Osman

Osman SOYKURT
ST Software Developer | TouchGFX

Hi @Osman SOYKURT​ 

Adding the HAL_Delay(100); has worked for me too. ✔�?

Must be some kind of power-up / init race condition?

In ST32CubeProgrammer when I click on the firmware upgrade button it wants me to "upgrade" from V2J40M27 to V2J39M7 - which looks like a downgrade to me ;)

0693W00000WIX4KQAX.png