cancel
Showing results for 
Search instead for 
Did you mean: 

Package for STM32F1 Series 1.8.0 trouble

lzai
Associate

Use this "STM32Cube Package for STM32F1 Series 1.8.0" ,  

This statement:

__HAL_TIM_SET_CAPTUREPOLARITY(htim,TIM_CHANNEL_2,TIM_INPUTCHANNELPOLARITY_FALLING);

is wrong.   Tips: ../Src/freertos.c(417): error: #53: expected a ":"

but in 1.7.0, it is Correct. why? 

1 ACCEPTED SOLUTION

Accepted Solutions
Wli.11
Associate

There is a bug in ` Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim.h`

here is the solution, found this file and change

#define TIM_RESET_CAPTUREPOLARITY(__HANDLE__, __CHANNEL__) \
 
- (((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCER &= ~(TIM_CCER_CC1P | TIM_CCER_CC1NP))) :\
 
+ (((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCER &= ~(TIM_CCER_CC1P | TIM_CCER_CC1NP)) :\
 
  ((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->Instance->CCER &= ~(TIM_CCER_CC2P | TIM_CCER_CC2NP)) :\
 
  ((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCER &= ~(TIM_CCER_CC3P)) :\
 
  ((__HANDLE__)->Instance->CCER &= ~(TIM_CCER_CC4P)))

View solution in original post

4 REPLIES 4
Wli.11
Associate

There is a bug in ` Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim.h`

here is the solution, found this file and change

#define TIM_RESET_CAPTUREPOLARITY(__HANDLE__, __CHANNEL__) \
 
- (((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCER &= ~(TIM_CCER_CC1P | TIM_CCER_CC1NP))) :\
 
+ (((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCER &= ~(TIM_CCER_CC1P | TIM_CCER_CC1NP)) :\
 
  ((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->Instance->CCER &= ~(TIM_CCER_CC2P | TIM_CCER_CC2NP)) :\
 
  ((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCER &= ~(TIM_CCER_CC3P)) :\
 
  ((__HANDLE__)->Instance->CCER &= ~(TIM_CCER_CC4P)))

lzai
Associate

thank you very much​

danelifab
Associate II

Many thanks! WLi.1