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.

TM4C中的DMA 发送出现异常

Hi,

我在用DMA发送数据的时候,当我发送的字符串比较长(我暂时是这么理解的)的时候,会出现发送的字符串前面17个左右的字符是正常的,后面的就是乱码。我发送的字符串内容及定义方式为:

#define SEND_DATATCP_CONNECT "AT+CIPSTART=\"TCP\",\"server.ceinware.com\",\"3333\"\r"

在串口调试助手上面显示的内容为:AT+CIPSTART="TCP"(后面的为空,用十六进制显示的话,这后面的就是写乱码,字符串长度是对的)

DMAUART0SendDat(SEND_DATATCP_CONNECT, 47);

DMA发送函数为:

void DMAUART0SendDat(const uint8_t *pui8Buffer, uint32_t Lenth)
{
uint8_t dat[100];
uint8_t index,i=0;
uint32_t ulMode=0;
index=Lenth;
while(index--)
{
dat[i++]=*(pui8Buffer++);
}

ulMode = uDMAChannelModeGet(UDMA_CHANNEL_UART0TX | UDMA_PRI_SELECT);
while(!(ulMode == UDMA_MODE_STOP))
{
}
uDMAChannelTransferSet(UDMA_CHANNEL_UART0TX | UDMA_PRI_SELECT,
UDMA_MODE_BASIC,dat,
(void *)(UART0_BASE + UART_O_DR),
Lenth);
Systick_SetCellTaskTimer(130);
while(Systick_GetCellTaskTimer()>0)
{
}
uDMAChannelEnable(UDMA_CHANNEL_UART0TX);
}