Skip to main content
FLamb.2
Associate II
Jan 11, 2021 10:45 AM UTC
Solved

usart.h / usart.c and the gpio.h / gpio.c files are missing

I am using a Nucleo F091RC.

When I create a new project, the

.../Inc/usart.h

.../Src/usart.c

.../Inc/gpio.h

.../Src/gpio.c

files are missing.

The button on the board is declared as GPIO_Input

The LED on the board is declared as GPIO_Output

PA2 is declared as USART2_TX

PA3 is declared as USART2_TX

When will the files appear in the folders?

This topic has been closed for replies.
Khouloud OTHMAN
Khouloud OTHMANBest answer
Associate
Jan 11, 2021 11:03 AM UTC

Hello FLamb.2,

STM32CubeMX tool offers you the possibility to whether generate the peripheral initialization in separate .c/.h files or keep all peripheral initialization in the main.c file. In fact you can check "Generate peripheral initialization as a pair of .c/.h files per peripheral" option under Project Manager/Advanced Settings panel as showed in the attached screenshot.

0693W000006IBMIQA4.png 

Hope this answers your question.

If yes, please click on the Select as Best button on my reply . This will help other members of the community find this solution more quickly.

Khouloud.

1 reply

Khouloud OTHMAN
Khouloud OTHMANBest answer
Associate
Jan 11, 2021 11:03 AM UTC

Hello FLamb.2,

STM32CubeMX tool offers you the possibility to whether generate the peripheral initialization in separate .c/.h files or keep all peripheral initialization in the main.c file. In fact you can check "Generate peripheral initialization as a pair of .c/.h files per peripheral" option under Project Manager/Advanced Settings panel as showed in the attached screenshot.

0693W000006IBMIQA4.png 

Hope this answers your question.

If yes, please click on the Select as Best button on my reply . This will help other members of the community find this solution more quickly.

Khouloud.