cancel
Showing results for 
Search instead for 
Did you mean: 

Gauge application working directly from touchgfx but not working when trying to run it through STM32CubeIDE. Please help to solve this issue

Rohit.1
Associate II
 
34 REPLIES 34
Alexandre RENOUX
Principal

Hello,

There were a few problems in your project.

First, the assets of the gauge were not the right size. You have a screen 480*272 and you want to fit a picture 359*359. Not possible.

0693W000000WmTUQA0.png

Second, the AT is 24bpp but the painter used for the gauge was a Painter565 which makes the application crashed. Did you try to run the simulator ? Because it was explicitly mentioned. Therefore I changed the painter to Painter888 (look at the variables in Gauge.hpp).

I also made a few changes to your Screen1View files because you were asking the needle to turn every 16 ms by 10 which would have a really strange behavior.

You will find enclosed the corrected project working (tested with gcc and CubeIDE).

Hope this will help you move forward in your project.

/Alexandre

Rohit.1
Associate II

Thank You very much.

It is worked. :smiling_face_with_smiling_eyes:

Now I have developed a custom board using STM32F746BGTx. Using all other components same as on the STM32F746G-Disco board.

But some pins are changed. Can I use my existing project file which was created for STM32F746G-Disco board by matching the pins with new custom board.

Alexandre RENOUX
Principal

If it's not the same MCU, I highly recommend you to create a new CubeMX project with your specific MCU and reset all the parameters to match your current config with the Disco board. It's only a matter of copy pasting and this should not take too much time ;)

/Alexandre

Rohit.1
Associate II

Where should be added hal.setButtonController(&btnctrl);

If added in TouchGFXConfiguration.cpp it is getting removed after modifying the screens in designer.

Rohit.1
Associate II

Please help.

Alexandre RENOUX
Principal

Hello,

Your user file is TouchGFXHAL.cpp/.hpp. When you add things related to the TouchGFX framework you modify this file.

Here you add hal.setButtonController(&btnctrl); in the TouchGFXHAL::initialize() function.

void TouchGFXHAL::initialize()
{
    /* Initialize TouchGFX Engine */
    TouchGFXGeneratedHAL::initialize();
 
    setButtonController(&bc);
 
}

/Alexandre

Thank You. Its working now!

I am using QSPI (MT25QL128ABA1ESE).

Pin map of My custom board for QSPI is different from that of STM32F746 Discovery board.

Now how can I make it work?

Simply change the QSPI pins in CubeMX according to your new pin map and regenerate code. Maybe other parameters need to be changed if it is not the same QSPI as the one on the F746 Disco board.

I don't know if you did it but as mentioned previously, I recommend you to create a new CubeMX project with your specific MCU.

/Alexandre

Rohit.1
Associate II

I have already created new CubeMX project and changed pins according to my custom board.

Is it necessary to generate the custom external loader file?

If it is then can You please provide me any example code for external loader of STM32F746G-DISCO board.

Rohit.1
Associate II

Please help