4539|2

108

帖子

0

TA的资源

一粒金砂(中级)

楼主
 

STemwin移植-智能摄像头入侵者 [复制链接]

利用keil的Manage Run-Time Environment可以快速进行开发但是首先要破解keil才能使用软件自带STemWin!

破解软件如下https://bbs.eeworld.com.cn/forum.php?mod=attachment&aid=MjE3MzU4fGU5ZThlZmIzZjg3ZDQxZGRhZjc2NTUzMmNjMjkxY2FjfDE3MzIyMDA4ODU%3D&request=yes&_f=.zip,支持最新的5.16a的破解

配置如下:









然后修改GUIConf.c

  1. /*********************************************************************
  2. *                SEGGER Microcontroller GmbH & Co. KG                *
  3. *        Solutions for real time microcontroller applications        *
  4. **********************************************************************
  5. *                                                                    *
  6. *        (c) 1996 - 2015  SEGGER Microcontroller GmbH & Co. KG       *
  7. *                                                                    *
  8. *        Internet: www.segger.com    Support:  support@segger.com    *
  9. *                                                                    *
  10. **********************************************************************

  11. ** emWin V5.30 - Graphical user interface for embedded applications **
  12. All  Intellectual Property rights  in the Software belongs to  SEGGER.
  13. emWin is protected by  international copyright laws.  Knowledge of the
  14. source code may not be used to write a similar product.  This file may
  15. only be used in accordance with the following terms:

  16. The software has been licensed to  ARM LIMITED whose registered office
  17. is situated at  110 Fulbourn Road,  Cambridge CB1 9NJ,  England solely
  18. for  the  purposes  of  creating  libraries  for  ARM7, ARM9, Cortex-M
  19. series,  and   Cortex-R4   processor-based  devices,  sublicensed  and
  20. distributed as part of the  MDK-ARM  Professional  under the terms and
  21. conditions  of  the   End  User  License  supplied  with  the  MDK-ARM
  22. Professional.
  23. Full source code is available at: www.segger.com

  24. We appreciate your understanding and fairness.
  25. ----------------------------------------------------------------------
  26. Licensing information

  27. Licensor:                 SEGGER Software GmbH
  28. Licensed to:              ARM Ltd
  29. Licensed SEGGER software: emWin
  30. License number:           GUI-00181
  31. License model:            LES-SLA-20007, Agreement, effective since October 1st 2011
  32. Licensed product:         MDK-ARM Professional
  33. Licensed platform:        ARM7/9, Cortex-M/R4
  34. Licensed number of seats: -
  35. ----------------------------------------------------------------------
  36. File        : GUIConf.c
  37. Purpose     : Display controller initialization
  38. ---------------------------END-OF-HEADER------------------------------
  39. */

  40. #include "GUI.h"

  41. /*********************************************************************
  42. *
  43. *       Defines
  44. *
  45. **********************************************************************
  46. */
  47. //
  48. // Define the available number of bytes available for the GUI
  49. //
  50. #define GUI_NUMBYTES  0x200000

  51. /*********************************************************************
  52. *
  53. *       Public code
  54. *
  55. **********************************************************************
  56. */
  57. /*********************************************************************
  58. *
  59. *       GUI_X_Config
  60. *
  61. * Purpose:
  62. *   Called during the initialization process in order to set up the
  63. *   available memory for the GUI.
  64. */
  65. void GUI_X_Config(void) {
  66.   //
  67.   // 32 bit aligned memory area
  68.   //
  69.   static U32 aMemory[GUI_NUMBYTES / 4] __attribute__((at(0xC0200000)));
  70.   //
  71.   // Assign memory to emWin
  72.   //
  73.   GUI_ALLOC_AssignMemory(aMemory, GUI_NUMBYTES);
  74.   //
  75.   // Set default font
  76.   //
  77.   GUI_SetDefaultFont(GUI_FONT_6X8);
  78. }

  79. /*************************** End of file ****************************/
复制代码
修改RTX_Conf_CM.C

  1. /*----------------------------------------------------------------------------
  2. *      CMSIS-RTOS  -  RTX
  3. *----------------------------------------------------------------------------
  4. *      Name:    RTX_Conf_CM.C
  5. *      Purpose: Configuration of CMSIS RTX Kernel for Cortex-M
  6. *      Rev.:    V4.70.1
  7. *----------------------------------------------------------------------------
  8. *
  9. * Copyright (c) 1999-2009 KEIL, 2009-2015 ARM Germany GmbH
  10. * All rights reserved.
  11. * Redistribution and use in source and binary forms, with or without
  12. * modification, are permitted provided that the following conditions are met:
  13. *  - Redistributions of source code must retain the above copyright
  14. *    notice, this list of conditions and the following disclaimer.
  15. *  - Redistributions in binary form must reproduce the above copyright
  16. *    notice, this list of conditions and the following disclaimer in the
  17. *    documentation and/or other materials provided with the distribution.
  18. *  - Neither the name of ARM  nor the names of its contributors may be used
  19. *    to endorse or promote products derived from this software without
  20. *    specific prior written permission.
  21. *
  22. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  23. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  24. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  25. * ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
  26. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  27. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  28. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  29. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  30. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  31. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  32. * POSSIBILITY OF SUCH DAMAGE.
  33. *---------------------------------------------------------------------------*/

  34. #include "cmsis_os.h"


  35. /*----------------------------------------------------------------------------
  36. *      RTX User configuration part BEGIN
  37. *---------------------------------------------------------------------------*/

  38. //-------- <<< Use Configuration Wizard in Context Menu >>> -----------------
  39. //
  40. // <h>Thread Configuration
  41. // =======================
  42. //
  43. //   <o>Number of concurrent running user threads <1-250>
  44. //   <i> Defines max. number of user threads that will run at the same time.
  45. //   <i> Default: 6
  46. #ifndef OS_TASKCNT
  47. #define OS_TASKCNT     6
  48. #endif

  49. //   <o>Default Thread stack size [bytes] <64-4096:8><#/4>
  50. //   <i> Defines default stack size for threads with osThreadDef stacksz = 0
  51. //   <i> Default: 200
  52. #ifndef OS_STKSIZE
  53. #define OS_STKSIZE     256     // this stack size value is in words
  54. #endif

  55. //   <o>Main Thread stack size [bytes] <64-32768:8><#/4>
  56. //   <i> Defines stack size for main thread.
  57. //   <i> Default: 200
  58. #ifndef OS_MAINSTKSIZE
  59. #define OS_MAINSTKSIZE 1024    // this stack size value is in words
  60. #endif

  61. //   <o>Number of threads with user-provided stack size <0-250>
  62. //   <i> Defines the number of threads with user-provided stack size.
  63. //   <i> Default: 0
  64. #ifndef OS_PRIVCNT
  65. #define OS_PRIVCNT     0
  66. #endif

  67. //   <o>Total stack size [bytes] for threads with user-provided stack size <0-1048576:8><#/4>
  68. //   <i> Defines the combined stack size for threads with user-provided stack size.
  69. //   <i> Default: 0
  70. #ifndef OS_PRIVSTKSIZE
  71. #define OS_PRIVSTKSIZE 0       // this stack size value is in words
  72. #endif

  73. //   <q>Stack overflow checking
  74. //   <i> Enable stack overflow checks at thread switch.
  75. //   <i> Enabling this option increases slightly the execution time of a thread switch.
  76. #ifndef OS_STKCHECK
  77. #define OS_STKCHECK    1
  78. #endif

  79. //   <q>Stack usage watermark
  80. //   <i> Initialize thread stack with watermark pattern for analyzing stack usage (current/maximum) in System and Thread Viewer.
  81. //   <i> Enabling this option increases significantly the execution time of osThreadCreate.
  82. #ifndef OS_STKINIT
  83. #define OS_STKINIT      0
  84. #endif

  85. //   <o>Processor mode for thread execution
  86. //     <0=> Unprivileged mode
  87. //     <1=> Privileged mode
  88. //   <i> Default: Privileged mode
  89. #ifndef OS_RUNPRIV
  90. #define OS_RUNPRIV     1
  91. #endif

  92. // </h>

  93. // <h>RTX Kernel Timer Tick Configuration
  94. // ======================================
  95. //   <q> Use Cortex-M SysTick timer as RTX Kernel Timer
  96. //   <i> Cortex-M processors provide in most cases a SysTick timer that can be used as
  97. //   <i> as time-base for RTX.
  98. #ifndef OS_SYSTICK
  99. #define OS_SYSTICK     1
  100. #endif
  101. //
  102. //   <o>RTOS Kernel Timer input clock frequency [Hz] <1-1000000000>
  103. //   <i> Defines the input frequency of the RTOS Kernel Timer.  
  104. //   <i> When the Cortex-M SysTick timer is used, the input clock
  105. //   <i> is on most systems identical with the core clock.
  106. #ifndef OS_CLOCK
  107. #define OS_CLOCK       200000000
  108. #endif

  109. //   <o>RTX Timer tick interval value [us] <1-1000000>
  110. //   <i> The RTX Timer tick interval value is used to calculate timeout values.
  111. //   <i> When the Cortex-M SysTick timer is enabled, the value also configures the SysTick timer.
  112. //   <i> Default: 1000  (1ms)
  113. #ifndef OS_TICK
  114. #define OS_TICK        1000
  115. #endif

  116. // </h>

  117. // <h>System Configuration
  118. // =======================
  119. //
  120. // <e>Round-Robin Thread switching
  121. // ===============================
  122. //
  123. // <i> Enables Round-Robin Thread switching.
  124. #ifndef OS_ROBIN
  125. #define OS_ROBIN       1
  126. #endif

  127. //   <o>Round-Robin Timeout [ticks] <1-1000>
  128. //   <i> Defines how long a thread will execute before a thread switch.
  129. //   <i> Default: 5
  130. #ifndef OS_ROBINTOUT
  131. #define OS_ROBINTOUT   5
  132. #endif

  133. // </e>

  134. // <e>User Timers
  135. // ==============
  136. //   <i> Enables user Timers
  137. #ifndef OS_TIMERS
  138. #define OS_TIMERS      1
  139. #endif

  140. //   <o>Timer Thread Priority
  141. //                        <1=> Low
  142. //     <2=> Below Normal  <3=> Normal  <4=> Above Normal
  143. //                        <5=> High
  144. //                        <6=> Realtime (highest)
  145. //   <i> Defines priority for Timer Thread
  146. //   <i> Default: High
  147. #ifndef OS_TIMERPRIO
  148. #define OS_TIMERPRIO   5
  149. #endif

  150. //   <o>Timer Thread stack size [bytes] <64-4096:8><#/4>
  151. //   <i> Defines stack size for Timer thread.
  152. //   <i> Default: 200
  153. #ifndef OS_TIMERSTKSZ
  154. #define OS_TIMERSTKSZ  256    // this stack size value is in words
  155. #endif

  156. //   <o>Timer Callback Queue size <1-32>
  157. //   <i> Number of concurrent active timer callback functions.
  158. //   <i> Default: 4
  159. #ifndef OS_TIMERCBQS
  160. #define OS_TIMERCBQS   4
  161. #endif

  162. // </e>

  163. //   <o>ISR FIFO Queue size<4=>   4 entries  <8=>   8 entries
  164. //                         <12=> 12 entries  <16=> 16 entries
  165. //                         <24=> 24 entries  <32=> 32 entries
  166. //                         <48=> 48 entries  <64=> 64 entries
  167. //                         <96=> 96 entries
  168. //   <i> ISR functions store requests to this buffer,
  169. //   <i> when they are called from the interrupt handler.
  170. //   <i> Default: 16 entries
  171. #ifndef OS_FIFOSZ
  172. #define OS_FIFOSZ      16
  173. #endif

  174. // </h>

  175. //------------- <<< end of configuration section >>> -----------------------

  176. // Standard library system mutexes
  177. // ===============================
  178. //  Define max. number system mutexes that are used to protect
  179. //  the arm standard runtime library. For microlib they are not used.
  180. #ifndef OS_MUTEXCNT
  181. #define OS_MUTEXCNT    8
  182. #endif

  183. /*----------------------------------------------------------------------------
  184. *      RTX User configuration part END
  185. *---------------------------------------------------------------------------*/

  186. #define OS_TRV          ((uint32_t)(((double)OS_CLOCK*(double)OS_TICK)/1E6)-1)


  187. /*----------------------------------------------------------------------------
  188. *      Global Functions
  189. *---------------------------------------------------------------------------*/

  190. /*--------------------------- os_idle_demon ---------------------------------*/

  191. /// \brief The idle demon is running when no other thread is ready to run
  192. void os_idle_demon (void) {

  193.   for (;;) {
  194.     /* HERE: include optional user code to be executed when no thread runs.*/
  195.   }
  196. }

  197. #if (OS_SYSTICK == 0)   // Functions for alternative timer as RTX kernel timer

  198. /*--------------------------- os_tick_init ----------------------------------*/

  199. /// \brief Initializes an alternative hardware timer as RTX kernel timer
  200. /// \return                             IRQ number of the alternative hardware timer
  201. int os_tick_init (void) {
  202.   return (-1);  /* Return IRQ number of timer (0..239) */
  203. }

  204. /*--------------------------- os_tick_val -----------------------------------*/

  205. /// \brief Get alternative hardware timer's current value (0 .. OS_TRV)
  206. /// \return                             Current value of the alternative hardware timer
  207. uint32_t os_tick_val (void) {
  208.   return (0);
  209. }

  210. /*--------------------------- os_tick_ovf -----------------------------------*/

  211. /// \brief Get alternative hardware timer's  overflow flag
  212. /// \return                             Overflow flag\n
  213. ///                                     - 1 : overflow
  214. ///                                     - 0 : no overflow
  215. uint32_t os_tick_ovf (void) {
  216.   return (0);
  217. }

  218. /*--------------------------- os_tick_irqack --------------------------------*/

  219. /// \brief Acknowledge alternative hardware timer interrupt
  220. void os_tick_irqack (void) {
  221.   /* ... */
  222. }

  223. #endif   // (OS_SYSTICK == 0)

  224. /*--------------------------- os_error --------------------------------------*/

  225. /* OS Error Codes */
  226. #define OS_ERROR_STACK_OVF      1
  227. #define OS_ERROR_FIFO_OVF       2
  228. #define OS_ERROR_MBX_OVF        3
  229. #define OS_ERROR_TIMER_OVF      4

  230. extern osThreadId svcThreadGetId (void);

  231. /// \brief Called when a runtime error is detected
  232. /// \param[in]   error_code   actual error code that has been detected
  233. void os_error (uint32_t error_code) {

  234.   /* HERE: include optional code to be executed on runtime error. */
  235.   switch (error_code) {
  236.     case OS_ERROR_STACK_OVF:
  237.       /* Stack overflow detected for the currently running task. */
  238.       /* Thread can be identified by calling svcThreadGetId().   */
  239.       break;
  240.     case OS_ERROR_FIFO_OVF:
  241.       /* ISR FIFO Queue buffer overflow detected. */
  242.       break;
  243.     case OS_ERROR_MBX_OVF:
  244.       /* Mailbox overflow detected. */
  245.       break;
  246.     case OS_ERROR_TIMER_OVF:
  247.       /* User Timer Callback Queue overflow detected. */
  248.       break;
  249.   }
  250.   for (;;);
  251. }


  252. /*----------------------------------------------------------------------------
  253. *      RTX Configuration Functions
  254. *---------------------------------------------------------------------------*/

  255. #include "RTX_CM_lib.h"

  256. /*----------------------------------------------------------------------------
  257. * end of file
  258. *---------------------------------------------------------------------------*/
复制代码




此帖出自stm32/stm8论坛

最新回复

谢谢  详情 回复 发表于 2016-10-19 10:42
点赞 关注
 

回复
举报

5

帖子

0

TA的资源

一粒金砂(初级)

沙发
 
顶一个楼主,非常棒的教程
此帖出自stm32/stm8论坛
 
 

回复

16

帖子

0

TA的资源

一粒金砂(初级)

板凳
 
谢谢
此帖出自stm32/stm8论坛
 
 

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

随便看看
查找数据手册?

EEWorld Datasheet 技术支持

相关文章 更多>>
关闭
站长推荐上一条 1/10 下一条

 
EEWorld订阅号

 
EEWorld服务号

 
汽车开发圈

About Us 关于我们 客户服务 联系方式 器件索引 网站地图 最新更新 手机版

站点相关: 国产芯 安防电子 汽车电子 手机便携 工业控制 家用电子 医疗电子 测试测量 网络通信 物联网

北京市海淀区中关村大街18号B座15层1530室 电话:(010)82350740 邮编:100190

电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号 Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved
快速回复 返回顶部 返回列表