Breakpoint or loop for configASSERT

I’m using an NXP processor along with their Redlib library. The Redlib assert prints to the UART and then issues a breakpoint. The port of FreeRTOS disables interrupts and then spins in an infinite loop.

I don’t know the relative merits of the infinite loop vs breakpoint are. I could connect the debugger to either situation. Is there something that I have missed that makes one method better than the other?

Thanks!

The FreeRTOS implementation provides an overridable default. Use whatever suits your debugging needs best!

Not all processors support a “breakpoint” instruction, so the examples are less apt to use it, since they try to be as portable as possible. Also, on some processors, a breakpoint instruction might not do what is desired if no debugger is connected. The infinite loop will ALWAYS hand the system so is a good portable method.

2 Likes