<?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>topic SDK_DelayAtLeastUs - is not working as it should in i.MX RT Crossover MCUs</title>
    <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/SDK-DelayAtLeastUs-is-not-working-as-it-should/m-p/1763114#M27724</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I'm creating a new applicaion using&amp;nbsp;SDK_DelayAtLeastUs, while in it&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;void SDK_DelayAtLeastUs	(	uint32_t 	delayTime_us,
uint32_t 	coreClock_Hz 
)	&lt;/LI-CODE&gt;&lt;P&gt;coreClock_Hz is nothing but the&amp;nbsp;BOARD_BOOTCLOCKRUN_CORE_CLOCK --&amp;gt; which is by default&amp;nbsp;600000000U.&lt;BR /&gt;&lt;BR /&gt;Yet the delay is not working as it should. Why is it so? All I'm trying is a simple LED Toggle!!&lt;/P&gt;&lt;LI-CODE lang="markup"&gt; while(1) {
    	GPIO_WritePinOutput(GPIO1,9,0);
    	        SDK_DelayAtLeastUs(1000, BOARD_BOOTCLOCKRUN_CORE_CLOCK);
    	GPIO_WritePinOutput(GPIO1,9,1);
    	        SDK_DelayAtLeastUs(1000, BOARD_BOOTCLOCKRUN_CORE_CLOCK);
    }&lt;/LI-CODE&gt;&lt;P&gt;PS :&amp;nbsp; - GPIO_WritePinOutput&amp;nbsp;works fine though.&lt;/P&gt;</description>
    <pubDate>Fri, 24 Nov 2023 06:42:25 GMT</pubDate>
    <dc:creator>GanesanGuru</dc:creator>
    <dc:date>2023-11-24T06:42:25Z</dc:date>
    <item>
      <title>SDK_DelayAtLeastUs - is not working as it should</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/SDK-DelayAtLeastUs-is-not-working-as-it-should/m-p/1763114#M27724</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I'm creating a new applicaion using&amp;nbsp;SDK_DelayAtLeastUs, while in it&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;void SDK_DelayAtLeastUs	(	uint32_t 	delayTime_us,
uint32_t 	coreClock_Hz 
)	&lt;/LI-CODE&gt;&lt;P&gt;coreClock_Hz is nothing but the&amp;nbsp;BOARD_BOOTCLOCKRUN_CORE_CLOCK --&amp;gt; which is by default&amp;nbsp;600000000U.&lt;BR /&gt;&lt;BR /&gt;Yet the delay is not working as it should. Why is it so? All I'm trying is a simple LED Toggle!!&lt;/P&gt;&lt;LI-CODE lang="markup"&gt; while(1) {
    	GPIO_WritePinOutput(GPIO1,9,0);
    	        SDK_DelayAtLeastUs(1000, BOARD_BOOTCLOCKRUN_CORE_CLOCK);
    	GPIO_WritePinOutput(GPIO1,9,1);
    	        SDK_DelayAtLeastUs(1000, BOARD_BOOTCLOCKRUN_CORE_CLOCK);
    }&lt;/LI-CODE&gt;&lt;P&gt;PS :&amp;nbsp; - GPIO_WritePinOutput&amp;nbsp;works fine though.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Nov 2023 06:42:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/SDK-DelayAtLeastUs-is-not-working-as-it-should/m-p/1763114#M27724</guid>
      <dc:creator>GanesanGuru</dc:creator>
      <dc:date>2023-11-24T06:42:25Z</dc:date>
    </item>
    <item>
      <title>Re: SDK_DelayAtLeastUs - is not working as it should</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/SDK-DelayAtLeastUs-is-not-working-as-it-should/m-p/1763326#M27734</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/216172"&gt;@GanesanGuru&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; How do you test it is not working?&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I have checked it on my side, it works OK:&lt;/P&gt;
&lt;P&gt;My test code is based on the RT1060 SDK led_blinky code,:&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;int main(void)
{
    /* Board pin init */
    BOARD_ConfigMPU();
    BOARD_InitBootPins();
    BOARD_InitBootClocks();
    /* Update the core clock */
    SystemCoreClockUpdate();

    /* Set systick reload value to generate 1ms interrupt */
    if (SysTick_Config(SystemCoreClock / 1000U))
    {
        while (1)
        {
        }
    }

    SDK_DelayAtLeastUs(1000000,BOARD_BOOTCLOCKRUN_CORE_CLOCK);
    while (1)
    {
        /* Delay 1000 ms */
      //  SysTick_DelayTicks(1000U);
      SDK_DelayAtLeastUs(1000000,BOARD_BOOTCLOCKRUN_CORE_CLOCK);
        if (g_pinSet)
        {
            GPIO_PinWrite(EXAMPLE_LED_GPIO, EXAMPLE_LED_GPIO_PIN, 0U);
            g_pinSet = false;
        }
        else
        {
            GPIO_PinWrite(EXAMPLE_LED_GPIO, EXAMPLE_LED_GPIO_PIN, 1U);
            g_pinSet = true;
        }
    }
}&lt;/LI-CODE&gt;
&lt;P&gt;Then the delay is about 1s.&lt;/P&gt;
&lt;P&gt;Please note, your import time is us, so, in fact, your code 1ms, if you just check the GPIO with your eye, not the oscilloscope, you will can't find it.&lt;/P&gt;
&lt;P&gt;You can test with 1s, then test it again.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Wish it helps you!&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Kerry&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Nov 2023 10:52:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/SDK-DelayAtLeastUs-is-not-working-as-it-should/m-p/1763326#M27734</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2023-11-24T10:52:41Z</dc:date>
    </item>
  </channel>
</rss>

