cancel
Showing results for 
Search instead for 
Did you mean: 

Does TxBufferCompleteCallback need to be reset? It only runs once.

TKrop
Associate II

I am using TxBufferCompleteCallback in order to verify that messages have been sent over FDCAN on the STM32G474RE board.

I have verified that the callback is run, which means it's been activated correctly. After the first run, it is no longer called, and my application is halted, because it appears that the TxBuffer has not been sent yet. In reality, the buffer is sent, and it is successfully received on the other end.

The IRQ_Handler is not getting its TxBufferComplete flag set, so there isn't much I can do in the way of figuring out what's happening.

The back and forth communication between my devices goes like this from the perspective of the G4: Receive, Send, TxBufferComplete, Receive, Send, waiting forever for sending to complete. The board I am communicating with is an H7 board known to work correctly.

Is there some API function that I missed, or is this a firmware bug?

Anything you wish to know about my setup which may help, please ask and I will tell.

1 ACCEPTED SOLUTION

Accepted Solutions
TKrop
Associate II

The G4 has all three Tx buffers enabled by default, contrasted to the H7 where you must specify the number to enable.

There doesn't appear to be any way to disable any of them, so in order to get the expected callbacks, one must enable those callbacks on all three buffers.

The reason it only worked once for me was because the first Tx buffer was completed, then the second Tx buffer was used for the next message, which did not trigger the callback, because I had only registered the callback for the first buffer out of habit from my use with the H7.

View solution in original post

1 REPLY 1
TKrop
Associate II

The G4 has all three Tx buffers enabled by default, contrasted to the H7 where you must specify the number to enable.

There doesn't appear to be any way to disable any of them, so in order to get the expected callbacks, one must enable those callbacks on all three buffers.

The reason it only worked once for me was because the first Tx buffer was completed, then the second Tx buffer was used for the next message, which did not trigger the callback, because I had only registered the callback for the first buffer out of habit from my use with the H7.