cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F746G_Discovery touch screen buttons stop working on hard reset

HTher.2
Associate II

Hello,

Using a STM32F746G-Discovery board and TouchGFX 4.20.0, the on-screen buttons of the "Button example" as distributed with the TouchGFX package do not respond after the board is reset via the reset button or on a power-up reset. When flashing the code and the ST-Link debugger resets the processor, it works fine, as well as when the processor is reset with STM32CubeProgrammer. Also works as expected under debugger control.

The processor is running fine, as established through a simple LED flashing routine in the HAL_TIM_PeriodElapsedCallback ISR.

Has this "feature" been seen elsewhere? Any ideas to the cause of this?

7 REPLIES 7
DZhan.9
Associate II

I got exactly the same issue. Did you manage to fix it?

HTher.2
Associate II

DZhan.9, sadly NO, the problem is persisting.

Hi,

I unfortunately don't have the board with me so we'll have to rely on another user or ST employee to give it a try, but could you share your board revision so that we know exactly which model it is? This should be written on a white sticker on your board.

This "button example" you are referring to is the "button example" available in TouchGFX Designer right ? Or is it from some sort of Out of the Box package ? Did you face a similar bug with other demos/examples available in TouchGFX Designer ?

Have you tried with TouchGFX 4.19 or older by any chance ?

/Romain

HTher.2
Associate II

Romain,

I can spot three white stickers on the board, the details as follows:

Sticker 1 (front):

STM32F746G-DISCO

DK32F746G$CU2

Sticker 2 (back):

MB1191-F746-C01

C222104827

Sticker 3 (back):

400725 1801 004827 2221

The problem manifested itself in my own application and as a fallback I tried the Button Example as supplied with TouchGFX 4.2.0: 0693W00000VOsYTQA1.pngThis example is simple enough to only address the issues I am experiencing.

The board setup is only supported from TouchGFX4.20.0 as described by the board description, so no, I have not tried older versions.

When the compiled application is deployed with Debug (-Og) optimization, it operates as expected after a debugger reset. Any other reset, reset button or power cycle makes the button inoperable. When the application is deployed with Size (-Os) optimization and no debug support, it fails from the onset, no touch screen activity.

I can add that TouchGFX 4.20.0 seems to use STM32CubeMX V6.5.0 using FW_F7 V1.16.2 to generate the setup. I am using STM32CubeIDE V1.10.1 that includes STM32CubeMX V6.6.1 and supports FW_F7 V1.17.0. I am still compiling with STM32Cube FW_F7 V1.16.2 (i.e. no migration).

Hello, 

I've been fighting this same issue for awhile now. This is what I've noticed:

1. My program works on STM32F746G-DISCO, DK32F746G$CU1. On reset and/or power on reset no issues. The touchscreen continues to work fine. 

2. The same program works only after flashing the first time onto a STM32F746G-DISCO, DK32F746G$CU2. On reset and/or power on reset the touchscreen fails to realize any touch events and will not move. I originally tried TouchGFX 4.16.0 with my original program but had to update since there was a flash verification error that manifested after programming. When I updated to TouchGFX 4.20.0 the flash verification error went away, but then the failing touchscreen error manifested. I've since updated to TouchGFX 4.21.4 and STM32CubeMX V6.8.1 and am experiencing the same issues.

3. Of the boards we have, every CU1 version works, and every CU2 version experiences the same issue.

The only differentiating schematic/pcb difference I've been able to find is the screen LCD controller. I believe the data sheets are the ones attached. https://community.st.com/t5/touchgfx-and-gui-mcu/stm32f746g-disco-display-datasheet/m-p/472172 

1. CU1 uses - HT043C

2. CU2 uses - GJX043A6 -40D Y

Has anyone else experienced/seen similar things or found a solution?

Thanks!

Romain, 

Comparing my program on a CU1 and CU2, I've tried TouchGFX 4.16.0, TouchGFX 4.20.0, and TouchGFX 4.21.4. The CU1 version always works, and the CU2 always locks up. As mentioned in my other reply, the only difference I can find is the following touchscreen component differences:

1. CU1 uses - HT043C

2. CU2 uses - GJX043A6 -40D Y

Do you have any other insight that might help?

Thanks!

Romain, 

As I've been digging into this more, I've been able to debug the issue and find a specific line of code that when break-pointed on and continuing after a button or power on reset, I can get the touchscreen to still work. Again, I have the following setup: TouchGFX 4.21.4 and STM32CubeMX V6.8.1. I'm not sure if it has to do with TouchGFX and/or CubeMX code generation, but I've tried some of the different items in here (uwtick-stops-updating-stuck-in-hal-initialize) that seem similar to my problem, but haven't gotten any of them to work.

I.e. this is what I've found in debugging: 

1. The first run (debug mode) after starting works without a breakpoint. When reset without a breakpoint the screen stops responding to touch events. If I breakpoint at 'MX_TouchGFX_Init(); found in main.c then run, the screen works again. This is fully repeatable.

  /* Initialize all configured peripherals */
  MX_GPIO_Init();
  MX_CRC_Init();
  MX_DMA2D_Init();
  MX_FMC_Init();
  MX_I2C3_Init();
  MX_LTDC_Init();
  MX_QUADSPI_Init();
  MX_USART6_UART_Init();
  MX_TouchGFX_Init();
  /* Call PreOsInit function */
  MX_TouchGFX_PreOSInit();
  /* USER CODE BEGIN 2 */

Driving into this, I go through the following lines fine: 

void MX_TouchGFX_Init(void)
{
  // Calling forward to touchgfx_init in C++ domain
  touchgfx_components_init();
  touchgfx_init();
}

/**********Into --> touchgfx_init()*******************/

void touchgfx_init()
{
    Bitmap::registerBitmapDatabase(BitmapDatabase::getInstance(), BitmapDatabase::getInstanceSize());
    TypedText::registerTexts(&texts);
    Texts::setLanguage(0);

    FontManager::setFontProvider(&fontProvider);

    FrontendHeap& heap = FrontendHeap::getInstance();
    /*
     * we need to obtain the reference above to initialize the frontend heap.
     */
    (void)heap;

    /*
     * Initialize TouchGFX
     */
    hal.initialize();
}

/**********Into --> hal.initialize();*******************/

void TouchGFXHAL::initialize()
{
    // Calling parent implementation of initialize().
    //
    // To overwrite the generated implementation, omit call to parent function
    // and implemented needed functionality here.
    // Please note, HAL::initialize() must be called to initialize the framework.

    TouchGFXGeneratedHAL::initialize();
    setFrameBufferStartAddresses((void*)0xC0000000, (void*)0xC003FC00, (void*)0xC007F800);  //enable the animation storage to allow slide animations
    lockDMAToFrontPorch(false);
    instrumentation.init();
    setMCUInstrumentation(&instrumentation);
    enableMCULoadCalculation(true);
}

 At TouchGFXGeneratedHAL::initialize(); --> HAL::initialize(); is where I get the specific failure. Now this function goes to a 'virtual void initialize();' and I can't seem to be able to find how/what this initialize is doing.

void TouchGFXGeneratedHAL::initialize()
{
    HAL::initialize();
    registerEventListener(*(Application::getInstance()));
    setFrameBufferStartAddresses((void*)0xC0000000, (void*)0xC003FC00, (void*)0);
}

Someone said that using CubeMX v6.5.0 for code generation fixes it, but I haven't been able to revert back from CubeMX v6.8.1 to v6.5.0, it gives me an error that the .ioc was generated for a later version and cannot be opened. 

Can you or anyone at ST please provide some guidance on how to fix this issue?

Thanks!