Re: stm32h7xx REQUIRES_FULL_LIBC


Andy Ross
 

That sounded curious, so I checked.   It looks like the STM32 RTC driver you found is an old-style y/m/d/h/m/s device with separate fields, and the driver is using mktime() to convert those to a linear value for use by the rest of the system.  Zephyr's minimal libc doesn't have mktime().

But mktime() is pretty small and simple on its own, even with leap day handling (if the device does that).  Dealing with timezones gets crazy, but I don't see any zone management in the driver and am guessing the device doesn't bother to store one (i.e. the value isn't "real" anyway, it just presents a number relative to some consistent zero).  It seems like it would be very feasible for someone to add that logic to the driver, or even contribute a generic GMT-based mktime() to Zephyr.

Andy

On 6/18/2020 5:14 AM, Jan Pohanka wrote:
Hello,

current implementation for stm32h7 soc has REQUIRES_FULL_LIBC enabled
in soc/arm/st_stm32/stm32h7/Kconfig.series. Can someone tell me a
reason for this? I have found that it is also in
drivers/counter/Kconfig.stm32_rtc so I expect that stm32 HAL (or LL)
for counter depends on full libc?

best regards
Jan


Join devel@lists.zephyrproject.org to automatically receive all group messages.