Skip to main content
Senior
February 4, 2024
Question

After modifying .ioc file, STM32 CUBE IDE removes some files which causes the build issue.

  • February 4, 2024
  • 6 replies
  • 2949 views

Hi All,

I already hold a running code which gets compiled perfectly. When I added RNG peripheral by modifying .ioc, I get many errors as build outcome. I have analyzed the root cause and I have found out, generating code after modifying .ioc file removes many files, such as some headers that were already in the previously built project.

Is there any way to preserve the previously successfully built project and just add the new files only such as whatever related with RNG peripheral?

 

 

    6 replies

    TDK
    February 4, 2024

     

    Only put your code within USER CODE sections. Don't put files in folders that CubeMX controls. The Core src/inc folder is fine. What files did it delete, and from where?

    If your IOC generates code that does not compile due to missing files, please attach it.

    "If you feel a post has answered your question, please click ""Accept as Solution""."
    demirAuthor
    Senior
    February 5, 2024

    Many files are deleted such as below. What could be the reason behind and how can I avoid it ?

     

    demir_0-1707158643735.png

     

    TDK
    February 5, 2024

    Files from 2020, so very old project, most likely using different CubeMX verson and HAL library version.

    "If you feel a post has answered your question, please click ""Accept as Solution""."
    demirAuthor
    Senior
    February 6, 2024

    Thank you.

    So, what you are saying is that, the files that I imported includes files from Cube MX version 2020. Is that so ?

    If yes, is there any way to fix it ?

    Btw, I am using STM32 Cube IDE 1.14.0.

    TDK
    February 6, 2024

    I don't have any history on your project. If it were me, I would update the F4 package to the latest version (Help -> Manage Embedded...), generate code, and see if it compiles. If it does not, attach the IOC here and I will look at it.

     

    "If you feel a post has answered your question, please click ""Accept as Solution""."
    demirAuthor
    Senior
    February 6, 2024

    I already have the latest version that is 1.28.0.

    Please find .ioc file attached.

     

    TDK
    February 6, 2024

    The project generates code and builds successfully for me without errors.

    The stm32f4xx_hal_can file is deleted as the project does not have any CAN peripherals enabled. Similar story for the PCD file.

    "If you feel a post has answered your question, please click ""Accept as Solution""."