AnsweredAssumed Answered

Use STM32Cube HAL as dependency for my own module

Question asked by Omar Suárez on Nov 15, 2017
Latest reply on Nov 15, 2017 by Clive One

Hi everyone,

 

I am developping some modules in C and ithey need to use some structures and functions from the HAL Cube. I have include the "stm32f7xx_hal.h" inside the ".h" file of my module but the Keil compiler throw me some undefined errors.

In fact al the undefined variables are from the HAL so I guess I am not including the correct ".h" file or the way of use the HAL as dependency is different.

This is a chunk of my code :

 

#ifndef __COMM_MODULE_H
#define __COMM_MODULE_H

#include <stdint.h>
#include "stm32f7xx_hal.h"

 

....

 

/* INTERFACE */
extern UART_HandleTypeDef huart3;
extern UART_HandleTypeDef huart6;

extern uint8_t rxBuffer[RXBUFFERSIZE];
extern uint8_t txBuffer[TXBUFFERSIZE];
extern volatile ITStatus Uart6Ready;
extern volatile ITStatus Uart3Ready;


extern void open_BT(void);
extern void open_USB(void);
extern void close_BT(void);
extern void close_USB(void);
extern void write_BT(uint8_t* txBuff, uint8_t size);
extern void write_USB(uint8_t* txBuff, uint8_t size);
extern void read_BT(uint8_t* rxBuff, uint8_t size);
extern void read_USB(uint8_t* rxBuff, uint8_t size);

 

....

....

#endif

 

 

The compiler then shows that the undefined variables are:

   + UART_HandleTypeDef

   + ITStatus

 

What is the correct way of using the HAL inside my own module as dependency?

 

Thanks in advanced,

Omar

Outcomes