Sysprogs forums › Forums › VisualGDB › STM32CubeMx Project with VisualGDB?
- This topic has 12 replies, 7 voices, and was last updated 9 years, 4 months ago by bitbybit.
-
AuthorPosts
-
May 2, 2015 at 13:03 #6409PeslapParticipant
How can I use a project (i.e. MDK arm v5) created with STM32CubeMx in VisualGDB?
May 2, 2015 at 19:07 #6413supportKeymasterUnless it contains assembly files that are incompatible with GCC, you can simply import it to VisualGDB. E.g. refer to the legacy project tutorial to see how to specify device-specific flags manually: http://visualgdb.com/tutorials/arm/legacy/
May 6, 2015 at 19:09 #6445PeslapParticipantThis is not a legacy ARM device. It is a STM32F4 which is directly supported from VDGB.
It would be very useful if there is an option to import a Keil Project.
Lagacy tutorial :
Where should I find some Compiler flags? Is it the ‘Compiler Control String’ from the Target Options Dialog, Tab C/C++? It is:
-c –cpu Cortex-M4 -D__MICROLIB -g -O0 –apcs=interwork –split_sections -I..\Inc -I..\User -I..\Drivers\STM32F4xx_HAL_Driver\Inc -I..\Drivers\STM32F4xx_HAL_Driver\Inc\Legacy -I..\Drivers\CMSIS\Include -I..\Drivers\CMSIS\Device\ST\STM32F4xx\Include -I..\Middlewares\Third_Party\LwIP\system -I..\Middlewares\Third_Party\LwIP\src\include -I..\Middlewares\Third_Party\LwIP\src\include\ipv4 -I..\Middlewares\Third_Party\LwIP\system\arch -I..\Middlewares\Third_Party\LwIP\src\include\ipv4\lwip -I..\Middlewares\Third_Party\LwIP\src\include\lwip -I..\Middlewares\Third_Party\LwIP\src\include\netif -I..\Middlewares\Third_Party\LwIP\src\include\posix -I..\Middlewares\Third_Party\LwIP\src\include\posix\sys -I..\Middlewares\Third_Party\LwIP\src\netif\ppp –C99
-I..\MDK-ARM\RTE -I C:\Keil_v5\ARM\PACK\Keil\STM32F4xx_DFP\2.3.0\Drivers\CMSIS\Device\ST\STM32F4xx\Include
-I C:\Keil_v5\ARM\CMSIS\Include
-DSTM32F407xx -DUSE_HAL_DRIVER -o “E407 Configuration\*.o” –omf_browse “E407 Configuration\*.crf” –depend “E407 Configuration\*.d”May 6, 2015 at 21:29 #6446PeslapParticipantNow it works:
in the debug.mak I add all the above includes (replaced “-I..\” by “”) after after INCLUDE_DIRS :=.
Add all c files to the solution. There is an conflict between the hal files in the Project (copied by CubeMX) and the files in folder Appdata/../com.sysprogs.arm.stm32/… So I removed this hal files from the project.
That’s all 🙂
May 10, 2015 at 08:01 #6451PeslapParticipantFrom the Visual Studio Project I excluded all files from Appdata/../com.sysprogs.arm.stm32/…
except <AppData>\Local\VisualGDB\EmbeddedBSPs\arm-eabi\com.sysprogs.arm.stm32\STM32F4xxxx-HAL\startup_stm32f4xx.cThe Keil compiler use C99. For gcc append –std=c99 in VDGB Property, Makefile settings, CFLAGS.
So I can develop & debug in Visual Studio & Resharper C++ & VisualGDB, which is more comfortable as the Keil IDE.
The release I build with the Keil compiler. A project based on the CubeMX UDP_Echo_Server result in FLASH size ( release build, in Keil -O3:)
gcc: 70 kB: .text=66kB .data=3048
Keil V5.04: Program Size: Code=34172 RO-data=732 RW-data=964 ZI-data=28060May 12, 2015 at 05:04 #6458supportKeymasterHi,
You can try further reducing the size of your binary by switching the libc to newlib-nano and experimenting with other libc options on the Device Settings page.
Also feel free to check out the new IntelliSense engine of VisualGDB 5.0. It is designed to handle GCC-specific code and supports refactoring and Code Map.
May 14, 2015 at 15:02 #6461sdziengeParticipantWith the upcoming bump to the new intellisense engine are there any plans to support CubeMX more directly? It’d be great to generate VisualGDB projects direct from CubeMX, but a close second would be to be able to import more completely from any of the existing automatically generated projects, not to mention automatic use of the installed CubeMX firmware/middleware libraries and templates.
May 14, 2015 at 17:34 #6465sd_tomParticipantwill second this.. doing the same kind of thing, but a different package from STM32 that isn’t part of Cube (iNEMO-M1 eval code).. there’s CoIDE, IAR, and Keil projects provided; would be nice if just one of those was generally importable; or somehow get “on board” with ST and become another set of packages that is supported by their releases. Sure it would do well for business. Challenge seems to be each is a different compiler, with different nuances (see the thread I just created).
May 18, 2015 at 21:53 #6477bitbybitParticipant+1
June 4, 2015 at 08:45 #6563spossParticipant+1
July 6, 2015 at 05:07 #6681supportKeymasterHi,
We have simplified the integration with STM32CubeMX in VisualGDB 5.0 Beta 3 and added a detailed tutorial showing how to use it: http://visualgdb.com/tutorials/arm/stm32/cube/
July 7, 2015 at 15:25 #6688WoodyWoodstaParticipantThis is great! I use STM32CubeMX often and was having to import everything myself.
July 29, 2015 at 20:07 #6763bitbybitParticipantExcellent work. Thanks guys.
-
AuthorPosts
- You must be logged in to reply to this topic.