Monday, December 11th 2017, 1:07am UTC+1

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to SEGGER Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

silabs

Beginner

Date of registration: Apr 22nd 2016

Posts: 3

1

Friday, April 22nd 2016, 12:34pm

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

I start with stm32f746g-disco (32F746GDISCOVERY). For examples in STM32CubeF7 (STM32Cube_FW_F7_V1.3.0) 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:

Source code

1
2
3
hButton = BUTTON_Create(0, 0, 100, 50, GUI_ID_OK, WM_CF_SHOW);
BUTTON_SetText(hButton, "Test");
GUI_Exec();

It's okay.

(Img)

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.

(Img)

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

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#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

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
// 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: Inc, Src and MDK-ARM.

Hex file: STM32746G_DISCOVERY_Button.hex - all ok
STM32746G_DISCOVERY_Window.hex - don't work

SEGGER - Schoenen

Super Moderator

Date of registration: Aug 13th 2015

Posts: 438

2

Friday, April 22nd 2016, 5:02pm

Hi,

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

Regards,
Sven

silabs

Beginner

Date of registration: Apr 22nd 2016

Posts: 3

3

Monday, April 25th 2016, 6:40pm

Hello Sven,

Thank you.
Everything worked out.

Best Regards.