Loading...
 

Zephyr project on STM32

   Zephyr Workbench, a VSCode extension to manage Zephyr on STM32.
It enables users to easily create, develop, and debug Zephyr applications.
Main features:
  • Install host dependencies.
  • Import toolchain and SDK.
  • Create, configure, build and manage apps.
  • Debug STM32.
You can directly download it from the VSCode marketplace
For more details, visit the Zephyr Workbench

System Workbench for STM32


RTC Alarm doesn't work second time.. Please Help me..

I’m a rookie. I designed that RTC alarms works every 5 seconds and toggles LED. (SMT32F7)
but first handler works. but second one doesn’t work. how to make it

int main(void)
{

CPU_CACHE_Enable();

HAL_Init();

/* Configure the system clock */
SystemClock_Config();

/* Initialize all configured peripherals */
HAL_PWR_EnableBkUpAccess();
__HAL_RCC_RTC_ENABLE();
MX_GPIO_Init();
MX_RTC_Init();

while (1)
{
}
}

void HAL_RTC_AlarmAEventCallback(RTC_HandleTypeDef *hrtc)
{
RTC_AlarmTypeDef sAlarm;
uint8_t tmpSeconds;

HAL_RTC_GetAlarm(hrtc, &sAlarm, RTC_ALARM_A, FORMAT_BIN);
if(sAlarm.AlarmTime.Seconds>50){
sAlarm.AlarmTime.Seconds=0;
}
else {
tmpSeconds = sAlarm.AlarmTime.Seconds;
sAlarm.AlarmTime.Seconds=tmpSeconds+0x05;
}

//sAlarm.AlarmTime.Minutes=sAlarm.AlarmTime.Minutes + 1;

HAL_GPIO_TogglePin(GPIOI, LED_ON_Pin);
while(HAL_RTC_SetAlarm_IT(hrtc, &sAlarm, FORMAT_BCD)!=HAL_OK)
{__NOP();}
}

void RTC_Alarm_IRQHandler(void)
{
HAL_RTC_AlarmIRQHandler(&hrtc);
}

void HAL_RTC_AlarmAEventCallback(RTC_HandleTypeDef *hrtc) {
/* Prevent unused argument(s) compilation warning */
UNUSED(hrtc);

/* NOTE : This function Should not be modified, when the callback is needed,
the HAL_RTC_AlarmAEventCallback could be implemented in the user file
*/
HAL_RTC_DeactivateAlarm(&hrtc,RTC_ALARM_A);
//__HAL_RCC_RTC_DISABLE();

MX_RTC_Init();
__HAL_RCC_RTC_ENABLE();

}


 

Newest Forum Posts

  1. Монтаж камина с грилем в Москве - установка и барбекю by KpddomErorb, 2025-05-10 18:28
  2. SPI on Nucleo_STMH533RE by royjamil, 2025-05-04 20:13
  3. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-25 07:37
  4. SPI on Nucleo_STMH533RE by royjamil, 2025-03-23 11:31
  5. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-23 09:33
  6. Configuring DMA for ADC in SW? by sam.hodgson, 2025-03-04 12:58
  7. Build a project in "release" mode by info@creosrl.it, 2025-02-20 18:12
  8. Build a project in "release" mode by info@creosrl.it, 2025-02-20 17:05
  9. Build a project in "release" mode by tang, 2025-02-20 10:36
  10. Build a project in "release" mode by info@creosrl.it, 2025-02-19 17:35

Last-Modified Blogs