2025-10-23 12:32 AM
Hello everyone!
I have a strange problem with bxCAN on ST32F427.
My bxCAN config:
CAN network and data flow config (hint - it's a CANopen protocol)
Answer mechanism: when ST32 receives a message from PC, RX ISR is triggered. In this ISR received message ID is analyzed and if an SDO-request is detected (ID is 0x601), ST32 immediatly puts an answer into Mailbox 2. Immediately means, that Mailbox is filled during this RX ISR.
So my problem: if i have two filled TX mailboxes, i expect two messages to be transmitted sequentially without any pause. During message "burst" from the PC i expect ST32 to win arbitration, because all of its messages have higher priority.
But what i see on the bus: if i have two TX mailboxes during the message burst from the PC, ST32 sends one of the messages, but then PC sends it's message. And after the first transmit ST32 doesn't even try to send the next one immediately. It sends it's second message only after PC's message.
How do i debug it: i've connected a Logical Analyzer to the ST32 and watch the following signals:
"CAN TX/RX ISR" signals are GPIOs the are pulled up on ISR entry and pulled down on ISR exit.
"PDO and SDO TX completed" signals are GPIOs that are pulled up in TX ISR when the program finds out which mailbox caused the ISR and pulled down on ISR exit.
"Mailbox 0 Full and Mailbox 2 Full" signals are GPIOs that are up when a mailbox is full and down, when it's empty based on TME0 and TME2 bits' states. The bits' states are software polled with 10 kHz frequency (ISR from timer).
The screenshot is in the attachment.
THERE IS AN ERROR - "MAILBOX 2 Full" is captioned as "MB1 Full" - but it's MB0 (i've noticed that too late, sorry).
So please, could someone help me on this? I couldn't find any bits or settings in bxCAN for "pause between transmissions". What am i doing wrong?
2025-10-23 1:27 AM - edited 2025-10-23 1:28 AM
Hello,
The issue is not clear!
The transmission of a message depends on the arbitration based on the ID sent vs other IDs sent by other nodes. Lower ID have the most priority to be transmitted on the bus.
2025-10-23 1:38 AM
Hi!
Yes, you're right, BUT
Lower ID wins if arbitration process starts.
As i mention in my post and show on the waveforms, the arbitration process does not start.
It's just PC taking the bus without any arbitration with MCU because MCU for some reason doesn't start transmission.
Please take a look at the picture attached to the original post.
2025-10-23 1:41 AM - edited 2025-10-23 1:42 AM
TLDR:
I have two filled mailboxes. Both with TXRQ set. The first mailbox transmits it's message. THEN i expect second mailbox to start transmitting. Maybe it will win arbitration, maybe not, that's not the problem.
The problem is that MCU doesn't even start transmission in time and another node occupies the bus.