To use the shell interface with a serial port there are a couple things that need to be edited in the twrk60n512.h file and the userconfig.h file
First the corresponding channel in the userconfig.h file needs to be initialized
#define BSPCFG_ENABLE_TTYD 1
Second the BSP_DEFAULT_IO_CHANNEL needs to be set up for the "ttyd:" in these lines in the twrk60n512.h file
#ifndef BSP_DEFAULT_IO_CHANNEL/* * Other Serial console options:(do not forget to enable BSPCFG_ENABLE_TTY define if changed) * "ttyf:" OSJTAG-COM polled mode * "ittyf:" OSJTAG-COM interrupt mode * "ttyd:" TWR-SER polled mode * "ittyd:" TWR-SER interrupt mode */ #if BSPCFG_ENABLE_TTYD #define BSP_DEFAULT_IO_CHANNEL "ttyd:" /* TWR-SER polled mode */ #define BSP_DEFAULT_IO_CHANNEL_DEFINED #else #define BSP_DEFAULT_IO_CHANNEL NULL #endif#endif
This will direct all the printf's used to the ttyd serial port, so then you can initialize the Shell
Shell(Shell_commands, NULL);
and it will be over the serial port. You will also have to recompile the BSP to incorporate the changes made in the userconfig.h and twrk60n512.h files.
Jeremy