cancel
Showing results for 
Search instead for 
Did you mean: 

DEBUG and RELEASE version of StdPeriphLib 3.2.0

Posted on July 02, 2010 at 13:14

DEBUG and RELEASE version of StdPeriphLib 3.2.0

3 REPLIES 3
swhite2
Associate III
Posted on May 17, 2011 at 13:57

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.

Posted on May 17, 2011 at 13:57

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-defined

USE_FULL_ASSERT

?
swhite2
Associate III
Posted on May 17, 2011 at 13:57

Yes. I use IAR's EWARM 5.xx product and if USE_FULL_ASSERT isn't defined no extra code is generated.