Dear Sir
Good day! I had a issue that was flexcan rx on MPC5744P devkit . On this case , I ued can0 on board and want to receive 63' can id . I set it in S32DSPA IDE as below :
status_t CAN_Init(void)
{
uint8_t i ;
uint8_t j ;
uint8_t PS=1;
flexcan_data_info_t dataInfo =
{
.data_length = 8U ,
.msg_id_type = FLEXCAN_MSG_ID_EXT
};
flexcan_id_table_t full_id_table [ i * j ];
for ( i = 1 ; i < 10 ; i++ )
{
for ( j = 1 ; j<8 ; l++)
{
if ( i < 2 ) {
full_id_table [ i * j ] ={ (uint32_t ) ( 0x18000000 | (uint32_t)((j+1)<<16) | (uin32_t) (PS<<8) | (uint32_t)(i)} ;
} else
{
full_id_table [ ((i-1) * j)+7 ] ={ (uint32_t ) ( 0x18000000 | (uint32_t)((j+1)<<16) | (uin32_t)(PS<<8) | (uint32_t)(i)} ;
}
}
}
FLEXCAN_DRV_Init(INST_CANCOM1, &canCom1_State, &canCom1_InitConfig0);
FLEXCAN_DRV_SetRxMbGlobalMask(INST_CANCOM1,FLEXCAN_MSG_ID_EXT,0x18FFFFFF);
FLEXCAN_DRV_ConfigRxFifo(INST_CANCOM1,FLEXCAN_RX_FIFO_ID_FORMAT_A,&full_id_table);
uint8_t temp ;
for ( temp = 1 ; temp <63 ; tempe++ )
{
FLEXCAN_DRV_ConfigRxMb(INST_CANCOM1,temp,&dataInfo,full_id_table[temp])
}
}
Then I run the receiving function , I find the each mailbox always was in STATUS_CAN_BUFF_OUT_OF_RANGE .
How can i slove this issue or may you provide me the more canId free receive in one mailbox sample code by the S32D
Hello Sir
Thank you
Hi,
if enabling RXFIFO some MBs are occupied by Rx FIFO and ID Filter table. This is determined by CTRL2[RFFN] setting. In flexcan component "RxFIFO ID filters number" parameter specifies this
So for example for 64 filter elements (RFFN=7), MB0-21 are used by RXFIFO and ID table.
Thus if you want to configure additional regular MBs for receiving/transmitting, MBs 22-63 can be used. You cannot config MB1, MB2 and so on as you have.
BR, Petr