Skip to main content
Visitor II
April 25, 2014
Question

STM32Cube file generation problem

  • April 25, 2014
  • 14 replies
  • 4975 views
Posted on April 25, 2014 at 17:17

The STM32Cube 

project file

attached

does not generate

the file

gpio.c

Can someone help me

?
    This topic has been closed for replies.

    14 replies

    Visitor II
    April 26, 2014
    Posted on April 26, 2014 at 22:12

    I used stm32cube in my project and no file gpio.c is created. Why do you expect that filename?

    Ron

    evolpi63Author
    Visitor II
    April 28, 2014
    Posted on April 28, 2014 at 12:55

    This STM32Cube project is setting to generate code for MDK-ARM toolchain and to generate peripheral initialization as a pair of .C/.H files per IP.

    When I open the code in MDK-ARM in the project window (on the left) this file is required bat not present (not generated by STM32Cube).

    Is there any

    solution ?

    Visitor II
    April 28, 2014
    Posted on April 28, 2014 at 13:55

    tried your *.ioc file and MX did not generate gpio.c file for me either (using  uVision 5.10.0.2). I'm currently working with STM32F407 and MX generates gpio.c file my project (the very same PE2 as you)m however i have only a few peripherals in use. One suggestion to move forward from this inconvenience until it's fixed by ST - if haven't done it already - is to do a clean project generation with option ''Generate peripheral initialization as a pair of '.c/.h' per IP'' unchecked and copy initialization from main.c to your own module (named other than gpio.c otherwise your effort is lost by next generation).

    evolpi63Author
    Visitor II
    April 28, 2014
    Posted on April 28, 2014 at 16:33

    Thanks

    this solves the

    problem.

    However,

    I will wait

    the solution

    of

    this inconvenience by ST.

    Visitor II
    May 2, 2014
    Posted on May 02, 2014 at 15:44

    Using the brand new CubeMx version (4.2, released two days ago), I took the .ioc file, generated code for Keil 4.73: no issue in Keil, link with no errors, and the gpio.c file clearly present in the project.

    Maybe it is worth trying with Mx 4.2 (I do not have any more 4.1, then can not reproduce initial problem).

    Rgds.

    0690X00000603MyQAI.jpg

    Visitor II
    May 11, 2014
    Posted on May 11, 2014 at 19:38

    I too am seeing issues with the generation of gpio.c using v4.2. I also have setup for seperate .c and .h. When I generated the files initially the gpio.c file was generated but afterwards when I make changes to the project in CubeMX and regenerate the files the gpio.c file is removed from the project....this is a real nuisance that I haven't been able to resolve.

    The workaround mentioned above may work but is a real inconvenience.

    Visitor II
    May 11, 2014
    Posted on May 11, 2014 at 21:45

    Just an update on my issue. If I copy the .ioc file on it's own to an empty folder and regenerate the files using CubeMX then the gpio.c file is generated. I then copy this file into the actual project folder. A bit of a workaround but does the job for now until issue is fixed.

    Visitor II
    May 12, 2014
    Posted on May 12, 2014 at 22:14

    I have this problem too, with a missing gpio.c file. However, I have found that the file is actually created, in the beginning of the generation process, but after some seconds it will be deleted again. Using my software editor, in file-open-mode, I manage to catch the gpio.c file when it gets created, and then I can save it again after the original file has been deleted by STM32Cube. Annoying but still a workaround. If I don't make any changes that affects the gpio.c file, I can just save a copy of the first file with a different name, and then copy that into the gpio.c after a new code generation run.

    Visitor II
    June 3, 2014
    Posted on June 03, 2014 at 19:22

    Hi,

    just to add to the list -- I've encountered the same issue. Create a new project, select ''Generate peripheral initialization as a pair of .c/.h files per IP'' in the settings, enable some random GPIO, then click on ''Generate Code''.

    In the first run gpio.c will be generated just fine. Now close STM32CubeMX, and restart it by double-clicking the respective *.ioc file. Click on ''Generate Code'' again. The gpio.c files is now gone.

    I currently use STM32CubeMX 4.2.0.

    Visitor II
    June 5, 2014
    Posted on June 05, 2014 at 12:12

    hermann.uwe wrote: ...restart it by double-clicking the respective *.ioc file. Click on ''Generate Code'' again. The gpio.c files is now gone.

    Thanks Herman, since your advice i've opened my project from MX (File -> Load... || Recent...) and the gpio.c file has been generated just fine at each time (...for now). So i to any one struggling with the same issue, close your project (perhaps restart CubeMX too) and open your project from the MX not by double clicking the *.ioc icon.