cancel
Showing results for 
Search instead for 
Did you mean: 

Undefined symbol - uint32_t inside ''stm32f7xx_hal_gpio.h''

Omar Suárez
Senior
Posted on September 13, 2017 at 16:58

Hello,

I am preparing a project to test some USART and timers using a STM32F769 and a Discovery board.

I configured the Project to work with the STM32CubeF7 using the HAL modules (I didn't use the STM32CubeMX to generate the project, I selected the files manually inside the Keil options).

I also added the 'stm32f7xx_hal_conf.h' and uncommented the required lines of code to include all he .h files.

Also included the USE_HAL_DRIVER in the project configuration to use the 'hal_conf.h' file.

But I am experimenting some issues inside the 'smt32f7xx_hal_gpio.h' and the definitions of the int variables ar marked as unknown type (uitn32_t, uint_8, etc) so some of the structures inside the file are also marked as 'undefined' (GPIO_InitTypeDef) and also a few functions inside the module are marked as 'undefined'.

I tried to fix it adding some includes inside my code but I couln't so I am sutcked now.

Anyone can help with this?

Thanks in advanced,

Omar

#stm32cube #keil #stm32f7 #undefined-symbol
1 ACCEPTED SOLUTION

Accepted Solutions
Omar Suárez
Senior
Posted on September 15, 2017 at 09:34

I finally solved this issue.

It was an error inside the 'stm32f7xx_hal_conf.h', I was uncomment the USART define line but not the UART define line so it was my fault.

Despite this was my fault this error (and your answers) made me understand some compiler, linker and coding subtetlies.

Thanks all for your help!

Omar

View solution in original post

7 REPLIES 7
Posted on September 13, 2017 at 20:56

Place

#include <stdint.h>

before the place you #include 'smt32f7xx_hal_gpio.h'

JW

Posted on September 14, 2017 at 09:58

That's a different problem. It's not enough #include the .h headers, you need compile and link all the related .c modules. This process is toolchain-dependent. I don't Keil.

JW

Posted on September 14, 2017 at 08:45

 ,

 ,

Thanks for the answer.

I have defined <,stdint.h>, inside the 'stm32f7xx_hal_conf.h' file before the ♯ include 'stm32f7xx_hal_gpio.h' but the error is still there:

.\Objects\uart_hal_cube_st_testing.axf: Error: L6218E: Undefined symbol HAL_UART_DeInit (referred from hal_communications.o).

.\Objects\uart_hal_cube_st_testing.axf: Error: L6218E: Undefined symbol HAL_UART_Init (referred from hal_communications.o).

.\Objects\uart_hal_cube_st_testing.axf: Error: L6218E: Undefined symbol HAL_UART_Receive_DMA (referred from hal_communications.o).

.\Objects\uart_hal_cube_st_testing.axf: Error: L6218E: Undefined symbol HAL_UART_Transmit_DMA (referred from hal_communications.o).

It is all a chain error in the includes.

The program compiles but fails during the linking phase.

Posted on September 14, 2017 at 09:02

There is something related to the 'HAL_StatusTypeDef' inside the 'stm32f7xx_hal_def.h' that goes wrong.

Posted on September 14, 2017 at 09:05

In the module I am preparing I am using the UART APIs from the STM32CubeF7 HAL and I am including those files:

&sharpinclude 'stm32f7xx_hal.h'

&sharpinclude 'stm32f7xx_hal_uart.h'

Could be something wrong there?

Posted on September 14, 2017 at 10:32

I think that my error is due to the use of some 'extern' variables inside my module.

I have declare them inside the 'my_module.h' as extern because I need to use them in the main.c file. Then I have defined them an initialized them inside the 'my_module.c' file (without the extern prefix).

Isn't the correct way to use extern variables?

Omar Suárez
Senior
Posted on September 15, 2017 at 09:34

I finally solved this issue.

It was an error inside the 'stm32f7xx_hal_conf.h', I was uncomment the USART define line but not the UART define line so it was my fault.

Despite this was my fault this error (and your answers) made me understand some compiler, linker and coding subtetlies.

Thanks all for your help!

Omar