Asserts

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
DAVE newbie question: I find that asserts are not triggering. Tried XMC_ASSERT, and plain assert. Couldn't find anything in Forum or DAVE help that tells me how I enable assert support, should I need to. DAVE-generated modules and stock DAVE APPs, include XMC_ASSERT and plain assert statements. I've tried flipping the sense of one each of those, and breakpointing just after, to check the relevant code is executing, but neither of those asserts trigger, either. Obviously I'm doing something basic wrong here. Any ideas?
0 Likes
2 Replies
User10538
Level 3
Level 3
you must enable them first via a define flag:
project properies -> c/c++ build -> settings -> tool settings/compiler/preprocessor/ -> defined sybols -D add the following: "XMC_ASSERT_ENABLE"
0 Likes
Not applicable
Brilliant, thanks Andy, I've just tried, and indeed my software now 'while(1) cycles' within 'XMC_AssertHandler' in xmc_common.c, if I include eg 'XMC_ASSERT("hi", 1==1);' in my code. I thought I'd see "hi' in the console, oh well. I checked also 'XMC_ASSERT("hi", 1==0);', and that doesn't cause 'while(1) cycle'.
0 Likes