[SOLVED] how can i solve uart error in iar compiler

Thread Starter

STP.Asghari

Joined Nov 22, 2022
12
Hi everyone
I encounter an error in the iar compiler when entering the following code.
Code:
#define Enter    HAL_UART_Transmit(&huart1,(unsigned char*)E,1,10);
#define CR       HAL_UART_Transmit(&huart1,(unsigned char*)C,1,10);
#define GIM      HAL_UART_Transmit(&huart1,(unsigned char*)G,1,10);
#define SUB      HAL_UART_Transmit(&huart1,(unsigned char*)S,1,10);
The error is written in the following line:
Code:
 Error[Pe136]: struct "<unnamed>#35" (declared Hat line 326 of "H:\IAR Codes\3- Sim800\sim800\Drivers\CMSIS\Device\ST\STM32F4xx\Include\stm32f401xc.h"h) has no field "HAL_UART_Transmit" H:\IAR Codes\3- Sim800\sim800\Core\Src\main.c 207
Please tell me why this error occurred and how to solve it. thank you.
 

Thread Starter

STP.Asghari

Joined Nov 22, 2022
12
the problem solved :
at line 2 : CR was defined in main and stm32f401xc.h And because of this, the compiler gave an error. I changed CR to CR1 in the main and the problem was solved.
 
Top