Home |
RTKernel-32 Programming Manual Multitasking, Real-Time, and RTKernel-32 Alternate APIs for RTKernel-32 RTKernel-32's Debug Version Preemptive or Cooperative Multitasking? Starting Objects' Methods as Tasks Performance and Interrupt Response Times Task Switches in Cooperative Scheduling Using the FPU in Interrupt Handlers |
RTKernel-32's Debug VersionDuring the program development phase, the Debug Version of RTKernel-32 should be used by all means. It contains additional code to recognize a number of error conditions. If an error occurs, the program is aborted with an error message. Moreover, the Debug Version can determine at which source code position a task is suspended. Also, it can calculate the CPU time usage of tasks and interrupts. To locate persistent bugs, it features the real-time Kernel Tracer, which can also be used by the application. Naturally, the Debug Version will not perform as fast as RTKernel-32's Standard Version. The only reason not to use the Debug Version during the testing phase could be the higher interrupt latency. To change the version used, a program need not be recompiled; relinking is sufficient. To use the Debug Version, link library Rtk32.lib (or Rtk32mp.lib for the multiprocessor kernel). The Standard Version is selected by linking Rtk32s.lib or Rtk32mps.lib instead. In the Debug Version, function RTKernelInit will display the message RTKernel-32 Debug Version to inform the programmer that the Debug Version is being used. The Debug Version's exit function will display the message RTKernel-32 exit function If this message is not displayed, execution of the exit function has been aborted, RTKernel-32 was unable to restore the interrupt vectors, and the system may be in an unstable state. During execution of an RTKernel-32 application, the Debug Version checks the following conditions:
If a check fails, the program is aborted with an error message. All error messages are listed in section Error and Information Messages. In addition to run-time checks, the Debug Version also writes kernel tracer entries into the trace buffer for every task state change and all semaphore, mailbox, and spinlock operations. Depending on RTKConfig flags, it can accumulate the CPU time consumed by tasks, interrupts handlers, and spinlock (see functions RTKTaskInfo, RTKIRQInfo, and RTKGetSpinlockTime).
|