Senior III
September 25, 2022
Question
BUG: CubeMX-generated code fails to compile...
- September 25, 2022
- 6 replies
- 3357 views
I regenerated files with latest CubeMX and the generated code fails to compile. Regeneration was done to incorporate a few settings changes and the latest pack for this processor; previously code generated was OK. Errors below, and I've attached the IOC file and the offending "C" source generated by CubeMX.
Any ideas what's going on?
Anybody at STM?? @Nawres GHARBI ? @Sara BEN HADJ YAHYA ?
Are you able to rebuild the project from the IOC file and reproduce this bug?
Thanks!
Best Regards, Dave
arm-none-eabi-gcc "../FATFS/Target/sd_diskio.c" -mcpu=cortex-m4 -std=gnu11 -g3 -DUSE_HAL_DRIVER -DDEBUG -DSTM32F407xx -DSTM32_THREAD_SAFE_STRATEGY=5 -c -I../Core/Inc -I../Drivers/Custom -I../Drivers/STM32F4xx_HAL_Driver/Inc -I../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy -I../Drivers/CMSIS/Device/ST/STM32F4xx/Include -I../Drivers/CMSIS/Include -I../Middlewares/Third_Party/FreeRTOS/Source/include -I../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F -I../FATFS/Target -I../FATFS/App -I../Middlewares/Third_Party/FatFs/src -I../Core/ThreadSafe -I../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2 -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"FATFS/Target/sd_diskio.d" -MT"FATFS/Target/sd_diskio.o" --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -o "FATFS/Target/sd_diskio.o"
../FATFS/Target/sd_diskio.c: In function 'BSP_SD_WriteCpltCallback':
../FATFS/Target/sd_diskio.c:645:53: warning: passing argument 3 of 'osMessageQueuePut' makes integer from pointer without a cast [-Wint-conversion]
645 | osMessageQueuePut(SDQueueID, (const void *)&msg, NULL, 0);
| ^~~~
| |
| void *
In file included from ../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os.h:155,
from ../FATFS/Target/ffconf.h:29,
from ../Middlewares/Third_Party/FatFs/src/ff.h:29,
from ../Middlewares/Third_Party/FatFs/src/ff_gen_drv.h:29,
from ../FATFS/Target/sd_diskio.c:29:
../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os2.h:689:86: note: expected 'uint8_t' {aka 'unsigned char'} but argument is of type 'void *'
689 | osStatus_t osMessageQueuePut (osMessageQueueId_t mq_id, const void *msg_ptr, uint8_t msg_prio, uint32_t timeout);
| ~~~~~~~~^~~~~~~~
../FATFS/Target/sd_diskio.c: In function 'BSP_SD_ReadCpltCallback':
../FATFS/Target/sd_diskio.c:664:53: warning: passing argument 3 of 'osMessageQueuePut' makes integer from pointer without a cast [-Wint-conversion]
664 | osMessageQueuePut(SDQueueID, (const void *)&msg, NULL, 0);
| ^~~~
| |
| void *
In file included from ../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os.h:155,
from ../FATFS/Target/ffconf.h:29,
from ../Middlewares/Third_Party/FatFs/src/ff.h:29,
from ../Middlewares/Third_Party/FatFs/src/ff_gen_drv.h:29,
from ../FATFS/Target/sd_diskio.c:29:
../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os2.h:689:86: note: expected 'uint8_t' {aka 'unsigned char'} but argument is of type 'void *'
689 | osStatus_t osMessageQueuePut (osMessageQueueId_t mq_id, const void *msg_ptr, uint8_t msg_prio, uint32_t timeout);
| ~~~~~~~~^~~~~~~~
../FATFS/Target/sd_diskio.c: In function 'BSP_SD_AbortCallback':
../FATFS/Target/sd_diskio.c:675:4: error: 'msg' undeclared (first use in this function)
675 | msg = RW_ABORT_MSG;
| ^~~
../FATFS/Target/sd_diskio.c:675:4: note: each undeclared identifier is reported only once for each function it appears in
../FATFS/Target/sd_diskio.c:675:10: error: 'RW_ABORT_MSG' undeclared (first use in this function)
675 | msg = RW_ABORT_MSG;
| ^~~~~~~~~~~~
../FATFS/Target/sd_diskio.c:676:53: warning: passing argument 3 of 'osMessageQueuePut' makes integer from pointer without a cast [-Wint-conversion]
676 | osMessageQueuePut(SDQueueID, (const void *)&msg, NULL, 0);
| ^~~~
| |
| void *
In file included from ../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os.h:155,
from ../FATFS/Target/ffconf.h:29,
from ../Middlewares/Third_Party/FatFs/src/ff.h:29,
from ../Middlewares/Third_Party/FatFs/src/ff_gen_drv.h:29,
from ../FATFS/Target/sd_diskio.c:29:
../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os2.h:689:86: note: expected 'uint8_t' {aka 'unsigned char'} but argument is of type 'void *'
689 | osStatus_t osMessageQueuePut (osMessageQueueId_t mq_id, const void *msg_ptr, uint8_t msg_prio, uint32_t timeout);
| ~~~~~~~~^~~~~~~~
make: *** [FATFS/Target/subdir.mk:25: FATFS/Target/sd_diskio.o] Error 1