Skip to main content
Graduate II
April 29, 2024
Question

Upload example code to STM32F407

  • April 29, 2024
  • 2 replies
  • 2258 views

Using CubeMX, selecting "Start My project from Example" I find 33 examples if I filter for the "STM32F407G-DISC1" Board. I would like to have a deeper understanding of the one named "Demonstrations" I select it and "Start my project in External IDE" and then "Open with Explorer", since VSCode is not an option.

Now how do I go from there to upload the code onto my board?

I have two questions:

  1. I find no IOC-file, I would like to open the project in CubeMX to see how the microcontroller pinout is configured.
  2. I find no makefile nor CMakeList.txt, how do I build the project which I need to do in order to upload it?
    This topic has been closed for replies.

    2 replies

    Technical Moderator
    April 29, 2024

    Hello @pcb 

    1. The examples developed for this board are not based on the STM32CubeMX. So, there is no .ioc file on them and you can't open them using the CubeMX.
    2. After generating the project and compile it using an IDE (CubeIDE for example) Then, you will find a makerfile generated on the Debug file of the project: 

     

    STTwo32_0-1714381947431.png

    Best Regards.

    STTwo-32

    pcbAuthor
    Graduate II
    April 30, 2024

    Thank you @STTwo-32,

    I have successfully managed to generate the Makefile by using the build action in STM32CubeIDE; however, I am not able to Run the project onto my STM32F407G-DISC1. Either from the IDE or VSCode.

    One thing that confuses me is that I do not find any configFiles such as stlink.cfg and stm32f4x.cfg

    Super User
    April 30, 2024

    I do not find any configFiles such as stlink.cfg and stm32f4x.cfg

    These files are for OpenOCD. The default debugger in CubeIDE is the "ST GDB server", it does not need these files. If you switch to OpenOCD, the config file will be created.