Skip to Content

FDCAN Transmit

This block handles transmitting messages via the FDCAN bus in STM microcontrollers.



FDCAN Transmit block

Table of Contents

Inputs

Input NameTypeDescription
Data[ ]uint8Data to send. The number of bytes at the input depends on the input or parameter Data length.
Set ExtIDboolOptional input
ID number type of the message to send (Standard or Extended). This input is optional and depends on the Enable input ID type parameter.
IDuint32Optional input
ID number of the message to send. This input is optional and depends on the Enable input ID parameter.
Data lengthuint8Optional input
Amount of data to send. This input is optional and depends on the Enable input length of data parameter.

Outputs

Output NameTypeDescription
Statusuint8Transmission status. Returns:
1 transmission successful
0 transmission failed

Block Parameters

ParameterDescription
Module numberCAN module number
Frame formatFrame format selection:
FDCAN_CLASSIC_CAN - classic frame format
FDCAN_FD_CAN - FDCAN frame format
Enable bitrate switching (BRS)Enables bit rate switching in FDCAN frames. This setting is visible if the Frame format parameter is set to FDCAN_FD_CAN.
Add message toSelection of the queue where the message will be added:
FIFO - FIFO queue
BUFFER - buffer
Enable input ID typeEnables the Set ExtID input
ID TypeConditional Parameter
Message ID number type:
Standard ID - standard number (11 bits)
Extended ID - extended number (29 bits)
This parameter is available if the Enable input ID type option is disabled.
Enable input IDEnables the ID input
ID messageConditional Parameter
ID number of the message to send. This parameter is available if the Enable input ID option is disabled.
Enable input length of dataEnables the Data length input
Data lengthConditional Parameter
Maximum data length per frame (in bytes). This parameter is available when the Enable input length of data option is disabled.
Frame repeatNumber of repetitions of the same frame. This setting allows the sent frame to be automatically repeated a specified number of times without needing to call the block again.
Send optionsConditional Parameter
Specifies how new frames are handled when the transmission queue is full:

Non-blocking (abort new) – the transmit function immediately returns an error, and the new frame is discarded.
Non-blocking (overwrite) – the transmit function returns immediately, and the new frame replaces an existing frame in the queue.
Blocking (abort new) – the transmit function waits for the time specified in the Timeout parameter for space to free up in the queue; if it is not possible to add the frame, the new frame is discarded.
Blocking (overwrite) – the transmit function waits for the time specified in the Timeout parameter for space to free up or overwrites an existing frame according to the driver configuration.
Wait for end sendingExecutes the block until data is sent or the time set in the Timeout parameter expires. If this option is enabled, the block returns a success status immediately after placing the message in the transmission queue, without waiting for its actual transmission.
TimeoutConditional Parameter
How long the system will wait to send the frame. This parameter is available when the Send options option is set to Blocking (abort new) or Blocking (overwrite).
TimeoutConditional Parameter
How long the system will wait for the block execution. This parameter is available when the Wait for end sending option is disabled.
Sample time [s]Function refresh rate


Block parameters for FDCAN Transmit

Configuration of CubeMX for a Given MCU

The configuration for FDCAN can be found on the CubeMX Configuration for a Given MCU subpage.

See Also

Last updated on