cancel
Showing results for 
Search instead for 
Did you mean: 

I upgraded my STM32CubeIDE from 1.4.0 release to 1.6.1 and following LED flash doesn't work. I tried release 1.5.1 also didn't work. Then I tried again on 1.4.0 release and it works fine. Why? Using WIndows7.

KMunj
Associate II

Here is the code;

 /* USER CODE BEGIN WHILE */

 while (1)

 {

  /* USER CODE END WHILE */

  /* USER CODE BEGIN 3 */

 HAL_GPIO_TogglePin(GPIOB, GPIO_PIN_0); // For F767ZI_Nucleo

 if (HAL_GPIO_ReadPin(GPIOC,GPIO_PIN_13) == 1)

  {

  HAL_Delay(3000);

  }

 else

  HAL_Delay(1000);

 }

 /* USER CODE END 3 */

1 ACCEPTED SOLUTION

Accepted Solutions
Paul1
Lead

Try:

  • Backup working project (and .ioc)
  • Open ioc file in old STM32CubeMX (?), do: Save Project, Generate Report (pdf and Txt), and generate code
  • Open ioc file in new STM32CubeMX (6.2.1), do: Save Project, Generate Report (pdf and Txt), and generate code
  • Compare the reports and generated code
  • (I use Beyond Compare for comparing project folders)

There may be a difference in generated code, or there may be an MX setting getting processed differently (maybe a Clock?)

  • I do these steps whenever upgrading a project's tools (STM32Cube or other), as I've been burned in the past with some tools causing unexpected changes. It is safer to over check, then to find some rarely used feature or piece of code has been unexpectedly changed and gets out to the customer/client.

Paul

View solution in original post

5 REPLIES 5
Markus GIRDLAND
ST Employee

Hello!

In what way does it work and/or not work?

It doesn't build? The code isn't doing what you have hoped?

Any error or additional information would be appreciated!

KMunj
Associate II

Hi Markus,

In both 1.6.1 and 1.5.1, I create the project with default settings. I don't make any changes to .ioc file. When main.c is generated I add the above code in the while loop.

Then I managed to compile the project without any warnings or errors. Then I load the binary by opening the debug session. Then I click on the green arrow "Start". Now LED LD1 doesn't flash. When I do the same with 1.4.0; I see the LED LD1 flash every second. If I press and hold Blue switch B1, LED LD1 flashes every 3 seconds.

I also tried a Timer project, which works fine on 1.4.0 doesn't work on 1.6.1 and 1.5.1. In this project, I set timer TIM3, in internal clock mode, Channel 1 to PWM output, Main MCU clock to 216MHz, prescaler to 0, and period to 4217 and pulse width to 2109. I should get a clock about 23.6KHz with 50% duty cycle. I do get with 1.4.0, but not with 1.6.1 and 1.5.1. In all the cases the project gets compiled and loaded properly without any warnings or errors.

Thanks

Kiran

Paul1
Lead

Try:

  • Backup working project (and .ioc)
  • Open ioc file in old STM32CubeMX (?), do: Save Project, Generate Report (pdf and Txt), and generate code
  • Open ioc file in new STM32CubeMX (6.2.1), do: Save Project, Generate Report (pdf and Txt), and generate code
  • Compare the reports and generated code
  • (I use Beyond Compare for comparing project folders)

There may be a difference in generated code, or there may be an MX setting getting processed differently (maybe a Clock?)

  • I do these steps whenever upgrading a project's tools (STM32Cube or other), as I've been burned in the past with some tools causing unexpected changes. It is safer to over check, then to find some rarely used feature or piece of code has been unexpectedly changed and gets out to the customer/client.

Paul

KMunj
Associate II

Hi Paul,

Thank you very much for your recommendations.

I got IDE 1.6.1 to work today. All I did was change my delay from 1 sec to 2 sec and rebuild the project and load/run.

LED started blinking, every 2 seconds.

Kiran

KMunj
Associate II

Hi Markus,

I got IDE 1.6.1 to work today. All I did was change my delay from 1 sec to 2 sec and rebuild the project and load/run.

LED started blinking, every 2 seconds. I also got the Timer project to work now.

No further action is required from your end.

Thanks

Kiran