Jump to content

STM32F4 to ILI9341 using uGFX


Recommended Posts

Posted (edited)

Hello. I'm currently trying to make something similar based on GunterO's Keil example, but it's just won't work with new libraries... Can anyone help me with this ? I'v made a simple one-page project in uGFX studio and now i'm trying to show it on a display.

 

Edited by Joel Bodenmann
Took this out of the linked topic and created a new one
Posted

First of all, when I replaced the old libraries to the new one without changing anything else - i've got this errors:

*** Using Compiler 'V5.06 update 5 (build 528)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin'
Build target 'STM32F4-Discovery USB'
assembling startup_stm32f40_41xxx.s...
linking...
.\Targets\STM32F4_Discovery\project.axf: Error: L6218E: Undefined symbol gfxSleepMilliseconds (referred from main.o).
.\Targets\STM32F4_Discovery\project.axf: Error: L6218E: Undefined symbol gfxMutexEnter (referred from gdisp.o).
.\Targets\STM32F4_Discovery\project.axf: Error: L6218E: Undefined symbol gfxMutexExit (referred from gdisp.o).
.\Targets\STM32F4_Discovery\project.axf: Error: L6218E: Undefined symbol gfxMutexInit (referred from gdisp.o).
.\Targets\STM32F4_Discovery\project.axf: Error: L6218E: Undefined symbol _gosHeapInit (referred from gos_raw32.o).
.\Targets\STM32F4_Discovery\project.axf: Error: L6218E: Undefined symbol _gosThreadsInit (referred from gos_raw32.o).
.\Targets\STM32F4_Discovery\project.axf: Error: L6218E: Undefined symbol gfxAlloc (referred from gdriver.o).
.\Targets\STM32F4_Discovery\project.axf: Error: L6218E: Undefined symbol gfxFree (referred from gdriver.o).
.\Targets\STM32F4_Discovery\project.axf: Error: L6218E: Undefined symbol gfxSemInit (referred from gtimer.o).
.\Targets\STM32F4_Discovery\project.axf: Error: L6218E: Undefined symbol gfxSemSignal (referred from gtimer.o).
.\Targets\STM32F4_Discovery\project.axf: Error: L6218E: Undefined symbol gfxSemSignalI (referred from gtimer.o).
.\Targets\STM32F4_Discovery\project.axf: Error: L6218E: Undefined symbol gfxSemWait (referred from gtimer.o).
.\Targets\STM32F4_Discovery\project.axf: Error: L6218E: Undefined symbol gfxThreadCreate (referred from gtimer.o).
.\Targets\STM32F4_Discovery\project.axf: Error: L6218E: Undefined symbol gfxYield (referred from gtimer.o).
Not enough information to list image symbols.
Not enough information to list load addresses in the image map.
Finished: 2 information, 0 warning and 14 error messages.
".\Targets\STM32F4_Discovery\project.axf" - 14 Error(s), 0 Warning(s).
Target not created.
Build Time Elapsed:  00:00:01

 

Posted

Solved the problem by deleting all files in the "gfx" subfolder in the project except for the screen driver files ("gdisp_lld_ILI9341.c" and "board_ILI9341.h") and adding just one "gfx_mk.c". But i think i've found a bug in a "gwin_widget.c":
 

void _gwidgetInit(void)
{
	geventListenerInit(&gl);
	geventRegisterCallback(&gl, gwidgetEvent, 0);
	// geventAttachSource(&gl, ginputGetMouse(GMOUSE_ALL_INSTANCES), GLISTEN_MOUSEMETA|GLISTEN_MOUSEDOWNMOVES);

	#if GINPUT_NEED_KEYBOARD || GWIN_NEED_KEYBOARD
		geventAttachSource(&gl, ginputGetKeyboard(GKEYBOARD_ALL_INSTANCES), GLISTEN_KEYUP);
	#endif
}

I'm not using mouse and GINPUT_NEED_MOUSE is FALSE, but geventAttachSource executes without any conditions with mouse. Just commented this as shown and now all works!

Posted

That is a bug that got resolved a very long time ago. Please use the very latest version of the µGFX library (the master branch from the git repository). You can always just download it as a ZIP archive if you don't want to use git. Your change is not a proper fix. Your touchscreen will not be working now.

  • 2 weeks later...
Posted (edited)

Ok, downloaded latest version (maybe you should to replace links in downloads page - they are outdated). Now i have a problem with my touchscreen (XPT2046/ADS7843) - I just don't know how to work with it... I've created a button in a simple one-page project using the uGFX-studio, plugged in my touch screen through 4-wire SPI, now what ? How to initialize ? Where I need to write the action for the button ? Can you give me a simple example ? Or step-by-step instructions, please ?
Here is my Keil project: http://www.mediafire.com/file/l308822avbrav2r/uGFX.rar

Edited by Linker
Posted
1 hour ago, Linker said:

(maybe you should to replace links in downloads page - they are outdated).

No, they are not outdated. Please read the description on the download page of the uGFX library.

 

1 hour ago, Linker said:

How to initialize ? Where I need to write the action for the button ? Can you give me a simple example ? Or step-by-step instructions, please ?

You can find all of this information in the documentation and the countless demos in the /demos directory.
gfxInit() automatically initializes everything for you. Once you implemented the board file you can just create high-level widgets such as buttons and listen for events as shown in the demos.

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