Jump to content

SW4STM32 IDE & uGFX configuration


Michal

Recommended Posts

  • Replies 56
  • Created
  • Last Reply

Top Posters In This Topic

That's my bad. I forgot to mention that in the "userfonts.h" file I changed the include to:

#include "../rsc/DejaVuSans16.c"

Normally you don't have to do this when you put the rsc folder inside the inc folder. But for some reason Eclipse wasn't including the file correctly then. I have no idea why though...

Link to comment
Share on other sites

Oh i mis-read that initially as needing to be in there, removing it fixed it, it builds now.

However, once flashed the display only shows garbage similar to what is seen during startup of the example project you provided.
Looking at the structure of the garbage, it looks like some horizontal misalignment.
a40a57628f71dd2f32cd11a366676b9f.png.2c213b6a2d0fb8515381c454e8b8b56d.pngIMG_20170531_150947.thumb.jpg.ff4c782308f145f134e8db2fdb50a04d.jpg

Link to comment
Share on other sites

Yes, that is intentional and yes, you can disable that by setting GWIN_SLIDER_NOSNAP to TRUE in your configuration file. 

Here's a copy of all the default values. It's taken from the example config file named gfxconf.example.h that you find in the top-level directory of the µGFX library distribution:

    #define GWIN_NEED_SLIDER                         FALSE
        #define GWIN_SLIDER_NOSNAP                   FALSE
        #define GWIN_SLIDER_DEAD_BAND                5
        #define GWIN_SLIDER_TOGGLE_INC               20

 

Link to comment
Share on other sites

  • 3 months later...

 

@cpu20 Could you tell me please, what did you exactly fix in includes? I tried update HAL for project's template from site (simple changed it in project to last version), but have compile error with touch and colors macros:

 

SW4STM32 - C_C++ - STM32F7-Disco_uGFX_drivers_ginput_touch_FT5336_gmouse_lld_FT5336_board_template.h - Eclipse 2017-09-11 17.55.25.png

Makefile's version compiles OK with last HAL. 

Edited by Dvor_nik
Link to comment
Share on other sites

The fix I just uploaded is just setting the event timeout to TIME_INFINITE. Else the event timer gives an immediate timeout which isn't caught.

That however has nothing to do with the color errors you are getting. The problem you see with the colors is due to the fact that both µGFX and the HAL_drivers use the names red, green and blue for their color naming schemes. Thus they conflict when you try to compile the program.
Those conflicts can be fixed by excluding the files in the HAL_driver that use those color names. The conflicting ones, if I remember correctly are the DMA2D driver and the LTDC driver. Normally you'll never need those HAL-drivers when using µGFX so you can simply exclude them from your build.
For more details on which files are excluded from build in the example project check the stm32f7xx_hal_conf.h file. (Note that when overwriting the HAL_driver in the project you also loose this file. But you do need this to make the HAL work!) All included drivers are listed there. You don't need many of them to make your program work, so play it safe and exclude everything you don't use.

I made another mistake in the example project btw. The stm32f7xx_hal_conf.h file should be located in the inc folder of the project. It is very bad practice to put it in the HAL_driver folders. I will fix that as soon as possible.

Link to comment
Share on other sites

Hello @cpu20,

Could you please tell me what have you done to make your template working? I am trying to follow all the steps with newest ugfx library and FreeRTOS- although FreeRTOS is not a problem here (I guess). I will tell you now what am I doing- step by step:

1. Creating new C project with clear STM32F745 MCU with HAL library and FreeRTOS included.
2. Importing ugfx library.
3. Adding the folder with ugfx to source location in project properties- I exclude every file except gfx_mk.c and gdisp/STM32LTDC folder.
4. I add in Paths and Symbols in project properties paths to ugfx and gdisp/STM32LTDC.
5. I copy files from boards/base/STM32F746-Discovery to src and inc directories.

In this moment, imho, it should work. But I constatly get these errors. Could you please tell me how did you get is running?

Btw, I am trying to run the display only now.

 

paths.png

symbols.png

source.png

errors.png

tree.png

Edited by Oshel
Link to comment
Share on other sites

Well, I managed to get rid of the HAL errors by including HAL files in order taht you did in your project.

But now I am facing these problems:

Type 'bool_t' could not be resolved	gdisp_lld_STM32LTDC.c
Type 'systemticks_t' could not be resolved	stm32f746g_discovery_sdram.c

And these problems are related with FreeRTOS. These types are present while raw32 is used- but there is no such definitions in gos_freertos.h file.

Edit:

I did remove errors by:

1. In file stm32f746g_discovery_sdram.c in line 261 (_FMC_SDRAM_SendCommand function) I replaced systemticks_t to uint32_t.

2. In file gdisp_driver.h I added "typedef int8_t bool_t;" right after "#if GFX_USE_GDISP".

Funny fact is that bool_t type should be included while using FreeRTOS- it is in gos_freertos.h.

So, although it compiles, I am sure that I did not do this right way...

Edited by Oshel
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...