Jump to content

STM32F746-Disco & Eclipse - Makefile approach


Simon

Recommended Posts

Hi,

In the past I have successfully built uGFX using the single file inclusion approach (notwithstanding issues with the sdram code - see later).

I want to use the Makefile approach so it is easier to incorporate bug fixes made to uGFX.

I have looked at the CibiStudio wiki post to try to replicate the same in Eclipse.

The steps I have taken are:

  • created a new C project for the STM32F746-Discovery board including firmware version 1.9
  • Made a link to the cloned uGFX repository:

image.thumb.png.7dca594d010505e2420b3ffb7ef1bf7d.png

  • Added exclude filters for source files in the following folders:
    • boards/addons
    • boards/base (excluding STM32F746-Discovery folder)
    • demos
    • drivers/gdisp (excluding STM32LTDC folder)
    • drivers/ginput (excluding touch/FT5336)
    • drivers/multiple
    • src/gfile
  • Added the ugfx folder linked to above to the Include path
  • Renamed 'board_STM32LTDC_template.h' to 'board_STM32LTDC.h'
  • Added ugfx/drivers/gdisp/STM32LTDC to the Include path to reolve an inclusion issue
  • Created a userfonts.h file in ugfx/src/gdisp to resolve a missing dependency issue
  • Excluded all .c font files in ugfx/src/gdisp/fonts from the build (I figured I could sort the fonts problem out later)
  • Added ugfx/boards/base/STM32F746-Discovery to the Include path

On compiling I now get the error:

In file included from /home/simon/uGFX-git/ugfx/drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c:94:0:
/home/simon/uGFX-git/ugfx/drivers/gdisp/STM32LTDC/board_STM32LTDC.h:22:20: error: 'SDRAM_DEVICE_ADDR' undeclared here (not in a function)
Finished building: /home/simon/uGFX-git/ugfx/drivers/ginput/touch/FT5336/gmouse_lld_FT5336.c
   (LLDCOLOR_TYPE *)SDRAM_DEVICE_ADDR, // Frame buffer address

My problems with the single file include method as mentioned above is the the file stm32f746g_discovery_sdram.c is duplicated in the uGFX repository but with reference to a header file called stm32f746_discovery_sdram.h but the version of stm32f746g_discovery_sdram.c included in the firmware references a header file called stm32746g_discovery_sdram.h

If I proceed to try and resolve this problem it becomes very messy and I didn't document how I have resolved it with the single file inclusion method.

So, two simple questions (!):

  • is this the correct way to implement the makefile approach in Eclipse?
  • how to correctly resolve the issues caused by the sdram files?

Thanks

Simon.

Link to comment
Share on other sites

Use our file instead of the firmware file in your build. STM keep changing their firmware in incompatible ways which is why we include a particular version in our repository.

@cpu20 is the expert in getting ide's to include the correct files. He has published a number of guides that may help.

The other way is to not rely on the ide's build generator and to instead create a true makefile project in eclipse. It is by far the easiest way to build uGFX and it is where we as developers started. If you are nterested in this have a look at some of the prepared makefiles in the various board example directories.

Link to comment
Share on other sites

On 13/11/2018 at 14:21, Simon said:

is this the correct way to implement the makefile approach in Eclipse?

With Makefile approach do you mean using the Makefile system provided by uGFX? Because then you need to make a Makefile project in Eclipse.

When you create a C project in Eclipse, it will create a Makefile for you depending on how you configured the project. When you create a Makefile project, Eclipse will not generate any makefiles and use the Makefile you provide.

What you are currently doing is manually configuring the whole Eclipse project to compile correctly. That is a very difficult process, but I think it is possible.

Link to comment
Share on other sites

21 hours ago, cpu20 said:

With Makefile approach do you mean using the Makefile system provided by uGFX? Because then you need to make a Makefile project in Eclipse.

I mean the Makefile approach shown here and in the image below rather than the Single file inclusion approach. 

image.png.50d1bbca52dd427058119febc915e799.png

I guess the issue I have encountered is that I can create a Makefile project and tell it to use the uGFX makefiles but how do I then incorporate my own code and tell Eclipse to include that in the builds.

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