I am assuming you are using the GNU toolchain. By default the toolchain C runtime library "newlib" is targeted to a semihosted environment, but only the low level write for printf() to the console is supported in the Synergy e2studio development environment. To be able to write you own low level _gettimeofday() function, to get the time from the RTC you would need to change the linker setting "Cross ARM C Linker- Miscellaneous- Other Linker FLags" from --specs=rdimon.specs to --specs=nosys.specs and provide your own version of the function _gettimeofday (struct timeval * tp, void * tzvp) (and any of the other syscall functions you require) . I have attached the semihosted version, so you can see what happens in the default setup, when --specs=rdimon.specs is specified.
↧