2024-02-07 02:59 AM
Hi ST
I am using STM32CubeMX v6.10.0 with selected MCU STM32H563ZITx.
When configuring FDCAN1 I may have found a bug in the tool. The below two Nominal Time Seg1 and Seg2 say that the lowest value is "2" and the tool is limiting setting it to "1" which I think is a valid setting.
The RM0481 Rev 1 says that the minimum value that is interpreted by the hardware of that value is "1" (when register segment is set to "0")
Can someone please verify my findings?
Br
Imre
Solved! Go to Solution.
2024-02-07 03:18 AM
Hello,
Yes according to the RM: NTSEG1 is in the range [0:255] and NTSEG2 ins the range [0:127].
In the HAL there is a substraction to meet these ranges:
hfdcan->Instance->NBTP = ((((uint32_t)hfdcan->Init.NominalSyncJumpWidth - 1U) << FDCAN_NBTP_NSJW_Pos) | \
(((uint32_t)hfdcan->Init.NominalTimeSeg1 - 1U) << FDCAN_NBTP_NTSEG1_Pos) | \
(((uint32_t)hfdcan->Init.NominalTimeSeg2 - 1U) << FDCAN_NBTP_NTSEG2_Pos) | \
(((uint32_t)hfdcan->Init.NominalPrescaler - 1U) << FDCAN_NBTP_NBRP_Pos));
So, to me, in CubeMx the ranges should be:
I'm raising this behavior internally and get back to you with feedback
2024-02-07 03:18 AM
Hello,
Yes according to the RM: NTSEG1 is in the range [0:255] and NTSEG2 ins the range [0:127].
In the HAL there is a substraction to meet these ranges:
hfdcan->Instance->NBTP = ((((uint32_t)hfdcan->Init.NominalSyncJumpWidth - 1U) << FDCAN_NBTP_NSJW_Pos) | \
(((uint32_t)hfdcan->Init.NominalTimeSeg1 - 1U) << FDCAN_NBTP_NTSEG1_Pos) | \
(((uint32_t)hfdcan->Init.NominalTimeSeg2 - 1U) << FDCAN_NBTP_NTSEG2_Pos) | \
(((uint32_t)hfdcan->Init.NominalPrescaler - 1U) << FDCAN_NBTP_NBRP_Pos));
So, to me, in CubeMx the ranges should be:
I'm raising this behavior internally and get back to you with feedback
2024-02-08 03:03 AM - edited 2024-02-09 08:19 AM
Hello,
Internal ticket submitted to treat this issue (172861) and the bug is confirmed. It will be fixed in one of the coming versions of CubeMx.
Thank you for raising the issue.
2024-03-22 02:27 AM
Issue fixed in the latest version of CubeMx V6.11.0 already available on the web.