Posts by Haia_Boosa
-
-
Hello everyone
I have created a simple GUI by means of GUIBUILDER app. It consists a window and one button.
A matrix keyboard is used and the keys data are passing to Emwin by executing WM_StoreKeyMsg(KeyValue,1) and WM_StoreKeyMsg(KeyValue,0) in interrupt routine, when the keys are pressing and releasing.
The problem is that both WM_NOTIFICATION_CLICKED and WM_NOTIFICATION_RELEASED callback routines are fired when just pressing and holding the button (executing WM_StoreKeyMsg(KeyValue,1)).
Where is the problem?Best regards
Haia_Boosa -
-
Hello Sven, Thank you for replying.
According to your estimation 155 KB memory is needed for 320×240. My MCU has 192 KB of RAM, but it is splitted into two region(128 KB RAM and 64 KB CCMRAM) that aren't continues in the memory map:
CCMRAM ORIGIN: 0X10000000 LEBGTH = 64KB
RAM ORIGIN: 0X20000000 LENGTH = 128KBIs there anyway to use this kind of memory for Emwin?
-
Hello everyone
I created simple GUI with GUIBUILDER app (window with background color and two buttons).
Keyboard events is passed to emwin by GUI_StoreKeyMsg() function(inside the keyboard external interrupt routine) and all of program is in the super loop that execute every 30 mili second.
By pressing TAB Key buttons is respectively get focused but this cause screen to flicker.I use STM32F407 with internal RAM (120 KB of RAM is dedicated to emwin) and ili9341 LCD Controller.
Can anyone help me to find problem?
Thanks in advance
Haia_Boosa -
-
Thanks for quick replies.
-
Hi
Is there any way to draw a circular gradient like the attached image by emwin?Thanks All
Haia Boosa -
Thanks a lot Florian.
-
Hello
How Can I overwrite GUIBuilder window creation callback. I want to draw a window with gradient background color.I tried the following modification on GUIBuilder output, but i did not work.
(Compiler warning is included at the bottom of code)
C: Gradient window
Display More/********************************************************************* * * * SEGGER Microcontroller GmbH & Co. KG * * Solutions for real time microcontroller applications * * * ********************************************************************** * * * C-file generated by: * * * * GUI_Builder for emWin version 5.32 * * Compiled Oct 8 2015, 11:59:02 * * (c) 2015 Segger Microcontroller GmbH & Co. KG * * * ********************************************************************** * * * Internet: www.segger.com Support: support@segger.com * * * ********************************************************************** */ // USER START (Optionally insert additional includes) // USER END #include "DIALOG.h" /********************************************************************* * * Defines * ********************************************************************** */ #define ID_WINDOW_0 (GUI_ID_USER + 0x00) // USER START (Optionally insert additional defines) // USER END /********************************************************************* * * Static data * ********************************************************************** */ // USER START (Optionally insert additional static data) static void _cbWin0(WM_MESSAGE * pMsg) { GUI_RECT Rect; switch (pMsg->MsgId) { case WM_PAINT: WM_GetClientRect(&Rect); GUI_DrawGradientH(Rect.x0, Rect.y0, Rect.x1, Rect.y1, GUI_RED, GUI_BLUE); break; default: WM_DefaultProc(pMsg); break; } } // USER END /********************************************************************* * * _aDialogCreate */ static const GUI_WIDGET_CREATE_INFO _aDialogCreate[] = { { WINDOW_CreateIndirect, "Gradient", ID_WINDOW_0, 0, 0, 320, 240, 0, 0x0, _cbWin0 }, // USER START (Optionally insert additional widgets) // USER END }; /********************************************************************* * * Static code * ********************************************************************** */ // USER START (Optionally insert additional static code) // USER END /********************************************************************* * * _cbDialog */ static void _cbDialog(WM_MESSAGE * pMsg) { // USER START (Optionally insert additional variables) // USER END switch (pMsg->MsgId) { // USER START (Optionally insert additional message handling) // USER END default: WM_DefaultProc(pMsg); break; } } /********************************************************************* * * Public code * ********************************************************************** */ /********************************************************************* * * CreateGradient */ WM_HWIN CreateGradient(void); WM_HWIN CreateGradient(void) { WM_HWIN hWin; hWin = GUI_CreateDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), _cbDialog, WM_HBKWIN, 0, 0); return hWin; } // USER START (Optionally insert additional public code) // USER END /*************************** End of file ****************************/ //************************************************* Compiler output: ->Warinigs (1 Item) initialization makes integer from pointer without a cast [-Wint-conversion] ->Infos (1 Item) (near initialization for '_aDialogCreate[0].NumExtraBytes') **************************************************/
Thanks in advance
-
I did not call WM_DeleteWindow() twice on the same window. Based on user interaction a custom message box (framwin) is created and deleted by pressing OK button on the message box. It works well in first creation and deletion, but doing same action i.e, pressing OK button (deleting the window) will cause Hardfault.
Best Regards,
Haia Boosa
-
Hello everyone
What is the best way to delete a framwin widget or a window?
When I use Wm_DeleteWindow(), it works fine in the first call but it results Hardfault in the next calls.Thank you very much
-
Hi Sven
Thanks for replying
The configuration is as follows:C: LCDConf.c
Display More#include "GUI.h" #include "GUIDRV_FlexColor.h" #ifndef WIN32 #include "ILI9341.h" #endif #define XSIZE_PHYS 240 #define YSIZE_PHYS 320 // // Color conversion // #define COLOR_CONVERSION GUICC_565 // // Display driver // #define DISPLAY_DRIVER GUIDRV_FLEXCOLOR /********************************************************************* * * Configuration checking * ********************************************************************** */ #ifndef VXSIZE_PHYS #define VXSIZE_PHYS XSIZE_PHYS #endif #ifndef VYSIZE_PHYS #define VYSIZE_PHYS YSIZE_PHYS #endif #ifndef WIN32 static void LCD_X_8080_16_WriteM01_16(U16 * pData, int NumItems) { //RS_HIGH; while (NumItems--) { LCD->LCD_RAM = *pData; pData++; } } static void LCD_X_8080_16_ReadM01_16(U16 * pData, int NumItems) { while (NumItems--) { *pData = LCD->LCD_RAM; pData++; } } #endif #ifndef WIN32 static void _InitController(void) { TFT_Init(); } #endif void LCD_X_Config(void) { GUI_DEVICE * pDevice; CONFIG_FLEXCOLOR Config = {0}; GUI_PORT_API PortAPI = {0}; // // Set display driver and color conversion // pDevice = GUI_DEVICE_CreateAndLink(DISPLAY_DRIVER, COLOR_CONVERSION, 0, 0); // // Display driver configuration, required for Lin-driver // LCD_SetSizeEx (0, XSIZE_PHYS, YSIZE_PHYS); LCD_SetVSizeEx (0, VXSIZE_PHYS, VYSIZE_PHYS); // // Orientation // Config.Orientation = GUI_SWAP_XY | GUI_MIRROR_Y; GUIDRV_FlexColor_Config(pDevice, &Config); // // Set controller and operation mode // #ifndef WIN32 PortAPI.pfWrite16_A0 = LCD_WR_REG; PortAPI.pfWrite16_A1 = LCD_WR_DATA; PortAPI.pfWriteM16_A1 = LCD_X_8080_16_WriteM01_16; PortAPI.pfReadM16_A1 = LCD_X_8080_16_ReadM01_16; GUIDRV_FlexColor_SetFunc(pDevice, &PortAPI, GUIDRV_FLEXCOLOR_F66709, GUIDRV_FLEXCOLOR_M16C0B16); #endif }
Target is STM32F407 and LCD driver is ILI9341.
SRAM settings is verified by writing and reading back from 8,16 and 32 bit defined variable in the SRAM address range.Best regard.
-
Hello everyone
where can I find more detail about aMemory array ( the following code):Detail about how and where the screen pixels information located in the aMemory array.
I have some problem when I use external SRAM as GUI memroy in STM32F407. It's look like that the image within LCD has been shifting upward in the SRAM mode.
Thanks in advance
-
Hello everyone
I'm working on STemWin532 library on STM32F103ZET6 bord in STM32CudeIDE. I could successfully configured LCD interface (The Controller is HX8325B and GUI runs on internal RAM) and insert some text on the screen (image 1)But when i use external SRAM as GUI memory result is very strange and interesting :). The text is driven out of the screen. The picture 2 shows the situation.
While the code is the same code that works correctly in the internal RAM of MCU. The only command that i changed is the following variable definition for GUI memory allocation:
C: GUIConf.c#include "GUI.h" #define GUI_NUMBYTES 1024*50 U32 static aMemory[GUI_NUMBYTES/4]; // This is for internal RAM U32 static aMemory[GUI_NUMBYTES/4]__attribute__((section(".GUI_0x68000000"))); // This is for extenal SRAM void GUI_X_Config(void) { GUI_ALLOC_AssignMemory(aMemory, GUI_NUMBYTES); }
The section .GUI_0x68000000 is defined within linker command file as follows:C: Linker
Display More// other codes ............... /* Memories definition */ MEMORY { RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 64K FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 512K ExtSRAM (xrw) : ORIGIN = 0x68000000, LENGTH = 1024K } /* Sections */ SECTIONS { .GUI_0x68000000 : { } >ExtSRAM // other codes....... }
Build Analyzer output of CudeIDE shows the memory usage as image 3.
There is no hard fault in execution procedure and while(1) loop is executing as normal:. (image 4)
Any help will highly appreciated.
Best Regards
H.Boosa -
Hi everyone
I'm using STM32F103ZET to run STemWin532 GUI. In the first step i configured everything for running from internal RAM and program worked fine and GUI displayed components like progress bar and ...., but when i changed linker command file to map GUI memory to external SRAM GUI did not work. I checked connection with SRAM and it was OK. I checked 8,16,32 bit memory accessing integrity by following code:C: main.c
Display Moremain() { // initial codes uint8_t static Var8[1000]__attribute__((section(".GUI_RAM")));//.GUI_RAM section is uint16_t static Var16[1000]__attribute__((section(".GUI_RAM")));//located at external SRAM uint32_t static Var32[1000]__attribute__((section(".GUI_RAM"))); uint8_t Read8[1000]; uint16_t Read16[1000]; uint32_t Read32[1000]; for(ii=0;ii<1000;ii++) { Var8[ii]=ii; Var16[ii]=ii; Var32[ii]=ii; } for(ii=0;ii<1000;ii++) { Read8[ii] = Var8[ii]; Read16[ii] = Var16[ii]; Read32[ii] = Var32[ii]; } // other codes }
We can write to External SRAM and read it back successfully.
I attached the STM32CubeIDE Build Analyzer Tool output for memory usage.
In this case (External SRAM) program runs GUI_Init() function successfully and memory allocation and LCD initialization are done, (The LCD is turn to black after GUI_Init() Execution just like when i use the internal RAM as GUI memory) but nothing else happens. Program then execute the following codes in the while(1) loop and screen remains black.
C: main.c
Display MoreGUI_Init(); PROGBAR_Handle Progbar0; Progbar0 = PROGBAR_Create(20, 80, 360, 80, WM_CF_SHOW); PROGBAR_SetFont(Progbar0, &GUI_Font20B_ASCII); int val=0; while (1) { GUI_Delay(50); if(val++>100) val = 0; PROGBAR_SetValue(Progbar0, val); }
I placed break point inside the while(1) to making sure that program is running.(Second attached file)
Thanks
Haia.B