Sysprogs forums › Forums › VisualGDB › Building STemWin_HelloWorld on STM32F7 Discovery board
Tagged: STM32F7 StemWin
- This topic has 12 replies, 6 voices, and was last updated 7 years, 9 months ago by tmkdoguscan.
-
AuthorPosts
-
November 13, 2015 at 13:09 #7215andyjtParticipant
Hi,
Being new to VisualGDB/STM32 and knowing the pain of sharp learning curves, I thought I’d share how I finally got the STM32F7 StemWin example working in VisualGDB:
(Hopefully I haven’t missed any steps out)Create a basic HAL led blink project…
I used newlib-nano, hardware floating point
Tick embedded frameworks in the VGDB project settings: STM32F7CubeHal, STM32746G-Discovery driversCopy and add files from the Cube StemWIN example…
\STM32\STM32Cube_FW_F7_V1.1.0\Projects\STM32746G-Discovery\Applications\STemWin\STemWin_HelloWorld
Copied the header files to my project dir and dragged them into the Header folder in VisualStudio – I overwrote the stm32f7xx_hal_conf.h so the correct HAL drivers were enabled
GUIConf.h LCDConf.h main.h stm32f7xx_hal_conf.h * This is where HAL drivers like SRAM are enable/disabled stm32f7xx_it.h * Interrupt handler method prototypes
Copied the source files to my project dir and added to VS
system_stm32f7xx.c * Didnt copy this as the VGDB one looked newer stm32f7xx_it.c GUIConf.c LCDConf.c main.c BASIC_HelloWorld.c * MEMDEV_WM_Ticker.c * MOVIE_ShowFeatures.c * copy these 3 files across but only add one to the project for now - remove and add whichever you want later
Add reference to the StemWin lib
In VGDB project makefile settings:
added the StemWin lib (STemWin528_CM7_GCC.a) by pointing to it in additional linker inputs
eg: C:\xxxx\STM32\STM32Cube_FW_F7_V1.1.0\Middlewares\ST\STemWin\Lib\STemWin528_CM7_GCC.a
Include the StemWin \inc folder for the library headers
eg: /xxxx/STM32/STM32Cube_FW_F7_V1.1.0/Middlewares/ST/STemWin/incAdd GUI_X.c to the project from
\xxxx\STM32\STM32Cube_FW_F7_V1.1.0\Middlewares\ST\STemWin\OSComment out the line CPU_CACHE_Enable(); In main.c
/* Enable the CPU Cache */ //CPU_CACHE_Enable();
I’m not sure why this needs doing but you’ll get a corrupted display if you don’t disable the CPU cache!
Hope I haven’t missed anything and someone finds it useful 🙂
November 13, 2015 at 20:52 #7218supportKeymasterHi,
Looks great, thanks for sharing this!
January 26, 2016 at 10:06 #7540r4d10nParticipantAndy.. great work ! It did help to figure out how to compile all those Demo projects…
I’ve added Touchscreen support routines as well. Working nice… https://github.com/r4d10n/STM32F746G-Discovery-Experiments
January 26, 2016 at 10:40 #7541andyjtParticipantI’m glad it was of help to someone and thanks for sharing your experiments 🙂
Since playing with the discovery, I moved onto a full blown STM32F7-EVAL board and possibly found the cause for having to disable the caches. For me it was related to reading the NOR flash ID, but could also explain the corrupted images in stemwin with the cache enabled.
You can try turn back on the I and D cache but configure the MPU (Memory Protection Unit) so that it doesn’t cache the (SDRAM?) memory area used for the screen framebuffer or maybe the memory containing the source images? That way the graphics should copy and display correctly but you’ll retain the advantage of faster code execution if the embedded memories are cached.
See this post on the ST forum: https://my.st.com/16aab033
- This reply was modified 8 years, 10 months ago by andyjt.
February 18, 2016 at 12:08 #7668igorfrancoParticipantHello Folks,
I changed my code according you defined, but when compile unfortunatelly I’m receiving :
Error 73 error : C:\ARMTC\STM32Cube_FW_F7_V1.3.0\Middlewares\ST\STemWin\Lib\STemWin528_CM7_GCC.a(WM_NotifyParent.o) uses VFP register arguments, Debug/BlinkLED.elf does not c:\sysgcc\arm-eabi\arm-eabi\bin\ld.exe 1 1 BlinkLED
Could you help me how to figure out this issue?
February 18, 2016 at 12:12 #7669andyjtParticipantTry turning on Hardware floating point support in your BlinkLED project.
February 18, 2016 at 12:58 #7670igorfrancoParticipantThanks… I missed “I used newlib-nano, hardware floating point”.
April 7, 2016 at 05:33 #7911Ken MacfarlaneParticipantUnder the Makefile settings, the default Linker Script path has spaces in it, so you have to make a local copy & then the warning stops (that breakpoints aren’t going to work properly).
February 12, 2017 at 16:33 #10382tmkdoguscanParticipantHi dear Andy,
Thanks for your useful quick tutorial. I am currently getting used to with VisualGDB environment as well as the STM32F7 Disco board. I have a sufficient experience on programming STM32F4 series on Atollic IDE. Now, I have the VisualGDB V5.2r8. and I followed all the steps you provided above but still having some build errors as follows:
Error ld returned 1 exit status C:\…. ProjectDir\collect2.exe
Error multiple definition of main C:\…. ProjectDir\main.c
Error multiple definition of Systick_Handler C:\…. ProjectDir\SysTick_HandlerWould anyone possibly help me to investigate about the causes of these errors?
Thank you very much!
- This reply was modified 7 years, 9 months ago by tmkdoguscan.
- This reply was modified 7 years, 9 months ago by tmkdoguscan.
February 12, 2017 at 22:23 #10385supportKeymasterHi,
This looks like a conflict between the system file provided by VisualGDB and the one that comes from STM32CubeMX. Please remove the reference to the default system init file via VisualGDB Project Properties -> Embedded Frameworks.
February 13, 2017 at 08:40 #10387tmkdoguscanParticipantThank you for reply!
Errors were gone after removing the BlinkLed source file (from GBD’s default BlinkLed example). Now, hello world appears! There is more, I had some new issues while trying to go beyond “Hello World!” 🙂
I am trying to use STemWin gadgets in the same template and using GuiBuilder tool to create corresponding .c file in which I included an image and 2 buttons, just for learning. But no way, I could not make them appear on the screen. I am following almost similar procedure as one did here, (this guy is modifying one of demonstration examples and has some additional steps which is not our case in visualGBD). I have created the header file as he did, and trying to create window that is designed on guibuilder, but I just have white screen when I place CreateWindow(); function in the main.c file.
I hope I am not getting too much by asking a lot 🙂 but I am sure many people are suffering from the same or similar problem, it would be very useful for everybody if we could have a better understanding here! Thanks!
All the best!
February 13, 2017 at 18:39 #10393supportKeymasterHi,
This does indeed go beyond the scope of our product support, so our best advice would be to stop the debug session with the “Break all” command and check if the program is stopped on an unhandled exception or something similar.
If not, please consider asking on the STemWin forums as they should have a better knowledge of the library internals.
February 25, 2017 at 09:18 #10534tmkdoguscanParticipantYou are right 🙂 and thank you very much!
and any possible recommendation is still welcomed from anybody interested in with this topic 😉
Best regards!
-
AuthorPosts
- You must be logged in to reply to this topic.