Skip to main content
KMunj
Associate III
May 16, 2019
Solved

CubeMX5.2/TouchGFX4.10.0/STCUBEIDE1.0 or SW4STM32 or TrueAtollic working properly with 32F746NGDiscovery

  • May 16, 2019
  • 26 replies
  • 8422 views

Has anyone got CubeMX5.2/TouchGFX4.10.0/STCUBEIDE1.0 or SW4STM32 or TrueAtollic working properly with any Discovery board? I mean be able to build with no errors and ​run it on any Discovery board? I had it working with CubeMX4.xx/TouchGFX4.10.0/SW4STM32. But when I  updated CubeMX4.xx to 5.2, I get build errors. I tried the procedure put by Zhi Pang on the community, but it doesn't work anymore. I get build errors.

If you have it working please send me some info on how you did it.

Thanks

Kiran

This topic has been closed for replies.
Best answer by Martin KJELDSEN

Hi guys,

https://community.st.com/s/question/0D50X0000At0N95SQE/cubeide-100-touchgfx-4100-working-project-inside-stm32f746gdisco

There's a working STM32F746G-DISCO project for your inspection. I will proceed with making a video tutorial now. It's a bit of a cumbersome process but i'll investigate how lenient i can be with official guidelines in order to get it out sooner :)

/Martin

26 replies

Martin KJELDSEN
Martin KJELDSENBest answer
Principal III
May 27, 2019

Hi guys,

https://community.st.com/s/question/0D50X0000At0N95SQE/cubeide-100-touchgfx-4100-working-project-inside-stm32f746gdisco

There's a working STM32F746G-DISCO project for your inspection. I will proceed with making a video tutorial now. It's a bit of a cumbersome process but i'll investigate how lenient i can be with official guidelines in order to get it out sooner :)

/Martin

KMunj
KMunjAuthor
Associate III
May 28, 2019

​Thanks, Martin. Very good job.

The project worked for me. Using this project, I will change it my application GUI and try it out today.

I will also see if I change the .ioc file, by changing GPIO pins, if it still works.

I would appreciate if you could update your following sticky on what else you find.

https://community.st.com/s/question/0D50X0000AqD8zPSQS/stm32cubeide-and-touchgfx-4100-a-brief-introduction

I tried it several times, but never managed to complete the build. It always give at least 2 errors.

Thanks

Kiran

KMunj
KMunjAuthor
Associate III
May 28, 2019

​Hi Martin,

Thank you very much for doing this. You did an excellent job. I started with your project. I changed your GUI with my GUI and every thing worked perfectly. Then I opened .ioc file and changed PI2 output from Low to High. Then I build the project again. But I got errors. Please see attached. Then I did clean project and build it again. Then I still got the build errors. Any idea why? I need to make few changes to few GPIOs in my set up.

Also please update your sticky at your convince at;

https://community.st.com/s/question/0D50X0000AqD8zPSQS/stm32cubeide-and-touchgfx-4100-a-brief-introduction

Thank you very much.

KIran

Martin KJELDSEN
Principal III
May 29, 2019

The problem is that when you make changes in CubeMX to GPIO you will overwrite what you've just fixed in the faulty project generation.

I would suggest that you use some form of version control, like git, to restore your "fixes" after you've regenerated. Maybe i'll do a guide for this as well.

It's really not in a good state right now but we're fighting to get this integration prioritized.

KMunj
KMunjAuthor
Associate III
May 31, 2019

​Hi Martin,

I am trying to add ledtask and buttontask to your project. But I can't find the file like following generated by TouchGFX.

 *****************************************************************************/

#include <touchgfx/hal/HAL.hpp>

#include <touchgfx/hal/BoardConfiguration.hpp>

#include <touchgfx/canvas_widget_renderer/CanvasWidgetRenderer.hpp>

using namespace touchgfx;

/* Kernel includes. */

#include "FreeRTOS.h"

#include "task.h"

#include "queue.h"

/**

 * Define the FreeRTOS task priorities and stack sizes

 */

#define configGUI_TASK_PRIORITY                ( tskIDLE_PRIORITY + 3 )

#define configGUI_TASK_STK_SIZE                ( 950 )

//#define CANVAS_BUFFER_SIZE (3600)

static void GUITask(void* params)

{

   touchgfx::HAL::getInstance()->taskEntry();

}

int main(void)

{

   hw_init();

   touchgfx_init();

   xTaskCreate(GUITask, (TASKCREATE_NAME_TYPE)"GUITask",

               configGUI_TASK_STK_SIZE,

               NULL,

               configGUI_TASK_PRIORITY,

               NULL);

   vTaskStartScheduler();

   for (;;);

}

I found two main.cpp (one in src folder and one in simulator folder) in your project. The one we want to add task is in target folder in touchGFX. I don't see target folder in your project either. Please see attached.

Thanks

Kiran

Martin KJELDSEN
Principal III
June 3, 2019

Hi.

You're right to be confused. If you generate the project using CubeIDE you will not have the same type of main.cpp as you refer to. You could define the tasks through CubeIDE/CubeMX. The task definitions will go to Src/main.cpp. e.g. for the default task:

 /* Create the thread(s) */
 /* definition and creation of defaultTask */
 osThreadDef(defaultTask, StartDefaultTask, osPriorityNormal, 0, 4096);
 defaultTaskHandle = osThreadCreate(osThread(defaultTask), NULL);

And the handler for the default task which enters the main event loop of touchgfx.

* USER CODE END Header_StartDefaultTask */
void StartDefaultTask(void const * argument)
{
 /* init code for FATFS */
 MX_FATFS_Init();
 
 /* init code for USB_HOST */
 MX_USB_HOST_Init();
 
/* Graphic application */ 
 GRAPHICS_MainTask();
 
 /* USER CODE BEGIN 5 */
 /* Infinite loop */
 for(;;)
 {
 osDelay(1);
 }
 /* USER CODE END 5 */ 
}

Hope this helps.

/Martin

KMunj
KMunjAuthor
Associate III
June 11, 2019

​Hi Martin,

I still struggling with this one. I keep on getting build errors.

Is it possible to post a tutorial or a sticky to do a project similar to your project "hw_integration_tasks_gpio.4.9.3" using STM32CubeIDE instead of starting from TouchGFX4.9.3? This will really help lots of people.

I have my sensors integrated into ST Development boards (746g-DISCO and 767z-DISCO). I can display the sensors' data on the Tera Term. But I can't display on the GUI on the LCD. I tried both ways starting from TouchGFX4.10 and from STM32CubeIDE.

Thanks

Kiran

Martin KJELDSEN
Principal III
June 12, 2019

Hi,

Yes, the example is based on 4.9.3 - When you load it through 4.10.0 do you get an upgrade dialogue?

/Martin

KMunj
KMunjAuthor
Associate III
June 12, 2019

​YES. I do following upgrade dialogue and I say YES.

Thanks

-Kiran

Martin KJELDSEN
Principal III
June 12, 2019

Can you show me the build errors? Doing a CubeIDE/CubeMX version of these example would require some time i don't have right now - But it's an excellent idea, @KMunj​! I will make a note of it.

/Martin

KMunj
KMunjAuthor
Associate III
June 19, 2019

​Hi Martin,

Sorry for the delay.

When I did HW Integration project using TouchGFX10.0, Simulator works fine, but when I give "Run Target", I get following fatal error;

"Model.cpp:10.21: Fatal error: ledtask.h No such file or directory #include "ledtask.h". I followed same steps as your project using TouchGFX4.9. I can't go back to 4.9, since it's not available on ST Web. I have ledtask.h and ledtask.c in the Target folder (same as your project). I tried with F746g-Disco (Rev 1.1) and F769i-Disco (Rev1.1).

In both cases I get the same error. Please see attached.

Another problem with TouchGFX10.0 is if I use Rev2.0 version of both the Disco boards, it doesn't produce the Target folder in the Project Directory like 4.9 did.

Thanks

Kiran

Martin KJELDSEN
Principal III
June 20, 2019

Hi,

4.10.0 is the first official ST version, so you cannot download it anywhere anymore, true.

Could you compare the makefile before and after the upgrade? (You have the original zip). The upgrade may have removed the include of ledtask.h from the makefile.

/Martin

KMunj
KMunjAuthor
Associate III
June 25, 2019

​Has anyone added HW integration to this project and got it to work? If so, please post it on the community.

All I want is toggling LED (LD1), every time I press button on LCD screen. I have no luck for last two weeks.

Thanks

Kiran