Page 1 of 2

GFX on STM32F103Z

Posted: Tue Nov 06, 2012 1:26 pm
by E-B Felix
Hi all

i just started to port the demos on my Open103Z (WaveShare) and the HY32D (SSD1289) but without success. I got several compiling errors and warnings. As example:
../../ChibiOS-2.5.0/ext/gfx-1.4.0/drivers/gdisp/SSD1289/gdisp_lld.c:79:4: error: #error "FSMC not implemented for this device"
-> I guess because there is no define for the STM32F1XX. What I see for F103 projects we have to set STM32F10X_HD

../../ChibiOS-2.5.0/ext/gfx-1.4.0/drivers/gdisp/SSD1289/gdisp_lld.c:89:2: warning: implicit declaration of function 'PAL_MODE_ALTERNATE' [-Wimplicit-function-declaration]
-> I gues this warning is because GFX use the GPIOv2 and the F103Z use GPIOv1

Before I start to fix all those points I just want to know if somebody has already a running system with GFX 1.4.0 and the STM32F103Z?

Another question is, what version of ChibiOS is supported from GFX?

Cheers
Felix

Re: GFX on STM32F103Z

Posted: Tue Nov 06, 2012 1:41 pm
by mobyfab
Any version from 2.4.0 shoud work with GFX.

Tectu is using an F103 with the same display, he should be able to answer your questions and fix the code.

i just started to port the demos on my Open103Z (WaveShare) and the HY32D (SSD1289) but without success. I got several compiling errors and warnings. As example:
../../ChibiOS-2.5.0/ext/gfx-1.4.0/drivers/gdisp/SSD1289/gdisp_lld.c:79:4: error: #error "FSMC not implemented for this device"
-> I guess because there is no define for the STM32F1XX. What I see for F103 projects we have to set STM32F10X_HD

Indeed. Check the examples, you might be missing some header files or defines.

../../ChibiOS-2.5.0/ext/gfx-1.4.0/drivers/gdisp/SSD1289/gdisp_lld.c:89:2: warning: implicit declaration of function 'PAL_MODE_ALTERNATE' [-Wimplicit-function-declaration]
-> I gues this warning is because GFX use the GPIOv2 and the F103Z use GPIOv1

Most likely.

Nobody has this Open103Z dev board to test but any board with an F103 should behave the same way.

Re: GFX on STM32F103Z

Posted: Tue Nov 06, 2012 2:03 pm
by Tectu
Hello E-B Felix,

I have hardware with STM32F103ZE and SSD1289 since yesterday. I run into the same problem with the FSMC not implemented stuff. I still try to figure out where the problem is.
Sadly, I cannot say if this is since I updated to ChibiOS/RT 2.5.1 or not. I will keep trying to figure out the problem tonight.
If you got your SSD1289 working with F1 over FSMC, please let me know.


~ Tectu

Re: GFX on STM32F103Z

Posted: Tue Nov 06, 2012 2:16 pm
by Badger
Tectu, did you not get my message on IRC? the problem you have is because your board uses FSMC-A19 for RS, instead of A16, so you'll need to change the address used to access lcd memory. I suppose the library needs configuration options for this. Once we've moved all the 8080 interface logic to one file this can be addressed.

Also looks like the STM32F103 macros are not correct, as E-B felix has pointed out.

Re: GFX on STM32F103Z

Posted: Tue Nov 06, 2012 2:20 pm
by Tectu
Hey Badger,

Na, I must have left before you wrote me that. I am sorry.
Do you know out of the mind how I can change it to A19 instead of A16?


~ Tectu

Re: GFX on STM32F103Z

Posted: Tue Nov 06, 2012 2:24 pm
by E-B Felix
Hi Tectu

one problem is that in all boards.h for the different STM32F1xx we hafe defines like:
#define STM32F10X_HD or #define STM32F10X_MD or #define STM32F10X_CL or similar...

But in all
all the gdisp_lld.c files we willl check for the STM32F1XX

Code: Select all

#if defined(STM32F1XX) || defined(STM32F3XX)

so I changed it to:

Code: Select all

#if defined(STM32F1XX) || defined(STM32F3XX) || defined( STM32F10X_HD )

but I guess we will need to include also other F10X_XX devices...
I am testing with ChibiOS 2.5.0 at the moment.

Another problem is:

Code: Select all

   palSetBusMode(&busD, PAL_MODE_ALTERNATE(12));
   palSetBusMode(&busE, PAL_MODE_ALTERNATE(12));


which i changed to

Code: Select all

#if defined(STM32F1XX) || defined(STM32F3XX) || defined( STM32F10X_HD )
   palSetBusMode(&busD,???);
   palSetBusMode(&busE, ???);
#elif defined(STM32F4XX) || defined(STM32F2XX)
   palSetBusMode(&busD, PAL_MODE_ALTERNATE(12));
   palSetBusMode(&busE, PAL_MODE_ALTERNATE(12));
#else
   #error "palSetBusMode not implemented for this device"
#endif

I just figure out what I have to use for the ???

I will also try the input from Badger with the adress change to access the LCD.

Cheers
Felix

Re: GFX on STM32F103Z

Posted: Tue Nov 06, 2012 2:26 pm
by Badger
Try changing:

Code: Select all

#define GDISP_RAM              (*((volatile uint16_t *) 0x60020000)) /* RS = 1 */

To:

Code: Select all

#define GDISP_RAM              (*((volatile uint16_t *) 0x60100000)) /* RS = 1 */


If that doesn't work you could also try 0x60200000 and 0x60080000

Re: GFX on STM32F103Z

Posted: Tue Nov 06, 2012 2:30 pm
by Badger
E-B Felix wrote:I just figure out what I have to use for the ???

I think you want PAL_MODE_STM32_ALTERNATE_PUSHPULL

Re: GFX on STM32F103Z

Posted: Tue Nov 06, 2012 2:57 pm
by Tectu
Badger wrote:I think you want PAL_MODE_STM32_ALTERNATE_PUSHPULL

I agree with that. That's what you're searching for.


~ Tectu

Re: GFX on STM32F103Z

Posted: Tue Nov 06, 2012 3:21 pm
by E-B Felix
Thanks

now it compiles but I get an unhandeld exception during the first access to the FSMC....

Does anybody have an idea where I can find the complete setup for the FSMC? So that I can check the settings. Is this done in ChibiOS or in GFX?

Cheers
Felix