cancel
Showing results for 
Search instead for 
Did you mean: 

CAN initialisation error in Cube IDE using CubeMX 6.1.0

LSiew.1
Associate

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.

7 REPLIES 7
RaJa
Associate II

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

Hi @RaJa​ 

I confirm your CAN configuration is correct

Bouraoui

Bouraoui Chemli
ST Employee

Hi @LSiew.1​ 

Can you precise the bxCAN frequency provided via APB1?

Bouraoui

Hi @RaJa​ 

Can you please provide us more details about the problem your are facing in STM32CubeIDE 1.5.0 and 1.5.1?

Bouraoui

0693W000006Hw2SQAS.png

I have a same problem.

I'm using STM32F446RE and set bxCAN to 1Mbps with settings:

  • ABP1 Colck : 45MHz
  • prescaler : 5
  • Time Quanta in Bit Segment 1: 7 Times
  • Time Quanta in Bit Segment 2: 1 Time
  • ReSynchronization Jump Width: 1 Time

With this setting, I have been using it for over a year without any problems.

But after migrate my cubemx project to 6.1.0(current version) parameter error occur.​

0693W000006Hw3BQAS.png

Tomasz Motylewski
Associate II

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.

Bouraoui Chemli
ST Employee

Hi all,

This issue is solved in STM32cubeMX version 6.2.0.

Bouraoui