STM32 FDCAN Send CAN messages without ACK
Good morning:
I'm working with the STM32G431KB on my own board. In the project we send messages thanks to the FDCAN HAL module driver layer for wakeup other ECU by expecific CAN messages.
Situation:
I am working using Polling mode for FDCAN:
hfdcan1.Instance = FDCAN1;
hfdcan1.Init.ClockDivider = FDCAN_CLOCK_DIV1;
hfdcan1.Init.FrameFormat = FDCAN_FRAME_CLASSIC;
hfdcan1.Init.Mode = FDCAN_MODE_NORMAL;
hfdcan1.Init.AutoRetransmission = DISABLE;
hfdcan1.Init.TransmitPause = DISABLE; //
hfdcan1.Init.ProtocolException = DISABLE;
hfdcan1.Init.NominalPrescaler = 9;
hfdcan1.Init.NominalSyncJumpWidth = 1;
hfdcan1.Init.NominalTimeSeg1 = 13;
hfdcan1.Init.NominalTimeSeg2 = 2;
hfdcan1.Init.DataPrescaler = 9;
hfdcan1.Init.DataSyncJumpWidth = 1;
hfdcan1.Init.DataTimeSeg1 = 13;
hfdcan1.Init.DataTimeSeg2 = 2;
hfdcan1.Init.StdFiltersNbr = 0;
hfdcan1.Init.ExtFiltersNbr = 0;
hfdcan1.Init.TxFifoQueueMode = FDCAN_TX_FIFO_OPERATION;
HAL_FDCAN_Init(&hfdcan1);
I sent messages without problems thanks to the function:
TxHeader.DataLength = FDCAN_DLC_BYTES_8;
TxHeader.IdType = FDCAN_STANDARD_ID;
TxHeader.TxFrameType = FDCAN_DATA_FRAME;
TxHeader.ErrorStateIndicator = FDCAN_ESI_PASSIVE;
TxHeader.BitRateSwitch = FDCAN_BRS_OFF;
TxHeader.FDFormat = FDCAN_CLASSIC_CAN;
TxHeader.TxEventFifoControl = FDCAN_STORE_TX_EVENTS;
TxHeader.MessageMarker = 0;
HAL_FDCAN_AddMessageToTxFifoQ(&hfdcan1, &TxHeader, data);Problem:
If there is any device connected, the system works correctly, because we receive ACK.
The problem is that I need to be able to send messages without any device being active to send the ACK. in this case i received error FDCAN_PROTOCOL_ERROR_ACK and finally sends FDCAN_PROTOCOL_ERROR_NO_CHANGE.
The system fails and even if I reset the FDCAN, there is no way to be able to send CAN messages again.
How can I configure/send CAN messages without the need for ACK from another device?
What are my options ?
Thanks!!
