2025-04-14 11:05 PM
Hi,
I have a funny issue. I just wanted to add a Share button to my Main Screen in an STM32TouchGFX of a working Weather Station app but when I built and run the app in STMCubeIDE all the widgets which uses background images showed surprising garbage images.
Then I changed the Section and Extra Section to IntFlashSection in Default Image Configuration group of Config menu of STM TouchGFX:
Then I rebuilt and run the app and everything worked just fine:
Who understands this?
I Checked the HSPI configuration in STM32CubeMX but I could not find any wrong settings for octo-SPI, so the external flash memory which stores the images (by default) seems to be okay.
In addition any ST Demo which based of TGFX works with external flash settings.
What could go wrong?
Thanks,
Louis
Solved! Go to Solution.
2025-05-05 2:08 AM
Hello @Louie88 ,
Sorry for the delay.
For me it flashed fine in TouchGFX Designer both for internal and external flash.
I assumed that when you flashed in TouchGFX Designer it worked because you told me you had warnings (not errors) and I did not see a fail in the log but you don't show the flashing process in the log so I am not sure now if it flashed or not.
However, I saw that in STM32CubeIDE, you do not set the external loader on the debug.
To fix that, right click on your project in STM32CubeIDE, go to "Debug As" => "Debug Configurations" :
Then select your project followed by "debug", go to "Debugger", in the "External loader" section, click on "Add" and select your board:
Now you can try to flash on STM32CubeIDE.
Regards,
2025-04-15 1:13 AM
Hello @Louie88 ,
Can you repeat the issue consistently?
It look like TouchGFX correctly rebuilt but then only the internal section was flashed but not the external and since before you used the external section to store assets, then your project had the wrong address for the assets.
If you flashed through TouchGFX Designer, I would have guessed that you previously selected "Only flash internal memory" and then forgot to unselect that option, but since you flashed in STM32CubeIDE I guess STM32CubeIDE forgot/failed to flash the external.
But with only one try (and fail) it is hard to diagnose the issue.
If you can repeat the issue, please share the steps to reproduce it and maybe the project so I can try it myself.
Regards,
2025-04-15 3:27 AM
Hello Gaetan,
Thans for the very quick reply.
Yes, it is consistent. I tried at least 50 times.
I have never tried to flash it from TouchGFX Designer, but I checked it and the Program All was selected in the Program and Run Target dropdown list. So I set the Section to ExtFlashSection (both) and flashed it from TouchGFX Designer. During building the app I found warnings in the log
...
...
Generating generated/images/src/__generated/image_icon_theme_images_hardware_keyboard_arrow_right_75_75_FFFFFF.svg.cpp
Generating generated/images/src/__generated/image_icon_theme_images_hardware_keyboard_arrow_up_75_75_ABABAB.svg.cpp
Generating generated/images/src/__generated/image_icon_theme_images_hardware_keyboard_arrow_up_75_75_FFFFFF.svg.cpp
Generating generated/images/src/__generated/image_icon_theme_images_social_share_75_75_ABABAB.svg.cpp
Generating generated/images/src/__generated/image_icon_theme_images_social_share_75_75_FFFFFF.svg.cpp
WARNING - Char 0x7F is used but does not exist in the font!
WARNING - A total of 33 Unicode characters did not exist in the font!
WARNING - Char 0x7F is used but does not exist in the font!
WARNING - A total of 33 Unicode characters did not exist in the font!
WARNING - Char 0x7F is used but does not exist in the font!
WARNING - A total of 33 Unicode characters did not exist in the font!
WARNING - Char 0x7F is used but does not exist in the font!
WARNING - A total of 33 Unicode characters did not exist in the font!
WARNING - Char 0x7F is used but does not exist in the font!
WARNING - A total of 33 Unicode characters did not exist in the font!
Done
Post Generate
touchgfx update_project --project-file=simulator/msvs/Application.vcxproj
Done
Post Generate Target
touchgfx update_project
.cproject file: ../STM32CubeIDE/.cproject
Writing STM32CubeIDE project file: ../STM32CubeIDE/.project
Writing STM32CubeIDE project file: ../STM32CubeIDE/.cproject
Done
...
...
I have never seen these warnings before. I have Hungarian translations but the translations appear on the screen right with accent characters so I do not understand it, especially the DELETE (0x7F) character.
Anyway, the result is a surprise. The right images appeared in all widgets even the external flash was selected in Config.
That probably means that I have a bad, faulty settings in the STM32CubeIDE.
Thanks for your help!
Louis
PS: I tried to run the app in simulator (from TGFX) but I could not. I got "main.h" not found (!) errors...
...
...
Compile
make -f simulator/gcc/Makefile -j8
Reading ./application.config
Reading ./target.config
Compiling gui/src/setup_screen/SetupPresenter.cpp
Compiling gui/src/setup_screen/SetupView.cpp
Compiling gui/src/main_screen/MainPresenter.cpp
Compiling gui/src/main_screen/MainView.cpp
Compiling gui/src/model/Model.cpp
Compiling gui/src/common/FrontendApplication.cpp
Compiling generated/gui_generated/src/setup_screen/SetupViewBase.cpp
Compiling generated/gui_generated/src/main_screen/MainViewBase.cpp
In file included from gui/src/model/Model.cpp:1:0:
gui/include/gui/model/Model.hpp:3:10: fatal error: main.h: No such file or directory
#include "main.h"
^~~~~~~~
compilation terminated.
make[2]: *** [build/MINGW32_NT-6.2/gui/src/model/Model.o] Error 1
generated/simulator/gcc/Makefile:196: recipe for target 'build/MINGW32_NT-6.2/gui/src/model/Model.o' failed
make[2]: *** Waiting for unfinished jobs....
...
...
I added global definitions,enums to "main.h" so I need this file to be included in Model.cppp and all in my screen files. In addition STM32CubeIDE always compiles and builds the application with one warning only:
STM32U5G9J-DK2.elf has a LOAD segment with RWX permissions STM32U5G9J-DK2 C/C++ Problem
Can it be related with the main issue?
Anyways this warning is always shown even with STM examples, demoes.
2025-04-23 1:27 AM
Hello @Louie88 ,
You say that you never flashed with TouchGFX Designer before but you certainly used TouchGFX Designer to create your project (with a working TBS then) because I see that you are using one of our discovery board (STM32U5G9J-DK2).
Then you should have a working STM32CubeIDE environment.
Can you share your project so I can try to flash it myself?
The warning are regarding fonts so it should not affect the widgets with images I assume.
I am not sure what you did to add the main.h to your simulator project but yes it is not included by default so you have to add the file to the simulator Makefile. Here is a couple thread talking about that :
Regarding the warning "LOAD segment with RWX permissions" this is because a section has the permission to read, write and execute but usually it is not allowed to have both write and execute together because we don't want to write a part of the running program.
I have already tried to fix that issue (just change the permission in the linker script) but re-generating the code will change the permission back.
So you can just ignore it.
Regards,
2025-04-23 1:42 AM
Hi Gaetan,
Thanks for the answers. Interesting. Should I just Export the project as a ZIP file from STM32CubeIDE. I have never exported or sent any projects to other developers so I am not sure how I can do that.
Thanks,
Louis
2025-04-23 1:57 AM
When creating your project from TouchGFX Designer, a folder is created.
Zip that folder (containing, the .ioc, the TouchGFX foldler, the STM32CubeIDE foldler, etc) using 7zip this way I can check the configurations, test the TouchGFX Designer flashing, etc.
Regards,
2025-04-23 2:35 AM
Hi Gaetan,
Okay, I attached content of my TouchGFX.zip folder. It is a demonstration Weather Station app which utilizes Adafruit BM2280 environmental sensor chip (Temperature, pressure and humidity via SPI) It show the date/time and has a data logger which shows the last 400 BME280 samples on a X/Y Line chart.
Without the chip the app might be locked in BME280_Measure() (in BME280.c) function because SPI1 is not interrupt driven and it might wait for answer from a not connected chip. Comment that function call out from Model.cpp (handleBMW280()).
Thanks for your help. I am sure I did something wrong; I am not guru.
Best regards,
Louis
2025-04-24 4:11 AM
Hello @Louie88 ,
Can you send me the full project, not just the TouchGFX folder, but the project's folder that includes the TouchGFX folder, the .ioc, the STM32CubeIDE folder, etc?
Right now I am missing the .ioc so I have to create a new project and import your project as a GUI which doesn't import the files outside of the TouchGFX folder.
Regards,
2025-04-24 5:33 AM
Hi Gaetan,
This is why I asked you what to send. Sharing a project is not sharpest function of Eclipse based IDEs...
Anyways I zipped the whole project but I deleted the Debuig and Release folders from STM32CubeIDE folder. There is an STM32U5G9J-DK2.ioc file in the WeatherStation root folder. Also in Readme.md, you found all my "internal" notes, and how to wire BME280 sensor to the development board.
Best regards,
Louis
2025-05-04 9:53 AM
Hi Gaetan,
Any answer? You got the source code more than a week ago.
Thanks,
Louis