GFX integration with IAR workbench

djung1000
Posts: 12
Joined: Mon Feb 04, 2013 9:18 pm

GFX integration with IAR workbench

Postby djung1000 » Mon Feb 04, 2013 10:16 pm

Hi all,

just bought a STM32F4-Discovery board after using a 32F103 board with an 800x480 display and the SSD1963 driver.
I came across the ChibiOS a week ago and really liked it. So now I would like to use it for a project and also to learn how to work with an RTOS.
Never used one before and I must say I am struggling a bit with the integration of the GFX using IAR workbench.
I tried one of the ChibiOS examples for the Discovery board and that worked fine.
So now I'm wondering, is there a general guide for RTOSes to help with the integration of a driver or any other way of working out how to get it to work?
I did try and follow the instructions on the wiki but failed miserably.

Please let me know if you need more info from my side to be able to help with that.

Thanks a lot
Dietmar

User avatar
Tectu
Posts: 1226
Joined: Thu May 10, 2012 9:50 am
Location: Switzerland
Contact:

Re: GFX integration with IAR workbench

Postby Tectu » Mon Feb 04, 2013 10:25 pm

Hello Dietmar and welcome to the world of ChibiOS :)

Honestly, I've never tried using ChibiOS/GFX within an IDE. But since everything is makefile driven and relies on ChibiOS/RT, I don't really see any issue. Generally, you just need to add all the ChibiOS/GFX files to your IAR project.
How do you use the ChibiOS project in IAR? Does IAR use a makefile system?

It would be also nice if you could give a bit more informations about what's exactly happening. Do you get any compiler or linker errors? Can you paste them? It's very likely that the IAR compiler does complain about a few things since the ChibiOS/GFX project has been written using GCC. I guess the main issues are awful things like variable declarations within the middle of code etc. One should really clean that up :)


Kind regards,

~ Joel Bodenmann

djung1000
Posts: 12
Joined: Mon Feb 04, 2013 9:18 pm

Re: GFX integration with IAR workbench

Postby djung1000 » Wed Feb 06, 2013 8:39 pm

Hi Joel,

thanks a lot for your response.
The IAR compiler doesn't use makefiles (as far as I can tell :))
I'm not a SW engineer, so don't know too much about these things.
The errors are all compiler errors :(.
Maybe I just need to use a different toolchain instead of the IAR workbench.

One of the problems is here in the gdisp_lld.

#if defined(GDISP_USE_FSMC)
__inline void GDISP_LLD(writeindex)(uint8_t cmd) {
GDISP_REG = cmd;
}
Error[Pe077]: this declaration has no storage class or type specifier C:\Temp\ChibiOS_2.4.3\ext\gfx\drivers\gdisp\SSD1963\gdisp_lld.c 67


Thanks
Dietmar

User avatar
Tectu
Posts: 1226
Joined: Thu May 10, 2012 9:50 am
Location: Switzerland
Contact:

Re: GFX integration with IAR workbench

Postby Tectu » Wed Feb 06, 2013 9:09 pm

Hello Dietmar,

The one you showed is a common issue. The GDISP_LLD() macro should be removed. It was meant for some special kind of usage (VMT) which isn't really used nor good implemented. You should be able to get rid of these errors by adjusting the macro #define GIDSP_LLD(x) in the drivers/gdisp/<your_driver>/gdisp_lld_config.h file. Simply removing the # should do it (all of them).
If you have the time and the will, you're welcome to remove the entire GDISP_LLD() stuff from the GDISP module. Simpy rename the functions to gdisp_lld_xxxxx where xxxx is the function description, such as draw_char, set_cursor etc. A pull request or a patched .zip would be very nice.

The recommended compiler to be used is GCC. Particually this one. It comes with a .exe for windows.


~ Tectu

djung1000
Posts: 12
Joined: Mon Feb 04, 2013 9:18 pm

Re: GFX integration with IAR workbench

Postby djung1000 » Thu Feb 07, 2013 9:12 am

Hey Tectu,
managed to get it compiled now using your pointers.
IAR needs "inline" instead of "__inline"
after that only had to add the functions to the header as IAR wants it that way :shock:
Then a few minor things not compatible with the C99 dialect and voila.
Doesn't work though, but that's a job for another day ;)

Cheers
D.

User avatar
Tectu
Posts: 1226
Joined: Thu May 10, 2012 9:50 am
Location: Switzerland
Contact:

Re: GFX integration with IAR workbench

Postby Tectu » Thu Feb 07, 2013 9:19 am

Hey Dietmar,

I'd be happy for a pullrequest containing the __inline fixes as well as the c99 stuff.
What's exactly not working? I guess you're on custom hardware? What driver are you using? Did you set everything up correctly?


~ Tectu

djung1000
Posts: 12
Joined: Mon Feb 04, 2013 9:18 pm

Re: GFX integration with IAR workbench

Postby djung1000 » Thu Feb 07, 2013 8:44 pm

I use a 5inch 800x480 display using the SSD1963 driver.
The wiring is via the FSMC interface using this one http://www.element14.com/community/groups/development-tools/blog/2012/05/26/stm32f4-discovery-hy32d-tft-lcd.
I think I found this here on the forum.
Next step will be to setup the display with all the correct parameters, that's most likely why it isn't working :oops:
No point in doing this if you can't even compile the code base I guess :)
I'll update while I go along

D.

User avatar
Tectu
Posts: 1226
Joined: Thu May 10, 2012 9:50 am
Location: Switzerland
Contact:

Re: GFX integration with IAR workbench

Postby Tectu » Thu Feb 07, 2013 8:54 pm

Hello Dietmar,

You should notice that the SSD1963 driver isn't up to date at all. The library had a heavy restructoring a few commits ago in which the interface between the highlevel library and the divers has been changed. Sadly the guy who orginally contributed the SSD1963 driver never ported it to the new state.
I hardly recommend you using the SSD1289 as a template and simply fill in the current SSD1963 routines.
I'd be once again very thankful for a contribution of the new driver. I couldn't do it myself since I don't own an SSD1963 display at all.


~ Tectu

djung1000
Posts: 12
Joined: Mon Feb 04, 2013 9:18 pm

Re: GFX integration with IAR workbench

Postby djung1000 » Fri Feb 08, 2013 2:42 am

Ahh, ok. I'll look into that maybe over the weekend if I have time. It is Summer down here, and the weather is far too nice to sit indoors for most of the day :mrgreen:

But thanks a lot for the hint Tectu

User avatar
Tectu
Posts: 1226
Joined: Thu May 10, 2012 9:50 am
Location: Switzerland
Contact:

Re: GFX integration with IAR workbench

Postby Tectu » Fri Feb 08, 2013 8:12 am

Huh? Regarding your name I thought you're from Germany :D
It's about -10°C here today, so not much summer at all :P

I'd recommend you to choose the SSD1289 driver in your makefile so you can first check if you can compile everything without problems. Then you can bother with porting the SSD1963 driver (which really shouldn't be any issue at all).
Let me know when you need some help.


~ Tectu


Return to “LCD Driver and Graphic Framework”

Who is online

Users browsing this forum: No registered users and 1 guest