2016-04-22 03:44 AM
I start with stm32f746g-disco
. For examples in STM32CubeF7 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.
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.
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
andhttps://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 okhttps://www.dropbox.com/s/ycsg242jm4nsy9h/STM32746G_DISCOVERY_Window.rar?dl=0
- don't work2016-05-08 02:20 AM
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.2016-06-19 05:07 AM
I have the same question, found a solution?
ThanksMauro2017-06-30 04:16 AM
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().