STM32CubeMx Project with VisualGDB?

Sysprogs forums Forums VisualGDB STM32CubeMx Project with VisualGDB?

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #6409
    Peslap
    Participant

    How can I use a  project (i.e. MDK arm v5) created with STM32CubeMx in VisualGDB?

    #6413
    support
    Keymaster

    Unless 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/

    #6445
    Peslap
    Participant

    This 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”

     

     

    #6446
    Peslap
    Participant

    Now 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 🙂

    #6451
    Peslap
    Participant

    From 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.c

    The 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=28060

     

    #6458
    support
    Keymaster

    Hi,

    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.

    #6461
    sdzienge
    Participant

    With 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.

    #6465
    sd_tom
    Participant

    will 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).

    #6477
    bitbybit
    Participant

    +1

    #6563
    sposs
    Participant

    +1

    #6681
    support
    Keymaster

    Hi,

    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/

    #6688
    WoodyWoodsta
    Participant

    This is great! I use STM32CubeMX often and was having to import everything myself.

    #6763
    bitbybit
    Participant

    Excellent work. Thanks guys.

Viewing 13 posts - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.