我是用範例程式,CAN_EX3_loopback_DMA。
我發現為什麼RAM存取位址會有重複兩次的data??
沒辦法設定成如果傳 4個byte就只存 4個byte嗎?
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.
请您看一下例程中下面的代码
//
// Check for data integrity
//
for(i = 0; i < 2; i++)
{
//
// Combine two bytes of CAN TX data into a single word for error
// checking since the DMA transfers data as words into the RX buffer.
//
txWordData = txMsgData[txIndex] + (txMsgData[txIndex + 1] << 8U);
if(rxMsgData[i] != txWordData)
{
// Something went wrong. rxMsgData doesn't contain expected data.
ESTOP0;
}
txIndex+=2;
}
而
// Place buffers in GSRAM #pragma DATA_SECTION(txMsgData, "ramgs0"); #pragma DATA_SECTION(rxMsgData, "ramgs0");