cancel
Showing results for 
Search instead for 
Did you mean: 

Where to define the USE_FULL_ASSERT ?

Nick Alexeev
Associate III

Colleagues, I’ve got a nitpick question.

Where’s the best place to define USE_FULL_ASSERT ? It can be defined as a preprocessor symbol. Or, it can be #defined in the stm32xxx_hal_conf.h file. Or, is there a setting in the .ioc file?

The stm32g4xx_hal_conf.h which STM32cubeIDE had generated for me has this block:

/**
  * @brief Uncomment the line below to expanse the "assert_param" macro in the
  *        HAL drivers code
  */
/* #define USE_FULL_ASSERT    1U */

But it’s not in the the USER CODE block. I’m concerned that the automatic code generator would restore the #define USE_FULL_ASSERT back to the commented out line next time it re-generates stm32g4xx_hal_conf.h .

Best regards,
- Nick

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Super User

If you want to use the CubeMX way, enable it within the IOC file here in Project Manager.

TDK_0-1762657069906.png

After regenerating code, it will get defined (uncommented) in the stm32g4xx_hal_conf.h file.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

1 REPLY 1
TDK
Super User

If you want to use the CubeMX way, enable it within the IOC file here in Project Manager.

TDK_0-1762657069906.png

After regenerating code, it will get defined (uncommented) in the stm32g4xx_hal_conf.h file.

If you feel a post has answered your question, please click "Accept as Solution".