Skip to main content
Ubus99
Associate III
November 23, 2019
Solved

Error with auto generated drivers in CubeIDE

  • November 23, 2019
  • 1 reply
  • 1733 views

I am not sure this belongs here, it could just as well be in MCU, but i believe it could be a configuration problem, so i put it here.

I am working on a project with Cube IDE. when I tried to compile for the first time, the build failed because of errors in the auto generated drivers. To fix this, I tried to delete all drivers and let MX import them again, but the error persisted.

The Error:

invalid type argument of '->' (have 'TIM_HandleTypeDef {aka struct <anonymous>}')	stm32f1xx_hal_tim.h	/>Project</Drivers/STM32F1xx_HAL_Driver/Inc	line 1222	C/C++ Problem
 
invalid type argument of '->' (have 'TIM_HandleTypeDef {aka struct <anonymous>}')	stm32f1xx_hal_tim.h	/>Project</Drivers/STM32F1xx_HAL_Driver/Inc	line 1229	C/C++ Problem
 
make: *** [Src/subdir.mk:73: Src/stm32f1xx_it.o] Error 1	>Project< 	C/C++ Problem
 
make: *** Waiting for unfinished jobs....	>Project<	 C/C++ Problem

The Code:

#define __HAL_TIM_SET_COUNTER(__HANDLE__, __COUNTER__) ((__HANDLE__)->Instance->CNT = (__COUNTER__))
 
/**
 * @brief Get the TIM Counter Register value on runtime.
 * @param __HANDLE__ TIM handle.
 * @retval 16-bit or 32-bit value of the timer counter register (TIMx_CNT)
 */
#define __HAL_TIM_GET_COUNTER(__HANDLE__) ((__HANDLE__)->Instance->CNT)
 
/**
 * @brief Set the TIM Autoreload Register value on runtime without calling another time any Init function.
 * @param __HANDLE__ TIM handle.
 * @param __AUTORELOAD__ specifies the Counter register new value.
 * @retval None
 */

I have no clue what is wrong, and I don't want to manually fix it, because cubemx will overwrite it anyway

This topic has been closed for replies.
Best answer by Ubus99

Solved, I was stupid. The call needs a pointer

1 reply

Ubus99
Ubus99AuthorAnswer
Associate III
November 24, 2019

Solved, I was stupid. The call needs a pointer