Go to the first, previous, next, last section, table of contents.

Error Handling

There are two types of errors that can happen when working with IC: compile-time errors and run-time errors.

Compile-time errors occur during the compilation of the source file. They are indicative of mistakes in the C source code. Typical compile-time errors result from incorrect syntax or mis-matching of data types.

Run-time errors occur while a program is running on the board. They indicate problems with a valid C form when it is running. A simple example would be a divide-by-zero error. Another example might be running out of stack space, if a recursive procedure goes too deep in recursion.

These types of errors are handled differently, as is explained below.

Compile-Time Errors

When compiler errors occur, an error message is printed to the screen. All compile-time errors must be fixed before a file can be downloaded to the board.

Run-Time Errors

When a run-time error occurs, an error message is displayed on the LCD screen indicating the error number. If the board is hooked up to IC when the error occurs, a more verbose error message is printed on the terminal.

Here is a list of the run-time error codes:

1
no stack space for start_process()
2
no process slots remaining
3
array reference out of bounds
4
stack overflow error in running process
5
operation with invalid pointer
6
floating point underflow
7
floating point overflow
8
floating point divide-by-zero
9
number too small or large to convert to integer
10
tried to take square root of negative number
11
tangent of 90 degrees attempted
12
log or ln of negative number or zero
15
floating point format error in printf
16
integer divide-by-zero

Go to the first, previous, next, last section, table of contents.