cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding RTC update in I-CUBE-LRWAN project

DSehg.1
Associate

Greetings,

I am working on the LoRaWAN Project and facing issues in updating RTC from a server/UART in LoRaWAN library.

My code is getting stuck while updating RTC, I am recieving time and from UART through user input.

RTC_TimeTypeDef set_time;

RTC_DateTypeDef set_date;

HAL_StatusTypeDef setTime_status;

HAL_StatusTypeDef setDate_status;

SysTime_t time;

set_date.Year = RxBuff->Buffer[1] - 12;

set_date.Month = RxBuff->Buffer[2];

set_date.Date = RxBuff->Buffer[3];

setDate_status = HAL_RTC_SetDate(&hrtc, &set_date, RTC_FORMAT_BIN);

set_time.Hours = RxBuff->Buffer[4];

set_time.Minutes = RxBuff->Buffer[5];

set_time.Seconds = RxBuff->Buffer[6];

if(set_time.Hours > 0x12){

set_time.TimeFormat = RTC_HOURFORMAT12_PM;

}

else{

set_time.TimeFormat = RTC_HOURFORMAT12_AM;

}

setTime_status = HAL_RTC_SetTime(&hrtc, &set_time, RTC_FORMAT_BIN);

Please Help me out from this. I found something on ST commnunity regarding same and one developer is setting RTC through void SysTimeSet( SysTime_t sysTime );

I am not able to understand this.

CurrentTaskId and TaskSet become 0 after updating RTC and code goes in NOTASKRUNNING mode and stuck in UTIL_SEQ_Idle( ) which returns nothing.

Please provide some code or another way to update the RTC in I-CUBE-LRWAN project. I want to use RTC for changing the interval time for LoRa uplink packets.

Regards,

Devesh Sehgal

0 REPLIES 0