1. 的options 下定义全局的宏 _DLIB_FILE_DESCRIPTOR
2. 然后在程序中 include <stdio.h>
3. 重写回调函数,  根据实际情况选择串口USARTn,
int fputc(int ch, FILE *f)
{
  /* Place your implementation of fputc here */
  /* Loop until the end of transmission */
模拟串口使用printf函数  while (USART_GetFlagStatus(USARTn, USART_FLAG_TC) == RESET)
  {}
 
  /* write a character to the USART */
  USART_SendData(USARTn, (uint8_t) ch);
  return ch;
}
4. 到现在为止,你就可以使用 printf() 函数了,如果你想让该串接口能接收数据,你还必须重写回调函数: 
              Int GetKey (void)  {
                  while (!(USARTn->SR & USART_FLAG_RXNE));
              return ((int)( USARTn->DR & 0x1FF));
          }
5. 将Int GetKey (void)接收结果,从串接发送出去,就可以实现超级终端的回显了。