Trying to get RTC working and HAL_GetTick() doesn't seem to be incrementing

Sysprogs forums Forums VisualGDB Trying to get RTC working and HAL_GetTick() doesn't seem to be incrementing

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #29425
    GeneM
    Participant

    I’m very much still learning the STM32 and all my work starts so far starts with examples.  I can run the  VisualGDB NewEmbedded Project -> STM32CubeMX Samples -> STM32F413ZH-Nucleo -> Examples -> RTC -> RTC_Calendar and it seems to work fine.  But when I put it in a larger app that started from the VisualGDB UART tutorial, it doesn’t.  I think I’ve tracked it down to the RTC_EnterInitMode subroutine in stm32F4xx_hal_rtc.c.  It looks like HAL_GetTick isn’t incrementing the tickstart value:

    tickstart = HAL_GetTick();

    /* Wait till RTC is in INIT state and if Time out is reached exit */
    while((hrtc->Instance->ISR & RTC_ISR_INITF) == (uint32_t)RESET)
    {
    if((HAL_GetTick() - tickstart ) > RTC_TIMEOUT_VALUE)
    {
    return HAL_TIMEOUT;
    }
    }
    }

    I’ve been trying to figure out what the STM32 HAL RTC example might be doing to make HAL_GetTick work but I’m not doing in the app I wrote from the VisualGDB UART example.  I don’t know if it makes any difference but my app is C++ and the HAL RTC example is straight C.  My code does have a SysTick_Handler in main.cpp as shown below.  The HAL example seems to bury the SysTick_Handler in various other files but it does seem to do the same thing.

    void SysTick_Handler(void)
    {
    HAL_IncTick();
    HAL_SYSTICK_IRQHandler();
    }

    Any suggestions will be greatly appreciated.

     

     

     

    #29426
    support
    Keymaster

    Hi,

    This looks like an issue specific to the STM32 microcontrollers and not something VisualGDB-specific. Please consider posting STM32-specific questions in the STM32 community instead.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.