cancel
Showing results for 
Search instead for 
Did you mean: 

HAL_RTCEx_BKUPWrite problem

Mohammad A
Senior
Posted on October 26, 2017 at 22:21

There seems to be a problem in HAL_RTCEx_BKUPWrite which is available in CubeF1 1.6.0 package.

void HAL_RTCEx_BKUPWrite(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister, uint32_t Data)
{
 uint32_t tmp = 0U;
 /* Prevent unused argument(s) compilation warning */
 UNUSED(hrtc);
 /* Check the parameters */
 assert_param(IS_RTC_BKP(BackupRegister));
 
 tmp = (uint32_t)BKP_BASE; 
 tmp += (BackupRegister * 4U);
 *(__IO uint32_t *) tmp = (Data & BKP_DR1_D);
}�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?

it's not clear if this function is capable of writing 32 bit variables or not, because Data is uint32_t but then it ANDs Data to cut its least significant 16 bits.

It may confuse the user.

#rtc #cube #hal #bug
0 REPLIES 0