cancel
Showing results for 
Search instead for 
Did you mean: 

FDCAN Nominal Time Segment 2 (NTSEG2) Parameter Missing During Project Migration

trzhongty
Associate
TitleFDCAN Nominal Time Segment 2 (NTSEG2) Parameter Missing During STM32CubeMX Project Migration, Leading to Incorrect Baud Rate Calculation
Product/ToolSTM32CubeMX
Version Found (New)V1.16.0 (CubeMX: V6.11.0 or newer)
Target FW PackageSTM32Cube FW H7 V1.12.1
Original Version (Old)V6.9.1
Original FW PackageSTM32Cube FW H7 V1.11.1
MCU FamilySTM32H7 Series (FDCAN Peripheral)
SeverityHigh - Causes incorrect calculation of the critical communication parameter (Baud Rate), requiring manual intervention to fix.

 

:lady_beetle:Issue Description

 

When opening an existing .ioc project file created with STM32CubeMX V6.9.1 and STM32Cube FW H7 V1.11.1 in the new STM32CubeMX V1.16.0 (with FW H7 V1.12.1) and initiating the project migration, the configuration for the FDCAN1 peripheral's Nominal Baud Rate parameters is incorrectly converted. This results in an incorrect CAN Baud Rate calculation post-migration.

 

:gear:Detailed Reproduction Steps

 

  1. Use STM32CubeMX V6.9.1 and STM32Cube FW H7 V1.11.1 to create an STM32H7 project with FDCAN1 configured for a 50 KHz Baud Rate.

  2. Save the .ioc file (Old Version Configuration).

  3. Upgrade/Switch to STM32CubeMX V1.16.0 and STM32Cube FW H7 V1.12.1.

  4. Open the .ioc file from Step 2 with the new CubeMX version, triggering the migration process.

  5. Observe the FDCAN1 configuration: the calculated Baud Rate will no longer be 50 KHz.

 

:open_file_folder:.ioc File Content Comparison

 

PropertyOriginal Version (V6.9.1) ValuePost-Migration (V1.16.0) ValueNotes
FDCAN1.DataPrescaler1010Unchanged
FDCAN1.DataTimeSeg11313Unchanged
FDCAN1.DataTimeSeg222Crucial parameter in old config
FDCAN1.NominalPrescaler(Missing/Implicit)10New parameter introduced
FDCAN1.NominalTimeSeg1(Missing/Implicit)13New parameter introduced
FDCAN1.NominalTimeSeg2(Missing)(Missing)Parameter missing post-migration
FDCAN1.CalculateBaudRateNominal5000053333Incorrect Baud Rate calculation

 

:microscope:Hypothesis for Root Cause

 

The FDCAN architecture requires the Nominal Time Segment 2 (NTSEG2) parameter for nominal baud rate calculation.

It is suspected that during the version migration process, the logic failed to map the value of FDCAN1.DataTimeSeg2 (which was 2 in the old file) to the newly required parameter FDCAN1.NominalTimeSeg2. This missing crucial parameter causes the Baud Rate to be incorrectly recalculated upon saving the migrated file.

 

:white_heavy_check_mark:Suggested Fix

 

Please update the project migration logic to ensure that the value of DataTimeSeg2 from the old FDCAN configuration is correctly mapped and assigned to the NominalTimeSeg2 parameter in the new .ioc file format.


标题 (Title)STM32CubeMX 版本迁移中 FDCAN Nominal Time Segment 2 (NTSEG2) 参数丢失,导致波特率计算错误
产品/工具STM32CubeMX
发现版本 (New Version)V1.16.0 (CubeMX: V6.11.0 或更新)
目标固件包STM32Cube FW H7 V1.12.1
原始版本 (Old Version)V6.9.1
原始固件包STM32Cube FW H7 V1.11.1
芯片系列STM32H7 系列 (涉及 FDCAN 外设)
严重程度高 (High) - 导致重要通信参数(波特率)不正确,需要手动干预才能恢复。

 

:lady_beetle:Bug 现象描述 (Issue Description)

 

当使用 STM32CubeMX V1.16.0 并将固件包更新至 STM32Cube FW H7 V1.12.1 时,打开一个由 STM32CubeMX V6.9.1STM32Cube FW H7 V1.11.1 创建的 .ioc 工程文件,并进行版本迁移。

迁移完成后,FDCAN1 外设的标称 (Nominal) 波特率计算参数发生错误,导致实际波特率与预期不符。

 

:gear:详细复现步骤 (Detailed Reproduction Steps)

 

  1. 使用 STM32CubeMX V6.9.1 和 STM32Cube FW H7 V1.11.1 创建一个 STM32H7 工程,并配置 FDCAN1,使其波特率为 50 KHz

  2. 保存 .ioc 文件(旧版本配置)。

  3. 升级/使用 STM32CubeMX V1.16.0STM32Cube FW H7 V1.12.1

  4. 使用新版本 CubeMX 打开步骤 2 中保存的 .ioc 文件,触发版本迁移。

  5. 在 FDCAN1 的配置界面中,观察到波特率计算结果已不再是 50 KHz。

 

:open_file_folder:.ioc 文件内容对比 (Content Comparison)

 

属性 (Property)原始版本 (V6.9.1) 值迁移后版本 (V1.16.0) 值备注 (Notes)
FDCAN1.DataPrescaler1010未变
FDCAN1.DataTimeSeg11313未变
FDCAN1.DataTimeSeg222关键参数
FDCAN1.NominalPrescaler(缺失/隐式)10出现新参数
FDCAN1.NominalTimeSeg1(缺失/隐式)13出现新参数
FDCAN1.NominalTimeSeg2(缺失)(缺失)推测缺失的参数
FDCAN1.CalculateBaudRateNominal5000053333波特率计算错误

 

:microscope:根本原因推测 (Hypothesis for Root Cause)

 

在 FDCAN 架构中,Nominal Time Segment 2 (NTSEG2) 的参数是计算标称波特率的关键。

推测在版本迁移过程中,程序未能正确地将旧版本 .ioc 文件中配置的 FDCAN1.DataTimeSeg2 (2) 的值,转换为新版本所需的 FDCAN1.NominalTimeSeg2 参数,导致该关键参数在新文件中缺失。这种参数的缺失导致波特率被重新错误计算。

 

:white_heavy_check_mark:建议的修复措施 (Suggested Fix)

 

请在版本迁移逻辑中,确保将旧版本 FDCAN 配置中的 DataTimeSeg2 的值,正确映射并赋值给新版本中的 NominalTimeSeg2 参数。




 

1 REPLY 1
Mahmoud Ben Romdhane
ST Employee

Hello @trzhongty 

 

Let me thank you for posting.

I am currently checking this behavior, and I will get back to you ASAP.

 

Thanks.

Mahmoud

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.