Page 1 of 1

osalDbgAssert gives wrong error string

Posted: Sat May 10, 2014 4:05 pm
by Korken
Hi,

I am using ChibiStudio to debug my application and a osalDbgAssert fails.
The problem is that the string specified in my osalDbgAssert is "TIM9 and TIM12 does not have CCR2", but when I look at the message in the debugger I get "eicu_lld_start" (which is the name of the function).
Why am I not getting the specified message so it is possible to know which assert that failed?

Code:

Code: Select all

osalDbgAssert((eicup->config->iccfgp[2] != NULL) && (eicup->config->iccfgp[3] != NULL), "TIM9 and TIM12 does not have CCR2");

Debug result: http://s13.postimg.org/68bietdz9/problem.png

Running ChibiStudio 3.0.0unstable

Thanks in advance!

Best Regards
Emil

Re: osalDbgAssert gives wrong error string

Posted: Sat May 10, 2014 4:10 pm
by Giovanni
Hi,

The description string is not used by the default assert implementation. The implementation can be overridden if you need a more complex errors handling.

Giovanni

Re: osalDbgAssert gives wrong error string

Posted: Sat May 10, 2014 4:34 pm
by Korken
Hi Giovanni, thanks for the quick reply!

Should this not be in the standard implementation? Or is there any problem for it to be there?

Re: osalDbgAssert gives wrong error string

Posted: Sat May 10, 2014 6:53 pm
by Giovanni
The problem is size, those strings are long.

Giovanni

Re: osalDbgAssert gives wrong error string

Posted: Sat May 10, 2014 7:06 pm
by Korken
I see. But aren't they saved in flash? A few kB that can be removed when you disable the debug option.
But perhaps this is still a problem for the smaller MCUs?

Re: osalDbgAssert gives wrong error string

Posted: Sat May 10, 2014 7:14 pm
by Giovanni
Not just that, the system has to fit in a small area when using some commercial code-limited compilers.

Giovanni

Re: osalDbgAssert gives wrong error string

Posted: Sat May 10, 2014 8:01 pm
by Korken
Indeed you are correct! As you say, it's probably best to make your own Assert function or have a flag for "extended debugging".