<?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 Re: Cortex M7 GPIO toggle frequency in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Cortex-M7-GPIO-toggle-frequency/m-p/1886633#M224899</link>
    <description>&lt;P&gt;Thank you &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/203368"&gt;@Manuel_Salas&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;but this won't help me I guess.&lt;/P&gt;&lt;P&gt;I'm using the &lt;EM&gt;GPIO_PortToggle&lt;/EM&gt; function, which reflects to&lt;/P&gt;&lt;LI-CODE lang="c"&gt;static inline void GPIO_PortToggle(GPIO_Type *base, uint32_t mask)
{
#if (defined(FSL_FEATURE_IGPIO_HAS_DR_TOGGLE) &amp;amp;&amp;amp; (FSL_FEATURE_IGPIO_HAS_DR_TOGGLE == 1))
    base-&amp;gt;DR_TOGGLE = mask;
#else
    base-&amp;gt;DR ^= mask;
#endif /* FSL_FEATURE_IGPIO_HAS_DR_TOGGLE */
}&lt;/LI-CODE&gt;&lt;P&gt;so I guess there is no overhead. The fact (from the previous thread), that GPIO is connected to IPG_CLK_ROOT which is running at 66.66MHz won't reflect to my behavior. The output freq on that pin is 4MHz.&lt;/P&gt;&lt;P&gt;On the other hand, could it be that I'm touching a wrong GPIO? Or maybe, would it be possible to test it on your side or provide me an application/code for verification?&lt;/P&gt;&lt;P&gt;Many thanks,&lt;BR /&gt;Andy&lt;/P&gt;</description>
    <pubDate>Thu, 13 Jun 2024 06:39:22 GMT</pubDate>
    <dc:creator>andrej_valek</dc:creator>
    <dc:date>2024-06-13T06:39:22Z</dc:date>
    <item>
      <title>Cortex M7 GPIO toggle frequency</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Cortex-M7-GPIO-toggle-frequency/m-p/1885197#M224795</link>
      <description>&lt;P&gt;Dear community!&lt;/P&gt;&lt;P&gt;I have an &lt;SPAN class=""&gt;8MPLUSLPD4-EVK&lt;/SPAN&gt; board and wanted to control the GPIO pin inside M7 core (MIMX8ML8xxxKZ). So I took the &lt;A href="https://github.com/nxp-mcuxpresso/mcux-sdk/" target="_blank" rel="noopener"&gt;https://github.com/nxp-mcuxpresso/mcux-sdk/&lt;/A&gt;&amp;nbsp; and use a led_output project as an example. I wanted to toggle GPIO pin as fast as possible. The Systemclk is running at 800MHz, but the output is toggling with freq 4MHz. I know, that the GPIO bus has to be driven lower then the syslck, but not 4MHz.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;// board.h
#define BOARD_SIGNAL_LOOP_GPIO      GPIO3
#define BOARD_SIGNAL_LOOP_GPIO_PIN  21U

// pin_mux.c
void BOARD_InitPins(void) {
    IOMUXC_SetPinMux(IOMUXC_SAI5_RXD0_GPIO3_IO21, 0U);
    IOMUXC_SetPinConfig(IOMUXC_SAI5_RXD0_GPIO3_IO21,
                        IOMUXC_SW_PAD_CTL_PAD_PE(1U) |
                        IOMUXC_SW_PAD_CTL_PAD_DSE(3U) |
                        IOMUXC_SW_PAD_CTL_PAD_FSEL(1U));


    IOMUXC_SetPinMux(IOMUXC_UART4_RXD_UART4_RX, 0U);
    IOMUXC_SetPinConfig(IOMUXC_UART4_RXD_UART4_RX, 
                        IOMUXC_SW_PAD_CTL_PAD_PUE_MASK |
                        IOMUXC_SW_PAD_CTL_PAD_PE_MASK);
    IOMUXC_SetPinMux(IOMUXC_UART4_TXD_UART4_TX, 0U);
    IOMUXC_SetPinConfig(IOMUXC_UART4_TXD_UART4_TX, 
                        IOMUXC_SW_PAD_CTL_PAD_PUE_MASK |
                        IOMUXC_SW_PAD_CTL_PAD_PE_MASK);
}

// main.c
#include "fsl_debug_console.h"
#include "pin_mux.h"
#include "clock_config.h"
#include "board.h"

int main(void)
{
    gpt_config_t gptConfig;

    /* Board pin, clock, debug console init */
    /* M7 has its local cache and enabled by default,
     * need to set smart subsystems (0x28000000 ~ 0x3FFFFFFF)
     * non-cacheable before accessing this address region */
    BOARD_InitMemory();

    /* Board specific RDC settings */
    BOARD_RdcInit();

    BOARD_InitBootPins();
    BOARD_BootClockRUN();
    BOARD_InitDebugConsole();

    /* Init GPIO pins as an outputs */
    gpio_pin_config_t signal_config = {kGPIO_DigitalOutput, 0, kGPIO_NoIntmode};
    GPIO_PinInit(BOARD_SIGNAL_LOOP_GPIO, BOARD_SIGNAL_LOOP_GPIO_PIN, &amp;amp;signal_config);

    PRINTF("Start generating signals...\r\n");

    while (1)
    {
        GPIO_PortToggle(BOARD_SIGNAL_LOOP_GPIO, 1u &amp;lt;&amp;lt; BOARD_SIGNAL_LOOP_GPIO_PIN);
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried multiple GPIOs, but the result is still the same.&lt;/P&gt;&lt;P&gt;So what's wrong here? Or the other question is, how can I verify, that the systemclk is running at 800MHz.&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Andy&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2024 13:01:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Cortex-M7-GPIO-toggle-frequency/m-p/1885197#M224795</guid>
      <dc:creator>andrej_valek</dc:creator>
      <dc:date>2024-06-11T13:01:35Z</dc:date>
    </item>
    <item>
      <title>Re: Cortex M7 GPIO toggle frequency</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Cortex-M7-GPIO-toggle-frequency/m-p/1886400#M224886</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/170941"&gt;@andrej_valek&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please refer to &lt;A href="https://community.nxp.com/t5/i-MX-Processors/GPIO-R-W-speed-far-below-the-set-kCLOCK-RootIpg-133-Mhz/m-p/1617992" target="_self"&gt;this thread&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Salas.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2024 21:08:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Cortex-M7-GPIO-toggle-frequency/m-p/1886400#M224886</guid>
      <dc:creator>Manuel_Salas</dc:creator>
      <dc:date>2024-06-12T21:08:52Z</dc:date>
    </item>
    <item>
      <title>Re: Cortex M7 GPIO toggle frequency</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Cortex-M7-GPIO-toggle-frequency/m-p/1886633#M224899</link>
      <description>&lt;P&gt;Thank you &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/203368"&gt;@Manuel_Salas&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;but this won't help me I guess.&lt;/P&gt;&lt;P&gt;I'm using the &lt;EM&gt;GPIO_PortToggle&lt;/EM&gt; function, which reflects to&lt;/P&gt;&lt;LI-CODE lang="c"&gt;static inline void GPIO_PortToggle(GPIO_Type *base, uint32_t mask)
{
#if (defined(FSL_FEATURE_IGPIO_HAS_DR_TOGGLE) &amp;amp;&amp;amp; (FSL_FEATURE_IGPIO_HAS_DR_TOGGLE == 1))
    base-&amp;gt;DR_TOGGLE = mask;
#else
    base-&amp;gt;DR ^= mask;
#endif /* FSL_FEATURE_IGPIO_HAS_DR_TOGGLE */
}&lt;/LI-CODE&gt;&lt;P&gt;so I guess there is no overhead. The fact (from the previous thread), that GPIO is connected to IPG_CLK_ROOT which is running at 66.66MHz won't reflect to my behavior. The output freq on that pin is 4MHz.&lt;/P&gt;&lt;P&gt;On the other hand, could it be that I'm touching a wrong GPIO? Or maybe, would it be possible to test it on your side or provide me an application/code for verification?&lt;/P&gt;&lt;P&gt;Many thanks,&lt;BR /&gt;Andy&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2024 06:39:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Cortex-M7-GPIO-toggle-frequency/m-p/1886633#M224899</guid>
      <dc:creator>andrej_valek</dc:creator>
      <dc:date>2024-06-13T06:39:22Z</dc:date>
    </item>
  </channel>
</rss>

