System Services
5-14
5.2.2
Handling Errors
SYS_error is used to handle DSP/BIOS error conditions as shown in
Example 5-13. Application programs as well as internal functions use
SYS_error to handle program errors.
Example 5-13.
DSP/BIOS Error Handling
SYS_error uses whatever function is bound to the Error function property to
handle error conditions. The default error function in the configuration
template is _UTL_doError, which logs an error message. In Example 5-14,
Error function can be configured to use doError which uses LOG_error to
print the error number and associated error string.
Example 5-14.
Using doError to Print Error Information
The errno parameter to SYS_error can be a DSP/BIOS error (for example,
SYS_EALLOC) or a user error (errno >= 256). See
TMS320 DSP/BIOS API
Reference Guide
for your platform for a table of error codes and strings.
Note:
Error checking that would increase memory and CPU requirements has
been kept to a minimum in the DSP/BIOS APIs. Instead, the API reference
documentation specifies constraints for calling DSP/BIOS API functions. It
is the responsibility of the application developer to meet these constraints.
Void SYS_error(s, errno, ...)
String s;
Uns errno;
Void doError(String s, Int errno, va_list ap)
{
LOG_error("SYS_error called: error id = 0x%x", errno);
LOG_error("SYS_error called: string = '%s'", s);
}
Summary of Contents for TMS320 Series
Page 1: ...TMS320 DSP BIOS v5 40 User s Guide Literature Number SPRU423G April 2009 ...
Page 16: ...xvi ...
Page 152: ...Tasks 4 48 Figure 4 12 Trace from Example 4 7 ...
Page 168: ...Semaphores 4 64 Figure 4 14 Trace Results from Example 4 11 ...
Page 202: ...5 20 ...
Page 287: ...Index 9 Index Void 1 11 W words data memory 3 15 of code 1 5 wrapper function 2 29 ...
Page 288: ...Index 10 Index ...