cancel
Showing results for 
Search instead for 
Did you mean: 

Need Help to configure the Cortex M7 and Timer4 for STM32H735

nevase123
Associate II

Hello Team,

I have created .ioc project for STM32H735, where I am doing below things,

1. Generating timer delay for 1mS via TIM3, in interrupt of 1ms I am toggling the GPIO, below are configurations,

nevase123_0-1717049257393.png

 

2. NVIC setting for TIM3 interrupt are as fallows,

nevase123_1-1717049257140.png

 

3. Cortex M7 configurations are as fallows,

nevase123_2-1717049257737.png

 

 

With this configuration I am not getting output i.e. GPIO is not toggling after 1mS. 

Request you please look into this where I am missing confutations.

 

If possible, please provide same project with .ioc.

 

Thanks & regards,

Sachin N

2 REPLIES 2
Sarra.S
ST Employee

Hello @nevase123

From the block diagram of STM32735 datasheet, TIM3 is connected to APB1 (138Mhz max) 

You need to configure ARR and PSC accordingly to achieve the 1ms interrupt, please share your timer configuration

For the code part, it's quite simple: 

Between /* USER CODE BEGIN 2 */ and /* USER CODE END 2 */ tags, insert the function:

  /* USER CODE BEGIN 2 */
  HAL_TIM_Base_Start_IT(&htim3);
  /* USER CODE END 2 */

And in the main.c add the GPIO toggle (example PA5):  

/* USER CODE BEGIN 0 */
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim){
	HAL_GPIO_TogglePin(GPIOA, GPIO_PIN_5);
}
/* USER CODE END 0 */

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

nevase123
Associate II

Hello Sarra,

Thank you for your reply!!!

Please find below time code, I did same things as you mentioned,

Timer3 Start:

/* USER CODE BEGIN 2 */

HAL_TIM_Base_Start_IT(&htim3);

/* USER CODE END 2 */

 

GPIO Toggle in callback function:

/* USER CODE BEGIN 4 */

void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)

 

{

HAL_GPIO_TogglePin(USER_LED1_GPIO_Port, USER_LED1_Pin);

 

}

 

I set presclaer to 100, so timer frequency is 1.355MHz(Timer tick = 738uS) and ARR is 1000. So I am expecting thee interrupt after 0.738Sec.

 

But unfortunately I am not getting interrupt.

 

Request you to please share the ISR based timer code with configuration file i.e. .ioc

 

Regards,

Sachin N