cancel
Showing results for 
Search instead for 
Did you mean: 

FDCAN Retransmission without blocking Bus

MStud.4
Associate

I have a CAN Network with several nodes. Each nodes sends only a ACK when the message was ment for it. Lets say I have nodes A, B and C.

Node A wants to send the message with ID 0x5. Node B ignores this message. Node C accepts this message (sends Ack). But currently, Node B is sending a burst of messages with ID 0x4.

What I have learned so far is, that I must have "Automatic Retransmission" on, else in this scenario, when Node A is trying to send the message and is loosing the Arbitration phase, it deletes the message. With "Automatic Retransmission" on, it sends the message as soon as the bus is free again.

Now the problem: Supose now node C gets disconnected from the network. With "Automatic Retransmission", node A spams the bus forever, since there is no Ack for the message. Now no message with higher ID than 0x5 can be sent anymore.

I want that node A resends the message after it lost in Arbitration phase, but that the bus does not get spammed forever if there is no Ack. How can I achieve that?

The MCU is G0B1KE with FDCAN.

I tried to do something with the Tx Event Fifo, but the callback never gets called. (I activated FDCAN_IT_TX_EVT_FIFO_NEW_DATA | FDCAN_IT_TX_COMPLETE | FDCAN_IT_RX_FIFO0_NEW_MESSAGE | FDCAN_IT_TX_EVT_FIFO_ELT_LOST but the HAL_FDCAN_TxEventFifoCallback is never called. However, the HAL_FDCAN_TxBufferCompleteCallback gets called, so I dont think it is a problem with interrupt config etc)

1 ACCEPTED SOLUTION

Accepted Solutions
SofLit
ST Employee

@MStud.4 wrote:

I have a CAN Network with several nodes. Each nodes sends only a ACK when the message was ment for it. 

 

No. The frame is acknowledged by at least one node (it could be more) that received a valid CAN frame not only the recipient ID. Valid CAN frame means a correct frame structure/format (no errors).

The non-recipients nodes of the identifier will acknowledge the frame but will reject the frame internally.

This is simply the CAN protocol not related to the STM32 product.

See the threads:

https://community.st.com/t5/stm32-mcus-products/can-transmit-acknowledged-even-though-no-receiving-node/td-p/651037

https://community.st.com/t5/stm32-mcus-products/i-would-like-to-know-the-acknowledge-sending-condition-of/td-p/309318

So even you send a Frame with a non-recipient ID on the bus, the frame will be even so acknowledged.

Hope I answered your question.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

View solution in original post

1 REPLY 1
SofLit
ST Employee

@MStud.4 wrote:

I have a CAN Network with several nodes. Each nodes sends only a ACK when the message was ment for it. 

 

No. The frame is acknowledged by at least one node (it could be more) that received a valid CAN frame not only the recipient ID. Valid CAN frame means a correct frame structure/format (no errors).

The non-recipients nodes of the identifier will acknowledge the frame but will reject the frame internally.

This is simply the CAN protocol not related to the STM32 product.

See the threads:

https://community.st.com/t5/stm32-mcus-products/can-transmit-acknowledged-even-though-no-receiving-node/td-p/651037

https://community.st.com/t5/stm32-mcus-products/i-would-like-to-know-the-acknowledge-sending-condition-of/td-p/309318

So even you send a Frame with a non-recipient ID on the bus, the frame will be even so acknowledged.

Hope I answered your question.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.