2020-04-20 12:28 AM
Hello,
I am working with STM32H7. I need to configure the CAN FD to work as Classic CAN 2.0. I have found an example that configures the CAN FD as Classic CAN 2.0, but in the example the system clock is different from my system clock.
I need to find the method to configure the STM32H7 CAN FD as CAN 2.0. Please help me cause I am not able to find this method anywhere.
Thank you in advance.
Best regards,
Vouria
Solved! Go to Solution.
2020-04-23 04:21 AM
Hello @VYoun
For a detailed description of the CAN bit timing and resynchronization mechanism, (Prop_Seg, Phase_Seg1, SJW...), refer to the ISO 11898-1 standard.
You can find through STM32CubeFW an example shows how to configure the FDCAN peripheral to send and receive
Classic CAN frames in normal mode : STM32Cube_FW_H7_V1.7.0\Projects\STM32H743I-EVAL\Examples\FDCAN\FDCAN_Classic_Frame_Networking
Best regards,
Bouraoui
2020-04-20 08:37 AM
Hello @VYoun
Please refer to STM32CubeMX; In Pinout & Configuration you can select the mode and the configuration of FDCAN under Conectivity. In Clock Configuration you can select the input clock of FDCAN.
Best regards
Bouraoui
2020-04-20 11:51 PM
Hello @Bouraoui Chemli ,
Thank you for your reply. I have used the STM32CuveMX and chose the "classic mode" for the CAN Bus.
The problem is that I can not find any formula for the CAN FD Bit Timing in "Classic Master" mode.
The Formulas are only for CAN FD and not for CAN FD "Classic Mode".
I appreciate your help.
Best regards,
Vouria
2020-04-21 07:25 AM
Hello @VYoun
You can find the equations for FDCAN as classic CAN in the reference manual RM0433 Rev7 section 56.4.4 Bit timing :
for the nominal bit time
– tq = (FDCAN_NBTP.NBRP[8:0] + 1) * tfdcan_tq_ck
– tSyncSeg = 1 tq
– tBS1 = tq * (FDCAN_NBTP.NTSEG1[7:0] + 1)
– tBS2 = tq * (FDCAN_NBTP.NTSEG2[6:0] + 1)
Best regards
Bouraoui
2020-04-21 07:35 AM
Hello @Bouraoui Chemli ,
Thank you for your reply.
I came across this formula. However, the parameters which are needed for the STM32CubeMX is different.
There I need the following parameters:
I appreciate if you could tell me how to derive the above parameters from the formula in the Reference Manual.
Thank you and best regards,
Vouria
2020-04-22 04:46 AM
Hello @VYoun
SJW is not included in the equations and explained in RM0433 Rev7 (page 2509).
For a detailed description of the CAN bit timing and resynchronization mechanism, refer to the ISO 11898-1 standard.
Best regards,
Bouraoui
2020-04-22 05:11 AM
Hello @Bouraoui Chemli ,
Thank you for your reply.
I went through the Reference Manual as you mentioned.
There are however two points which are not clear to me:
In the Reference Manual it is mentioned that: FDCAN_NBTP.NTSEG1[7:0] is the sum of Prop_Seg and Phase_Seg1.
my question is how is the value of Prop_Seg is found?
second, regarding the NominalSyncJumpWidth. This is discussed in the reference manual on page 2509, however there is nothing mentioned about finding its value.
Thank you again for your help.
Best regards,
Vouria
2020-04-23 04:21 AM
Hello @VYoun
For a detailed description of the CAN bit timing and resynchronization mechanism, (Prop_Seg, Phase_Seg1, SJW...), refer to the ISO 11898-1 standard.
You can find through STM32CubeFW an example shows how to configure the FDCAN peripheral to send and receive
Classic CAN frames in normal mode : STM32Cube_FW_H7_V1.7.0\Projects\STM32H743I-EVAL\Examples\FDCAN\FDCAN_Classic_Frame_Networking
Best regards,
Bouraoui