Anyone has some experience with emWIN for STM32F4 Discovery boards? - Page 1
Forum section: electronics / general

author: slow_rider
author_rank: Regular Contributor
timestamp: July 08, 2015, 02:04:59 pm
content: I have the Discovery board with the LCD on it and I would like to use the LCD to display a menu system, perhaps even using the touch screen. My problem is at a very basic step I'm afraid - I can't seem to be able to add the emWIN files to my current uVision4 project. The documentation from both ST and Segger is not suitable because one is outdated and the other simply refers to a different product.Right now I have created a library called "GUI" and dropped all the files from Cube 1.7 emWIN library in it. These are the files found in the following folders: Config, inc, Lib & OS. The one exception to this is the lib folder, from which I only copied "STemWin526_CM4_Keil.lib".After compiling I get these errors:Code:compiling GUIConf.c...compiling GUIDRV_Template.c.....\GUI\LCD_Private.h(57): error: #5: cannot open source input file "LCDConf.h": No such file or directory#include "LCDConf.h"..\GUI\GUIDRV_Template.c: 0 warnings, 1 errorcompiling LCDConf_FlexColor_Template.c...compiling LCDConf_Lin_Template.c.....\GUI\LCDConf_Lin_Template.c(164): error: #20: identifier "CUSTOM_LCD_CopyBuffer" is undefinedLCD_SetDevFunc(0, LCD_DEVFUNC_COPYBUFFER, (void(*)(void))CUSTOM_LCD_CopyBuffer);..\GUI\LCDConf_Lin_Template.c(165): error: #20: identifier "CUSTOM_LCD_CopyRect" is undefinedLCD_SetDevFunc(0, LCD_DEVFUNC_COPYRECT, (void(*)(void))CUSTOM_LCD_CopyRect);..\GUI\LCDConf_Lin_Template.c(166): error: #20: identifier "CUSTOM_LCD_FillRect" is undefinedLCD_SetDevFunc(0, LCD_DEVFUNC_FILLRECT, (void(*)(void))CUSTOM_LCD_FillRect);..\GUI\LCDConf_Lin_Template.c(167): error: #20: identifier "CUSTOM_LCD_DrawBitmap8bpp" is undefinedLCD_SetDevFunc(0, LCD_DEVFUNC_DRAWBMP_8BPP, (void(*)(void))CUSTOM_LCD_DrawBitmap8bpp);..\GUI\LCDConf_Lin_Template.c(168): error: #20: identifier "CUSTOM_LCD_DrawBitmap16bpp" is undefinedLCD_SetDevFunc(0, LCD_DEVFUNC_DRAWBMP_16BPP, (void(*)(void))CUSTOM_LCD_DrawBitmap16bpp);..\GUI\LCDConf_Lin_Template.c(211): warning: #550-D: variable "p" was set but never usedLCD_X_SETVRAMADDR_INFO * p;..\GUI\LCDConf_Lin_Template.c(220): warning: #550-D: variable "p" was set but never usedLCD_X_SETORG_INFO * p;..\GUI\LCDConf_Lin_Template.c(229): warning: #550-D: variable "p" was set but never usedLCD_X_SHOWBUFFER_INFO * p;..\GUI\LCDConf_Lin_Template.c(238): warning: #550-D: variable "p" was set but never usedLCD_X_SETLUTENTRY_INFO * p;..\GUI\LCDConf_Lin_Template.c: 4 warnings, 5 errorscompiling SIMConf.c...compiling GUI_X.c...compiling GUI_X_OS.c.....\GUI\GUI_X_OS.c(59): error: #5: cannot open source input file "cmsis_os.h": No such file or directory#include "cmsis_os.h"..\GUI\GUI_X_OS.c: 0 warnings, 1 error"Tracer Configuration\Tracer Configuration.axf" - 7 Error(s), 9 Warning(s).Target not createdIf anyone knows how to move onward form this it will be highly appreciated! I know some errors seem silly, like the one notifying a file can not be found - it is not included with the library files.

author: Palmitoxico
author_rank: Regular Contributor
timestamp: July 08, 2015, 04:17:52 pm
content: I've no experience with Keil or emWIN, but by reading the error log I suspect that you don't have the header filesLCDConf.handcmsis_os.hincluded in your project.

author: jnz
author_rank: Frequent Contributor
timestamp: July 08, 2015, 04:48:41 pm
content: Yea, "No such file or directory" seems to be your problem pretty clearly.I have uv5, no experience with 4. But I can tell you had about ZERO luck trying to Cube to export files into Keil. It was MUCH better to just use the Runtime Environment to handle all that stuff. I quickly gave up on it. I'm not crazy about the new Hal, I mean, it's not actually all that different from the standard lib everyone seems to have little issue with but their Cube program needs some work.

author: Jeroen3
author_rank: Super Contributor
timestamp: July 09, 2015, 06:26:00 am
content: You have to "overload" several routines to add the lower hardware layer for your target.And you need to define the settings in LCDconf.h, otherwise the defaults are used or an error is thrown.You also need to add each folder containing header files to the keil project in the "include paths", it is not recursive.

author: slow_rider
author_rank: Regular Contributor
timestamp: July 10, 2015, 10:41:21 pm
content: Thanks for the answers, I wish it was so simple! I have added all the files to the project and made sure sub-folder are included as well. The errors regarding CUSTOM_LCD_CopyBuffer puzzle me. I did a search in the entire project files and could not find another reference for these.

author: Jeroen3
author_rank: Super Contributor
timestamp: July 11, 2015, 11:26:21 am
content: Use notepad++ to do a directory search.That funcion looks like it is to overload memcpy with your own memory copy routine.Either disable it in the conf or create it.

author: andersm
author_rank: Super Contributor
timestamp: July 11, 2015, 12:19:44 pm
content: From AN4323:QuoteI'm guessing the various _Template.c files are meant to be used when adding support for new hardware. Did you open the files and see if there's any explaining comments or similar in them?

author: slow_rider
author_rank: Regular Contributor
timestamp: July 11, 2015, 07:41:07 pm
content: As far as I've noticed the commenting towards user modification of the files is minimal to non existing. There is one file that has a bunch of functions with empty bodies to be filled by the user, thing is that is the example program I can not see these files being used.I did the folder search exactly that was (with NP++) and it found that expression in that single file only. I am not sure if I am missing something here or not. Anyway ST should really do something about updating their app notes and other supporting documents. I can't remember the last time I've spent so much time on something like this.

author: Jeroen3
author_rank: Super Contributor
timestamp: July 11, 2015, 09:04:35 pm
content: Everything becomes clear if you'd just read emWin's manual, from the start.They have seveval chapters describing the project, and which files to include.The STemwin version is precompiled, so you only have to include the header files, the conf file (with the compiled library settings) and you have to provide the low level api required to access the actual display through GPIO, SPI, UART.... And you have to assign some memory.Refer to one of the many example board project to see their software structure.You cannot blindly include everything, same goes for cmsis, because it contains template files. Those cannot be compiled, because they are not finished.

author: slow_rider
author_rank: Regular Contributor
timestamp: July 12, 2015, 05:42:35 am
content: When you say the emWin manual, you refer to the file by Segger? Thanks!