Jump to content

SW4STM32 IDE & uGFX configuration


Michal

Recommended Posts

Hi everyone

I am  trying configure SW4STM32 with uGFX but i have some problems. Now I am working on windows 10 system and 

I implementing ugfx to baremetal stm32f7 disco project and I follow with:

- create a new ugfx folder in project tree anc copy content ugfc library and exlude from build

- copy gfx_mk.c from ugfx/src to my src folder

- copy gfxconf.example.h into iclude and configure as follows:

#ifndef _GFXCONF_H
#define _GFXCONF_H

#define GFX_USE_GDISP                   TRUE
#define GDISP_NEED_VALIDATION           FALSE
#define GDISP_NEED_CLIP                 FALSE
#define GDISP_NEED_TEXT                 FALSE
#define GDISP_NEED_CIRCLE               TRUE
#define GDISP_NEED_ELLIPSE              FALSE
#define GDISP_NEED_ARC                  FALSE
#define GDISP_NEED_SCROLL               FALSE
#define GDISP_NEED_PIXELREAD            FALSE
#define GDISP_NEED_CONTROL              FALSE
#define GDISP_NEED_MULTITHREAD          FALSE
#define GDISP_NEED_ASYNC                FALSE
#define GDISP_NEED_MSGAPI               FALSE

/* Builtin Fonts */
#define GDISP_INCLUDE_FONT_SMALL        FALSE
#define GDISP_INCLUDE_FONT_LARGER       FALSE
#define GDISP_INCLUDE_FONT_UI1          FALSE
#define GDISP_INCLUDE_FONT_UI2          FALSE
#define GDISP_INCLUDE_FONT_LARGENUMBERS FALSE

#endif /* _GFXCONF_H */

next i copy follows files into my project add path | properties>> C/C++ Build/settings >> includes 

"../ugfx"
"../STM32LTDC"

"../FT5336"
"../STM32F746-Discovery"

end in main i include gfx.h

Someone could tell me what i do wrong ?? or share simple already configured project redy to compile.

 

Thank

 

 

Edited by Michal
Link to comment
Share on other sites

  • Replies 56
  • Created
  • Last Reply

Top Posters In This Topic

main problem is the errors 
make: *** [src/main.o] Error 1    ff             C/C++ Problem
unknown type name 'UART_HandleTypeDef'    stm32746g_discovery.h    /ff/Utilities/STM32746G-Discovery    line 317    C/C++ 
bifore adding ugfx libraries there is no errors

i think i done somethink wrong

 

Link to comment
Share on other sites

Please use code-boxes to add code & compiler outputs to your posts.

The error you're getting suggests that there's an issue with the inclusion of the CubeHAL. Either you are using incompatible versions or you didn't include the CubeHAL properly.
In your case we'd recommend you to use the STM32F746G-Discovery baremetal make based template project. You should be able to just download, compile and run it without any problems at all as it contains everything you need. We definitely need more information on this in order to help you.
You should then be able to either import that project into SW4STM32 or create a new project based upon that template.

We can create a complete ready-to-run project for your particular setup but it will take us between one and two weeks until we get the time to do that.

Link to comment
Share on other sites

Beginings are hard , i still have some troubleI create new project upon project You linked to post, because direction import from workspace is not working , and 

fatal error: gdisp_lld_config.h: No such file or directory    gdisp.h    /nnn/ugfx/src/gdisp    line 157    C/C++ Problem
make: *** [ugfx/src/gwin/gwin.o] Error 1    nnn             C/C++ Problem
But it exist in workspace , so I add path for src/gdisp/mcufont but occured another errors of this type so i add ewry posible

in the end  i got aditional 90 errors. 

should i add this path path or no , maybe will be better if i wait some for  complete ready-to-run project  which You mentioned 

or maybe You could create short step-by-stem guide if it is not a big problem.

Link to comment
Share on other sites

  • 4 months later...
On 23. 12. 2016 at 07:31, Joel Bodenmann said:

We'll put together an official ready-to-run project for the STM32F746G-Discovery project using the SW4STM32 / AC6 IDE. It should be ready for download within a week.

Have you managed to make this project?

Regards!

Link to comment
Share on other sites

Ok i am giving in, i am starting to lose my mind. 
I can't seem to get uGFX to actually work on a STM32F746G-DISCOVERY, i've documented the steps I took in pictures: 
I am not sure if this is an issue related to this board specifically or not, but i figured adding to this thread makes more sense than making a new one.
I mostly followed the eclipse guide.
I first created a project using the new c project wizard:

bda46015711b7523b4567e2c8736e1f2.png.d21139962413b2914f7ac63e0c9527ce.png

15f4159c9156a3947bd3f79af4420fe6.png.1cffea2cf017a8d7aeff5f8ced18840d.png

e46fab3329ae163ad636159f7950aa74.png.5700026815c367bea4a611bfed7f3ea5.png

778bb5187e6e29348c7e461f329ee863.thumb.png.2b225453b81894b1a2256024fe756d6d.png

I then imported uGFX as described in the guide and excluded everything except for \src\gfx_mk.c

47ad62fadbba3598170cca6983d4a47d.png.ed561de55bf2040088954684814c4ab8.png

cbda6e8a7be5e87ee9ba49c86e00b48e.thumb.png.08d56133d6f1203e20c8b8fb00a2e2f9.png
c1e8c84da378b0a280c0ee47f5226111.thumb.png.0533d4f1866052d75f8349292e2bc9bc.png
268747690ca136e9d65c9131a9a3251f.thumb.png.72000b9f76fec86afd23216ef230dda3.png

I then copied and edited gfxconf.h as per the guide, and included gfx.h in main.c, with a call to gfxInit();
It compiles without errors.
a313d9a9ed92478ef54e55a4013a0c15.thumb.png.8254e0d1a6bd48ca259962b2fde94c06.png

So I went on to including the drivers for the board. i removed the drivers/ filter and added all the other filters so drivers/gdisp/STM32LTDC and drivers/ginput/touch/FT5336 are allowed

e051aaf9dce2e19bf78120f247021513.thumb.png.ea298e376fb5e2a4150da1ffc350e5e7.png

After this step, the project still compiles, although i do not have the board file included yet - most likely no relevant function calls yet.
At this step i am not quite sure which board files to include, here is what I did though: 
I copied the following files from boards/STM32F746-Discovery to my inc folder:

  • board_STM32LTDC.h
  • stm32f7_i2c.c
  • stm32f7_i2c.h
  • stm32f746nghx_flash.ld

I am uncertain what do do with stm32f7xx_hal_conf.h from example_raw32, does that go into HAL_Driver/Inc/ ?

I also copied gmouse_lld_FT5336_board.h to uGFX/drivers/ginput/touch/FT5336 and deleted gmouse_lld_FT5336_board_template.h

Everything still compiles fine.

After that, i grabbed the while loop from main.c and the gfxconf.h from this template:

When i now try to compile it does this:
77981beed621781ba75b45f09316222e.thumb.png.e4f0dba3cd2e1ccac4a15b00d2693446.png

I am completely stuck, really close to setting stuff on fire, send help.

Link to comment
Share on other sites

In your gfxconf.h you need to uncomment #define GFX_USE_GDISP and change value from FALSE to TRUE. But then all hell breaks loose!!! :)

I get 693 errors after that. :(

If it helps here is the first error:

expected declaration specifiers or '...' before '(' token    gdisp_colors.h    /F7_uGFX_005/uGFX/src/gdisp    line 313    C/C++ Problem

it points to function:

#define HTML2COLOR_R(h)        (((h) & ((0xFFL & ~((1<<(8-COLOR_BITS_R))-1))<<16)) >> (24-(COLOR_BITS_R+COLOR_SHIFT_R)))
 

on line 313 in gdisp_colors.h

Edited by Slemi
Link to comment
Share on other sites

4 hours ago, blacktronics said:

I am completely stuck, really close to setting stuff on fire, send help.

No need for a fire here :P We are here to help you!

4 hours ago, blacktronics said:

At this step i am not quite sure which board files to include, here is what I did though: 
I copied the following files from boards/STM32F746-Discovery to my inc folder:

You did everything correctly so far. But here we'll have to take another approach as all the board files for the STM32F746-DISCO are already written and ready to be used. So first there is no need to do this:

4 hours ago, blacktronics said:

I also copied gmouse_lld_FT5336_board.h to uGFX/drivers/ginput/touch/FT5336 and deleted gmouse_lld_FT5336_board_template.h

Normally you don't mess with the files in the library itself. You should keep the µGFX library untouched and copy any board files needed to your inc folder. But!!!! don't do that yet in this case!

Here it is much easier to just go back to Project -> properties -> C/C++ General -> Paths and Symbols -> Includes. Here you should add the folder /boards/STM32F746-Discovery for all languages again.
Doing this will include both the gmouse_lld_FT5336_board.h and board_STM32LTDC.h into your project.

One tip I was planning to add in the tutorial:

Easily_exclude.thumb.png.eabf57e95479d4df35a4c4c4c52f3b90.png

If you want to easily exclude files from your build without having to constantly go back to the filter, you can select them in your Project Explorer, right click and choose Resource Configurations -> Exclude from Build...
That will give you this dialog:

Easily_exclude2.png.458197161801a8382f152da64d9e4085.png

Deselect all the check boxes here and click OK. The files should now be included in your project.

If you want to exclude them again do the exact same thing, but check all the check boxes in the "Exclude from build" dialog.

I'll explain it here with the method from the guide but you can also use the above method to include the files. So next go back to Project -> properties -> C/C++ General -> Paths and Symbols -> Source Location tab. First delete the boards entry form the filter list. Now also include the boards/STM32F746-Discovery folder. Here we will have to add a filter also because there are files SW4STM32 already generated that are also in the folder and keeping them both will give conflicts.
So in the filter exclude everything in the boards folder except for the following files in the STM32F746-Discovery folder:
- stm32f7_i2c.c
- stm32f746g_discovery_sdram.c
- stm32f746g_raw32_system.c
- stm32f746g_raw32_ugfx.c

Now you should be able to enable #define GFX_USE_GDISP without getting compiler errors.

Let us know if this doesn't work out!

Edit: One thing I didn't see is if you included the driver folders (STM32LTDC and FT5336) to your Includes.

Edited by cpu20
Link to comment
Share on other sites


 

9 minutes ago, cpu20 said:

Yes, could you give me the output of your error messages? (Console)

Hi!

 

I still have the same error as before. Starting to loose my mind triyng to get this to work for last six hours. I have enough for today, or my board might meet my hammer. Will try again tomorrow. Not sure anymore what I have already changed and what not. Tried everything five times already from scratch. Wish there was someone who knows that would create step-by-step tutorial for this for us who don't know. :(

printscreen.JPG

Edited by Slemi
Link to comment
Share on other sites

@Slemi Don't worry, we'll find a way to make it work.

I just downloaded SW4STM32 and I get the same errors. The problem lies in the fact that the suite includes alot of files for the board that are giving conflicts. I am trying to resolve everything but it will take some time.

Link to comment
Share on other sites

I've looked a little bit further into it and it seems there is an incompatibility between the HAL-driver used by SW4STM32 and the stm32f746_discovery_sdram.c file used for the board.
The problem is temporarily fixed by manually editing the inclusions:

Use this to get started with and I'll look into fixing the issue properly when I have more time. You will see that when initializing there is some glitching on the screen which gets resolved after the initialization.

To use the project just do Import -> Existing project into workspace.

Link to comment
Share on other sites

Okay, sorry to bother you again - the template you provided works fine. 
However, how do I now use the output from studio? 
I just copied the contents of the output folder into my inc folder, and copied the code from main_example.c into main.c 
It went apocalypse on me:

fe3c0b3fc57b9fe5a5c87d33ed1329e6.thumb.png.e24cc3202e5cb51d336ab87f53a01a7c.png

Link to comment
Share on other sites

7 hours ago, blacktronics said:

Okay, sorry to bother you again

No problem, happy to help anywhere I can.

All the .h files generated by µGFX studio should be copied into your inc dir. However the gui.c file as well as the rsc folder should be copied into your src folder.
The compiler is also saying there are some problems in your gfxconf.h. Maybe something went wrong when generating the file in the studio. If changing what I said here does not work, post your gfxconf.h here and I'll take a look where there might be a problem.

Link to comment
Share on other sites

First you'll have to copy and paste the GOS settings from the original gfxconf.h. This is because the studio does not generate these.

///////////////////////////////////////////////////////////////////////////
// GOS - One of these must be defined, preferably in your Makefile       //
///////////////////////////////////////////////////////////////////////////

So copy everything from the original gfxconf.h below this GOS header (and above the GDISP header) and copy it into your new gfxconf.h file.

Next for using font stuff you must add uGFX/src/gdisp/mcufont to your include paths in your project settings.

Move the rsc folder (containing the font file DejaVuSans16.c) to the root directory of your project and also add it to your include paths.

Result_studio.thumb.png.a543aa4e92a5828c4dddbda9305f40db.png

This should be the result. Don't forget to add HAL_Init(); to the beginning of your main program!

gfxconf.h

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...