cancel
Showing results for 
Search instead for 
Did you mean: 

Imported TouchGFX Project into Visual Studio 2017 & 2019 --> Build failed.

RHug.1
Associate II

Board: STM32F746NGH6

Display: ETEM043005XDH6

I tried creating an Embedded Project (after installing VisualGDB) with following settings:

  • import a project built with command-line tools (since I want to import the existing TouchGFX Project)
    • Generate a new MSBuild project
  • Select my Device: STM32F746NG (leave all settings)
  • Import my Project Folder (TouchGFXProjects/ProjectName)
  • Debug using: USB Input: "ST-Link v2" --> Test sucessful

When trying to build the project I run into several missing included directories as well as View.cpp / Mainbase.cpp and other files

After including those using Visual Studio help I receive a several Error:

"SDL_stdinc.h" Line 261:

  • narrowing conversion of '-1' from 'int' to 'unsigned int' [-Wnarrowing}
  • size '-1' of array 'SDL_dummy_enum' is negative

--> Checking the code I see a comment written by the developers (of TouchGFX) on Line 284

  • /* TODO: include/SDL_stdinc.h:174: error: size of array 'SDL_dummy_enum' is negative */

But there is no fix or workaround mentioned.

Flashing the application via TouchGFX Designer takes way too much time. Since I am editing the source files in VS I would also like to flash the application via the integrated ST-Link v2 also receiving a more detailed error log and being able to debug.

Looking forward to any reply or links for further help.

EDIT:

This code fails as stated above:

#define SDL_COMPILE_TIME_ASSERT(name, x)               \
       typedef int SDL_dummy_ ## name[(x) * 2 - 1]
 
 
 
//This is the comment from Devs I was taking about 
 
#ifndef DOXYGEN_SHOULD_IGNORE_THIS
#if !defined(__ANDROID__)
   /* TODO: include/SDL_stdinc.h:174: error: size of array 'SDL_dummy_enum' is negative */
typedef enum
{
    DUMMY_ENUM_VALUE
} SDL_DUMMY_ENUM;
 
SDL_COMPILE_TIME_ASSERT(enum, sizeof(SDL_DUMMY_ENUM) == sizeof(int));
#endif
#endif /* DOXYGEN_SHOULD_IGNORE_THIS */

Best Regards

Rafael

9 REPLIES 9
LTimm.1
Associate III

I don't use Visual Studio myself, but I think it's this static assert that fails:

SDL_COMPILE_TIME_ASSERT(enum, sizeof(SDL_DUMMY_ENUM) == sizeof(int));

SDL seems to expect that enums have the same size as an int. Don't know why that's not the case in Visual Studio. Maybe it packs the enum into a smaller size.

LTimm.1
Associate III

By the way, if you are compiling for target then something is wrong. As I understand it SDL is only used for the simulator.

I imported the project and tried to build it first.

But that very first step already failed

Romain DIELEMAN
ST Employee

Hi,

As @LTimm.1 said Visual Studio is only used for the simulator, the issue you have on line 261 is not linked to the target. We use IDE like IAR or keil.

Could you give us more details and information on what you are doing? Do you use the STM32f746G disco board? If yes, did you create a project with the given application template on Designer for that specific board?

I am using STM32F746NGH6 Board.

I have created the specific project in TouchGFX Designer, sucessfully flashed it on the device and was able to transmit data using UART.

Since the flashing process (including compiling the GUI etc.) in TouchGFX takes way too long, I aimed changing to Visual Studio since it's able to integrate the Debugger "ST-Link V2" and giving me the possibility of flashing the device directly.

Please correct me if being wrong.

TouchGFX designer uses make to build with arm-gcc for its Application Templates when you click "Run target". But the visual studio projects also in the Application Templates are simulator only by default (Hence why you're seeing SDL references).

"Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D"

If you want to use Visual Studio for some sort of cross-platform arm-gcc compilation with visualGDB support then you have to do some work - It's not something that comes supported out of the box. In this case we'd just suggest CubeIDE, i think (The STM32F746-DISCO V3 template supports it).

/Martin

In order to use STM32CubeIDE can you tell me how to import an existing TouchGFX Designer Project?

I am missing a clear documentation for the tools provided by ST.

At the current release, do I even need STM32CubeMX?

I am using an ETEM Board with STM32F746NGH6 Board.

Is the following routine possible: ?

  1. Create Project with TouchGFX Designer
    1. Design UI
    2. Write Code for functions defined in TouchGFX Designer
  2. Create Project in STM32CubeIDE with selected Board STM32F746NG (aka 32F746G Board)
    1. Import existing TouchGFX Designer Project --> That's the step I can't find any documentation for, neither am able to resolve
  3. Debug and flash my programm (as mentioned earlier above with Visual Studio. SInce VS ain't work without a lot of effort I switched to STM32CubeIDE)

Hi,

when you create a project in TouchGFX Designer, select the right application template directly for that mcu. When you will create your project and generate code, all the configuration will be done automatically for you for this board.

0690X00000DXBjtQAH.gif You then do not have to create from scratch a project in STM32CubeIDE, you just need to adapt it to what you have.

I am aware of this.

As mentioned I wanted to import the selected Template "EDT 4'3" with the modified UI + Code changes I created into STM32CubeIDE to continue changing code within the IDE as well as flashing the application via STM32CubeIDE on my device.

Open the ".project" file with the IDE Symbol imports the project into STM32CUbeIDE but I am not able to build it / run it.

I think I found a solution :

  • Open the "TouchGFX" Folder in your Project Folder inside the DIE
  • Double Click on the created "ApplicationTemplate.touchgfx.part"
  • click "browse" and open your previous created TouchGFX Designer Project
  • click "Generate Code" at the top right--> Your Code has sucesfully been generated into loaded into your IDE Project (Refresh)

But it seems not everything is imported.

Can you tell me how to import a Project I have created using the suiting template (for my board) via TouchGFX Designe into STM32CubeIDE to be able to flash it on my board?

The connection from ST-Link to the Board to STM32CubeIDE is already sucessful.