STM32CubeF4
STM32CubeF4 copied to clipboard
Warning in sd_diskio.c - osMessageQueuePut integer from pointer without a cast
Describe the set-up
- STM32CubeIDE Version: 1.10.1
- Project on STM32F407VGT6 with
- FreeRtos (CMSIS_V2)
- FatFs (on SD card)
Describe the bug A clean compilation on a freshly generated code has two identical warnings:
passing argument 3 of 'osMessageQueuePut' makes integer from pointer without a cast [-Wint-conversion]
(on file sd_diskio.c, lines 644 and 663).
In both cases the offending line is osMessageQueuePut(SDQueueID, (const void *)&msg, NULL, 0);, while the prototype of the function is osStatus_t osMessageQueuePut (osMessageQueueId_t mq_id, const void *msg_ptr, uint8_t msg_prio, uint32_t timeout), so parameter 3 is implicitly converted from a pointer (NULL) to a uint8_t.
How To Reproduce
- Setup a project on any (I think) STM32F4
- Activate FATFS and FREERTOS (CMSIS_V2)
- Generate the code
- Build the code
Additional context
Instead of using NULL use the appropriate priority (osPriorityNone, defined in cmsis_os2.h, as suggested in this post)