cancel
Showing results for 
Search instead for 
Did you mean: 

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

KMunj
Associate II

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

26 REPLIES 26
KMunj
Associate II

​Thanks, Martin.

I followed all your steps, but something is still missing.

In your step 3, I added LCD Reset Pin XRES = PI12. This was required to make TouchGFX OK to Execute.

Without clicking Execute I built the project, but I got 7 errors. Please see attached.

Then I went thru rest of the steps. When I went to step 8 and built the code again, IDE got hung up.

I waited for 15 minutes, but no luck.

Thanks

Kiran

KMunj
Associate II

​Now I opened the windows task manager and killed the IDE.

I reopened the IDE and built the project again. This time it didn't get hung up, but got 3 errors.

Please see attached.

Thanks

Kiran

These errors seem to indicate that you did not Execute the TouchGFX designer (not saying you didn't 🙂 ) - Because those files should get generated into your project folder.

Thanks for the hint about LCD reset pin - You're right i accidentally left that out.

You have not excluded the simulator folder from compilation. I think CubeIDE/CubeMX reset / overwrote your local project changes if you re-generated code. You probably weren't getting those errors the first time around.

/Martin

Martin KJELDSEN
Chief III

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
Associate II

​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
Associate II

​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

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
Associate II

​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

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