1.下载这几个文件,也可以在Jscope的安装路径下找到。
char JS_RTT_UpBuffer[4096]; // J-Scope RTT Buffer
int JS_RTT_Channel = 1; // J-Scope RTT Channel
上面的缓存大小可以给小点512也行。
SEGGER_RTT_ConfigUpBuffer(JS_RTT_Channel, "JScope_I4I4I4", &JS_RTT_UpBuffer[0], sizeof(JS_RTT_UpBuffer), SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL);
5.#pragma pack(push, 1)
struct {
signed int Sine1;
signed int Sine2;
signed int Sine3;
} acValBuffer;
#pragma pack(pop)
上面是你要发送的结构体,自己定义
6.在你要发送的地方赋值并发送,例如在ADC中断
acValBuffer.Sine1 = ia;
acValBuffer.Sine2 = ib;
acValBuffer.Sine3 = ic;
SEGGER_RTT_Write(JS_RTT_Channel, &acValBuffer, sizeof(acValBuffer));
#pragma pack(push, 1)
struct {
signed int Sine1;
signed int Sine2;
short Sine3;
short Sine4;
} acValBuffer;
#pragma pack(pop)
那么对应的初始化要改"JScope_I4I4I4"这个参数就要改成"JScope_I4I4I2I2"
8.还有一个更重要的!那就是如果发送频率过快,快卡死,卡在一个循环里。SEGGER_RTT.c这个文件的_WriteBlocking函数要做修改。
if(0 == NumBytesToWrite)
NumBytesToWrite =1;
联系客服