2010-07-02 04:14 AM
DEBUG and RELEASE version of StdPeriphLib 3.2.0
2011-05-17 04:57 AM
The 'assert_param()' macro is defined, in ST's code, in stm32f10x_conf.h. As you already know the USE_FULL_ASSERT define controls whether it evaluates to a function call or '((void)0)'. Most compilers will see the latter as pointless and not generate any code but you'd have to check this for whatever you're using. That is generate assembler listings for the library modules and have a look.
In my (real world) code 'assert_param()' evaluates to a function that dumps the info out a serial port in debug builds (where USE_FULL_ASSERT is define in the project) but not in release builds. It has proved VERY valuable to me. In fact just a few days ago I discovered an issue, with one of the ST library functions, that I hadn't been aware of. I've spent a lot of time building a stable low-level platform for STM32 processors. It includes real fault handling (dumps CPU registers) and debug serial output routines. All that upfront effort has save me hours of debugging time. In fact I use the 'assert_param()' macro in my own code.2011-05-17 04:57 AM
Thank you, Stuart.
Perhaps I will use assert_param if I have a debug problem. Do you think that IAR EWARM ignores this dummy function generated by non-definedUSE_FULL_ASSERT
?2011-05-17 04:57 AM
Yes. I use IAR's EWARM 5.xx product and if USE_FULL_ASSERT isn't defined no extra code is generated.