cancel
Showing results for 
Search instead for 
Did you mean: 

how i correct these errors

ta2eh
Associate

Please somebody can help me to correct my errors in stm32cubeide for stm32f401cdu6 project

../Core/Src/main.c: In function 'HAL_UART_RxCpltCallback':

../Core/Src/main.c:77:38: warning: assignment to 'char' from 'char *' makes integer from pointer without a cast [-Wint-conversion]

77 | rxbuffer[bufferIndex]="\0";

| ^

../Core/Src/main.c:84:37: warning: passing argument 2 of 'HAL_UART_Receive_IT' makes pointer from integer without a cast [-Wint-conversion]

84 | HAL_UART_Receive_IT(&huart6,uart_char,1);

| ^~~~~~~~~

| |

| char

In file included from ../Core/Inc/stm32f4xx_hal_conf.h:411,

from ../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal.h:29,

from ../Core/Inc/main.h:30,

from ../Core/Src/main.c:20:

../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_uart.h:748:75: note: expected 'uint8_t *' {aka 'unsigned char *'} but argument is of type 'char'

748 | HAL_StatusTypeDef HAL_UART_Receive_IT(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size);

| ~~~~~~~~~^~~~~

../Core/Src/main.c: In function 'processsms':

../Core/Src/main.c:91:17: warning: implicit declaration of function 'sendcommand2' [-Wimplicit-function-declaration]

91 | sendcommand2("We Have Mesaj");

| ^~~~~~~~~~~~

../Core/Src/main.c: At top level:

../Core/Src/main.c:103:6: warning: conflicting types for 'sendcommand2'; have 'void(char *)'

103 | void sendcommand2 (char * cmdx)

| ^~~~~~~~~~~~

../Core/Src/main.c:91:17: note: previous implicit declaration of 'sendcommand2' with type 'void(char *)'

91 | sendcommand2("We Have Mesaj");

| ^~~~~~~~~~~~

../Core/Src/main.c: In function 'main':

../Core/Src/main.c:157:31: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]

157 | HAL_UART_Receive_IT(&huart2,(uint8_t *)uart_char,1);

1 REPLY 1
Saket_Om
ST Employee

Hello @ta2eh 

Could you please share your code?

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.
Saket_Om