cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WLE5x NVIC RTC on Rev. Y die crash

6313oscar
Associate II

Hi,

 

We have been using the STM32WLE5CB for a while now, using the older die revision Z. Since we have a new batch with the new revision Y die of the STM32WLE5x we couldn't get our firmware working anymore. 

To try make it work we have tried to use the example LoRaWAN endnode and couldn't get it working on this revision. It seems to get stuck in initializing the RTC Alarm in the MX_NVIC_Init()

HAL_NVIC_EnableIRQ(RTC_Alarm_IRQn);

 Where it finally crashes in the core_cm4.h 

/**
  \brief   Get Interrupt Enable status
  \details Returns a device specific interrupt enable status from the NVIC interrupt controller.
  \param [in]      IRQn  Device specific interrupt number.
  \return             0  Interrupt is not enabled.
  \return             1  Interrupt is enabled.
  \note    IRQn must not be negative.
 */
__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn)
{
  if ((int32_t)(IRQn) >= 0)
  {
    return((uint32_t)(((NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
  }
  else
  {
    return(0U);
  }
}

Does anyone know what difference there is between Revision Z and Y, and how I can resolve my problem? The 32kHz RTC clock is working on my board where I have looked at the LSCO Clock Output on a scope.

3 REPLIES 3
STTwo-32
ST Employee

Hello @6313oscar and welcome to the ST Community 😊.

First, are you using both revisions on the same design or different ones ?

Second, Is it exactlly the same MCU on both revisions (the STM32WLE5CB)?

Best Regards.

STTwo-32

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hello STTwo-32,

It's the same design with one the STM32WLE5CBU6 on board as a LoRaWAN endnode sensor, we just got a new batch of PCB's with the new die revision Y on it. previously it was die revision Z on the design, the rest of the PCB design didn't change.

 

kind regards,

Oscar

It seems to go through the NVIC enable when  __HAL_RCC_RTCAPB_CLK_ENABLE(); is comment-out. But now I cannot init the RTCAPB afterwards.

 

void HAL_RTC_MspInit(RTC_HandleTypeDef* rtcHandle)
{

    RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
    if(rtcHandle->Instance == RTC)
    {
        PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_RTC;
        PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE;

        if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)
        {
            Error_Handler();
        }

        __HAL_RCC_RTC_ENABLE(); // Enable RTC clock
        
        /*
         * With the RTCAPB CLK enable comment-out it will go through the HAL_NVIC_enableIRQ
         */
        // __HAL_RCC_RTCAPB_CLK_ENABLE();

        HAL_NVIC_SetPriority(RTC_Alarm_IRQn, 0, 0);
        HAL_NVIC_EnableIRQ(RTC_Alarm_IRQn);


        // RTC interrupt Init for timestamps, etc.
        HAL_NVIC_SetPriority(TAMP_STAMP_LSECSS_SSRU_IRQn, 0, 0);
        HAL_NVIC_EnableIRQ(TAMP_STAMP_LSECSS_SSRU_IRQn);
    }

}