Skip to main content
Professional
Associate III
November 29, 2018
Question

cubemx + touchgfx STM32f429i disco fatal error: SDL2/SDL_video.h: No such file or directory

  • November 29, 2018
  • 17 replies
  • 5766 views

Hello,

i tried to generate for STM32f429i disco a project with graphic = touchgfx.

1) i generate cubemx (for STM32f429i disco) project for SW4STM32 toolchain

2) i generate a simple touchgfx project for SW4STM32 toolchain

But compilation under eclipse gives the following errors :

HALSDL2.hpp:22:10: fatal error: SDL2/SDL_video.h: No such file or directory

HALSDL2.hpp:22:10: fatal error:SDL2/SDL_render.h: No such file or directory

main.cpp:30:10: fatal error: shellapi.h: No such file or directory

I can i solve these compilation errors ?

thanks

best regards

17 replies

Mon2
Senior III
December 22, 2018

Hi @Clark Sann​. Have to do my role for a few hours of shopping with the Mrs. but hope to get back to this later today. In hindsight, as they say on G.I. Joe, knowing is half the battle. Embarrassed to say that the SW4STM32 learning curve was not so easy for us and THE root cause of this battle. Now, we can build from scratch with touch panel in less than 2 minutes using TouchGFX. More details to follow. If you are really stuck after the documentation review, we can work on a Teamviewer remote session. I am on the EST time zone. Bye for now.

PS: Agree that TouchGFX is VERY powerful and to be open, we had it operational quickly after installation without even reading the limited documentation. Do not believe we were so luck with STEMWin or others. This combo will be great for the development community. Also, somewhere at work, have the STM32F746-DISCO kit but could not locate it yesterday. Will give that a quick review, time permitting. The procedure for use of that kit with IAR is documented on the Draupner main website.

Clark Sann
Associate III
December 22, 2018

@Mon2​ ,

Thanks for you offer to help and your assistance so far! Have a good time shopping and it's good you have your priorities straight! =)

I am CST. But I hope I don't have to bother you with screen sharing.

Mon2
Senior III
December 23, 2018

Hello @Clark Sann​ and all, please see here:

https://community.st.com/s/question/0D50X0000A7Y1xxSQC/stm32f429idisc1-tutorials-with-iar-and-sw4stm32-compilers-with-touchgfx-stm32cubemx

Welcome your feedback and hope this helps.

Going to grab a Netflix and will check back later, in case this tutorial goes South :)

Good luck!!

Professional
Associate III
January 3, 2019

Hello

thanks a lot for the SW4STM32_Tutorial_STM32F429i_DISC1 project

What must be modified in this project to set the screen to landscape (in touchGFX + eclipse) ?

best regards

Martin KJELDSEN
Principal III
January 3, 2019

@Professional​, https://touchgfx.zendesk.com/hc/en-us/articles/203563972-Display-Orientation discusses how to change display orientation.

HAL::getInstance()->setDisplayOrientation(ORIENTATION_LANDSCAPE); 

The STM32F429-DISCO board runs PORTRAIT natively, so you also need to tell the image converter to rotate your images. It should be outlined in the article.

Hope that helps!

Best regards,

Martin

Professional
Associate III
January 4, 2019

Hello

thank for the reply

i have :

1) modified the TouchGFX\config\gcc\app.mk

screen_orientation := -rotate90

2) re-generate the TouchGFX (generate code)

3) modified the BoardConfiguration.cpp in touchgfx_init()

HAL::getInstance()->setDisplayOrientation(ORIENTATION_LANDSCAPE);

Project clean+ build

target program chip

This is all right, but i would like to have a rotation in the reverse direction -90 instead of +90

is it possible ?

Thanks a lot

best regards

Martin KJELDSEN
Principal III
January 4, 2019

Unfortunately there's no way, natively, to do a 270 degree rotation.

I posted a widget in this thread that can perform a 180 degree rotation in software and @danielschramm9​ has ported it to 270 degrees. You would then not have to configure your application for rotation as this is done through a custom widget. This is a very ineffecient way of doing the rotation since all pixels have to be swapped after the screen has been rendered to memory.

https://community.st.com/s/question/0D50X0000A1lVxsSQE/repost-change-lcd-orientation-in-180-degree

scottSD
Senior III
April 4, 2019

Has anyone come up with a solution to this? I run into the same thing when running it for the STM32F746G Discovery board.

Martin KJELDSEN
Principal III
April 8, 2019

What exactly is your problem, @scottSD​?

Thanks,

Martin

scottSD
Senior III
April 8, 2019

Martin,

Thanks for you reply.

My main task right now is getting CubeMX, TouchGFX, and Atollic TrueSTUDIO (or System workbench) to play well together. I have had many issues doing that. As I stated in my comment that I am using the STM32F746G Discover board.

I followed the instructions laid out in the following post:

https://touchgfx.zendesk.com/hc/en-us/community/posts/360025859872-How-To-TouchGFX-4-9-3-example-for-Atollic-9-0-1

But had quite a few problems with files not being included in the path, etc.

Note that I have been able to run the Atollic TrueSTUDIO example code right to the Discovery board (Run > Debug). I have also been able to run the TouchGFX examples right to the Discovery Board ("Run Target").

It just seems that creating projects through CubeMX/TouchGFX (either by themselves or by opening the CubeMX plug-in (perspective) in TrueStudio is not very easily done.

Do you have any step-by-step instructions that work reliably?

Visitor II
February 22, 2025

This issue often arises due to CubeMX and TouchGFX integration. If you need a proper setup, check the official ST forums or documentation.

YZalo.1
Associate II
April 2, 2026

in the project I did not find SDL2/SDL_video.h, SDL2/SDL_render.h and I found SDL_video.h, SDL_render.h and included them in the file that gives the error. And I also added the patch in properties->C/C++ Build ->Setting-> Include Patch of the project and this error disappeared