Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
Hi.,
...I want to use all 64 message for receiving can frame....Is it possible to use all 64 message object !!


Best Regards,
Irfan.
0 Likes
12 Replies
lock attach
Attachments are accessible only for community members.
Travis
Employee
Employee
First solution authored Welcome! 500 replies posted
Yes it is possible, please see attached example. There is a ppt in the folder which describe the process of creating more than 10 msg obj by modifying the DAVE3 codings.
0 Likes
User6793
Level 4
Level 4
Does this enable all MOs as an RX FIFO as well?
I spent quite a long time setting up the FIFO that was unsupported by Dave at that time.
If you need the code I'm happy to share 🙂

Cheers
0 Likes
User5327
Level 4
Level 4
Travis wrote:
Yes it is possible, please see attached example. There is a ppt in the folder which describe the process of creating more than 10 msg obj by modifying the DAVE3 codings.


Where is that ppt file pls?
0 Likes
Not applicable
Thanks Travis !!
But i didnt find any ppt along with it..!!
0 Likes
User6793
Level 4
Level 4
I will share the code I use for setting up two RX FIFOs, one for two different base MOs with separate HW message filters.
There are 64 MOs all together and one really have to read the parts describing CAN FIFO and List pointers in the reference manual very carefully.
I found it very useful during the debug phase of this code to make a CLI command that shows the value of the various registers.
The code runs under freeRTOS, but it should be quite easy to adapt to other needs.
Hope someone finds it useful.

Here is the output from the CLI 'can status'

>can status
CAN node status:
LEC:NO ERROR
CAN MO status:
Message object 1: (TX base)
Message object 2: (RX base) Acceptance filter ID 0xA3002A00 MASK 0x3FFFFF80
Message object 3: (RX GL base) Acceptance filter ID 0xA3000000 MASK 0x3FFFFF80
Message object 4: (RX slave MO)
Message object 5: (RX slave MO)
Message object 6: (RX slave MO)
Message object 7: (RX slave MO)
Message object 8: (RX slave MO)
Message object 9: (RX slave MO)
Message object 10: (RX slave MO)
Message object 11: (RX slave MO)
Message object 12: (RX slave MO)
Message object 13: (RX slave MO)
Message object 14: (RX slave MO)
Message object 15: (RX slave MO)
Message object 16: (RX slave MO)
Message object 17: (RX slave MO)
Message object 18: (RX slave MO)
Message object 19: (RX slave MO)
Message object 20: (RX slave MO)
Message object 21: (RX slave MO)
Message object 22: (RX slave MO)
Message object 23: (RX slave MO)
Message object 24: (RX slave MO)
Message object 25: (RX slave MO)
Message object 26: (RX slave MO)
Message object 27: (RX slave MO)
Message object 28: (RX slave MO)
Message object 29: (RX slave MO)
Message object 30: (RX slave MO)
Message object 31: (RX slave MO)
Message object 32: (RX slave MO)
Message object 33: (RX slave MO)
Message object 34: (RX GL slave MO)
Message object 35: (RX GL slave MO)
Message object 36: (RX GL slave MO)
Message object 37: (RX GL slave MO)
Message object 38: (RX GL slave MO)
Message object 39: (RX GL slave MO)
Message object 40: (RX GL slave MO)
Message object 41: (RX GL slave MO)
Message object 42: (RX GL slave MO)
Message object 43: (RX GL slave MO)
Message object 44: (RX GL slave MO)
Message object 45: (RX GL slave MO)
Message object 46: (RX GL slave MO)
Message object 47: (RX GL slave MO)
Message object 48: (RX GL slave MO)
Message object 49: (RX GL slave MO)
Message object 50: (RX GL slave MO)
Message object 51: (RX GL slave MO)
Message object 52: (RX GL slave MO)
Message object 53: (RX GL slave MO)
Message object 54: (RX GL slave MO)
Message object 55: (RX GL slave MO)
Message object 56: (RX GL slave MO)
Message object 57: (RX GL slave MO)
Message object 58: (RX GL slave MO)
Message object 59: (RX GL slave MO)
Message object 60: (RX GL slave MO)
Message object 61: (RX GL slave MO)
Message object 62: (RX GL slave MO)
Message object 63: (RX GL slave MO)

MSID0 0x00000000 MSPND index (0x00000020 = none)
MSID1 0x00000020 MSPND index (0x00000020 = none)
MSID2 0x00000020 MSPND index (0x00000020 = none)
MSID3 0x00000020 MSPND index (0x00000020 = none)
MSID4 0x00000020 MSPND index (0x00000020 = none)
MSID5 0x00000020 MSPND index (0x00000020 = none)
MSID6 0x00000020 MSPND index (0x00000020 = none)
MSID7 0x00000020 MSPND index (0x00000020 = none)
MSIMASK 0x3FFFFFFF
MSPND0 0x00000001 pending MOs
MSPND1 0x00000000 pending MOs
MSPND2 0x00000000 pending MOs
MSPND3 0x00000000 pending MOs
MSPND4 0x00000000 pending MOs
MSPND5 0x00000000 pending MOs
MSPND6 0x00000000 pending MOs
MSPND7 0x00000000 pending MOs
MO1 0x031F2003 base MO pointers SEL/CUR/TOP/BOT
MO2 0x21213E21 base MO pointers SEL/CUR/TOP/BOT
LIST0 0x00003F3F LIST register
LIST1 0x01000000 LIST register
LIST2 0x00020200 LIST register
LIST3 0x01000000 LIST register
LIST4 0x001D2003 LIST register
LIST5 0x001D3E21 LIST register
LIST6 0x01000000 LIST register
LIST7 0x01000000 LIST register

NSR 0x00000018
TXq 00000000


TX counter : 00001096
RX counter : 00000028
0 Likes
User6793
Level 4
Level 4
Code for status printout:
void Can::showStatus(void) {
int i;

printf("CAN node status:\n");

if (CAN001_GetNodeFlagStatus(canHandle_, CAN001_ALERT_STATUS) == CAN_SET)
printf("\t\tALERT_STATUS\n");
if (CAN001_GetNodeFlagStatus(canHandle_, CAN001_ERROR_WARN_STATUS) == CAN_SET)
printf("\t\tERROR_WARN_STATUS\n");
if (CAN001_GetNodeFlagStatus(canHandle_, CAN001_BUS_OFF_STATUS) == CAN_SET)
printf("\t\tBUS_OFF_STATUS\n");
if (CAN001_GetNodeFlagStatus(canHandle_, CAN001_LIST_LENGTH_ERROR) == CAN_SET)
printf("\t\tLIST_LENGTH_ERROR\n");
if (CAN001_GetNodeFlagStatus(canHandle_, CAN001_LIST_OBJECT_ERROR) == CAN_SET)
printf("\t\tLIST_OBJECT_ERROR\n");

switch(canHandle_->CanNodeRegs->NSR & 0x00000007) {
case 0: printf("\t\tLEC:NO ERROR\n"); break;
case 1: printf("\t\tLEC:STUFF ERROR\n"); break;
case 2: printf("\t\tLEC:FORM ERROR\n"); break;
case 3: printf("\t\tLEC:ACK ERROR\n"); break;
case 4: printf("\t\tLEC:BIT1 ERROR\n"); break;
case 5: printf("\t\tLEC:BIT0 ERROR\n"); break;
case 6: printf("\t\tLEC:CRC ERROR\n"); break;
default:
break;
}

printf("CAN MO status:\n");

for (i=1; i<=CAN_RX_FIFO_DEPTH+CAN_RX_GL_FIFO_DEPTH+3; i++) {
switch(i) {
case 1: printf("\tMessage object %d: (TX base)\n", i); break;
case 2: printf("\tMessage object %d: (RX base) ", i);
printf("Acceptance filter ID 0x%08x MASK 0x%08x\n", CAN_MO1->MOAR, CAN_MO1->MOAMR);
break;
case 3: printf("\tMessage object %d: (RX GL base) ", i);
printf("Acceptance filter ID 0x%08x MASK 0x%08x\n", CAN_MO2->MOAR, CAN_MO2->MOAMR);
break;
default:
if (i<=CAN_RX_FIFO_DEPTH+3)
printf("\tMessage object %d: (RX slave MO)\n", i);
else
printf("\tMessage object %d: (RX GL slave MO)\n", i);
break;
}

if (CAN001_GetMOFlagStatus(canHandle_,i, RECEIVE_PENDING) == CAN_SET)
printf("\t\tMO-RECEIVE_PENDING\n");
if (CAN001_GetMOFlagStatus(canHandle_,i, TRANSMIT_PENDING) == CAN_SET)
printf("\t\tMO-TRANSMIT_PENDING\n");
if (CAN001_GetMOFlagStatus(canHandle_,i, NEW_DATA) == CAN_SET)
printf("\t\tMO_NEW_DATA\n");
if (CAN001_GetMOFlagStatus(canHandle_,i, MESSAGE_LOST) == CAN_SET)
printf("\t\tMO_MESSAGE_LOST\n");
}


printf("\n");
for (i=0; i<8; i++)
printf("MSID%d 0x%08x MSPND index (0x00000020 = none)\n", i, CAN->MSID);
printf("MSIMASK 0x%08x\n", CAN->MSIMASK);

for (i=0; i<8; i++)
printf("MSPND%d 0x%08x pending MOs\n", i, CAN->MSPND);
printf("MO%d 0x%08x base MO pointers SEL/CUR/TOP/BOT\n", 1, CAN_MO1->MOFGPR);
printf("MO%d 0x%08x base MO pointers SEL/CUR/TOP/BOT\n", 2, CAN_MO2->MOFGPR);

#if 0
printf("\n");
printf("CAN->MCR 0x%08x\n",CAN->MCR);
printf("CAN_MO0->MOIPR 0x%08x (TX base)\n",CAN_MO0->MOIPR);
printf("CAN_MO1->MOIPR 0x%08x (RX base)\n",CAN_MO1->MOIPR);
printf("CAN_MO2->MOIPR 0x%08x (RX GL base)\n",CAN_MO2->MOIPR);
for (i=0; i if (i printf("CAN_MO%d->MOIPR 0x%08x (RX slave)\n",i+3,((CAN_MO_TypeDef *)(m_ptrMObase+(i*0x20)))->MOIPR);
else
printf("CAN_MO%d->MOIPR 0x%08x (RX GL slave)\n",i+3,((CAN_MO_TypeDef *)(m_ptrMObase+(i*0x20)))->MOIPR);
}

for (i=0; i<(CAN_RX_FIFO_DEPTH+CAN_RX_GL_FIFO_DEPTH+1); i++) {
if (i printf("CAN_MO%d->MOFGPR 0x%08x (RX slave)\n",i+3,((CAN_MO_TypeDef *)(m_ptrMObase+(i*0x20)))->MOFGPR);
else
printf("CAN_MO%d->MOFGPR 0x%08x (RX GL slave)\n",i+3,((CAN_MO_TypeDef *)(m_ptrMObase+(i*0x20)))->MOFGPR);
}
for (i=0; i<(CAN_RX_FIFO_DEPTH+CAN_RX_GL_FIFO_DEPTH+1); i++) {
if (i printf("CAN_MO%d->MOSTAT 0x%08x (RX slave)\n",i+3,((CAN_MO_TypeDef *)(m_ptrMObase+(i*0x20)))->MOSTAT);
else
printf("CAN_MO%d->MOSTAT 0x%08x (RX GL slave)\n",i+3,((CAN_MO_TypeDef *)(m_ptrMObase+(i*0x20)))->MOSTAT);
}
#endif

for (i=0; i<8; i++)
printf("LIST%d 0x%08x LIST register\n", i, CAN->LIST);

printf("\n");
printf("NSR 0x%08x\n", canHandle_->CanNodeRegs->NSR);
printf("TXq %08u\n\n", uxQueueMessagesWaiting(txQueue_));
printf("\n");
printf("TX counter : %08ld\n", m_tx_counter);
printf("RX counter : %08ld\n", m_rx_counter);

}
0 Likes
User6793
Level 4
Level 4
Code for FIFO setup. MO1 is TX, MO2 & MO3 are 2x30MO base MOs. MO64 is not used.
It should be possible to use this as a starting point to configure MO1 as the base MO and MO2-64 as slave MOs

// class implementation ------------------------------------------------------
Can::Can(int index, unsigned portBASE_TYPE uxPriority, unsigned short usStackDepth)
{
debugLevel_ = 0;

// Setup handles/instance
switch (index) {
case 0:
instanceName_ = "CAN0";
canHandle_ = &CAN001_Handle0; // MUST use CAN node 1 because of pinning. Only node that can mux to 1.12/1.13. This fact does not reflect in the handle name!

nvicRxHandle_ = &NVIC002_Handle2;
nvicTxHandle_ = &NVIC002_Handle3;

// these message numbers are numbered from 1 to n
txMessageObjectNumber_ = 1;
rxMessageObjectNumber_ = 2;
rxGlMessageObjectNumber_ = 3;

// array with base MO numbers (0..n-1) for use in RX IRQ handler
m_rxfifo_pending_reg[0] = rxMessageObjectNumber_-1;
m_rxfifo_pending_reg[1] = rxGlMessageObjectNumber_-1;

rxMessageHandle_ = &CAN001_MessageHandle0_1;
txMessageHandle_ = &CAN001_MessageHandle0_2;
rxTaskCode_ = vCan0RxTask;

/* Node1 initialization */
CAN001_lNodeInit(&CAN001_Handle0);

/* Enable Node Alert interrupt */
EnableNodeInterrupt(CAN001_Handle0, CAN_ALERT_INTERRUPT);

/* Configuration of TX Pin 1.12 based on User configuration */
/* DEBUG INFO */
//PDR_PD = 0
PORT1->PDR1 &= (~(PORT1_PDR1_PD12_Msk));
PORT1->PDR1 |= ((0 << PORT1_PDR1_PD12_Pos) & \
PORT1_PDR1_PD12_Msk);
/* Configuration of RX Pin 1.13 based on User configuration */
PORT1->IOCR12 |= (0 << 11);

/* LMO1 Initialization */
CAN001_ConfigMsgObj(&CAN001_Handle0, &CAN001_MessageHandle0_1, rxMessageObjectNumber_);
CAN001_ConfigMsgObj(&CAN001_Handle0, &CAN001_MessageHandle0_1, rxGlMessageObjectNumber_);
/* Enable receive interrupt */
EnableMOInterrupt(CAN001_Handle0, CAN_MO_RECEIVE_INTERRUPT, rxMessageObjectNumber_);
EnableMOInterrupt(CAN001_Handle0, CAN_MO_RECEIVE_INTERRUPT, rxGlMessageObjectNumber_);

/* LMO2 Initialization */
CAN001_ConfigMsgObj(&CAN001_Handle0, &CAN001_MessageHandle0_2, txMessageObjectNumber_);
/* Enable transmit interrupt */
EnableMOInterrupt(CAN001_Handle0, CAN_MO_TRANSMIT_INTERRUPT, txMessageObjectNumber_);

/*
* CAN peripheral configuration:
*/
//Node1 configuration:
WR_REG(CAN_NODE1->NCR, CAN_NODE_NCR_CCE_Msk, CAN_NODE_NCR_CCE_Pos, 1); // Configuration Change Enable = 1
WR_REG(CAN_NODE1->NPCR, CAN_NODE_NPCR_RXSEL_Msk, CAN_NODE_NPCR_RXSEL_Pos, RXD_SIGNAL2);
WR_REG(CAN_NODE1->NIPR, CAN_NODE_NIPR_ALINP_Msk, CAN_NODE_NIPR_ALINP_Pos, SRN1);

//Message object 0 configuration:
// these message numbers are numbered from 0 to n-1
WR_REG(CAN_MO0->MOIPR, CAN_MO_MOIPR_TXINP_Msk, CAN_MO_MOIPR_TXINP_Pos, SRN0);

// these message numbers are numbered from 0 to n-1
WR_REG(CAN_MO0->MOIPR, CAN_MO_MOIPR_MPN_Msk, CAN_MO_MOIPR_MPN_Pos, 0x00); // MSPND0
WR_REG(CAN_MO1->MOIPR, CAN_MO_MOIPR_MPN_Msk, CAN_MO_MOIPR_MPN_Pos, 0x20); // MSPND1
WR_REG(CAN_MO2->MOIPR, CAN_MO_MOIPR_MPN_Msk, CAN_MO_MOIPR_MPN_Pos, 0x40); // MSPND2

WR_REG(PORT1->IOCR12, PORT_IOCR_PC0_PCR_Msk, PORT_IOCR_PC0_PCR_Pos, PORT_IOCR_PCR2); /* P1.12 : PORT1_IOCR12_PC12_PCR */
WR_REG(PORT1->IOCR12, PORT_IOCR_PC0_OE_Msk, PORT_IOCR_PC0_OE_Pos, PORT_IOCR_OE1); /* P1.12 : PORT1_IOCR12_PC12_OE */


#ifdef CAN_RX_FIFO
// create list of addressed MSG RX FIFO
for (i=0; i CAN001_lAllocateMOtoNodeList(3, i+3); // this is actually LIST4!

// create list of broadcast MSG RX FIFO
for (i=0; i CAN001_lAllocateMOtoNodeList(4, i+CAN_RX_FIFO_DEPTH+3); // // this is actually LIST5!

m_ptrMObase = CAN_MO3_BASE; // MO0 & MO1 are base objects

// setup MO1
// SEL CUR TOP BOT
CAN_MO1->MOFGPR = (3<<24) | (3<<16)| ((CAN_RX_FIFO_DEPTH+3-1)<<8)| (3<<0);
CAN_MO1->MOFCR |= (1<<18) | (1<<0); // RxFIFO base MMC=1 OVIE=1: RxFIFO_CUR=0--> 0/2 .. CAN_RX_FIFO_DEPTH has been filled ->INT
// TXINP RXINP
CAN_MO1->MOIPR |= (1<<4) | (1<<0); // RxFIFO overflow INT point uses TXINP --> INT_O7

// setup MO2
// SEL CUR TOP BOT
CAN_MO2->MOFGPR = ((CAN_RX_FIFO_DEPTH+3)<<24) | ((CAN_RX_FIFO_DEPTH+3)<<16)| ((CAN_RX_FIFO_DEPTH+CAN_RX_GL_FIFO_DEPTH+3-1)<<8)| ((CAN_RX_FIFO_DEPTH+3)<<0);
CAN_MO2->MOFCR |= (1<<18) | (1<<0); // RxFIFO base MMC=1 OVIE=1: RxFIFO_CUR=0--> 0/2 .. CAN_RX_FIFO_DEPTH has been filled ->INT
// TXINP RXINP
CAN_MO2->MOIPR |= (1<<4) | (1<<0); // RxFIFO overflow INT point uses TXINP --> INT_O7

CAN->MSIMASK = 0;
for (i=0; i CAN->MSIMASK |= (1 << (i));

for (i=0; iMOSTAT 0x3E3D56A9 (RX GL slave)!
{
Peripheral::reserve((uint32_t)(m_ptrMObase+(i*0x20)), instanceName_);
CAN001_MessageHandle0 = &CAN001_MessageHandle0_1; // set RX slave objects equal to RX base object
/* LMOn Initialization */
CAN001_ConfigMsgObj(&CAN001_Handle0, CAN001_MessageHandle0, i+3);

((CAN_MO_TypeDef *)(m_ptrMObase+(i*0x20)))->MOCTR = 0x0000080; // reset RXEN in RxFIFO slave object, so that all Rx goes through Rx_base

if (i < CAN_RX_FIFO_DEPTH) {
// SEL CUR TOP BOT
((CAN_MO_TypeDef *)(m_ptrMObase+(i*0x20)))->MOFGPR = (0<<24) | (1<<16) | (0<<8)| (0<<0);
}
else {
// SEL CUR TOP BOT
((CAN_MO_TypeDef *)(m_ptrMObase+(i*0x20)))->MOFGPR = (0<<24) | (2<<16) | (0<<8)| (0<<0);
}
// OVIE RXIE MMC
((CAN_MO_TypeDef *)(m_ptrMObase+(i*0x20)))->MOFCR |= (0<<18) | (1<<16) | (0<<0); // RxFIFO slave MMC=0

// Copy MOIPR from base objects to slaves. Ensure correct MSPND register & index is used.
if (i < CAN_RX_FIFO_DEPTH)
((CAN_MO_TypeDef *)(m_ptrMObase+(i*0x20)))->MOIPR = CAN_MO1->MOIPR | i << 8;
else
((CAN_MO_TypeDef *)(m_ptrMObase+(i*0x20)))->MOIPR = CAN_MO2->MOIPR | (i-CAN_RX_FIFO_DEPTH) << 8;
}

WR_REG(CAN_MO1->MOIPR, CAN_MO_MOIPR_MPN_Msk, CAN_MO_MOIPR_MPN_Pos, 0x01); // park base object indexes away from FIFO indexes to avoid setting pending bit0 when wrapping around, MSPND0-bit1 not used
WR_REG(CAN_MO2->MOIPR, CAN_MO_MOIPR_MPN_Msk, CAN_MO_MOIPR_MPN_Pos, 0x02); // park base object indexes away from FIFO indexes to avoid setting pending bit0 when wrapping around, MSPND0-bit2 not used

#endif

break;

default:
panic(PANIC_USER, "Invalid Can instance");
}
instance[index] = this;

rxQueue_ = xQueueCreate(CAN_RX_FIFO_DEPTH+CAN_RX_GL_FIFO_DEPTH, (unsigned portBASE_TYPE)sizeof(CanMessage)); // EP-322 Node: CAN RX buffer in freeRTOS is smaller than HW FIFO. Causes node panics sometimes.
txQueue_ = xQueueCreate(32, (unsigned portBASE_TYPE)sizeof(CanMessage));
txSem_ = xSemaphoreCreateMutex();

if ((rxQueue_ == NULL) || (txQueue_ == NULL) || (txSem_ == NULL))
panic(PANIC_USER, "Unable to create CAN queues/semaphores");

if (xTaskCreate(rxTaskCode_, (const char*)"CanRx", usStackDepth, this, uxPriority, NULL) != pdPASS)
panic(PANIC_USER, "Unable to create CAN rx task");

setRxFilter(IDENTIFIER_ID_FULL | (getNodeNumber() << 8), MSG_HW_FILTER_MASK);

setGlRxFilter(IDENTIFIER_ID_FULL, MSG_HW_FILTER_MASK); // accept only GL messages

Cli::getInstance()->registerCommand("can", canCmd, -2, "CAN test");

m_rx_counter = m_tx_counter = 0;
}
0 Likes
User6793
Level 4
Level 4
Here is the CAN RX IRQ service routine:

void Can::rxInterruptHandler(void)
{
CanMessage msg;
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
int pending_index;
int i;


// RX FIFOs irq
for (i=0; i while (CAN->MSID[m_rxfifo_pending_reg] != CAN_MSI_NO_PENDING) {
if (0 == i)
pending_index = CAN->MSID[m_rxfifo_pending_reg]+3;
else
pending_index = CAN->MSID[m_rxfifo_pending_reg]+CAN_RX_FIFO_DEPTH+3;

if (CAN001_GetMOFlagStatus(canHandle_,pending_index+1, MESSAGE_LOST) == CAN_SET)
panic(PANIC_USER, "CAN MSG LOST");

if (CAN001_GetMOFlagStatus(canHandle_, pending_index+1, RECEIVE_PENDING) == CAN_SET) {
CAN001_ClearMOFlagStatus(canHandle_, pending_index+1, RECEIVE_PENDING);

if (0 == i)
CAN->MSPND[m_rxfifo_pending_reg] = ~(1 << (pending_index-3)); // Reset message pending register
else
CAN->MSPND[m_rxfifo_pending_reg] = ~(1 << (pending_index-CAN_RX_FIFO_DEPTH-3)); // Reset message pending register

CAN001_ReadMsgObj(canHandle_, CAN001_MessageHandle0[pending_index-3], pending_index+1);

newCanMessage(&msg, CAN001_MessageHandle0[pending_index-3]->Identifier & 0x000000ff);
msg.size = CAN001_MessageHandle0[pending_index-3]->DataLength;
msg.identifier = CAN001_MessageHandle0[pending_index-3]->Identifier;
msg.nodeNum = (msg.identifier & 0x0000ff00) >> 8;
memcpy(msg.data, CAN001_MessageHandle0[pending_index-3]->data, msg.size);

if (xQueueSendFromISR(rxQueue_, &msg, &xHigherPriorityTaskWoken) != pdTRUE) // put message in queue
panic(PANIC_USER, "CAN RX OF");
m_rx_counter++;
}
}

if (CAN001_GetNodeFlagStatus(canHandle_,CAN001_ALERT_STATUS) == CAN_SET)
{
CAN001_ClearNodeFlagStatus(canHandle_,CAN001_ALERT_STATUS);

if (CAN001_GetNodeFlagStatus(canHandle_, CAN001_BUS_OFF_STATUS) == CAN_SET)
{
vTaskDelay((getSerial() & 0x000000ff) / portTICK_RATE_MS); // wait a pseudo random number of ms before panicing
panic(PANIC_USER, "CAN BOFF"); // this happens when many nodes sends STANDBY with the same CAN ID simultaneously, reset will make the node try again
}
}

portEND_SWITCHING_ISR(xHigherPriorityTaskWoken);

}
0 Likes
Not applicable
Hi OMR.....,
Thanks for the help...But is there any way to implement this without FIFOs??..
0 Likes
User6793
Level 4
Level 4
Not if you don't want to lose any messages ...
But of course, if your CAN traffic is 'slow' with no back-to-back messages you could only use one RX MO.
If however you want to let the HW do the burst buffering for you, you must use the FIFO.
0 Likes
Not applicable
Thanks OMR,
Does it possible without Rtos..??
0 Likes
Travis
Employee
Employee
First solution authored Welcome! 500 replies posted
farooquiirfan98 wrote:
Thanks OMR,
Does it possible without Rtos..??


The CAN should work independent of the RTOS.
0 Likes