<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>LPC MicrocontrollersのトピックRe: LPC55S6x Connecting the RTC to newlib time.h using _gettimeofday()</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S6x-Connecting-the-RTC-to-newlib-time-h-using-gettimeofday/m-p/1684589#M53409</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am not familiar with the newlib timer, I can not find out the file either&lt;/P&gt;
&lt;PRE class="lia-code-sample  language-c"&gt;&lt;CODE&gt;reent.h&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Can you attach the reent.h file so that we can have a test.&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;Xiangjun Rong&lt;/P&gt;</description>
    <pubDate>Mon, 10 Jul 2023 07:30:38 GMT</pubDate>
    <dc:creator>xiangjun_rong</dc:creator>
    <dc:date>2023-07-10T07:30:38Z</dc:date>
    <item>
      <title>LPC55S6x Connecting the RTC to newlib time.h using _gettimeofday()</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S6x-Connecting-the-RTC-to-newlib-time-h-using-gettimeofday/m-p/1683096#M53359</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to connect the onboard rtc of the LPC55S69&amp;nbsp;to the time.h functions in newlib:&lt;/P&gt;&lt;P&gt;I have tried defining my own&amp;nbsp;_gettimeofday() function &lt;A href="https://community.nxp.com/t5/LPCXpresso-IDE/time-does-nothing/m-p/550428/highlight/true#M11415" target="_blank" rel="noopener"&gt;based on this forum post&lt;/A&gt; as follows:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;#include "LPC55S69_cm33_core0.h"
#include "fsl_common.h"
#include "fsl_rtc.h"

#include &amp;lt;time.h&amp;gt;
#include &amp;lt;reent.h&amp;gt;
#include "assert.h"

int _gettimeofday_r(struct _reent *pReent, struct timeval *tp, void *tzvp)
{
	assert(pReent != NULL);
	assert(tp != NULL);

	if (tp)
	{
		tp-&amp;gt;tv_sec = RTC_GetSecondsTimerCount(RTC); // get the seconds from a clock source
		tp-&amp;gt;tv_usec = 0; // get the microsconds from a clock source
	}

	return 0;
}

int _gettimeofday(struct timeval *tp, void *tzvp)
{
	return _gettimeofday_r(_impure_ptr, tp, tzvp);
}&lt;/LI-CODE&gt;&lt;P&gt;However it seems to create the following error(s):&lt;/P&gt;&lt;P&gt;Description Resource Path Location Type&lt;BR /&gt;c:/nxp/mcuxpressoide_11.7.1_9221/ide/plugins/com.nxp.mcuxpresso.tools.win32_11.7.1.202301190959/tools/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/lib/thumb/v8-m.main+fp/hard\libcr_newlib_semihost.a(syscalls.o): in function `_gettimeofday': firmware C/C++ Problem&lt;/P&gt;&lt;P&gt;Description Resource Path Location Type&lt;BR /&gt;first defined here firmware line 59 C/C++ Problem&lt;/P&gt;&lt;P&gt;Description Resource Path Location Type&lt;BR /&gt;make: *** [makefile:115: all] Error 2 firmware C/C++ Problem&lt;/P&gt;&lt;P&gt;Description Resource Path Location Type&lt;BR /&gt;make[1]: *** [makefile:124: firmware.axf] Error 1 firmware C/C++ Problem&lt;/P&gt;&lt;P&gt;Description Resource Path Location Type&lt;BR /&gt;make[1]: Target 'main-build' not remade because of errors. firmware C/C++ Problem&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this not the correct way to define this function?&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2023 10:19:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S6x-Connecting-the-RTC-to-newlib-time-h-using-gettimeofday/m-p/1683096#M53359</guid>
      <dc:creator>Jelle</dc:creator>
      <dc:date>2023-07-06T10:19:47Z</dc:date>
    </item>
    <item>
      <title>Re: LPC55S6x Connecting the RTC to newlib time.h using _gettimeofday()</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S6x-Connecting-the-RTC-to-newlib-time-h-using-gettimeofday/m-p/1684589#M53409</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am not familiar with the newlib timer, I can not find out the file either&lt;/P&gt;
&lt;PRE class="lia-code-sample  language-c"&gt;&lt;CODE&gt;reent.h&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Can you attach the reent.h file so that we can have a test.&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;Xiangjun Rong&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2023 07:30:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S6x-Connecting-the-RTC-to-newlib-time-h-using-gettimeofday/m-p/1684589#M53409</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2023-07-10T07:30:38Z</dc:date>
    </item>
    <item>
      <title>Re: LPC55S6x Connecting the RTC to newlib time.h using _gettimeofday()</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S6x-Connecting-the-RTC-to-newlib-time-h-using-gettimeofday/m-p/1687601#M53477</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;The reent.h file is supplied by the newlib library in the mcuxpresso SDK.&lt;/P&gt;&lt;P&gt;The original source can be found in the newlib github repository:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/eblot/newlib/blob/master/newlib/libc/include/reent.h" target="_blank"&gt;https://github.com/eblot/newlib/blob/master/newlib/libc/include/reent.h&lt;/A&gt;&lt;/P&gt;&lt;P&gt;On my machine it can be found at:&lt;BR /&gt;C:\nxp\MCUXpressoIDE_11.7.1_9221\ide\plugins\com.nxp.mcuxpresso.tools.win32_11.7.1.202301190959\tools\arm-none-eabi\include&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2023 13:47:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S6x-Connecting-the-RTC-to-newlib-time-h-using-gettimeofday/m-p/1687601#M53477</guid>
      <dc:creator>Jelle</dc:creator>
      <dc:date>2023-07-13T13:47:45Z</dc:date>
    </item>
  </channel>
</rss>

