Hello,
I'm doing a project in uV 4.7.0 using the Segger emWin Middlewear. Im trying to program the
screen on my Keil Eval board to rotate between 3 images and never stop. I took the Tamplate
from C:\Keil\ARM\Boards\Keil\MCBSTM32F400\emWin\Template and modified it.
My problem is that after the images has been shown 4 times each, the screen get stuck on one of
them. I think it has to do something with that I run out off memory. I tried using the
GUI_MEMDEV commands but I can't seam to get it working.
My code looks like:
Display All
I'm using the Segger emWin GUI builder to create the images:
WM_HWIN CreateNO(void);
WM_HWIN CreateWindow2(void);
WM_HWIN Createwin3(void);
I think I'm runing out of memory. But the GUI_MEMDEV_Delete() doesn't seam to free up memory as I thought. Does anybody have an idea of how to get this to work?
Best regards
Björn Skånberg
I'm doing a project in uV 4.7.0 using the Segger emWin Middlewear. Im trying to program the
screen on my Keil Eval board to rotate between 3 images and never stop. I took the Tamplate
from C:\Keil\ARM\Boards\Keil\MCBSTM32F400\emWin\Template and modified it.
My problem is that after the images has been shown 4 times each, the screen get stuck on one of
them. I think it has to do something with that I run out off memory. I tried using the
GUI_MEMDEV commands but I can't seam to get it working.
My code looks like:
C Source Code
- /*********************************************************************
- * SEGGER Microcontroller GmbH & Co. KG *
- * Solutions for real time microcontroller applications *
- **********************************************************************
- * *
- * (c) 1996 - 2012 SEGGER Microcontroller GmbH & Co. KG *
- * *
- * Internet: www.segger.com Support: support@segger.com *
- * *
- **********************************************************************
- ** emWin V5.16 - Graphical user interface for embedded applications **
- All Intellectual Property rights in the Software belongs to SEGGER.
- emWin is protected by international copyright laws. Knowledge of the
- source code may not be used to write a similar product. This file may
- only be used in accordance with the following terms:
- The software has been licensed to ARM LIMITED whose registered office
- is situated at 110 Fulbourn Road, Cambridge CB1 9NJ, England solely
- for the purposes of creating libraries for ARM7, ARM9, Cortex-M
- series, and Cortex-R4 processor-based devices, sublicensed and
- distributed as part of the MDK-ARM Professional under the terms and
- conditions of the End User License supplied with the MDK-ARM
- Professional.
- Full source code is available at: www.segger.com
- We appreciate your understanding and fairness.
- ----------------------------------------------------------------------
- File : main.c
- Purpose : Main program Template
- ---------------------------END-OF-HEADER------------------------------
- */
- #include <stm32f4xx.h>
- #include "gui.h"
- #include "Dialog.h"
- #include <stdio.h>
- extern WM_HWIN CreateNO(void);
- extern WM_HWIN CreateWindow2(void);
- extern WM_HWIN Createwin3(void);
- GUI_MEMDEV_Handle hMem1;
- GUI_MEMDEV_Handle hMem2;
- GUI_MEMDEV_Handle hMem3;
- /*********************************************************************
- *
- * MainTask
- */
- void MainTask(void) {
- GUI_Init();
- }
- void GUI_me(void){
- GUI_SelectLayer(hMem1);
- hMem1=GUI_MEMDEV_Create(0,0,240,320);
- GUI_MEMDEV_Select(hMem1);
- CreateWindow2();
- GUI_MEMDEV_CopyToLCD(hMem1);
- GUI_MEMDEV_Clear(hMem1);
- GUI_MEMDEV_Delete(hMem1);
- }
- void GUI_me2(void){
- GUI_SelectLayer(hMem2);
- hMem2=GUI_MEMDEV_Create(0,0,240,320);
- GUI_MEMDEV_Select(hMem2);
- CreateNO();
- GUI_MEMDEV_CopyToLCD(hMem2);
- GUI_MEMDEV_Clear(hMem2);
- GUI_MEMDEV_Delete(hMem2);
- }
- void GUI_me3(void){
- GUI_SelectLayer(hMem3);
- hMem3=GUI_MEMDEV_Create(0,0,240,320);
- GUI_MEMDEV_Select(hMem3);
- Createwin3();
- GUI_MEMDEV_CopyToLCD(hMem3);
- GUI_MEMDEV_Clear(hMem3);
- GUI_MEMDEV_Delete(hMem3);
- }
- /*********************************************************************
- *
- * Main
- */
- int main (void) {
- MainTask();
- while(1){
- GUI_me();
- GUI_Delay(1000);
- GUI_me2();
- GUI_Delay(1000);
- GUI_me3();
- GUI_Delay(1000);
- }
- /*************************** End of file ****************************/
I'm using the Segger emWin GUI builder to create the images:
WM_HWIN CreateNO(void);
WM_HWIN CreateWindow2(void);
WM_HWIN Createwin3(void);
I think I'm runing out of memory. But the GUI_MEMDEV_Delete() doesn't seam to free up memory as I thought. Does anybody have an idea of how to get this to work?
Best regards
Björn Skånberg