Skip to main content
po221
Senior
January 29, 2022
Solved

Implicit declaration of MX_SPI3_Init after CubeMX migration

  • January 29, 2022
  • 6 replies
  • 3364 views

Hello

I'm using STM32cubeIDE with an L431RC

CubeMX invited me to migrate my .ioc from 6.2 to 6.4 and FW_L4 from 1.17 to 1.17.1

After that I have a warning Implicit declaration of MX_SPI3_Init in main.c

This is only in cubeMX generated code

For information cubeMX asked me to enable USE_NEWLIB_REENTRANT in freertos0693W00000JNo2YQAT.jpg 

What could I have done wrong?

How to fix this error of cubeMX, which does not include spi.h in main.c?

0693W00000JNo1zQAD.jpg0693W00000JNo1pQAD.jpgThanks in advance

PS : I specify that I have for the moment avoided the problem by adding :

/* USER CODE BEGIN Includes */

#include "spi.h"

/* USER CODE END Includes */

Here I want to correct the original problem that forces me to do this.

This topic has been closed for replies.
Best answer by Sara BEN HADJ YAHYA

Hello @po221​ ,

Thanks for your feedback,

This is a known issue and it is already raised to the dev team. For more details, please check my answer in this thread https://community.st.com/s/question/0D53W00001K3a7JSAR/missing-include-spih-in-stm32cubemx-v-640-hal-191-stm32h7

Sorry for any inconvenience that this may cause.

If you issue is solved, please close this post by clicking the "Select as Best" button. This will help other members of the community find this response more quickly :)

Sara.

6 replies

TDK
January 29, 2022

Probably a migration or cube generation bug if it persists after generating code. Can you include the IOC?

"If you feel a post has answered your question, please click ""Accept as Solution""."
po221
po221Author
Senior
January 29, 2022
TDK
January 30, 2022

I could duplicate the issue. Definitely a bug.

Perhaps @Khouloud OTHMAN​ can look.

"If you feel a post has answered your question, please click ""Accept as Solution""."
ssipa.1
Visitor II
January 30, 2022

hello

Regarding to your question and as i understood from that about CubeMX code generation here i can give you the following piece. try it

revert the sourceEntries to this in .cproject file

<sourceEntries>

<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>

</sourceEntries>

po221
po221Author
Senior
January 30, 2022

I'm not sure I understand what this should change but I just tested and it doesn't change the absence of #include "spi.h" in main.c

Sara BEN HADJ YAHYA
ST Technical Moderator
January 31, 2022

Hello @po221​ ,

Thanks for your feedback,

This is a known issue and it is already raised to the dev team. For more details, please check my answer in this thread https://community.st.com/s/question/0D53W00001K3a7JSAR/missing-include-spih-in-stm32cubemx-v-640-hal-191-stm32h7

Sorry for any inconvenience that this may cause.

If you issue is solved, please close this post by clicking the "Select as Best" button. This will help other members of the community find this response more quickly :)

Sara.

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question.