This Application Note will go through the process of adding a CAN-FD message into a dbc file containing only CAN messages. It will also show any manual configuration changes required after importing a dbc file and running confgen to get a CAN-FD message to worth on the vrta target. Note that it will not show the configuration of application software. For examples on how to do this, refer to the Getting started & AUTOSAR Workflow (especially chapters 1 and 2).
Adding a CAN-FD message to a standard CAN dbc file
A standard CAN dbc file must be converted into a CAN-FD dbc by defining the BusType as "CAN FD", and also by adding a CAN-FD Attribute to the file (After ISOLAR-AB 9.1 this should not be necessary). This will allow ISOLAR to recognise that the file contains CAN-FD messages. To tell the difference between a standard CAN message and a CAN-FD message you can use the "VFrameFormat" attribute to specify what type of message it is.
This is an example of steps that could be taken to add a CAN-FD message to a dbc file containing only CAN messages:
Configure the Bus Type to be "CAN FD":
BA_ "BusType" "CAN FD"
Add the CANFD_BRS attribute:
BA_DEF_ BO_ "CANFD_BRS" ENUM "0","1";
- This attribute is defined for each CAN ID and states whether the message uses the CAN_FD bitrate or the CAN bitrate.
A default should be assigned for this attribute:
BA_DEF_DEF "CANFD_BRS" "0";
Add the vFrameFormat attribute:
BA_DEF BO_ "VFrameFormat" ENUM "StandardCAN", "ExtendedCAN", "StandardCAN_FD", "ExtendedCAN_FD";
- The BO_ means that the VFrameFormat is defined for each CAN ID
It is possible to assign a default VFrameFormat so that you only need to assign the attribute to messages that require a different VFrameFormat.
BA_DEF_DEF "VFrameFormat" "StandardCAN";
Define the new message:
BO_ 253 ApplicationECU_TestResFD_Tx: 16 ApplicationECU SG_ ApplicationECU_SG_TestResFD_Tx : 0|16@1- (1,0) [0|0] "" TestECU
Give the new message the VFrameFormat attribute (Note that 253 is the Can ID, and 2 refers to the second element of the VFrameFormat Enum (in this case "StandardCAN_FD")):
BA_ "VFrameFormat" BO_ 253 2;
- In order for ISOLAR (Versions belowing 9.1) to recognise that the dbc file describes a CAN-FD network a CAN-FD attribute must be given to the network. Examples of such attributes include:
- "SyncJumpWidthMin" , "SyncJumpWidthMax" , "SamplePointMax" "SamplePointMin"
For example
BA_ "SamplePointMax" 81.25;
Example DBC File
VERSION "" NS_ : NS_DESC_ CM_ BA_DEF_ BA_ VAL_ CAT_DEF_ CAT_ FILTER BA_DEF_DEF_ EV_DATA_ ENVVAR_DATA_ SGTYPE_ SGTYPE_VAL_ BA_DEF_SGTYPE_ BA_SGTYPE_ SIG_TYPE_REF_ VAL_TABLE_ SIG_GROUP_ SIG_VALTYPE_ SIGTYPE_VALTYPE_ BO_TX_BU_ BA_DEF_REL_ BA_REL_ BA_DEF_DEF_REL_ BU_SG_REL_ BU_EV_REL_ BU_BO_REL_ SG_MUL_VAL_ BS_: BU_: ApplicationECU TestECU BO_ 10 ApplicationECU_TestResult_Tx: 8 ApplicationECU SG_ ApplicationECU_SG_TestResult0_Tx : 0|8@1- (1,0) [0|0] "" TestECU SG_ ApplicationECU_SG_TestResult1_Tx : 8|8@1- (1,0) [0|0] "" TestECU BO_ 20 TestECU_TestCode_Tx: 8 TestECU SG_ TestECU_SG_TestCode0_Tx : 0|8@1- (1,0) [0|0] "" ApplicationECU SG_ TestECU_SG_TestCode1_Tx : 8|8@1- (1,0) [0|0] "" ApplicationECU BO_ 1264 UDS_RX_FUNC: 8 TestECU SG_ UDS_RX_FUNC_SIGNAL : 0|8@1- (1,0) [0|0] "" ApplicationECU BO_ 1248 UDS_RX_PHY: 8 TestECU SG_ UDS_RX_PHY_SIGNAL : 0|8@1- (1,0) [0|0] "" ApplicationECU BO_ 1232 UDS_TX: 8 ApplicationECU SG_ UDS_TX_SIGNAL : 0|8@1- (1,0) [0|0] "" TestECU BO_ 2015 Diag_OBD_ON_CAN_Rx: 8 TestECU SG_ OBD_RX_SIGNAL : 0|8@1- (1,0) [0|0] "" ApplicationECU BO_ 2024 Diag_OBD_ON_CAN_Tx: 8 ApplicationECU SG_ OBD_TX_SIGNAL : 0|8@1- (1,0) [0|0] "" TestECU BO_ 253 ApplicationECU_TestResFD_Tx: 16 ApplicationECU SG_ ApplicationECU_SG_TestResFD_Tx : 0|16@1- (1,0) [0|0] "" TestECU BA_DEF_ "BusType" STRING ; BA_DEF_ BO_ "CANFD_BRS" ENUM "0","1"; BA_DEF_ BO_ "VFrameFormat" ENUM "StandardCAN","ExtendedCAN","StandardCAN_FD","ExtendedCAN_FD"; BA_DEF_ "SamplePointMax" FLOAT 0 100; BA_DEF_DEF_ "BusType" "CAN"; BA_DEF_DEF_ "CANFD_BRS" "0"; BA_DEF_DEF_ "VFrameFormat" "StandardCAN"; BA_ "BusType" "CAN FD"; BA_ "SamplePointMax" 81.4; BA_ "VFrameFormat" BO_ 253 2;
Manual Configuration Changes Required
Once the dbc file has been imported and confgen has been run, in order to get codegen to complete you must configure the CanControllerFdBaudrateConfig.
When running on the vrta CAN-FD seems to only work with basic identifiers for rx rather than full.
When using MCALGen for the vrta also, you may be required to add a HwFilter configuration.
A mask of 0 should cause this filter to have no effect.
On the VRTA platform the CanHandleType should also be set to basic for Rx messages, otherwise the id will be handled incorrectly.
This will also mean that in the CanIf module inside of CanIfHrhConfig a list or range of ids should be configured, e.g.