Skip to main content
Associate II
April 16, 2024
Question

43: error: invalid use of incomplete typedef 'uart_handle_t' {aka 'struct uart_handle'}

Hi all,

I am a new member to stm controllers.

i am using B-L072z-LRWAN1 & SUB IOT STACK.

While iam using wrapper class functions i am able to see the output of my code

uart_handle_t* uart_0;

uart_0 = uart_init(0,9600,0);

uart_enable(uart_0);

uart_send_byte(uart_0,0x07);

 

but while i am trying to send data using hal function i am facing this

error

 

error: invalid use of incomplete typedef 'uart_handle_t' {aka 'struct uart_handle'}

 

code

uart_handle_t* uart;

uart = uart_init(0,9600,0);

uart_enable(uart);

uint8_t data = 0x55;

uint8_t *pdata = &data;

HAL_UART_Transmit(&uart->handle, &data, 1, HAL_MAX_DELAY);

 

but please also have look at wraper class code

void uart_send_byte(uart_handle_t* uart, uint8_t data) {

HAL_UART_Transmit(&uart->handle, &data, 1, HAL_MAX_DELAY);

}

 

please help, thanks in advance

This topic has been closed for replies.

5 replies

STTwo-32
ST Technical Moderator
April 29, 2024

Hello @sai_sankar_rao_R 

Can you give more details about your issue (detailed description of the project, Error context, Some creenshoots,...).

Best Regards.

STTwo-32

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
Associate II
June 10, 2024

sai_sankar_rao_R_0-1718001581929.png

 

sai_sankar_rao_R_1-1718001592163.png

 

Karl Yamashita
Principal
June 10, 2024

You need to show your uart_handle_t structure. It's probably missing UART_HandleTypeDef and if handler is it, I don't see where you initialized it with a instance?

If a reply has proven helpful, click on Accept as Solution so that it'll show at top of the post.CAN Jammer an open source CAN bus hacking toolCANableV3 Open Source
Andrew Neil
Super User
June 10, 2024

Please use this button to properly post source code:

AndrewNeil_0-1718034154289.png

 

 

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Tesla DeLorean
Guru
June 10, 2024

Do you have the actual typedef, or any, in this file or it's includes?

If not, probably wants you to explicitly describe the pointer

struct uart_handle_t* uart_0;

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..