Author Topic: Anyone has some experience with emWIN for STM32F4 Discovery boards?  (Read 8177 times)

0 Members and 1 Guest are viewing this topic.

Offline slow_riderTopic starter

  • Regular Contributor
  • *
  • Posts: 80
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: [Select]
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 error
compiling LCDConf_FlexColor_Template.c...
compiling LCDConf_Lin_Template.c...
..\GUI\LCDConf_Lin_Template.c(164): error:  #20: identifier "CUSTOM_LCD_CopyBuffer" is undefined
    LCD_SetDevFunc(0, LCD_DEVFUNC_COPYBUFFER, (void(*)(void))CUSTOM_LCD_CopyBuffer);
..\GUI\LCDConf_Lin_Template.c(165): error:  #20: identifier "CUSTOM_LCD_CopyRect" is undefined
    LCD_SetDevFunc(0, LCD_DEVFUNC_COPYRECT,   (void(*)(void))CUSTOM_LCD_CopyRect);
..\GUI\LCDConf_Lin_Template.c(166): error:  #20: identifier "CUSTOM_LCD_FillRect" is undefined
    LCD_SetDevFunc(0, LCD_DEVFUNC_FILLRECT, (void(*)(void))CUSTOM_LCD_FillRect);
..\GUI\LCDConf_Lin_Template.c(167): error:  #20: identifier "CUSTOM_LCD_DrawBitmap8bpp" is undefined
    LCD_SetDevFunc(0, LCD_DEVFUNC_DRAWBMP_8BPP, (void(*)(void))CUSTOM_LCD_DrawBitmap8bpp);
..\GUI\LCDConf_Lin_Template.c(168): error:  #20: identifier "CUSTOM_LCD_DrawBitmap16bpp" is undefined
    LCD_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 used
      LCD_X_SETVRAMADDR_INFO * p;
..\GUI\LCDConf_Lin_Template.c(220): warning:  #550-D: variable "p" was set but never used
      LCD_X_SETORG_INFO * p;
..\GUI\LCDConf_Lin_Template.c(229): warning:  #550-D: variable "p" was set but never used
      LCD_X_SHOWBUFFER_INFO * p;
..\GUI\LCDConf_Lin_Template.c(238): warning:  #550-D: variable "p" was set but never used
      LCD_X_SETLUTENTRY_INFO * p;
..\GUI\LCDConf_Lin_Template.c: 4 warnings, 5 errors
compiling 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 created

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

Offline Palmitoxico

  • Regular Contributor
  • *
  • Posts: 55
  • Country: br
  • no
Re: Anyone has some experience with emWIN for STM32F4 Discovery boards?
« Reply #1 on: July 08, 2015, 04:17:52 pm »
I've no experience with Keil or emWIN, but by reading the error log I suspect that you don't have the header files LCDConf.h and cmsis_os.h included in your project.
 

Offline jnz

  • Frequent Contributor
  • **
  • Posts: 593
Re: Anyone has some experience with emWIN for STM32F4 Discovery boards?
« Reply #2 on: July 08, 2015, 04:48:41 pm »
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.
 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 4078
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: Anyone has some experience with emWIN for STM32F4 Discovery boards?
« Reply #3 on: July 09, 2015, 06:26:00 am »
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.
 

Offline slow_riderTopic starter

  • Regular Contributor
  • *
  • Posts: 80
Re: Anyone has some experience with emWIN for STM32F4 Discovery boards?
« Reply #4 on: July 10, 2015, 10:41:21 pm »
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.
 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 4078
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: Anyone has some experience with emWIN for STM32F4 Discovery boards?
« Reply #5 on: July 11, 2015, 11:26:21 am »
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.
 

Offline andersm

  • Super Contributor
  • ***
  • Posts: 1198
  • Country: fi
Re: Anyone has some experience with emWIN for STM32F4 Discovery boards?
« Reply #6 on: July 11, 2015, 12:19:44 pm »
From AN4323:
Quote
If the used display controller is not supported, user can easily create his own driver just by adapting the GUIDRV_Template.c file located under Library\STemWinLibraryXYZ\Config.
I'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?

Offline slow_riderTopic starter

  • Regular Contributor
  • *
  • Posts: 80
Re: Anyone has some experience with emWIN for STM32F4 Discovery boards?
« Reply #7 on: July 11, 2015, 07:41:07 pm »
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.

 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 4078
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: Anyone has some experience with emWIN for STM32F4 Discovery boards?
« Reply #8 on: July 11, 2015, 09:04:35 pm »
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.
« Last Edit: July 11, 2015, 09:06:27 pm by Jeroen3 »
 

Offline slow_riderTopic starter

  • Regular Contributor
  • *
  • Posts: 80
Re: Anyone has some experience with emWIN for STM32F4 Discovery boards?
« Reply #9 on: July 12, 2015, 05:42:35 am »
When you say the emWin manual, you refer to the file by Segger? Thanks!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf