cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeIDE and TouchGFX 4.10.0: Resolving compilation issues

Martin KJELDSEN
Chief III

Hi everyone,

I've removed the previous, textual guide. Instead, here's a video guide on how to get CubeIDE and TouchGFX working on an STM32F746G-DISCO board. I accidentally exported the video in 720p but have created a 1080p version. Leaving both links here because the 720p version may have useful comments and resolutions:

1080p: https://youtu.be/VOs2LYO7wSA

720p: https://youtu.be/xZ0pPhQCQUY

And here's the project i created and modified:

https://community.st.com/s/question/0D50X0000At0N95SQE/cubeide-100-touchgfx-4100-working-project-inside-stm32f746gdisco

 (NOTE: This project does not have the modifications from our STM32F746G-DISCO/CubeMX article).

Best regards,

Martin

95 REPLIES 95

Well, difficult to say - What you're showing me here is the hardware configuration only.

How did you create this project? What's driving TouchGFX?

/Martin

Hi Martin,

The project trend is as follow:

STM32CubeMX (V5.4.0)

Board Select (STM32F469) (STM32Cube_FW_F4_V1.24.1) + default Discovery pin configuration

Set CubeMX to generate code for CubeIDE with seperate *.c and *.h file

Set Hardware Configuration and Execute TouchGFX (V4.12.3)

Draw some Box and add some Scaled Pictures

Return to CubeMX and regenerate program then open project in CubeIDE

Exclude Simulator files from build (I don't add "***_ts" files yet)

Some problem with MX_FREERTOS_Init and GRAPHICS_MainTask, I add a header to project with following code and include it in "Main.cpp", "freertos.cpp", and "BoardConfiguration.cpp"

#ifndef SharedHeader_H
#define SharedHeader_H
 
#ifdef __cplusplus
extern "C" {
#endif
 
extern void MX_FREERTOS_Init(void);
extern void GRAPHICS_MainTask(void);
 
#ifdef __cplusplus
}
#endif
 
#endif /* SharedHeader_H */

Finally I add two line in FLASH *.ld to address QSPI memory:

QSPI (rx)         : ORIGIN = 0x90000000, LENGTH = 16M //Added to Memories definition
ExtFlashSection : { *(ExtFlashSection) } >QSPI //Added afeter ARM attributes

Then I compile and download the program. All 4 LEDs are still on and screen is black.

This is my story...

Hope you can help me with this!

PS1: If I use TouchGFX board simulator from the very first step without using cubeMX, the design runs on board. But I need cubeMX to add other peripherals and manage then. As you know TouchGFX simulator does not provide *.ioc for cubeMX.

PS2: I suggest TouchGFX to make the *.ioc file and have an option to choose target IDE instead of generate all IDEs interface.

PS3: Thank you for your great work on beautiful GUI design software...

Hi Matrin,

I do some modification and run everything again. It turns out the black screen is due to the Box in black in my splash screen. I changed the color of the Box and the it works. BUT now I think I find the problem and need your help to solve it. The problem is QSPI memory. It seems when TouchGFX wants to load assets from external flash, it faced with hard fault.

In my splash screen there is a LOGO image which it must be faded in after 1-sec. Splash screen loaded and then stuck there. When I delete that LOGO application works fine. That's why I suspect the external flash.

The linker code if as follow

/*
*****************************************************************************
**
 
**  File        : LinkerScript.ld
**
**  Abstract    : Linker script for STM32F469NIHx Device with
**                2048KByte FLASH, 256KByte RAM
**
**                Set heap size, stack size and stack location according
**                to application requirements.
**
**                Set memory bank area and size if external memory is used.
**
**  Target      : STMicroelectronics STM32
**
**
**  Distribution: The file is distributed as is, without any warranty
**                of any kind.
**
**  (c)Copyright Ac6.
**  You may use this file as-is or modify it according to the needs of your
**  project. Distribution of this file (unmodified or modified) is not
**  permitted. Ac6 permit registered System Workbench for MCU users the
**  rights to distribute the assembled, compiled & linked contents of this
**  file as part of an application binary file, provided that it is built
**  using the System Workbench for MCU toolchain.
**
*****************************************************************************
*/
 
/* Entry Point */
ENTRY(Reset_Handler)
 
/* Highest address of the user mode stack */
_estack = 0x20030000;    /* end of RAM */
/* Generate a link error if heap and stack don't fit into RAM */
_Min_Heap_Size = 0x200;      /* required amount of heap  */
_Min_Stack_Size = 0x400; /* required amount of stack */
 
/* Specify the memory areas */
MEMORY
{
FLASH (rx)      : ORIGIN = 0x08000000, LENGTH = 2048K
RAM (xrw)      : ORIGIN = 0x20000000, LENGTH = 192K
CCMRAM (xrw)      : ORIGIN = 0x10000000, LENGTH = 64K
QSPI (rx)         : ORIGIN = 0x90000000, LENGTH = 16M
}
 
/* Define output sections */
SECTIONS
{
  /* The startup code goes first into FLASH */
  .isr_vector :
  {
    . = ALIGN(4);
    KEEP(*(.isr_vector)) /* Startup code */
    . = ALIGN(4);
  } >FLASH
 
  /* The program code and other data goes into FLASH */
  .text :
  {
    . = ALIGN(4);
    *(.text)           /* .text sections (code) */
    *(.text*)          /* .text* sections (code) */
    *(.glue_7)         /* glue arm to thumb code */
    *(.glue_7t)        /* glue thumb to arm code */
    *(.eh_frame)
 
    KEEP (*(.init))
    KEEP (*(.fini))
 
    . = ALIGN(4);
    _etext = .;        /* define a global symbols at end of code */
  } >FLASH
 
  /* Constant data goes into FLASH */
  .rodata :
  {
    . = ALIGN(4);
    *(.rodata)         /* .rodata sections (constants, strings, etc.) */
    *(.rodata*)        /* .rodata* sections (constants, strings, etc.) */
    . = ALIGN(4);
  } >FLASH
 
  .ARM.extab   : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
  .ARM : {
    __exidx_start = .;
    *(.ARM.exidx*)
    __exidx_end = .;
  } >FLASH
 
  .preinit_array     :
  {
    PROVIDE_HIDDEN (__preinit_array_start = .);
    KEEP (*(.preinit_array*))
    PROVIDE_HIDDEN (__preinit_array_end = .);
  } >FLASH
  .init_array :
  {
    PROVIDE_HIDDEN (__init_array_start = .);
    KEEP (*(SORT(.init_array.*)))
    KEEP (*(.init_array*))
    PROVIDE_HIDDEN (__init_array_end = .);
  } >FLASH
  .fini_array :
  {
    PROVIDE_HIDDEN (__fini_array_start = .);
    KEEP (*(SORT(.fini_array.*)))
    KEEP (*(.fini_array*))
    PROVIDE_HIDDEN (__fini_array_end = .);
  } >FLASH
 
  /* used by the startup to initialize data */
  _sidata = LOADADDR(.data);
 
  /* Initialized data sections goes into RAM, load LMA copy after code */
  .data : 
  {
    . = ALIGN(4);
    _sdata = .;        /* create a global symbol at data start */
    *(.data)           /* .data sections */
    *(.data*)          /* .data* sections */
 
    . = ALIGN(4);
    _edata = .;        /* define a global symbol at data end */
  } >RAM AT> FLASH
 
  _siccmram = LOADADDR(.ccmram);
 
  /* CCM-RAM section 
  * 
  * IMPORTANT NOTE! 
  * If initialized variables will be placed in this section,
  * the startup code needs to be modified to copy the init-values.  
  */
  .ccmram :
  {
    . = ALIGN(4);
    _sccmram = .;       /* create a global symbol at ccmram start */
    *(.ccmram)
    *(.ccmram*)
    
    . = ALIGN(4);
    _eccmram = .;       /* create a global symbol at ccmram end */
  } >CCMRAM AT> FLASH
 
  
  /* Uninitialized data section */
  . = ALIGN(4);
  .bss :
  {
    /* This is used by the startup in order to initialize the .bss secion */
    _sbss = .;         /* define a global symbol at bss start */
    __bss_start__ = _sbss;
    *(.bss)
    *(.bss*)
    *(COMMON)
 
    . = ALIGN(4);
    _ebss = .;         /* define a global symbol at bss end */
    __bss_end__ = _ebss;
  } >RAM
 
  /* User_heap_stack section, used to check that there is enough RAM left */
  ._user_heap_stack :
  {
    . = ALIGN(8);
    PROVIDE ( end = . );
    PROVIDE ( _end = . );
    . = . + _Min_Heap_Size;
    . = . + _Min_Stack_Size;
    . = ALIGN(8);
  } >RAM
 
  
 
  /* Remove information from the standard libraries */
  /DISCARD/ :
  {
    libc.a ( * )
    libm.a ( * )
    libgcc.a ( * )
  }
 
  .ARM.attributes 0 : { *(.ARM.attributes) }
  ExtFlashSection : { *(ExtFlashSection) } >QSPI
}
 
 

The linker commands are borrowed from original firmware.

I add some screenshots of my QSPI setting. It maybe worth to note that I enabled QUADSPI global interrupt.

0690X00000As0mSQAR.png

Hi again Martin,

I take one step more. I add External Loader to Debugger.

0690X00000As0oxQAB.png

Now it seems debugger do some modifications on external memory. After it finishes the downloading process my application runs very well. :)

The most awkward thing is when I reset the board it does not work again and it stuck at somewhere that screen shows salt-and-pepper noise. :\

Any suggestion?

Thanks for your time and efforts.

zul-a
Associate II

Thanks @scottSD​ . It works for me when I follow your instructions. @Martin KJELDSEN​ Please take note of these for next release fix?

Regards

Zain

FJB2069
Associate III

Martin,

I am trying to get an STM324291-eval board up and running through TouchGFX and CubeIDE. Coming up with similar build errors. Tried following your example above with Discovery Board, but not having much luck.

Would have thought this would have been fixed by now!

Can you provide my a solution for this eval board?