硬汉嵌入式论坛

 找回密码
 立即注册
查看: 23119|回复: 8
收起左侧

[μCGUI] First touch witch uCGUI  /  触摸女巫UCGUI

[复制链接]

1

主题

4

回帖

1

积分

新手上路

积分
1
发表于 2013-1-21 05:28:04 | 显示全部楼层 |阅读模式
Hi all!
This is my very first post on this forum. I bought the STM32-V2 board two yearsago and have done a lot of interesting things with it. Now I became interested in the colour LCD and touchcontroller. I have done some research on how to control the LCD and readout theX and Y coordinates of the touch controller. That was far easy using someexamples and application notes provided on the DVD  with the V2 board.
But  there is a lot more I want to do witch theLCD. I started to search for some GUI libs and found the STM GUI LIB describedin application note AN3128. The lib is free to use and can be downloaded fromthe stm site. I tried to make use of that lib and I found a lot of errors. Ifinally got it work partially and was not satisfied with it. The only nice thingwas the Embedded Resource Editor GUI provided with the lib. To sum up, I couldn’tmake use of it…
A week agoI found the uCGUI !!! That changed my point of view dramatically because of its functionality! Now my goal is to makeuse of it, learn how it works and write some application with it. But there alot of unknowns for me now… So I would like to tell you my actual  progress and ask for some help to getstarted.


My workingenvironment is Keil uVision 4.20 and ULINK 2 JTAG. I’m used to the Keil’s insideRTOS (sometimes called ARTX) and the TCPNet library. I used them a lot for nowbut not always. I also use the newest STM FWlib version 3.5.0.
The lastdays I was reading all topics on the armfly technical forum about uCGUI andexperimented with the provided examples/projects.
I downloaded and got working the F103 DEMO from http://www.armbbs.cn/forum.php?mod=viewthread&tid=377
But theuCGUI GIF demo showed mi an error .\Obj\output.axf: Error: L6218E: Undefinedsymbol exit (referred from jerror.o).  Ifound some ther example with a gif image on the forum that was working.
So I havesome working projects to experiment and learn on.


Now to myquestion and thoughts:
1.       1. What is the easiest way to importthe uCGUI to a Keil projet without using any RTOS? I’m attached my emptyproject with startup routines and some UART configuration. This is the templateI’m always starting a new project. Can it be done from here?
2.       2. Is it a god idea to use the Keil RTXinstead the uCOSII witch uCGUI?
3.       3. Is there any graphical editor foeuCGUI that can generate code files for my project (fo a simple UI without writingall the stuff by hand).
4.       4. What is the thing about VisualStudio and emWIN, is this only for simulation proposes or can it be used increating the UI?
5.       5. What is the difference between emWINand uCGUI, what is better to start with?
6.       6. Is it better to use and precompiled *.libfile or better the whole source files in Keil projects?


So that aregenerally all my firs problems with the uCGUI adventure. Basically I want to doonly a simple interface witch some buttons, sliders and labels maybe some iconsbut nothing more. It must support touch and eventually hardware buttons.
I’m very interestedin your help. Every tip that could help me to start working with uCGUI or emWINis very important to me.

At last Ido not understand your language, I’m using google translate to read this forum.

clean_template.rar

3.05 MB, 下载次数: 559

回复

使用道具 举报

1

主题

4

回帖

1

积分

新手上路

积分
1
 楼主| 发表于 2013-1-21 05:29:49 | 显示全部楼层
这是一个谷歌翻译上面的文字:
大家好!
这是我的第一篇文章在这个论坛。我两年前买了STM32-V2板,并做了很多有趣的事情。现在我感兴趣的彩色液晶显示屏和触摸屏控制器。我做了一些研究如何控制LCD和读出的X和Y坐标的触摸控制器。这是远很容易使用一些例子和应用笔记提供的DVD V2板。
但是,有很多我想要做的巫婆LCD。我开始寻找一些GUI库和应用笔记AN3128中描述的STM GUI LIB。的的lib是免费使用,可以从STM网站下载。我试图使用该库,我发现了一个很大的错误。我终于得到它的工作部分,并不满意。唯一的好东西是嵌入的资源编辑器GUI提供的lib。总结起来,我不能让使用它...
一个星期前,我发现的UCGUI!这显着地改变了我的观点,因为它的功能!现在我的目标是利用它,了解它是如何工作的,并写一些应用程序。但那里有很多未知数的我现在...所以,我想告诉你我的实际进展情况,并要求有一定的帮助以开始浏览网页。
我的工作环境是Keil uVision 4.20和ULINK 2 JTAG。我已经习惯了Keil公司的内部RTOS(有时也被称为ARTX)和TCPNet的库。我用了很多,但并不总是。我还使用了最新的的STM FWlib版本3.5.0。
最后的日子里,我阅读所有主题armfly技术论坛关于UCGUI提供的例子/项目和试验。
我下载并得到了工作的F103 DEMO http://www.armbbs.cn/forum.php?mod=viewthread&tid=377
但UCGUI GIF演示展示公里的错误。\\ OBJ \\ output.axf:错误:L6218E:未定义的符号的出口(简称从jerror.o)。,我发现了一些进一步的例子在论坛上,工作为GIF图像。
所以,我有一些工作项目,尝试和学习的。
现在我的问题和想法:
1。进口的UCGUI的Keil谟,而无需使用任何RTOS最简单的方法是什么?我附上我的空项目,启动程序和一些UART配置。这是我总是开始一个新的项目模板。从这里可以这样做吗?
2。它是一个神的想法,而不是使用Keil RTX的UCOSII巫UCGUI?
3。是否有任何图形编辑器敌人的UCGUI的,我的项目可以生成代码文件(FO一个简单的用户界面,而无需编写所有的东西的手)。
4。有关Visual Studio和EMWIN的东西是什么,这只是模拟建议或它可以用于创建UI呢?
5。 EMWIN和ucgui,什么是更好的开始之间的区别是什么?
6。这是更好地使用和预编译的*。lib文件或更好的完整的源代码文件在Keil项目吗?
所以,一般都是我的冷杉问题的UCGUI冒险的。基本上,我想要做的只是一个简单的界面巫一些按钮,滑块和标签也许一些图标,但没有更多。它必须支持触摸和最终的硬件按钮。
在您的帮助,我很感兴趣。每一个提示,可以帮我重新开始与UCGUI或EMWIN工作对我很重要。

最后,我不懂你的语言,我用谷歌翻译阅读本论坛。
回复

使用道具 举报

1万

主题

6万

回帖

10万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
107490
QQ
发表于 2013-1-21 09:08:18 | 显示全部楼层
Are you from Poland?   My English is very bad, but I will try to answer your question in English
To
question 1
IT is very easy to import uCGUI without using any RTOS  compared with using RTOS, Chinese New Year is coming,
so there is a lot of things to do, Somedays later, I will provide an examples for you, But now, I want to give you some tips
(1) without using RTOS,  config  for ucGUI,  you can find these funtion in your project

/*
********************************************************************
*
*       Global data
*
********************************************************************
*/
extern __IO int32_t g_iRunTime;    // this  variable is from   bsp_timer.c  file
                                                        // without using RTOS,  we just need to provide time tick
/*********************************************************************
*
*      Timing:
*                 GUI_X_GetTime()
*                 GUI_X_Delay(int)

  Some timing dependent routines require a GetTime
  and delay function. Default time unit (tick), normally is
  1 ms.
*/
int GUI_X_GetTime(void)
{

    return g_iRunTime;
}

void GUI_X_Delay(int ms)
{
    int tEnd = g_iRunTime + ms;
    while ((tEnd - g_iRunTime) > 0);
}

/*********************************************************************
*
*       GUI_X_Init()
*
* Note:
*     GUI_X_Init() is called from GUI_Init is a possibility to init
*     some hardware which needs to be up and running before the GUI.
*     If not required, leave this routine blank.
*/

void GUI_X_Init(void) {}


/*********************************************************************
*
*       GUI_X_ExecIdle
*
* Note:
*  Called if WM is in idle state
*/

void GUI_X_ExecIdle(void)
{
    GUI_X_Delay(1);
}

/*********************************************************************
*
*      Logging: OS dependent

Note:
  Logging is used in higher debug levels only. The typical target
  build does not use logging and does therefor not require any of
  the logging routines below. For a release build without logging
  the routines below may be eliminated to save some space.
  (If the linker is not function aware and eliminates unreferenced
  functions automatically)

*/

void GUI_X_Log     (const char *s) { GUI_USE_PARA(s); }
void GUI_X_Warn    (const char *s) { GUI_USE_PARA(s); }
void GUI_X_ErrorOut(const char *s) { GUI_USE_PARA(s); }

/*********************************************************************
*
*      Multitasking:
*
*                 GUI_X_InitOS()
*                 GUI_X_GetTaskId()
*                 GUI_X_Lock()
*                 GUI_X_Unlock()
*
* Note:
*   The following routines are required only if emWin is used in a
*   true multi task environment, which means you have more than one
*   thread using the emWin API.
*   In this case the
*                       #define GUI_OS 1
*  needs to be in GUIConf.h
*/

void GUI_X_InitOS(void)    {  }
void GUI_X_Unlock(void)    {  }
void GUI_X_Lock(void)      {  }
U32  GUI_X_GetTaskId(void) { return 1; }


/*********************************************************************
*
*      Event driving (optional with multitasking)
*
*                 GUI_X_WaitEvent()
*                 GUI_X_WaitEventTimed()
*                 GUI_X_SignalEvent()
*/

void GUI_X_WaitEvent(void)            {  }
void GUI_X_SignalEvent(void)          {  }
void GUI_X_WaitEventTimed(int Period) {  }

/*************************** End of file ****************************/

(2)using RTOS
#include "ucos_ii.h"
#include "GUI_Private.H"
#include "stdio.H"

/*
*********************************************************************************************************
*      When porting   OS_SEM_EN flag must be enabled
*********************************************************************************************************
*/
static  OS_EVENT  *DispSem;
static  OS_EVENT  *EventMbox;

static  OS_EVENT  *KeySem;
static  int        KeyPressed;
static  char       KeyIsInited;


/*
*********************************************************************************************************
*                                        TIMING FUNCTIONS
*
* Notes: Some timing dependent routines of uC/GUI require a GetTime and delay funtion.
*        Default time unit (tick), normally is 1 ms.
*********************************************************************************************************
*/

int GUI_X_GetTime(void)
{
   return ((int)OSTimeGet());
}

void GUI_X_Delay(int period)
{
  INT32U  ticks;
  ticks=(period*1000)/OS_TICKS_PER_SEC;
  OSTimeDly((INT16U)ticks);
}


/*
*********************************************************************************************************
*                                          GUI_X_ExecIdle()
*********************************************************************************************************
*/
void GUI_X_ExecIdle(void)
{
  //OS_X_Delay(1);
  OSTimeDly(50);
}


/*
*********************************************************************************************************
*                                    MULTITASKING INTERFACE FUNCTIONS
*
* Note(1): 1) The following routines are required only if uC/GUI is used in a true multi task environment,
*             which means you have more than one thread using the uC/GUI API.  In this case the #define
*             GUI_OS 1   needs to be in GUIConf.h
*********************************************************************************************************
*/

void GUI_X_InitOS (void)
{
   DispSem = OSSemCreate(1);         
  EventMbox = OSMboxCreate((void *)0);   
}


void GUI_X_Lock(void)
{
  INT8U err;
  OSSemPend(DispSem,0,&err);
}


void GUI_X_Unlock(void)
{
  OSSemPost(DispSem);
}


U32 GUI_X_GetTaskId(void)
{
  return ((U32)(OSTCBCur->OSTCBPrio));
}

/*
*********************************************************************************************************
*                                        GUI_X_WaitEvent()
*                                        GUI_X_SignalEvent()
*********************************************************************************************************
*/


void GUI_X_WaitEvent(void)
{
   INT8U err;
   (void)OSMboxPend(EventMbox,0,&err);
}


void GUI_X_SignalEvent(void)
{
  (void)OSMboxPost(EventMbox,(void *)1);
}

/*
*********************************************************************************************************
*                                      KEYBOARD INTERFACE FUNCTIONS
*
* Purpose: The keyboard routines are required only by some widgets.
*          If widgets are not used, they may be eliminated.
*
* Note(s): If uC/OS-II is used, characters typed into the log window will be placed    in the keyboard buffer.
*          This is a neat feature which allows you to operate your target system without having to use or
*          even to have a keyboard connected to it. (useful for demos !)
*********************************************************************************************************
*/

static void CheckInit(void)
{
  if(KeyIsInited==0)
    {
      KeyIsInited = 1;
      GUI_X_Init();
    }
}
void GUI_X_Init(void)
{
  KeySem = OSSemCreate(0);
}


int GUI_X_GetKey(void)
{
    int r;
    r = KeyPressed;
    CheckInit();
    KeyPressed = 0;
    return (r);
}


int GUI_X_WaitKey(void)
{
    int  r;
    INT8U  err;
    CheckInit();
    if(KeyPressed==0)
      {
        OSSemPend(KeySem,0,&err);
      }
    r= KeyPressed;
    KeyPressed = 0;
    return (r);
}


void GUI_X_StoreKey(int k)
{
    KeyPressed = k;
    OSSemPost(KeySem);
}

void GUI_X_Log(const char *s)
{
GUI_USE_PARA(s);
}

void GUI_X_Warn(const char *s)
{
GUI_USE_PARA(s);
}

void GUI_X_ErrorOut(const char *s)
{
GUI_USE_PARA(s);
}
回复

使用道具 举报

1万

主题

6万

回帖

10万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
107490
QQ
发表于 2013-1-21 09:12:36 | 显示全部楼层
To question 2
I think it is a good idea to use the Keil RTXinstead the uCOSII witch uCGUI, maybe some people do not think so
To question 3
this
graphical editor is designed by a software engineer from China,

uCGUIBulider4.0.zip (9.38 MB, 下载次数: 471)
To question 4
you can port the source code whitch is created by yourself from VS to Keil MDK, this avoids downloading your
source code repeat.

To question 5
emWIN an ucGUI are the same source code, but from different company, so you can start with emWin
or ucGUI.

emWin : http://www.segger.com/index.html
uc
GUI:  http://micrium.com/rtos/ucgui/overview/
To question 6
IT is better with the whole source files in Keil projects
回复

使用道具 举报

1

主题

4

回帖

1

积分

新手上路

积分
1
 楼主| 发表于 2013-1-21 20:38:33 | 显示全部楼层
Thank You eric for such a complete answer. It’s very nice that you answered so comprehensively.
Yes, I’m from Poland and to be more accurate from Poznan. Poland is -7 (earlier) hours from your time. Your English is on a high level so I can understand everything you are writing.

About question 1:
I must carefully analyze the code and fid all the routines. As far as I understand the main goal in the standalone version is jus to provide timer tick to uCGUI. So my idea is to set up the SysTikc timer to 1ms and in the interrupt routine increase a 32bit variable as my virtual time counter. This variable mus the be returned in the GUI_X_GetTume function. Is that right?
Also all the multitasking function should be leaved blank?

In RTOS scenario I should provide this functions:
- GUI_X_SignalEvent()
- GUI_X_WaitEventTimed()
- GUI_X_WaitEvent()
- GUI_X_InitOS(void)  
- GUI_X_Unlock(void)
- GUI_X_Lock(void)
- GUI_X_GetTaskId(void)

There are some things I’m worry about. In all examples uCGUI uses uCOS and the OS_EVENT, OSSemCreate, OSMboxCreate, OSSemPend, OSSemPost and so on are fo uCOS designed and not for Keil RTX. So I assume that I should rewrite this function to make use of  the Keil RTX OS functions. I’m not on my computer now so I can not experiment with it and have no idea how to do it for now but I will try in the evening maybe.
So I just hope that Keil RTX has all the necessary functions that uCGUI needs to work on multitasking environment.

About question 3:
Thank you very much for the uCGUI builder. I try to get used to the Chinese menus;-) There is a problem on my Windows 7 64bit machine witch this app but I will try to figure it out.

About question 4:
I don’t exactly understand what for can I use Visual Studio?

About question 5:
Is there any difference between emWIN and uCGUI? I mean differences in performance, API and so on.

About question 6:
Why are separate source files better than one lib file?


In the and I would like to ask you about some resources of uCOSII, I found only  a Chinese scanned book on the forum that I don’t understand;-)
回复

使用道具 举报

1

主题

4

回帖

1

积分

新手上路

积分
1
 楼主| 发表于 2013-1-22 08:26:41 | 显示全部楼层
Hi all!
I have tested uCGUI as a standalone package and it works. I have just removed all the uCOS stuff from the project and corrected some things. I have also added a SysTick 1ms to time uCGUI. It works just fine.
But that is no the gola of this project and I will try to make it work with Keil RXT.

There is also a thing about the GUI Builder. I have used for testing the emWin Builder which is very simple and do not provide a nice UI but the code works in uCGUI. I have added just a simple button and text label.
I would like to use the uCGUI builder but the Chinese version has some problems in my Polish Windows and I don’t know what it could be.  It does not generate any output and gives me a lot o error dialogues.
回复

使用道具 举报

1万

主题

6万

回帖

10万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
107490
QQ
发表于 2013-1-22 10:07:06 | 显示全部楼层
About question 1:
         Yes, you are right.
         In the installation directory of Keil MDK have the file you need.  Version 4.23 of  Keil MDK  has  emWin 5.12
         Version 4.54 of  Keil MDK  has  emWin 5.16
          1.jpg
        The file GUI_X_RTX.c is  the one you need.  I provide emWin5.16 for you , which file is in Keil MDK 4.54
       emWin5.16.rar (15.12 MB, 下载次数: 204)


       About question 3:
              I do not know whether it supports  Win 7 64bit ,  it  runs all right  on Windows XP.

       About question 4:
              you can  debug the project easily which you create on PC with VS,   but  if you debug it with Keil MDK
        you need download the code into MCU and see whether it is right.  you need repeat this progress until it
        is right.   This progress is inconvenient.
             So, if  the project run well on  PC with VS,  you can port it to Keil MDK.

      About question 5:
         uCGUI  is emWIN,  emWin is uCGUI,  they are the same, but they come from different company.
        uCGUI  comes from Micrium, Inc.    http://micrium.com/
        emWin comes from Segger, Inc      http://www.segger.com/index.html

       Why they the same?  I think  they have cooperative relationship


       About question 6:   
           if you use sseparate source files , this way is benefit for new learner .   

       UCOS-II or UCOS-III
        you can download document , user manual , books and souce code from here
        http://micrium.com/
回复

使用道具 举报

1

主题

4

回帖

1

积分

新手上路

积分
1
 楼主| 发表于 2013-1-23 05:17:40 | 显示全部楼层
Hi!
So I tried to make a simple project with Keil RTX and emWin you provided to me. I can complie the project but when I RUN IN ON MY V2 board it enters HardFaultException and I can not find what it is. Coul you take a look on it?
I have also tested uCGUI with Keil RTX, juz chabging the F103 demo what can be found on the forum and i works. So I do sometching wrong with emWIN.

My emWIN project attachet below:

Test_emWin_RTX.rar

17.62 MB, 下载次数: 300

回复

使用道具 举报

3

主题

68

回帖

77

积分

初级会员

积分
77
发表于 2014-3-10 14:09:54 | 显示全部楼层
[s:152]
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|Archiver|手机版|硬汉嵌入式论坛

GMT+8, 2024-6-4 09:27 , Processed in 0.195499 second(s), 28 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表