2020-05-24 07:57 AM
To compile I use the following flags:
-mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -std=gnu99 -DSTM32F429xx -DDEBUG -DUSE_FULL_LL_DRIVER -DUSE_FULL_ASSERT -DHSE_VALUE=8000000 -DUSE_HAL_DRIVER -I../Application -I../AA -I../BSP/STM32F4 -I../aaBasic -I../tests -I../aaUtils -I../aaTests -I../system/include -I../system/include/device -I../system/include/cmsis -I../system/include/stm32f4-hal -I../lwip/src/include -I../lwip/system -Og -ffunction-sections -fdata-sections -g -fstack-usage -Wall -Wformat=2 -Wshadow -Wunused -Wlogical-op -Wconversion -Wsign-conversion -Wextra -pedantic -Wswitch-default -specs=nano.specs
The log window displays a lot of warning messages from HAL and LL files. All these yellow lines bother me and each time I have to go and see if one or 2 is not from my files. Some examples:
..\system\src\stm32f4-hal\stm32f4xx_ll_fmpi2c.c:221:0: warning: ISO C forbids an empty translation unit [-Wpedantic]
..\system\src\stm32l4p-hal\stm32l4xx_hal_rcc.c: In function 'HAL_RCC_OscConfig':
..\system\src\stm32l4p-hal\stm32l4xx_hal_rcc.c:946:1: warning: embedding a directive within macro arguments is not portable
#if defined(RCC_PLLP_SUPPORT)
^
..\system\src\stm32l4p-hal\stm32l4xx_hal_rcc.c:948:1: warning: embedding a directive within macro arguments is not portable
#endif
^
../system/include/stm32l4p-hal/stm32l4xx_hal_dma.h:85:42: warning: comma at end of enumerator list [-Wpedantic]
HAL_DMA_STATE_TIMEOUT = 0x03U, /*!< DMA timeout state */
^
..\system\src\stm32f4-hal\stm32f4xx_ll_rcc.c: In function 'LL_RCC_GetRNGClockFreq':
..\system\src\stm32f4-hal\stm32f4xx_ll_rcc.c:752:42: warning: unused parameter 'RNGxSource' [-Wunused-parameter]
uint32_t LL_RCC_GetRNGClockFreq(uint32_t RNGxSource)
^~~~~~~~~~
..\system\src\stm32f4-hal\stm32f4xx_ll_rcc.c: In function 'LL_RCC_GetUSBClockFreq':
..\system\src\stm32f4-hal\stm32f4xx_ll_rcc.c:847:42: warning: unused parameter 'USBxSource' [-Wunused-parameter]
uint32_t LL_RCC_GetUSBClockFreq(uint32_t USBxSource)
..\system\src\stm32f4-hal\stm32f4xx_ll_adc.c:290:53: warning: unused parameter 'ADCxy_COMMON' [-Wunused-parameter]
..\system\src\stm32f1-hal\stm32f1xx_hal_tim_ex.c:1734:60: warning: unused parameter 'htim' [-Wunused-parameter]
1734 | HAL_StatusTypeDef HAL_TIMEx_RemapConfig(TIM_HandleTypeDef *htim, uint32_t Remap)
../system/include/stm32f4-hal/stm32f4xx_ll_rtc.h:673:114: warning: conversion to 'unsigned int' from 'int' may change the sign of the result [-Wsign-conversion]
673 | #define __LL_RTC_CONVERT_BCD2BIN(__VALUE__) (uint8_t)(((uint8_t)((__VALUE__) & (uint8_t)0xF0U) >> (uint8_t)0x4U) * 10U + ((__VALUE__) & (uint8_t)0x0FU))
It would be nice if HAL and LL compile properly ...
2020-05-24 08:39 AM
Seems like sometimes they used UNUSED(...) to prevent unused parameter warnings, but not everywhere. I can't imagine it's a high priority.
2020-05-31 06:58 AM
That's not much, but it shows that the quality process for software development at ST is not very rigorous.
And this little rigor is transmitted to our developments in these traces, which must be explained during each quality review ... The listeners' opinion: "You use ST software... Maybe you should do without it."
The perceptible quality of ST software would be better if there were no warnigs during compilation.
I notice that there is no response from ST when we talk about the quality of its software ...
2020-05-31 09:50 AM
Precisely for this situation all decent lint tools have notion of "system libraries" - that's, external source outside of your control.
Apply this and cut the noise.
The decision whether to use the ST software, or roll your own, is up to you.
-- pa