cancel
Showing results for 
Search instead for 
Did you mean: 

stm32f746g-disco and emWin (Does not work create a window)

sergej
Associate II
Posted on April 22, 2016 at 12:44

I start with stm32f746g-disco

http://www2.st.com/content/st_com/en/products/evaluation-tools/product-evaluation-tools/mcu-eval-tools/stm32-mcu-eval-tools/stm32-mcu-discovery-kits/32f746gdiscovery.html

. For examples in STM32CubeF7

http://www2.st.com/content/st_com/en/products/evaluation-tools/product-evaluation-tools/mcu-eval-tools/stm32-mcu-eval-tools/stm32-mcu-discovery-kits/32f746gdiscovery.html

in particular STM32Cube_FW_F7_V1.3.0\Projects\STM32746G-Discovery\Applications\STemWin\ STemWin_HelloWorld. Compiles example in Keil uVision5 (without optimization) - it's OK, HelloWorld displays. Create a button:

hButton = BUTTON_Create(0, 0, 100, 50, GUI_ID_OK, WM_CF_SHOW);
BUTTON_SetText(hButton, ''Test'');
GUI_Exec();

It's okay. 0690X00000603ImQAI.jpg In GUIBuilder.exe do simple box (box + text), call the function CreateWindow - that does not work. Distorted window background and distorted text labels. The reason I can not find. 0690X00000603P3QAI.jpg If you have a board stm32f746g-disco it can flash Hex file can be a problem with the card. Thank you. Source: Changed only BASIC_HelloWorld.c

#include ''GUI.h''
#include ''DIALOG.h''
WM_HWIN CreateWindow(void);
/*********************************************************************
*
* Public code
*
**********************************************************************
*/
/*********************************************************************
*
* MainTask
*/
void MainTask(void)
{
static BUTTON_Handle hButton;
static WM_HWIN hWin;
/*
// All ok
hButton = BUTTON_Create(0, 0, 100, 50, GUI_ID_OK, WM_CF_SHOW);
BUTTON_SetText(hButton, ''Test'');
*/
/**/
// Don't work
CreateWindow();
/**/
GUI_Exec();
while (1);
}
/*************************** End of file ****************************/

Added only WindowDLG.c

// USER START (Optionally insert additional includes)
// USER END
#include ''DIALOG.h''
/*********************************************************************
*
* Defines
*
**********************************************************************
*/
#define ID_WINDOW_0 (GUI_ID_USER + 0x00)
#define ID_TEXT_0 (GUI_ID_USER + 0x01)
// USER START (Optionally insert additional defines)
// USER END
/*********************************************************************
*
* Static data
*
**********************************************************************
*/
// USER START (Optionally insert additional static data)
// USER END
/*********************************************************************
*
* _aDialogCreate
*/
static const GUI_WIDGET_CREATE_INFO _aDialogCreate[] = {
{ WINDOW_CreateIndirect, ''Window'', ID_WINDOW_0, 0, 0, 480, 272, 0, 0x0, 0 },
{ TEXT_CreateIndirect, ''Text'', ID_TEXT_0, 100, 100, 80, 20, 0, 0x64, 0 },
// 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) {
WM_HWIN hItem;
// USER START (Optionally insert additional variables)
// USER END
switch (pMsg->MsgId) {
case WM_INIT_DIALOG:
//
// Initialization of 'Window'
//
hItem = pMsg->hWin;
WINDOW_SetBkColor(hItem, 0x00FF0000);
//
// Initialization of 'Text'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_0);
TEXT_SetText(hItem, ''Test'');
TEXT_SetTextColor(hItem, 0x00FFFFFF);
TEXT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
TEXT_SetFont(hItem, GUI_FONT_13_1);
// USER START (Optionally insert additional code for further widget initialization)
// USER END
break;
// USER START (Optionally insert additional message handling)
// USER END
default:
WM_DefaultProc(pMsg);
break;
}
}
/*********************************************************************
*
* Public code
*
**********************************************************************
*/
/*********************************************************************
*
* CreateWindow
*/
WM_HWIN CreateWindow(void);
WM_HWIN CreateWindow(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 ****************************/

The files from:

https://www.dropbox.com/s/7di6rs13ucjlfks/Inc.rar?dl=0

,

https://www.dropbox.com/s/kx4cdmukq3zubiv/Src.rar?dl=0

and

https://www.dropbox.com/s/f42dz0gquxg96vh/MDK-ARM.rar?dl=0

. Hex file:

https://www.dropbox.com/s/4vtpvuvzoqmslpf/STM32746G_DISCOVERY_Button.rar?dl=0

- all ok

https://www.dropbox.com/s/ycsg242jm4nsy9h/STM32746G_DISCOVERY_Window.rar?dl=0

- don't work
3 REPLIES 3
Posted on May 08, 2016 at 11:20

My guess is that the configuration of the STemWin library implemented in the Hello World example simply does not include the functionality you are looking for.  This is a problem starting with one of the example programs, and not having a configurable baseline using CubeMX and the libraries themselves.  It would be helpful if ST provided information of how they got to the examples they show, rather than just the final product which is more a demo than an example of how to use their products.

To print Hello World on the display, all that is needed if the STemWin libraries is a few basic library calls with the display set up as a single window taking up the entire display.  It is likely that this is set up in a way that does not support creation of multiple windows to display on the LCD.  And without more information about what is implemented it is a long road to recreate the demo in a way that would be useful for what you want to do.

olivertwo
Associate
Posted on June 19, 2016 at 14:07

I have the same question, found a solution?

Thanks

Mauro

Posted on June 30, 2017 at 11:16

This sucks, cross posting without marking the thread as solved, just fire and forget.

Solution see:

http://mail.free-ide.com/index.php?page=Thread&threadID=3118

Please try to disable the data cache by a call of SCB_DisableDCache() before GUI_Init().