Question
STM32H7 FDCAN FiFo receives wrong values sometimes
Dear all,
i have a custom pcb with a STM32H753XIHx.
I want to use CAN1 Interface to receive PDO and SDOs (Baudrate: 125k, CANopen).
My receive routine looks like this:
// CAN 1 receive interrupt callback
void HAL_FDCAN_RxFifo0Callback(FDCAN_HandleTypeDef *hfdcan, uint32_t RxFifo0ITs)
{
// static allocation saves instantiation time during interrupt
static struct canMsg *rxmsg = NULL;
static FDCAN_RxHeaderTypeDef rxheader;
char temp = 0;
if(hfdcan == &hfdcan1)
{
// CAN element available ?
if ( FREE_EMPTY() == 0 )
{
// Element aus freeRx-Puffer holen
if((rxmsg = FREE_PULL())!= NULL )
{
// retrieve rx message from fifo
if( HAL_FDCAN_GetRxMessage(hfdcan, FDCAN_RX_FIFO0, &rxheader, (uint8_t*) rxmsg->Data.Values.c ) == HAL_OK )
{
The received CAN message payload will be stored inside rxmsg->Data.Values.c[].
I send static SDO messages to the pcb:
0x43 0x10 0x20 0x01 0x08 0x00 0x00 0x00
But from time to time, the payload is corrupted (e.g. everything filled with 0x00) like:
0x43 0x10 0x20 0x01 0x00 0x00 0x00 0x00
Please find attached my ioc configuration.
Please let me know if i need to optimize something in ioc file to receive can messages completely correct.
Thank you very much
