ART-Pi开发板,新建Wifi示例工程,打开hwtimer就42个错误?

发布于 2021-03-03 15:10:40

RT-thread studio建工程,新建Wifi示例工程是有问题,打开hwtimer就42个错误?
使能timer13,按官方的示例建立的hwtimer_sample,hwtimer名称改为timer13了!
使用模板工程的话hwtimer_sample没有问题!这是什么怪问题?

新建工程rt-thread4.02,基于开发板art-pi 示例工程wifi
硬件里打开timer13,编译就出错,错误信息如下:
../libraries/drivers/drv_hwtimer.c:83:5: error: unknown type name 'TIM_HandleTypeDef'
arm-none-eabi-gcc "../libraries/drivers/drv_sdram.c"

 TIM_HandleTypeDef    tim_handle;
 ^

In file included from E:RT-ThreadStudioworkspaceart_pi_wifi_sht30librariesdriversinclude/drv_config.h:112:0,

             from ../libraries/drivers/drv_hwtimer.c:18:

E:RT-ThreadStudioworkspaceart_pi_wifi_sht30librariesdriversinclude/config/tim_config.h:34:8: error: field name not in record or union initializer

    .tim_handle.Instance     = TIM13,                    \
    ^

../libraries/drivers/drv_hwtimer.c:139:5: note: in expansion of macro 'TIM13_CONFIG'

 TIM13_CONFIG,
 ^

E:RT-ThreadStudioworkspaceart_pi_wifi_sht30librariesdriversinclude/config/tim_config.h:34:8: note: (near initialization for 'stm32_hwtimer_obj[0]')

    .tim_handle.Instance     = TIM13,                    \
    ^

../libraries/drivers/drv_hwtimer.c:139:5: note: in expansion of macro 'TIM13_CONFIG'

 TIM13_CONFIG,
 ^

In file included from E:RT-ThreadStudioworkspaceart_pi_wifi_sht30librariesSTM32H7xx_HALCMSISDeviceSTSTM32H7xxInclude/stm32h7xx.h:115:0,

             from E:\RT-ThreadStudio\workspace\art_pi_wifi_sht30\board/board.h:15,
             from ../libraries/drivers/drv_hwtimer.c:13:

E:RT-ThreadStudioworkspaceart_pi_wifi_sht30librariesSTM32H7xx_HALCMSISDeviceSTSTM32H7xxInclude/stm32h750xx.h:2406:29: warning: initialization makes integer from pointer without a cast [-Wint-conversion]
#define TIM13 ((TIM_TypeDef *) TIM13_BASE)

                         ^

E:RT-ThreadStudioworkspaceart_pi_wifi_sht30librariesdriversinclude/config/tim_config.h:34:35: note: in expansion of macro 'TIM13'

    .tim_handle.Instance     = TIM13,                    \
                               ^

../libraries/drivers/drv_hwtimer.c:139:5: note: in expansion of macro 'TIM13_CONFIG'

 TIM13_CONFIG,
 ^

E:RT-ThreadStudioworkspaceart_pi_wifi_sht30librariesSTM32H7xx_HALCMSISDeviceSTSTM32H7xxInclude/stm32h750xx.h:2406:29: note: (near initialization for 'stm32_hwtimer_obj[0].tim_handle')
#define TIM13 ((TIM_TypeDef *) TIM13_BASE)

                         ^

E:RT-ThreadStudioworkspaceart_pi_wifi_sht30librariesdriversinclude/config/tim_config.h:34:35: note: in expansion of macro 'TIM13'

    .tim_handle.Instance     = TIM13,                    \
                               ^

../libraries/drivers/drv_hwtimer.c:139:5: note: in expansion of macro 'TIM13_CONFIG'

 TIM13_CONFIG,
 ^

../libraries/drivers/drv_hwtimer.c: In function 'timer_init':
../libraries/drivers/drv_hwtimer.c:209:5: error: unknown type name 'TIM_HandleTypeDef'

 TIM_HandleTypeDef *tim = RT_NULL;
 ^

../libraries/drivers/drv_hwtimer.c:215:16: error: 'TIM_HandleTypeDef' undeclared (first use in this function)

     tim = (TIM_HandleTypeDef *)timer->parent.user_data;
            ^

../libraries/drivers/drv_hwtimer.c:215:16: note: each undeclared identifier is reported only once for each function it appears in
../libraries/drivers/drv_hwtimer.c:215:35: error: expected expression before ')' token

     tim = (TIM_HandleTypeDef *)timer->parent.user_data;
                               ^

../libraries/drivers/drv_hwtimer.c:228:16: error: request for member 'Instance' in something not a structure or union

     if (tim->Instance == TIM13 || tim->Instance == TIM14)
            ^

../libraries/drivers/drv_hwtimer.c:228:42: error: request for member 'Instance' in something not a structure or union

     if (tim->Instance == TIM13 || tim->Instance == TIM14)
                                      ^

../libraries/drivers/drv_hwtimer.c:241:12: error: request for member 'Init' in something not a structure or union

     tim->Init.Period            = 10000 - 1;
        ^

../libraries/drivers/drv_hwtimer.c:242:12: error: request for member 'Init' in something not a structure or union

     tim->Init.Prescaler         = prescaler_value;
        ^

../libraries/drivers/drv_hwtimer.c:243:12: error: request for member 'Init' in something not a structure or union

     tim->Init.ClockDivision     = TIM_CLOCKDIVISION_DIV1;
        ^

../libraries/drivers/drv_hwtimer.c:243:39: error: 'TIM_CLOCKDIVISION_DIV1' undeclared (first use in this function)

     tim->Init.ClockDivision     = TIM_CLOCKDIVISION_DIV1;
                                   ^

../libraries/drivers/drv_hwtimer.c:246:16: error: request for member 'Init' in something not a structure or union

         tim->Init.CounterMode   = TIM_COUNTERMODE_UP;
            ^

../libraries/drivers/drv_hwtimer.c:246:39: error: 'TIM_COUNTERMODE_UP' undeclared (first use in this function)

         tim->Init.CounterMode   = TIM_COUNTERMODE_UP;
                                   ^

../libraries/drivers/drv_hwtimer.c:250:16: error: request for member 'Init' in something not a structure or union

         tim->Init.CounterMode   = TIM_COUNTERMODE_DOWN;
            ^

../libraries/drivers/drv_hwtimer.c:250:39: error: 'TIM_COUNTERMODE_DOWN' undeclared (first use in this function)

         tim->Init.CounterMode   = TIM_COUNTERMODE_DOWN;
                                   ^

../libraries/drivers/drv_hwtimer.c:252:12: error: request for member 'Init' in something not a structure or union

     tim->Init.RepetitionCounter = 0;
        ^

../libraries/drivers/drv_hwtimer.c:255:12: error: request for member 'Init' in something not a structure or union

     tim->Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
        ^

../libraries/drivers/drv_hwtimer.c:255:39: error: 'TIM_AUTORELOAD_PRELOAD_DISABLE' undeclared (first use in this function)

     tim->Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
                                   ^

../libraries/drivers/drv_hwtimer.c:257:13: warning: implicit declaration of function 'HAL_TIM_Base_Init' [-Wimplicit-function-declaration]

     if (HAL_TIM_Base_Init(tim) != HAL_OK)
         ^

../libraries/drivers/drv_hwtimer.c:271:13: warning: implicit declaration of function '__HAL_TIM_CLEAR_FLAG' [-Wimplicit-function-declaration]

         __HAL_TIM_CLEAR_FLAG(tim, TIM_FLAG_UPDATE);
         ^

../libraries/drivers/drv_hwtimer.c:271:39: error: 'TIM_FLAG_UPDATE' undeclared (first use in this function)

         __HAL_TIM_CLEAR_FLAG(tim, TIM_FLAG_UPDATE);
                                   ^

../libraries/drivers/drv_hwtimer.c:273:13: warning: implicit declaration of function '__HAL_TIM_URS_ENABLE' [-Wimplicit-function-declaration]

         __HAL_TIM_URS_ENABLE(tim);
         ^

../libraries/drivers/drv_hwtimer.c: In function 'timer_start':
../libraries/drivers/drv_hwtimer.c:283:5: error: unknown type name 'TIM_HandleTypeDef'

 TIM_HandleTypeDef *tim = RT_NULL;
 ^

../libraries/drivers/drv_hwtimer.c:287:12: error: 'TIM_HandleTypeDef' undeclared (first use in this function)

 tim = (TIM_HandleTypeDef *)timer->parent.user_data;
        ^

../libraries/drivers/drv_hwtimer.c:287:31: error: expected expression before ')' token

 tim = (TIM_HandleTypeDef *)timer->parent.user_data;
                           ^

../libraries/drivers/drv_hwtimer.c:290:5: warning: implicit declaration of function '__HAL_TIM_SET_COUNTER' [-Wimplicit-function-declaration]

 __HAL_TIM_SET_COUNTER(tim, 0);
 ^

../libraries/drivers/drv_hwtimer.c:292:5: warning: implicit declaration of function '__HAL_TIM_SET_AUTORELOAD' [-Wimplicit-function-declaration]

 __HAL_TIM_SET_AUTORELOAD(tim, t - 1);
 ^

../libraries/drivers/drv_hwtimer.c:297:12: error: request for member 'Instance' in something not a structure or union

     tim->Instance->CR1 |= TIM_OPMODE_SINGLE;
        ^

../libraries/drivers/drv_hwtimer.c:297:31: error: 'TIM_OPMODE_SINGLE' undeclared (first use in this function)

     tim->Instance->CR1 |= TIM_OPMODE_SINGLE;
                           ^

../libraries/drivers/drv_hwtimer.c:301:12: error: request for member 'Instance' in something not a structure or union

     tim->Instance->CR1 &= (~TIM_OPMODE_SINGLE);
        ^

../libraries/drivers/drv_hwtimer.c:305:9: warning: implicit declaration of function 'HAL_TIM_Base_Start_IT' [-Wimplicit-function-declaration]

 if (HAL_TIM_Base_Start_IT(tim) != HAL_OK)
     ^

../libraries/drivers/drv_hwtimer.c: In function 'timer_stop':
../libraries/drivers/drv_hwtimer.c:316:5: error: unknown type name 'TIM_HandleTypeDef'

 TIM_HandleTypeDef *tim = RT_NULL;
 ^

../libraries/drivers/drv_hwtimer.c:320:12: error: 'TIM_HandleTypeDef' undeclared (first use in this function)

 tim = (TIM_HandleTypeDef *)timer->parent.user_data;
        ^

../libraries/drivers/drv_hwtimer.c:320:31: error: expected expression before ')' token

 tim = (TIM_HandleTypeDef *)timer->parent.user_data;
                           ^

../libraries/drivers/drv_hwtimer.c:323:5: warning: implicit declaration of function 'HAL_TIM_Base_Stop_IT' [-Wimplicit-function-declaration]

 HAL_TIM_Base_Stop_IT(tim);
 ^

../libraries/drivers/drv_hwtimer.c: In function 'timer_ctrl':
../libraries/drivers/drv_hwtimer.c:331:5: error: unknown type name 'TIM_HandleTypeDef'

 TIM_HandleTypeDef *tim = RT_NULL;
 ^

../libraries/drivers/drv_hwtimer.c:338:12: error: 'TIM_HandleTypeDef' undeclared (first use in this function)

 tim = (TIM_HandleTypeDef *)timer->parent.user_data;
        ^

../libraries/drivers/drv_hwtimer.c:338:31: error: expected expression before ')' token

 tim = (TIM_HandleTypeDef *)timer->parent.user_data;
                           ^

../libraries/drivers/drv_hwtimer.c:359:16: error: request for member 'Instance' in something not a structure or union

     if (tim->Instance == TIM13 || tim->Instance == TIM14)
            ^

../libraries/drivers/drv_hwtimer.c:359:42: error: request for member 'Instance' in something not a structure or union

     if (tim->Instance == TIM13 || tim->Instance == TIM14)
                                      ^

../libraries/drivers/drv_hwtimer.c:372:9: warning: implicit declaration of function '__HAL_TIM_SET_PRESCALER' [-Wimplicit-function-declaration]

     __HAL_TIM_SET_PRESCALER(tim, val - 1);
     ^

../libraries/drivers/drv_hwtimer.c:375:12: error: request for member 'Instance' in something not a structure or union

     tim->Instance->EGR |= TIM_EVENTSOURCE_UPDATE;
        ^

../libraries/drivers/drv_hwtimer.c:375:31: error: 'TIM_EVENTSOURCE_UPDATE' undeclared (first use in this function)

     tim->Instance->EGR |= TIM_EVENTSOURCE_UPDATE;
                           ^

../libraries/drivers/drv_hwtimer.c: In function 'timer_counter_get':
../libraries/drivers/drv_hwtimer.c:390:5: error: unknown type name 'TIM_HandleTypeDef'

 TIM_HandleTypeDef *tim = RT_NULL;
 ^

../libraries/drivers/drv_hwtimer.c:394:12: error: 'TIM_HandleTypeDef' undeclared (first use in this function)

 tim = (TIM_HandleTypeDef *)timer->parent.user_data;
        ^

../libraries/drivers/drv_hwtimer.c:394:31: error: expected expression before ')' token

 tim = (TIM_HandleTypeDef *)timer->parent.user_data;
                           ^

../libraries/drivers/drv_hwtimer.c:396:15: error: request for member 'Instance' in something not a structure or union

 return tim->Instance->CNT;
           ^

../libraries/drivers/drv_hwtimer.c: In function 'TIM8_UP_TIM13_IRQHandler':
../libraries/drivers/drv_hwtimer.c:465:5: warning: implicit declaration of function 'HAL_TIM_IRQHandler' [-Wimplicit-function-declaration]

 HAL_TIM_IRQHandler(&stm32_hwtimer_obj[TIM13_INDEX].tim_handle);
 ^

../libraries/drivers/drv_hwtimer.c: At top level:
../libraries/drivers/drv_hwtimer.c:523:36: error: unknown type name 'TIM_HandleTypeDef'
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)

                                ^

../libraries/drivers/drv_hwtimer.c: In function 'timer_counter_get':
../libraries/drivers/drv_hwtimer.c:397:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
make: * [libraries/drivers/subdir.mk:48: libraries/drivers/drv_hwtimer.o] Error 1
make: * Waiting for unfinished jobs....
"make -j4 all" terminated with exit code 2. Build might be incomplete.

18:08:21 Build Failed. 42 errors, 22 warnings. (took 29s.975ms)

查看更多

关注者
0
被浏览
103
1 个回答
whj467467222
whj467467222 认证专家 2021-03-03

贴出更多的错误信息,才能棒到你哦

撰写答案

请登录后再发布答案,点击登录

发布
问题

分享
好友

手机
浏览

扫码手机浏览