STM32F746 - Discovery emWin general setup

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • 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
    • Hi,

      You might try our eval package for this board:
      segger.com/downloads/eval/Segg…ry_CortexM_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:
      segger.com/downloads/embedded-studio/
      ST-Link Reflash Utility:
      segger.com/downloads/jlink/#STLink_Reflash

      Back to your questions.
      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 Source Code

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

      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.
      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 Source Code

      1. volatile GUI_TIMER_TIME TimeMS;
      2. GUI_TIMER_TIME GUI_X_GetTime(void) {
      3. return TimeMS;
      4. }
      5. void GUI_X_Delay(int ms) {
      6. int tEnd = TimeMS + ms;
      7. while ((tEnd - TimeMS) > 0);
      8. }
      9. static void _HWTimerCallback(void) {
      10. TimeMS++; // Increment
      11. }
      12. void GUI_X_Init(void) {
      13. //
      14. // Init HW Timer with 1ms period
      15. //
      16. _InitHWTimer();
      17. }
      Display All

      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
      Please read the forum rules before posting.

      Keep in mind, this is *not* a support forum.
      Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
      Should you be entitled to support you can contact us via our support system: segger.com/ticket/

      Or you can contact us via e-mail.
    • Hi,

      In stm32cubemx repository for stm32f7(STM32Cube_FW_F7_V1.11.0) series contains a demonstration project. In this project stemwin/config contains hardware configuration for emwin library to work in stm32f7 mcu. Also in stm32cubemx v4.25 STemWin middleware added so you can make necessary hardware adjustment in stm32cubemx gui.


      Note: to find stm32cubemx repository, create a project and then go into project->settings page, at the bottom default repository location can be found.

      The post was edited 1 time, last by dogan.ozdogan ().