Skip to main content
FLamb.2
Associate II
January 11, 2021
Solved

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

  • January 11, 2021
  • 1 reply
  • 3548 views

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.
Best answer by Khouloud OTHMAN

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
January 11, 2021

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.