Other Parts Discussed in Thread: C2000WARE
Tool/software:
my board is 280039C Launchpad, i use the MCAN Examples mcan_ex9_transmit t o test;
I find that when i set txMsg[loopCnt].brs = 1U; the canfd stufferr occurred, if i set the BRS is 0,there is no strufferr,and the data is successfully send;
the versions is C2000Ware_5_04_00_00;
besides, i build a new project with sysyconfig 1.23, and send message by the cputimer0 ISR, the situation is the same,while i set the txMsg[loopCnt].brs = 0U; there is no err;
void myMCAN0_init(){
MCAN_RevisionId revid_myMCAN0;
MCAN_InitParams initParams_myMCAN0;
MCAN_ConfigParams configParams_myMCAN0;
MCAN_MsgRAMConfigParams msgRAMConfigParams_myMCAN0;
MCAN_BitTimingParams bitTimes_myMCAN0;
//
// Initialize MCAN Init parameters.
//
initParams_myMCAN0.fdMode = true;
initParams_myMCAN0.brsEnable = true;
initParams_myMCAN0.txpEnable = false;
initParams_myMCAN0.efbi = true;
initParams_myMCAN0.pxhddisable = true;
initParams_myMCAN0.darEnable = false;
initParams_myMCAN0.wkupReqEnable = false;
initParams_myMCAN0.autoWkupEnable = false;
initParams_myMCAN0.emulationEnable = false;
initParams_myMCAN0.tdcEnable = true;
initParams_myMCAN0.wdcPreload = 255;
//
// Transmitter Delay Compensation parameters.
//
initParams_myMCAN0.tdcConfig.tdcf = 10;
initParams_myMCAN0.tdcConfig.tdco = 6;
//
// Initialize MCAN Config parameters.
//
configParams_myMCAN0.monEnable = false;
configParams_myMCAN0.asmEnable = false;
configParams_myMCAN0.tsPrescalar = 15;
configParams_myMCAN0.tsSelect = 0;
configParams_myMCAN0.timeoutSelect = MCAN_TIMEOUT_SELECT_CONT;
configParams_myMCAN0.timeoutPreload = 65535;
configParams_myMCAN0.timeoutCntEnable = false;
configParams_myMCAN0.filterConfig.rrfs = false;
configParams_myMCAN0.filterConfig.rrfe = false;
configParams_myMCAN0.filterConfig.anfe = 0;
configParams_myMCAN0.filterConfig.anfs = 0;
//
// Initialize Message RAM Sections Configuration Parameters.
//
msgRAMConfigParams_myMCAN0.flssa = myMCAN0_MCAN_STD_ID_FILT_START_ADDR;
//
// Standard ID Filter List Start Address.
//
msgRAMConfigParams_myMCAN0.lss = myMCAN0_MCAN_STD_ID_FILTER_NUM;
//
// List Size: Standard ID.
//
msgRAMConfigParams_myMCAN0.flesa = myMCAN0_MCAN_EXT_ID_FILT_START_ADDR;
//
// Extended ID Filter List Start Address.
//
msgRAMConfigParams_myMCAN0.lse = myMCAN0_MCAN_EXT_ID_FILTER_NUM;
//
// List Size: Extended ID.
//
msgRAMConfigParams_myMCAN0.txStartAddr = myMCAN0_MCAN_TX_BUFF_START_ADDR;
//
// Tx Buffers Start Address.
//
msgRAMConfigParams_myMCAN0.txBufNum = myMCAN0_MCAN_TX_BUFF_SIZE;
//
// Number of Dedicated Transmit Buffers.
//
msgRAMConfigParams_myMCAN0.txFIFOSize = 0;
msgRAMConfigParams_myMCAN0.txBufMode = 0;
msgRAMConfigParams_myMCAN0.txBufElemSize = 7;
//
// Tx Buffer Element Size.
//
msgRAMConfigParams_myMCAN0.txEventFIFOStartAddr = myMCAN0_MCAN_TX_EVENT_START_ADDR;
//
// Tx Event FIFO Start Address.
//
msgRAMConfigParams_myMCAN0.txEventFIFOSize = myMCAN0_MCAN_TX_EVENT_SIZE;
//
// Event FIFO Size.
//
msgRAMConfigParams_myMCAN0.txEventFIFOWaterMark = 0;
//
// Level for Tx Event FIFO watermark interrupt.
//
msgRAMConfigParams_myMCAN0.rxFIFO0startAddr = myMCAN0_MCAN_FIFO_0_START_ADDR;
//
// Rx FIFO0 Start Address.
//
msgRAMConfigParams_myMCAN0.rxFIFO0size = myMCAN0_MCAN_FIFO_0_NUM;
//
// Number of Rx FIFO elements.
//
msgRAMConfigParams_myMCAN0.rxFIFO0waterMark = 0; // Rx FIFO0 Watermark.
msgRAMConfigParams_myMCAN0.rxFIFO0OpMode = 0;
msgRAMConfigParams_myMCAN0.rxFIFO1startAddr = myMCAN0_MCAN_FIFO_1_START_ADDR;
//
// Rx FIFO1 Start Address.
//
msgRAMConfigParams_myMCAN0.rxFIFO1size = myMCAN0_MCAN_FIFO_1_NUM;
//
// Number of Rx FIFO elements.
//
msgRAMConfigParams_myMCAN0.rxFIFO1waterMark = 0; // Level for Rx FIFO 1
// watermark interrupt.
msgRAMConfigParams_myMCAN0.rxFIFO1OpMode = 0; // FIFO blocking mode.
msgRAMConfigParams_myMCAN0.rxBufStartAddr = myMCAN0_MCAN_RX_BUFF_START_ADDR;
//
// Rx Buffer Start Address.
//
msgRAMConfigParams_myMCAN0.rxBufElemSize = 7;
//
// Rx Buffer Element Size.
//
msgRAMConfigParams_myMCAN0.rxFIFO0ElemSize = 7;
//
// Rx FIFO0 Element Size.
//
msgRAMConfigParams_myMCAN0.rxFIFO1ElemSize = 7;
//
// Rx FIFO1 Element Size.
//
//
// Initialize bit timings.
//
bitTimes_myMCAN0.nomRatePrescalar = 3; // Nominal Baud Rate Pre-scaler.
bitTimes_myMCAN0.nomTimeSeg1 = 9; // Nominal Time segment before sample point.
bitTimes_myMCAN0.nomTimeSeg2 = 8; // Nominal Time segment after sample point.
bitTimes_myMCAN0.nomSynchJumpWidth = 7; // Nominal (Re)Synchronization Jump Width Range.
bitTimes_myMCAN0.dataRatePrescalar = 1; // Data Baud Rate Pre-scaler.
bitTimes_myMCAN0.dataTimeSeg1 = 9; // Data Time segment before sample point.
bitTimes_myMCAN0.dataTimeSeg2 = 8; // Data Time segment after sample point.
bitTimes_myMCAN0.dataSynchJumpWidth = 7; // Data (Re)Synchronization Jump Width.
//
// Get MCANSS Revision ID.
//
MCAN_getRevisionId(myMCAN0_BASE, &revid_myMCAN0);
//
// Wait for Memory initialization to be completed.
//
while(0 == MCAN_isMemInitDone(myMCAN0_BASE));
//
// Put MCAN in SW initialization mode.
//
MCAN_setOpMode(myMCAN0_BASE, MCAN_OPERATION_MODE_SW_INIT);
//
// Wait till MCAN is not initialized.
//
while (MCAN_OPERATION_MODE_SW_INIT != MCAN_getOpMode(myMCAN0_BASE));
//
// Initialize MCAN module.
//
MCAN_init(myMCAN0_BASE, &initParams_myMCAN0);
//
// Configure MCAN module.
//
MCAN_config(myMCAN0_BASE, &configParams_myMCAN0);
//
// Configure Bit timings.
//
MCAN_setBitTime(myMCAN0_BASE, &bitTimes_myMCAN0);
//
// Configure Message RAM Sections
//
MCAN_msgRAMConfig(myMCAN0_BASE, &msgRAMConfigParams_myMCAN0);
//
// Internal loopback mode
//
MCAN_lpbkModeEnable(myMCAN0_BASE, MCAN_LPBK_MODE_EXTERNAL, false);
//
// Take MCAN out of the SW initialization mode
//
MCAN_setOpMode(myMCAN0_BASE, MCAN_OPERATION_MODE_NORMAL);
while (MCAN_OPERATION_MODE_NORMAL != MCAN_getOpMode(myMCAN0_BASE));
}



