A better ASSERT

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

A better ASSERT

974 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by briand on Thu Sep 23 16:23:09 MST 2010
Is there an instruction or register that can be used to cause the processor to break into the debugger?  I see ASSERT written with while(1) in example code, but I would imagine there's something more direct than having to hit pause just to see if you've failed.
0 Kudos
Reply
3 Replies

952 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by briand on Fri Sep 24 14:32:34 MST 2010
Perfect, thanks.
0 Kudos
Reply

952 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Fri Sep 24 03:47:16 MST 2010
Yes, I'm interested :)

Is this
Quote:
first public beta of the new "Redlib_v2" C library

included in the next release of Windows-LPCXpresso?
0 Kudos
Reply

952 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Fri Sep 24 02:12:41 MST 2010
Assuming you are linking with the semihosted variant of the Redlib C library, then assert has been recoded for the next version of redlib ("Redlib_v2", a beta of which is included within the Linux beta of LPCXpresso) such that it will terminate execution of the program, rather than going in to a while(1) loop.

In the meantime, if you want to cause program termination yourself, then you can call the function from within the semihosting layer of Redlib:

void __exit(void);
Note that this interface to the semihosting layer in Redlib_v2 has unfortunately had to change slightly, and __exit() will become __sys_appexit().

There are a few more notes on Redlib_v2 for anyone who is interested:

http://support.code-red-tech.com/CodeRedWiki/redlib_v2_notes

[Please note that this FAQ is still work in progress.]

Regards,
CodeRedSupport.
0 Kudos
Reply