Skip to main content
LSiew.1
Visitor II
December 15, 2020
Question

CAN initialisation error in Cube IDE using CubeMX 6.1.0

When trying to initialise any of the two CAN interfaces of my STM32F446RE in CubeMX, using the CubeIDE-integrated version, presumably a rounding error occurs.

These are my settings:

  • Prescaler: 5
  • Time Quanta in Bit Segment 1: 6 Times
  • Time Quanta in Bit Segment 2: 2 Time
  • ReSynchronization Jump Width: 1 Time

When setting this up, it always says that Nominal Bit Time is too short (999ns), although the baud rate is correctly set to exactly 1Mbaud.

When using CubeMX version 6.0.1 without CubeIDE, everything works fine.

This topic has been closed for replies.

7 replies

RaJa
Associate II
December 25, 2020

The same problem with STM32F405RG. Previously configured 42MHz APB1

  • Prescaler: 3
  • Time Quanta in Bit Segment 1: 10 Times
  • Time Quanta in Bit Segment 2: 3 Time
  • ReSynchronization Jump Width: 1 Time

The same error while these settings works correct

 This problem in STM32CubeIDE 1.5.0 and 1.5.1

Bowman32
ST Employee
January 6, 2021

Hi @RaJa​ 

I confirm your CAN configuration is correct

Bouraoui

Bowman32
ST Employee
January 6, 2021

Hi @LSiew.1​ 

Can you precise the bxCAN frequency provided via APB1?

Bouraoui

Tomasz Motylewski
Visitor II
February 1, 2021

same problem here. It is wrong rouding.

111.1111111111111111*(7+1+1) = 999.9999999999999999 which should be rounded to 1000 ns.

In my case APB1 clock frequency 42 MHz. Time qauntum

47.61904761904762*(16+4+1) = 1000.00000000000002

Mcu.Name=STM32F437I(G-I)Tx

CAN1.ABOM=ENABLE

CAN1.BS1=CAN_BS1_16TQ

CAN1.BS2=CAN_BS2_4TQ

CAN1.CalculateTimeQuantum=47.61904761904762

CAN1.IPParameters=CalculateTimeQuantum,Prescaler,BS2,BS1,ABOM,NART

CAN1.NART=ENABLE

CAN1.Prescaler=2

And I am getting the same error with 999 ns.

This happened after stm32cubeide update to 1.5.1 as well. Before no error.

Bowman32
ST Employee
March 18, 2021

Hi all,

This issue is solved in STM32cubeMX version 6.2.0.

Bouraoui