Tuesday, May 22nd 2018, 3:40pm UTC+2

You are not logged in.

  • Login
  • Register

gvi70000

Beginner

Date of registration: May 15th 2017

Posts: 11

1

Friday, April 27th 2018, 12:15pm

STM32F746 - Discovery emWin general setup

Hello Segger team,

I know that "this is not the correct place to ask" for STM board support, but since ST provides very limited support for home users (with limited knowledge of advance setup, memory map) it will kindly ask your support on the following:

1. How to setup and the files to be changed in order to store the static data (images) in the QSPI memory, how to use/setup the SDRAM
2. How to setup LCDConf, GUIConf, flash icf and any other file in order to have the best emWin performance on this board
3. How to setup emWin to work without OS
4. How to use the GUI with peripherals present on the board

Example files or even better, a starter template, will help many of us. I know that on the forum examples are provided, but they are scatter and hard to follow.

Thank you,
Ion

SEGGER - Schoenen

Super Moderator

Date of registration: Aug 13th 2015

Posts: 584

2

Friday, April 27th 2018, 2:37pm

Hi,

You might try our eval package for this board:
https://www.segger.com/downloads/eval/Se…_EmbeddedStudio

It includes all of our middleware components and you don't have to bother about configuring emWin.

You need our IDE (which has no limitation), and you have to upgrade the ST-Link to a J-Link OB.
You can download the required software here under the links below.

Embedded Studio:
https://www.segger.com/downloads/embedded-studio/
ST-Link Reflash Utility:
https://www.segger.com/downloads/jlink/#STLink_Reflash

Back to your questions.

Quoted

1. How to setup and the files to be changed in order to store the static
data (images) in the QSPI memory, how to use/setup the SDRAM
Unfortunately, I don't have any experience with the QSPI flash. I always used the onboard flash.

To use the SDRAM you need to have a piece of code which gets called on startup and intitializesSDRAM. In the linker file you have to define a region which covers the SDRAM (e.g. from 0xC0000000 to 0xC0800000) and define a section to be placed into the region.

In your code you have to "mark" variables which should be placed into a section. For example, place aMemory into section GUI_RAM:

C/C++ Source code

1
static __no_init U32 aMemory[GUI_NUMBYTES / 4] @ "GUI_RAM";

Quoted

2. How to setup LCDConf, GUIConf, flash icf and any other file in order to have the best emWin performance on this board
Almost the same as mentioned above with aMemory.

In the LCDConf.c simply place an array with the size of the framebuffer (xSize * ySize * BytesPerPixel * NumBuffers) into the SDRAM and use the address of the array (which should point to into the framebuffer) and pass it forward to emWin.

Quoted

3. How to setup emWin to work without OS
You have to implement 3 functions. One to initialize a timer with a 1ms period, one which returns a variable which gets incremented by the timer (each ms) and one which performs a delay for given amount of time.

A bit like this, _InitHWTimer() has to be implemented on your own and _HWTimerCallback() is just an example.

C/C++ Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
volatile GUI_TIMER_TIME TimeMS;

GUI_TIMER_TIME GUI_X_GetTime(void) { 
  return TimeMS; 
}

void GUI_X_Delay(int ms) { 
  int tEnd = TimeMS + ms;
  while ((tEnd - TimeMS) > 0);
}

static void _HWTimerCallback(void) {
  TimeMS++;  // Increment 
}

void GUI_X_Init(void) {
  //
  // Init HW Timer with 1ms period
  //
  _InitHWTimer();
}

Quoted

4. How to use the GUI with peripherals present on the board
Almost as without a GUI. Without an OS you have to take care that it might take some time before emWin returns from GUI_Exec() depending on the workload of emWin (redrawing a lot of windows, touch input..).

Easier it might be with an OS and create a tasks for the different peripherals.

Regards,
Sven

gvi70000

Beginner

Date of registration: May 15th 2017

Posts: 11

3

Friday, April 27th 2018, 3:00pm

Hello Sven,

Thank you very much for the quick reply, i will follow the steps provided and let you know the result.

Hats off for you and Segger supportt.

Best regards,
Ion

golf2109

Beginner

Date of registration: Nov 26th 2017

Posts: 7

4

Sunday, April 29th 2018, 11:25am

Last versions of CubeMX (4.25) is made graphics config for your board with STemWin