i'm using ChibiOS 17.6.0 to read CAN messages. I'm using an STM32F427VGT_100 device.
Implementing the code as in the STM32F4xx-CAN example project i can correctly catch every Frame receive event:
Code: Select all
while (true) {
if (chEvtWaitAnyTimeout(ALL_EVENTS, MS2ST(100)) == 0)
continue;
while (canReceive(&CAND2, CAN_ANY_MAILBOX, &rxmsg, TIME_IMMEDIATE) == MSG_OK ) {
//i can reach this point any time a CAN message arrives...
}
}
But all rxmsg fields are blank: SID, DLC and data... i checked the CAN messages with a Canalyzer tool and i'm sure messages are not empty.
Also I'm able to receive messages only if i pass the CAN_ANY_MAILBOX constant in the canReceive method.
In the STM32F4xx-CAN example project is left to the reader the CAN message parsing... is there any task i'm missing?
Thanks