Jump to content

testing STM32F429i-Discovery demo on Chibios 3


fixer

Recommended Posts

I have been trying to test current uGFX on ChibiOS 3 too. ( I did a fresh pull last night ).

First of all there seems to be an error in the example Makefile you use to explain what mods are needed to include uGFX

http://wiki.ugfx.org/index.php?title=ChibiOS/RT

You say that there must not be a main.c in the project that links a uGFX demo ( which have their own main.c ) but you forget to remove it in the example. You may wish to correct that.

I tried to add the oscilloscope and play-wave demos but they complained about a missing .h file. I suspect something has been renamed but the change not reflected in the demo code.

I renamed at a guess and it looked like it fixed the problem:

cp gaudio_driver_play.h gaudio_play_config.h

However, it failed with problems in SPI.

I skipped and went for gdsip/basics to get things running and hit the same problem:


ugfx/boards/base/STM32F429i-Discovery/board_STM32F429iDiscovery.h:15:19: error: 'SPID5' undeclared (first use in this function)
#define SPI_PORT &SPID5

Plus some missing function definitions eg; :

ugfx/boards/base/STM32F429i-Discovery/board_STM32F429iDiscovery.h:118:2: warning: implicit declaration of function 'spiSend' [-Wimplicit-function-declaration]
spiSend(SPI_PORT, 1, &sindex);

The STM32F429iDiscovery appears to be fully supported and has an explicit subdir for Chibios 3.0 , what is this all about?

Do I need to manually turn things on Chibios HAL until it stops complaining?

BTW, I had already built the Chibios demo and it compiled without problems.

Thanks.

Link to comment
Share on other sites

OK, I was misunderstanding how to include the demos.

I have now compiled the demo example in /ugfx/boards/base/STM32F429i-Discovery/example_chibios_3.x without problems ( I have not flashed it but it compiles cleanly ).

However, I don't see why editing the Chibios demo is not working. As a trivial test example, say I want to use the blinking LED demo and use uGFX to have a red dot blink on the display at the same time using gdisp . Before worrying about implementing that I need to link in the basic uGFX functionality following the guide.

I edit the chibios demo Makefile as indicated. I first define GFXLIB , then:


### add uGFX includes:

include $(GFXLIB)/gfx.mk
include $(GFXLIB)/boards/base/STM32F429i-Discovery/board.mk
include $(GFXLIB)/drivers/gdisp/STM32F429iDiscovery/driver.mk

I've modified CSRC and INCDIR to include GFX. However, it fails to build.



Compiling chprintf.c
Compiling gfx.c
In file included from /foobar/ugfx/src/gfx.c:16:0:
/foobar/ugfx/gfx.h:55:21: fatal error: gfxconf.h: No such file or directory
#include "gfxconf.h"
^
compilation terminated.
make: *** [build/obj/gfx.o] Error 1

Have I not followed the guilde correctly or is this not what it is intended for?

Thx.

Link to comment
Share on other sites

We are currently planing on creating a second, dedicated repository named uGFX-Demos or uGFX-Demo-Projects. This repository will contain many ready-to-use projects. The goal is to have working-out-of-the-box projects for the most common boards (eg. the Discovery boards) and the most common IDEs (Keil, ChibiStudio, just Makefile, ...) and most common underlying systems (ChibiOS, FreeRTOS, BareMetal, ...).

However, this is a lot of work and we will most likely rely on the help of the community to not only provide a large set of projects but also to keep them working.

Regarding your question: I think you didn't follow or understand the guide properly. You are missing the configuration file. The file gfxconf.h is a hard-coded include inside the uGFX code.

In order to compile your project just copy the available template as described in the wiki and enable the ChibiOS support and you should have a working project that just doesn't do anything yet :)

If you have any other questions please do not hesitate to ask.

~ Tectu

Link to comment
Share on other sites

Thanks, I'd just worked that out and came back to post : "never mind".

I do now have a clean compilation of the chibios demo with uGFX compiled but unused. Fine.

A couple of suggstions:

rather than braking into continuation lines in the example config it may be clearer ( an easer to revert etc ) if just done by adding extra path content in a separate line:


INCDIR += $(GFXINC)
CSRC += $(GFXSRC)

When I first built it having only turned on CHIBIOS in the config file , it was spamming the console with warnings about undefined GFX_USE_GDISP

gfxconf.example.h contains indicating that the default value is FALSE. This is incorrect : it is undefined.

//#define GFX_USE_GDISP                                FALSE

Either it should be defined as false ( which is effectively what the code does when it is undefined ) or the doc should not say it has a default of FALSE when it is in fact UNDEFINED.

Is there a logic to leaving it undefined which is spamming the console with warnings.

Thanks for the help ;)

Link to comment
Share on other sites

Thank you for your recommendation regarding the ChibiOS Makefiles. We will have a look at this once we get to adding official demo projects.

Regarding the GFX_USE_GDISP macro: Why do you say that it is undefined? There is a default value that is set in the top-level gfx.h file:


* @brief GFX Graphics Display Basic API
* @details Defaults to FALSE
* @note Also add the specific hardware driver to your makefile.
* Eg. include $(GFXLIB)/drivers/gdisp/Nokia6610/driver.mk
*/
#ifndef GFX_USE_GDISP
#define GFX_USE_GDISP FALSE
#endif

~ Tectu

Link to comment
Share on other sites

I beg your pardon, I copied the wrong line. it was GFX_NO_INLINE that I was referring to .

    //#define GFX_NO_INLINE                            FALSE

If I leave that commented I get a metric tonne of messages like this one:


Compiling gwin.c
In file included from /svn/stm32/stm32f4_linux/local/src/ugfx/src/gwin/gwin.c:13:0:
/svn/stm32/stm32f4_linux/local/src/ugfx/gfx.h:61:5: warning: "GFX_NO_INLINE" is not defined [-Wundef]
#if GFX_NO_INLINE

Link to comment
Share on other sites

Yes, you are right. GFX_NO_INLINE is missing a default value.

We added that just a couple of days ago and therefore it hasn't been tested on a wide variety of systems so far.

We just pushed a fix for that (the default value is defined within the GOS module as this setting has to do with support different compiler sets).

Can you please pull the latest master and check that this fixes the issue?

Thank you for reporting this issue.

~ Tectu

Link to comment
Share on other sites

You're welcome. A tiny contribution to feedback into uGFX. I have not tried using it yet but it looks pretty good so far.

I also made a small improvement to the CalibrationTransform bug, in case you haven't noticed. Just a little more efficient.

I'll try to check out that correction to master later.

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