STMicroelectronics / stm32h7xx-hal-driver

Provides the STM32Cube MCU Component "hal_driver" of the STM32H7 series.
BSD 3-Clause "New" or "Revised" License
97 stars 43 forks source link

stm32h7xx_hal_ospi.c does not compile when assert_param actually evaluates "expr" #34

Closed fermentedfly closed 1 year ago

fermentedfly commented 1 year ago

Describe the set-up STM32H7B3 GCC 12.2.0 HAL Driver Git Tag: v1.11.1

Describe the bug stm32h7xx_hal_ospi.c does not compile when the assert_param macro actually evaluates expr

The offending lines are stm32h7xx_hal_ospi.c:1654 & 1732 assert_param(IS_OSPI_STATUS_BYTES_SIZE(dlr_reg+1U)); -> variable dlr_reg does not exist

How To Reproduce

stm32h7xx_hal_conf.h Enable OSPI #define HAL_OSPI_MODULE_ENABLED Set a custom assert_param macro, e.g.

extern void vConfigAssertHook();
#define assert_param(expr) ((expr) ? (void)0U : vConfigAssertHook())
HBOSTM commented 1 year ago

Hello @fermentedfly,

Thank you for this contribution. There is no problem from my side. If USE_FULL_ASSERT is defined: This check will be executed. In this case 'dlr_reg' is defined. else This check will be executed, in this case 'expr' is not used, and assert_param returns 0. So, please allow me to close this issue. Thank you again for your comprehension.

Best Regards,