Skip to main content
MHara.2
Associate
December 17, 2022
Question

BlueNRG-1 : HAL_VTimerStart_ms always returns 0x01 error

  • December 17, 2022
  • 1 reply
  • 700 views

I copied the code snippet and vtimer.c from RTC_Virtual_Timer project to BLE_Beacon project. But HAL_VTimerStart_ms always returns 0x01 error(=timer already started). Similarly, I copied the same code to Micro_Sleep_Test project, it works normally with 0x00. It's unlikely, does that mean the BLE stack is using the same VTimer? (The BLE stack seems to have some VTimer functions. Micro_Sleep_Test project does not use the BLE stack.)

Why does the difference occur? and Is there a workaround?

    This topic has been closed for replies.

    1 reply

    MHara.2
    MHara.2Author
    Associate
    December 20, 2022

    HAL_VTimerStart_ms() of BLE_Beacon project is

    int HAL_VTimerStart_ms(uint8_t timerNum, int32_t msRelTimeout);

    Other hand, HAL_VTimerStart_ms() of RTC_Virtual_Timer project is

    int HAL_VTimerStart_ms(VTIMER_HandleType *timerHandle, uint32_t msRelTimeout);

    The difference was the first argument.

    Why is it making such a difference, it's annoying!

    When I set the "uint8_t timerNum", VTimer in the BLE_Beacon project is working correctly.