主题中讨论的其他器件:TMS570LS3137
大家好、我正在使用 TMS570LS3137 HDK、并需要对 SCI2/Lin 端口使用多缓冲区。
我已经将我的项目与一些简单的测试代码相关联。
如果我 在 scilinREG->GCR1中设置 mbuf_mode、则不会发送字符。
如果我没有设置 mbuf_mode、则传输字符。
scilinREG->GCR1 |=(UINT32)((UINT32) 1U <<10U);// mbuf_mode,这行代码使事情停止工作
在项目中、我添加了该行、
scilinREG->GCR1 |=(UINT32)((UINT32) 1U << 10U);
到 sci.c 中的 sciInit()。
在 sci.c scilinREG->format = 0x00030007;// length = 4中,buffer length 设置为4。
下面是我的测试代码:
sciInit();
///初始化后等待空闲--这是在 sciInit ()后需要的,以使事情工作
while (sciIsIdleDetected (scilinREG));
//观察 CCS 终端上的字符
while (!sciIsTxReady (scilinREG));
scilinREG->TD =(uint32)'a';
while (!sciIsTxReady (scilinREG));
scilinREG->td =(uint32)'b';
while (!sciIsTxReady (scilinREG));
scilinREG->td =(uint32)'c';
while (!sciIsTxReady (scilinREG));
scilinREG->td =(UINT32)'d';
while (!sciIsTxReady (scilinREG));
scilinREG->TD =(uint32)'e';
项目当前设置为传输 CCS 终端、但我也尝试了设置环回位并进行 SCI 读取、但结果是相同的:如果 mbuf_mode=0、则没问题、如果 mbuf_mode=1、则不会传输任何内容 。
我很确定我错过了一些简单的东西、但我在论坛中的搜索并没有显示任何内容。
非常感谢您的帮助、
此致、

