ivan47 Posted March 15, 2015 Report Share Posted March 15, 2015 Hello, I'm new here, so before I begin, please be gentle. Recently I've got ILI9341 and started to learn about LCDs. Now, the problem started when I tried to implementuGFX, because there wasn't any Keil project using uGFX.The question is, what should I do to make simple program (drawing circle, text, without some RTOS) using uGFX and compile it succesfully.If someone already done something like that in Keil, I would be grateful if he could send me his Keil project.I tried STemWin, but big part of the code was inaccessible. So i decided I should try uGFX.Please help Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted March 15, 2015 Report Share Posted March 15, 2015 Hello ivan47 and welcome to the community!Sadly there are no Keil examples because they are never generic. With IDEs like Keil you will always be very hardware and application specific. However, many of our customers use Keil with uGFX without any problems. I myself have also implemented many projects with uGFX in Keil and I never faced any issues so far. Sadly they cannot be shared as those are commercial projects and therefore company property.To start I'd highly recommend to get a blinking LED example working first. Then make sure that your SPI port works before you start even downloading uGFX. I'm not sure what you're using. You should be able to find some Keil examples for the STM32F4 Discovery board with the stdperiph library without any problems as this is a very common board. Maybe ST even provides an official one.As soon as you have your basic project working you can start adding the required uGFX files. For starting you will just need the ILI9341 driver and the GDISP subsystem. Furthermore you'll need to include the corresponding GOS port (RAW32 in your case). Sadly there is no straight forward step-by-step guide for this as it again is very hardware and platform specific. We tried to write some minimal guide a few months ago. Maybe this helps: http://wiki.ugfx.org/index.php?title=IDEShould you run into any problems we're happy to help where ever we can. Just make sure that you properly report the problems that you're facing (complete compiler output, probably screenshot of your file tree etc. etc. Just whatever is needed to allow us helping you quickly.)I hope that helps for now.~ Tectu Link to comment Share on other sites More sharing options...
ivan47 Posted March 15, 2015 Author Report Share Posted March 15, 2015 Thanks for your answer in such short notice. The thing is, I've already made driver functions (for sending data, commands, etc) for ILI9341.I already implemented functions for drawing. And now, my college project is to implement some libraries like uGFX, so I can do the same thing(and more). Anyway, thanks for your reply. I'll take a look at link you send and try to do it myself. Thanks Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted March 15, 2015 Report Share Posted March 15, 2015 Sounds like you have the experience that it takes to use uGFX in your project. All you really have to do is adding the files to the Keil file tree.Good luck.~ Tectu Link to comment Share on other sites More sharing options...
GunterO Posted March 16, 2015 Report Share Posted March 16, 2015 The question is, what should I do to make simple program (drawing circle, text, without some RTOS) using uGFX and compile it succesfully.Hi,I have some experience with Keil's µVision and µGFX, but I wonder why you don't want to use some RTOS as base? For example ChibiOS/RT has quite a good HAL worked out which you can use without the immediate need for multi threading knowledge or something like that. ChibiOS has a good support base/community and ChibiOS & µGFX are getting along very good :-)You are talking about STM32F4, do you mean the Discovery board? I guess you don't use the BaseBoard & LCD (SSD2119) because you mention ILI9341? Because I have some ready to use ChibiOS/µGFX/µVision samples for that combination.Concerning the ILI9341, how is this connected/configured? Via SPI or parallel? In case of SPI, I optimized the board file for this just recently :-) Link to comment Share on other sites More sharing options...
ivan47 Posted March 16, 2015 Author Report Share Posted March 16, 2015 Hey GunterO. Well, I have some experience working with FreeRTOS (I've never worked with ChibiOS, but I see many people use it).However, I'm building example project to demonstrate working with some GUI libraries, and how to get them to work on different boards with different modules. I wanna use StdPeriph_Driver libraries and I don't want to implement RTOS in the whole story... for now. I'm using STM32F4 discovery board with the base board on it, and I've got ILI9341 module with SPI interface. I will probably get the LCD module for BB, but I want first to enable working with ILI9341. The thing is, I already have some basic drivers function, but I apparentlylack the programming skills to implement uGFX in Keil. I would like to see Keil project you made for ChibiOS, maybe it will help. Link to comment Share on other sites More sharing options...
inmarket Posted March 16, 2015 Report Share Posted March 16, 2015 I you want to use ugfx without a rtos, have a look at the raw32 gos layer. It allows you to implement ugfx with no operating system.If you search the forum you will find code snippets etc from other users who have used this. Link to comment Share on other sites More sharing options...
ivan47 Posted March 16, 2015 Author Report Share Posted March 16, 2015 I tried to implement uGFX libraries to Keil, using Std_Periph_Driver libraries, but I've got lots of errors.I've attached text file with some of the errors. Please help.uGFX_Keil_error.zip Link to comment Share on other sites More sharing options...
GunterO Posted March 16, 2015 Report Share Posted March 16, 2015 Which version of µGFX are you using? Does not look like the latest (Master) or even v2.2. Link to comment Share on other sites More sharing options...
ivan47 Posted March 16, 2015 Author Report Share Posted March 16, 2015 I updated the version, but same problems appear. There is: invalid redeclaration of type name "int8_t",expected a ";", and lots of others. I would like if someone could spare some time and take a look at my Keil project.I could share my whole project over mail. Link to comment Share on other sites More sharing options...
ivan47 Posted March 16, 2015 Author Report Share Posted March 16, 2015 There is also use of GDisplay *g variable in board_ILI9341.h file so I included gfx.h (that seems to solve the issue, but I'm not sure if I'm suppose to do that)(Sry for my bad english) Link to comment Share on other sites More sharing options...
GunterO Posted March 16, 2015 Report Share Posted March 16, 2015 If you tell me how you connected the lcd to the discovery board (spi lines, cs, ...) I can have a look. I could find out from the source as well, but you better tell me to be sure and to verify I have here such a lcd and discovery board.Pm me for my e-mail so you can send the project. Link to comment Share on other sites More sharing options...
GunterO Posted March 17, 2015 Report Share Posted March 17, 2015 I received your sourcecode.The CMSIS library you are using is quite old, you better download the most recent version (can be found on TM's website).Concerning µGFX library. You better keep this library it's default structure. Copying files into your own directory is in my opinion not a good idea. Just point µVision in the right direction is preferred. Makes it easier to maintain and upgrade the library later on. I keep all the libraries I use strictly separated. All I use in the projects folder are configuration files like defines.h, gfxconf.h, ...Anyway, as far I can see, you are not using any µGFX commands/code in your main.c. What exactly are you trying to do?Is current code working (without µGFX)? Because all this code is based on TM's libraries.Which SPI are you using on the F4 discovery? SPI3? Please tell me which pins you have connected to your LCD and how. All of them please. Link to comment Share on other sites More sharing options...
ivan47 Posted March 17, 2015 Author Report Share Posted March 17, 2015 Project without uGFX works. I can draw, write etc. Pin definitions are located in defines.h.#define ILI9341_SPI SPI3 //OR something similar#define ILI9341_SPI_PINS TM_SPI_PinsPack_1/* Change custom CS, DC and RESET pins *//* CS pin */#define ILI9341_CS_CLK RCC_AHB1Periph_GPIOC#define ILI9341_CS_PORT GPIOC#define ILI9341_CS_PIN GPIO_Pin_2/* WRX or DC pin */#define ILI9341_WRX_CLK RCC_AHB1Periph_GPIOD#define ILI9341_WRX_PORT GPIOD#define ILI9341_WRX_PIN GPIO_Pin_13/* RST pin */#define ILI9341_RST_CLK RCC_AHB1Periph_GPIOD#define ILI9341_RST_PORT GPIOD#define ILI9341_RST_PIN GPIO_Pin_12Now I'm trying to include right headers file, and import right .c files in my project tree, to implement uGFX.So I had to include tm_stm32f4_ili9341.h in my board_ILI9341.h file (because if init function and some others), I also had to include gfx.h file (because GDisplay *g is used... not sure about that).There was also this problem with inline keyword in tm_stm32f4_ili9341.h and gdisp.c, so I replaced it with __inline.So, now I get this linker errors:.\Build Log\SPI_LCD.axf: Error: L6218E: Undefined symbol GDISPVMT_OnlyOne (referred from gdisp.o)..\Build Log\SPI_LCD.axf: Error: L6218E: Undefined symbol gdisp_lld_init (referred from gdisp.o)..\Build Log\SPI_LCD.axf: Error: L6218E: Undefined symbol gdisp_lld_write_color (referred from gdisp.o)..\Build Log\SPI_LCD.axf: Error: L6218E: Undefined symbol gdisp_lld_write_start (referred from gdisp.o)..\Build Log\SPI_LCD.axf: Error: L6218E: Undefined symbol gdisp_lld_write_stop (referred from gdisp.o)..\Build Log\SPI_LCD.axf: Error: L6218E: Undefined symbol gdriverGetInstance (referred from gdisp.o)..\Build Log\SPI_LCD.axf: Error: L6218E: Undefined symbol gdriverGetNext (referred from gdisp.o)..\Build Log\SPI_LCD.axf: Error: L6218E: Undefined symbol gdriverInstanceCount (referred from gdisp.o)..\Build Log\SPI_LCD.axf: Error: L6218E: Undefined symbol gdriverRegister (referred from gdisp.o)..\Build Log\SPI_LCD.axf: Error: L6218E: Undefined symbol _setjmp (referred from gos_raw32.o)..\Build Log\SPI_LCD.axf: Error: L6218E: Undefined symbol gfxMillisecondsToTicks (referred from gos_raw32.o)..\Build Log\SPI_LCD.axf: Error: L6218E: Undefined symbol gfxSystemTicks (referred from gos_raw32.o)..\Build Log\SPI_LCD.axf: Error: L6218E: Undefined symbol _gdriverDeinit (referred from gfx.o)..\Build Log\SPI_LCD.axf: Error: L6218E: Undefined symbol _gdriverInit (referred from gfx.o).The thing I want in the end is to be able to draw shapes, place text (and later use windows ets) using uGFX functions. Link to comment Share on other sites More sharing options...
GunterO Posted March 17, 2015 Report Share Posted March 17, 2015 I have it compiling except 1 error:.\Targets\STM32F4_Discovery\project.axf: Error: L6218E: Undefined symbol _setjmp (referred from gos_raw32.o).I need to figure out why _setjmp() isn't found, but I'm close :-) Link to comment Share on other sites More sharing options...
inmarket Posted March 17, 2015 Report Share Posted March 17, 2015 _setjmp is a compiler defined routine (although occasionally it is found in the c library). Specifically check the compiler options and if that doesn't help try including the standard c library.Also, _setjmp is generally the compiler specific version whereas setjmp (without the underscore) is the c library version which internally calls _setjmp.With the Kiel compiler however it may not define the underscore version. In that case change gos_raw32.c so that it uses the correct version for the Kiel compiler. If that happens please let us know so we can patch the master repository. Link to comment Share on other sites More sharing options...
GunterO Posted March 17, 2015 Report Share Posted March 17, 2015 Hi, thanks for your reply.Yes, I found a possible issue with it.More details here: http://forum.ugfx.org/viewtopic.php?f=23&t=183Maybe you can put a fix inside a #if defined(__KEIL__) ... #endif thing specific for µVision? Link to comment Share on other sites More sharing options...
inmarket Posted March 17, 2015 Report Share Posted March 17, 2015 Reply posted to that thread.Thanks for helping ivan47 Link to comment Share on other sites More sharing options...
ivan47 Posted March 18, 2015 Author Report Share Posted March 18, 2015 Thanks guys, I'll try that when I get my PC Link to comment Share on other sites More sharing options...
GunterO Posted March 18, 2015 Report Share Posted March 18, 2015 I have your project compiling here, but I still need to test it with the board/LCD, will do this evening.If you want, I can send you the project, or you wait until I did some testing. Link to comment Share on other sites More sharing options...
ivan47 Posted March 18, 2015 Author Report Share Posted March 18, 2015 Could you please do that, I can't get any work done concerning STM32 until tommorow.I'm planning on doing some kind of beginners guide to help people set up project with uGFXin Keil IDE. I'm hope this will "speed up" to someone new to this like me. Link to comment Share on other sites More sharing options...
GunterO Posted March 18, 2015 Report Share Posted March 18, 2015 Hi Ivan,I've send you the project via WeTransfer (you should have received an e-mail about this). It compiles (no worries about the µGFX warnings, I have the same with my working projects). However, there is something wrong with your board_ILI9341.h file. I don't think you can just add the stuff from tm_stm32f4_ili9341.h and hope it works.Maybe you can look at my board file from here http://forum.ugfx.org/viewtopic.php?f=23&t=175&start=20#p1364 and see if it gets you any further. That board file is based on the ChibiOS/RT HAL, but maybe it can help you.I might look into this further when I have some spare time.Good luck! Link to comment Share on other sites More sharing options...
ivan47 Posted March 18, 2015 Author Report Share Posted March 18, 2015 Thanks GunterO. Really appreciate it.I see that second parameter in your write_index function is uint8_t type, in my it is uint16_t (i thought it should be that way),also the same with write_data.I used TM_ILI9341_SendCommand function for write_index, and TM_ILI9341_SendData for write_data. I didn't implement functionsfor acquireing and releasing the bus. Link to comment Share on other sites More sharing options...
GunterO Posted March 18, 2015 Report Share Posted March 18, 2015 Yep, there was the problem with the board file indeed. Those functions are expecting a byte, not a word.Anyway, now it is working perfect with µGFX. Another project working in my examples folder And I must say, even a lot faster then on the STM32L152RE-Nucleo board, but that was expected because of the high clock of the STM32F4-Discovery board.Maybe you can try to use SPI1, because it can run @ 42MHz (BaudRatePrescaler_4), while the max frequency for SPI2 & SPI3 is 21MHz (BaudRatePrescaler_8).I wonder how much this ILI9341 can take Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted March 18, 2015 Report Share Posted March 18, 2015 Maybe you can try to use SPI1, because it can run @ 42MHz (BaudRatePrescaler_4), while the max frequency for SPI2 & SPI3 is 21MHz (BaudRatePrescaler_8).I wonder how much this ILI9341 can take The ILI9341 controller can't handle more than 20MHz when I recall correctly. However, you won't be able to archive this with your standard Arduino bread boarding & jumper wires anyway.~ Tectu Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now