Trying to read from CAN RX mailbox 1 (the second mailbox) results in an OS exception (I think; I'm new to Chibi and the board I'm using it on doesn't have a lot of IO to tell me what's wrong).
I'm using ChibiOS 3.0.0b5
I'm using an STM32F405, for which CAN_RX_MAILBOXES is defined to be 2
Reading through can_lld_receive for the STM32 (os/hal/ports/STM32/LLD/can_lld.c), it looks like I should be passing a mailbox ID of `2` in order to read mailbox 1 (0 is ANY, 1 is mailbox 0, and 2 is mailbox 1 on this chip).
In canReceive (os/hal/src/can.c), there is an assertion: `mailbox < (canmbx_t)CAN_RX_MAILBOXES` ; obviously this fails if I pass `2` as the desired mailbox.
I've updated the assertion on my copy of ChibiOS to be `mailbox <= (canmbx_t)CAN_RX_MAILBOXES`, and it works. (I'm also using the CAN filters to assign messages to mailbox 0 or 1 depending on their ID).
CAN RX mailbox support on STM32
Moderator: RoccoMarco
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times