Skip to main content
KnarfB
Super User
July 2, 2023
Solved

Bug: STM32CubeMX 6.8.1 STM32G431 TIM1 LL init code generation

  • July 2, 2023
  • 1 reply
  • 1943 views

how to reproduce:

  • generate a new C project for Nucleo-G431RB with all default settings.
  • enable TIM1 with internal clock source
  • set the prescaler to 170-1
  • set code generation for TIM to LL

generated code:

 

 

 /* USER CODE END TIM1_Init 1 */
 TIM_InitStruct.Prescaler = 170-LL_TIM_ETR_FILTER_FDIV1_N2;

 

 

which is incorrect (and finally killed a motor driver). For HAL code generation, everything looks fine:

 

 

 /* USER CODE END TIM1_Init 1 */
 htim1.Instance = TIM1;
 htim1.Init.Prescaler = 170-1;

 

 

Fun fact: Attaching the .ioc, .zip or .tar failed:

 

The attachment's tim1_bug.tar content type (application/x-tar) does not match its file extension and has been removed.

 

KnarfB

    This topic has been closed for replies.
    Best answer by Semer CHERNI

    Hello @KnarfB 

    First let me thank you for posting.

    I'm able to reproduce the described misbehavior. This issue need to be fixed from future releases. But in the meanwhile, you will need to change the cell parameter to "No check" as shown in the screenshot bellow.

    SemerCHERNI_0-1688375870551.png

    Whit this been said, I will raise the issue internally for analysis and fix. Internal tickets number: 1156332 (This is an internal tracking number and is not accessible or usable by customers).

    KR,

    Semer.

    1 reply

    Semer CHERNI
    Semer CHERNIBest answer
    ST Employee
    July 3, 2023

    Hello @KnarfB 

    First let me thank you for posting.

    I'm able to reproduce the described misbehavior. This issue need to be fixed from future releases. But in the meanwhile, you will need to change the cell parameter to "No check" as shown in the screenshot bellow.

    SemerCHERNI_0-1688375870551.png

    Whit this been said, I will raise the issue internally for analysis and fix. Internal tickets number: 1156332 (This is an internal tracking number and is not accessible or usable by customers).

    KR,

    Semer.