32.2 Configuring Debug Input/Output for the Target And Tool

The debug-support library, for both the APPIN/APPOUT mechanism and the Starter Kit mechanism, works by providing alternate I/O helper functions: _mon_write (), _mon_putc (), and _mon_getc() . These alternate functions use the APPIN/APPOUT or Starter Kit mechanism as requested in the project. These debug-support function implementations override the default helper I/O function implementations.

You can choose which implementation to use by defining a preprocessor symbol. To choose the APPIN/APPOUT implementation, pass the -mappio-debug option to pic32-gcc.exe. To choose the PIC32 Starter Kit implementation, pass -DPIC32_STARTER_KIT to the compiler shell. Also use #include <p32xxxx.h> to include the generic header file in your source code.

With one of the above options passed to the compiler and the sys/appio.h include file added to your source code, the debugging-support library provides alternate I/O helper functions to the linker. These alternate I/O helper functions redirect stdin and stdout to the appropriate debugging mechanism. Standard I/O functions now use the selected mechanism.