This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

串口调试



调试过程中经常需要打印调试信息,一般使用C标准库函数printf函数,但是DSP库函数占用内存空间太大,且耗时太大。故自己编写以下串口打印函数,此函数在51系列和430系列单片机调试时都很顺利,但是在F2812中运行到此函数时就进入非法中断,一直不得其解。刚开始学习DSP,请问问题出在何处。在此先谢过! 以下是部分源代码:

#include "DSP28_Device.h"

#include <string.h>

#include <stdarg.h>

#include <stdio.h>

#include <stdlib.h>

static char string[128];

void Sci_printf(const char * fmt,...)

{ va_list ap; va_start(ap,fmt);

vsprintf(string,fmt,ap);//

Sci_sendstring(string);

va_end(ap);

}