cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to compile STemWin Demo code for L4R9I-DISCO in TrueStudio and failing miserably.

Carl Farrington
Associate III
Posted on July 13, 2018 at 00:50

Hi. I am trying to compile the STemWin Demo code for L4R9I-DISCO in TrueStudio and failing miserably.

Firstly I did the import procedure which is supposed to make it easy to get all the Cube demo stuff into True Studio. Well, it's taken  about an hour of constantly attempting to compile, and then having to search for .h files and add in new include paths.

but now my problem seems to be a bigger one.

STM32Cube_FW_L4_V1.12.0\Projects\32L4R9IDISCOVERY\Demonstrations\STemWin\Modules\iddmeasure\iddmeasure.c appears to call the following 3 functions, which as far as I can tell do not exist in any files anywhere within the distribution:

SystemClock_Config()

Init_RTC()

TIMER_Init()

I have grepped the whole STM32Cube_FW_L4_V1.12.0 directory and I don't see these functions being declared anywhere.

Please can somebody shed some light?

Here's the actual error output:

arm-atollic-eabi-gcc -c ..\Gui\Core\power_measurement\generated\modes\low_power_sleep_mode\low_power_sleep_mode_text.c -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -std=gnu11 -ID:\STM32Cube_FW_L4_V1.12.0\Middlewares\ST\STemWin\inc -ID:\STM32Cube_FW_L4_V1.12.0\Projects\32L4R9IDISCOVERY\Demonstrations\STemWin\Gui\Target -ID:\STM32Cube_FW_L4_V1.12.0\Projects\32L4R9IDISCOVERY\Demonstrations\STemWin\Core\Inc -ID:\STM32Cube_FW_L4_V1.12.0\Drivers\STM32L4xx_HAL_Driver\Inc -ID:\STM32Cube_FW_L4_V1.12.0\Projects\32L4R9IDISCOVERY\Demonstrations\STemWin\Binary\Config -ID:\STM32Cube_FW_L4_V1.12.0\Drivers\CMSIS\Device\ST\STM32L4xx\Include -ID:\STM32Cube_FW_L4_V1.12.0\Middlewares\Third_Party\FatFs\src -ID:\STM32Cube_FW_L4_V1.12.0\Drivers\CMSIS\Include -ID:\STM32Cube_FW_L4_V1.12.0\Drivers\BSP\STM32L4R9I-Discovery -ID:\STM32Cube_FW_L4_V1.12.0\Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS -ID:\STM32Cube_FW_L4_V1.12.0\Middlewares\Third_Party\FreeRTOS\Source\include -ID:\STM32Cube_FW_L4_V1.12.0\Middlewares\ST\STM32_USB_Device_Library\Core\Inc -ID:\STM32Cube_FW_L4_V1.12.0\Middlewares\Third_Party\FreeRTOS\Source\portable\GCC\ARM_CM4F -ID:\STM32Cube_FW_L4_V1.12.0\Projects\32L4R9IDISCOVERY\Demonstrations\STemWin\Gui\Core\generated -ID:\STM32Cube_FW_L4_V1.12.0\Projects\32L4R9IDISCOVERY\Demonstrations\STemWin\Modules\iddmeasure -ID:\STM32Cube_FW_L4_V1.12.0\Projects\32L4R9IDISCOVERY\Demonstrations\STemWin\Modules\audioplayer -O0 -g -fstack-usage -Wall -specs=nano.specs -o Gui\Core\power_measurement\generated\modes\low_power_sleep_mode\low_power_sleep_mode_text.o

..\Modules\iddmeasure\iddmeasure.c: In function 'Idd_LprRestore':

..\Modules\iddmeasure\iddmeasure.c:603:3: warning: implicit declaration of function 'SystemClock_Config' [-Wimplicit-function-declaration]

SystemClock_Config();

^~~~~~~~~~~~~~~~~~

..\Modules\iddmeasure\iddmeasure.c: In function 'SystemHardwareInit':

..\Modules\iddmeasure\iddmeasure.c:1133:3: warning: implicit declaration of function 'Init_RTC' [-Wimplicit-function-declaration]

Init_RTC();

^~~~~~~~

..\Modules\iddmeasure\iddmeasure.c:1135:3: warning: implicit declaration of function 'TIMER_Init' [-Wimplicit-function-declaration]

arm-atollic-eabi-gcc -c ..\Gui\Core\generated\fonts\RobotoCnBold48.c -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -std=gnu11 -ID:\STM32Cube_FW_L4_V1.12.0\Middlewares\ST\STemWin\inc -ID:\STM32Cube_FW_L4_V1.12.0\Projects\32L4R9IDISCOVERY\Demonstrations\STemWin\Gui\Target -ID:\STM32Cube_FW_L4_V1.12.0\Projects\32L4R9IDISCOVERY\Demonstrations\STemWin\Core\Inc -ID:\STM32Cube_FW_L4_V1.12.0\Drivers\STM32L4xx_HAL_Driver\Inc -ID:\STM32Cube_FW_L4_V1.12.0\Projects\32L4R9IDISCOVERY\Demonstrations\STemWin\Binary\Config -ID:\STM32Cube_FW_L4_V1.12.0\Drivers\CMSIS\Device\ST\STM32L4xx\Include -ID:\STM32Cube_FW_L4_V1.12.0\Middlewares\Third_Party\FatFs\src -ID:\STM32Cube_FW_L4_V1.12.0\Drivers\CMSIS\Include -ID:\STM32Cube_FW_L4_V1.12.0\Drivers\BSP\STM32L4R9I-Discovery -ID:\STM32Cube_FW_L4_V1.12.0\Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS -ID:\STM32Cube_FW_L4_V1.12.0\Middlewares\Third_Party\FreeRTOS\Source\include -ID:\STM32Cube_FW_L4_V1.12.0\Middlewares\ST\STM32_USB_Device_Library\Core\Inc -ID:\STM32Cube_FW_L4_V1.12.0\Middlewares\Third_Party\FreeRTOS\Source\portable\GCC\ARM_CM4F -ID:\STM32Cube_FW_L4_V1.12.0\Projects\32L4R9IDISCOVERY\Demonstrations\STemWin\Gui\Core\generated -ID:\STM32Cube_FW_L4_V1.12.0\Projects\32L4R9IDISCOVERY\Demonstrations\STemWin\Modules\iddmeasure -ID:\STM32Cube_FW_L4_V1.12.0\Projects\32L4R9IDISCOVERY\Demonstrations\STemWin\Modules\audioplayer -O0 -g -fstack-usage -Wall -specs=nano.specs -o Gui\Core\generated\fonts\RobotoCnBold48.o

TIMER_Init(TimerInitMode_Full, &RTCHandle);

^~~~~~~~~~

..\Modules\iddmeasure\iddmeasure.c:1135:14: error: 'TimerInitMode_Full' undeclared (first use in this function)

TIMER_Init(TimerInitMode_Full, &RTCHandle);

^~~~~~~~~~~~~~~~~~

..\Modules\iddmeasure\iddmeasure.c:1135:14: note: each undeclared identifier is reported only once for each function it appears in

..\Modules\iddmeasure\iddmeasure.c:1135:35: error: 'RTCHandle' undeclared (first use in this function)

TIMER_Init(TimerInitMode_Full, &RTCHandle);

^~~~~~~~~

arm-atollic-eabi-gcc -c ..\Gui\Core\power_measurement\generated\buttons\button_run\animation\cercle1\animation_circle1_opacity90.c -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -std=gnu11 -ID:\STM32Cube_FW_L4_V1.12.0\Middlewares\ST\STemWin\inc -ID:\STM32Cube_FW_L4_V1.12.0\Projects\32L4R9IDISCOVERY\Demonstrations\STemWin\Gui\Target -ID:\STM32Cube_FW_L4_V1.12.0\Projects\32L4R9IDISCOVERY\Demonstrations\STemWin\Core\Inc -ID:\STM32Cube_FW_L4_V1.12.0\Drivers\STM32L4xx_HAL_Driver\Inc -ID:\STM32Cube_FW_L4_V1.12.0\Projects\32L4R9IDISCOVERY\Demonstrations\STemWin\Binary\Config -ID:\STM32Cube_FW_L4_V1.12.0\Drivers\CMSIS\Device\ST\STM32L4xx\Include -ID:\STM32Cube_FW_L4_V1.12.0\Middlewares\Third_Party\FatFs\src -ID:\STM32Cube_FW_L4_V1.12.0\Drivers\CMSIS\Include -ID:\STM32Cube_FW_L4_V1.12.0\Drivers\BSP\STM32L4R9I-Discovery -ID:\STM32Cube_FW_L4_V1.12.0\Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS -ID:\STM32Cube_FW_L4_V1.12.0\Middlewares\Third_Party\FreeRTOS\Source\include -ID:\STM32Cube_FW_L4_V1.12.0\Middlewares\ST\STM32_USB_Device_Library\Core\Inc -ID:\STM32Cube_FW_L4_V1.12.0\Middlewares\Third_Party\FreeRTOS\Source\portable\GCC\ARM_CM4F -ID:\STM32Cube_FW_L4_V1.12.0\Projects\32L4R9IDISCOVERY\Demonstrations\STemWin\Gui\Core\generated -ID:\STM32Cube_FW_L4_V1.12.0\Projects\32L4R9IDISCOVERY\Demonstrations\STemWin\Modules\iddmeasure -ID:\STM32Cube_FW_L4_V1.12.0\Projects\32L4R9IDISCOVERY\Demonstrations\STemWin\Modules\audioplayer -O0 -g -fstack-usage -Wall -specs=nano.specs -o Gui\Core\power_measurement\generated\buttons\button_run\animation\cercle1\animation_circle1_opacity90.o

Info: Parallel threads used: 8
12 REPLIES 12
Carl Farrington
Associate III
Posted on July 13, 2018 at 10:59

I seem to be getting different errors each time, and SystemClock_Config() is there in main.c. Maybe my wingrep tool sucks

:(

but each time I try to build debug I generally get a different failure. Is it because I need to Clean after each failure? If I do that, then I am now failing here:

..\Core\Src\k_mfx.c: In function 'MfxThread':

..\Core\Src\k_mfx.c:152:16: error: 'IddTest' undeclared (first use in this function)

if(IddTest[iddTestIndex].IddRestore != NULL){

^~~~~~~

..\Core\Src\k_mfx.c:152:16: note: each undeclared identifier is reported only once for each function it appears in

..\Core\Src\k_mfx.c:152:24: error: 'iddTestIndex' undeclared (first use in this function)

if(IddTest[iddTestIndex].IddRestore != NULL){

^~~~~~~~~~~~

..\Core\Src\k_mfx.c:155:15: warning: implicit declaration of function 'SystemHardwareInit' [-Wimplicit-function-declaration]

SystemHardwareInit(HWINIT_IDD);

^~~~~~~~~~~~~~~~~~

..\Core\Src\k_mfx.c:155:34: error: 'HWINIT_IDD' undeclared (first use in this function)

SystemHardwareInit(HWINIT_IDD);

^~~~~~~~~~
Carl Farrington
Associate III
Posted on July 14, 2018 at 15:00

I'd like to report back that I have had some success now!

It seems you have to be careful about which directories you allow TrueStudio to try to import/convert. The SW4STM32 projects seem to convert nicely. Also I think moving to a shorter pathname helped (it certainly was a problem for Keil), i.e. I moved the whole lot to D:\STM32Cube_FW_L4_V1.12.0

So I have successfully compiled two of the projects that use the DSI display - the one with a diver picture (DSI_CmdMode_SingleBuffer) and also the BSP example which is a nice big one.

Unfortunately the StemWin HelloWorld_BASIC compiles just fine but produces no output on the board.

I think I quite like this TrueStudio. It's quite confusing for total newbs though.

Johan Bergman
Associate II
Posted on July 16, 2018 at 00:12

I had the same black screen problem with the STemWin HelloWorld_BASIC example, using the STM32L4R9I, however I managed to fix it by capturing the return value of GUI_Init().

int foo = GUI_Init();
printf('%d', foo);�?�?�?�?�?�?

Does the compilersomehow optimize out the call to GUI_Init()? I have no idea. I'm still having issues with the drawing API though. Text renders just fine but GUI_Clear(),GUI_FillCircle() etc. produce weird results andhorizontallines across the display.

I'm also a complete beginner and man does it take time to get everything set up. I kinda wish every example shipped with a simple makefile so that I could just quickly run make, stick with VSCode and be done with it.

Let me know if you make some progress!

Posted on July 16, 2018 at 09:28

Ah, thanks Johan! I&39ll give this a go tonight.

I&39ve spent the weekend getting the BSP demo working on an alternate screen, and it&39s all working well ( 

https://community.st.com/0D50X00009XkW7ISAV

 )

I would like to move onto some StemWin stuff now. I&39ll try what you&39ve suggested tonight.

Johan Bergman
Associate II

Have you had any success with STemWin? I'm still stuck and can't get the demo to work properly.

Carl Farrington
Associate III

Hi Johan!

Well, I have had success with STemWin on a different board now - yes, after about a week of headscratching with the LTDC on a parallel RGB TFT panel. Just couldn't get it going. Thought it could have been the SDRAM framebuffer, or pixel clock.. I was really getting nowhere.

Then, I changed layer 0 Alpha from 0 to 255 in CubeMX. What a facepalm moment!

So then, I went ahead and used a framewin from the win32 gui builder, and it works a treat as well!

This is on a Chinese stm32f767 development board so I was sort of starting from scratch a bit with their pinouts and stuff. All their example code was for Keil.

Dilbert K
Senior

Hi Johan,

"I had the same black screen problem with the STemWin HelloWorld_BASIC example, using the STM32L4R9I, however I managed to fix it by capturing the return value of GUI_Init()."

What is required to fix this ?? Can you share ?

Carl Farrington
Associate III

Hi Dilbert.

What John, up there, had originally said (but it has been screwed up by the "FFS" fabulous forum software), was that he suspected the compiler was for some reason optimising out the GUI_Init, but by 'doing something' with the GUI_Init, i.e. capturing its return result, stuff worked.

I've attached the screenshot from above which is not very helpful at all due to FFS alterations,

but if you changed the GUI_Init(); to be:

int foo = GUI_Init();
printf('%d',foo);
 

That's what John said fixed it for him. I haven't tried that though. It seems a bit strange that the compiler would remove it.

In my own separate tests from scratch with CubeMX on an STM32F7 board, I found that the CubeMX default's were also giving me a black screen, but it was because I needed somewhere to change the Alpha level of the layer. I guess there's a function for doing this within your code normally (I'm not that far along yet), but instead I just changed layer 0 alpha from 0 to 255 in CubeMX, and hey presto, I got Hello World on my stm32f7 with that adafruit LCD panel running off the LTDC with external SDRAM framebuffer. I then tried a Framewin and I got exactly what I designed on the PC too.

So maybe look at that too..

Carl Farrington
Associate III

Sorry I forgot to attach, and FFS won't let me do it in the edit box...