Is there a way to patch the assert?

Asked by clonephone82

Hi,

How does the assert macro works?

I am a STM32 dev and I would like to use the Standard assert if possible but I need to redirect the failure to serial port or lcd.
So is it possible to redefine the macro?

many thanks

Question information

Language:
English Edit question
Status:
Solved
For:
GNU Arm Embedded Toolchain Edit question
Assignee:
No assignee Edit question
Solved by:
john
Solved:
Last query:
Last reply:
Revision history for this message
Best john (jkovach) said :
#1

You can simply define your own __assert_func:
void __assert_func(const char *file, int line, const char *func, const char *failedexpr)
{
...
}
I tried it, works for me.

Revision history for this message
clonephone82 (ecam) said :
#2

Thanks john, that solved my question.