Stm32F4xx Spi 16 bits setup warning message when compiling
Hello all,
I set up an SPI com with FDM, motorola, 16 bits, MSB first, 10.5 Mbits/s, low, 2 edges, and global interrupt checked.
Program:
uint16_t RxData[1]; // 16bits data
HAL_GPIO_WritePin(GPIOC, GPIO_PIN_0, RESET);
HAL_SPI_Receive(&hspi1, RxData, 1, 100);
HAL_GPIO_WritePin(GPIOC, GPIO_PIN_0, SET);
When I compile it, I get a warning message:
../Core/Src/main.c:342:34: warning: passing argument 2 of 'HAL_SPI_Receive' from incompatible pointer type [-Wincompatible-pointer-types]
342 | HAL_SPI_Receive(&hspi2, RxData1, 1, 100);
| ^~~~~~~
| |
| uint16_t * {aka short unsigned int *}
In file included from ../Core/Inc/stm32f4xx_hal_conf.h:399,
from ../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal.h:29,
from ../Core/Inc/main.h:31,
from ../Core/Src/main.c:12:
../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_spi.h:671:69: note: expected 'uint8_t *' {aka 'unsigned char *'} but argument is of type 'uint16_t *' {aka 'short unsigned int *'}
671 | HAL_StatusTypeDef HAL_SPI_Receive(SPI_HandleTypeDef *hspi, uint8_t *pData, uint16_t Size, uint32_t Timeout);
The warning disappeared when I compile it the second time. Downloaded the program and worked perfectly. Does this create intermittent problem down the road? If it does, what is the best way to fix it?
Thank you in advance!
