2021-06-15 06:54 PM
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 */
Solved! Go to Solution.
2021-06-16 09:52 AM
Try:
There may be a difference in generated code, or there may be an MX setting getting processed differently (maybe a Clock?)
Paul
2021-06-16 12:24 AM
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!
2021-06-16 08:41 AM
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
2021-06-16 09:52 AM
Try:
There may be a difference in generated code, or there may be an MX setting getting processed differently (maybe a Clock?)
Paul
2021-06-17 03:45 PM
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
2021-06-17 03:47 PM
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