<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>GPIOTE + PPI SDK v2.5.2 issue + zephyr</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/109026/gpiote-ppi-sdk-v2-5-2-issue-zephyr</link><description>Hi all, 
 
 I am using nrf SDK v2.5.2 and zephyr. In my application I want to measure a signal frequency coming from a GPIO, I read about the PPI and I thought it was good for my use case. 
 I tried to make it work, and it required the use of GPIOTE and</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 05 Jul 2024 08:24:56 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/109026/gpiote-ppi-sdk-v2-5-2-issue-zephyr" /><item><title>RE: GPIOTE + PPI SDK v2.5.2 issue + zephyr</title><link>https://devzone.nordicsemi.com/thread/492383?ContentTypeID=1</link><pubDate>Fri, 05 Jul 2024 08:24:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:86524afd-048f-439e-bfd7-869d2078ea7b</guid><dc:creator>PW</dc:creator><description>&lt;p&gt;Thanks.I see, there is a lot of differences between SDK2.6.0 and github&amp;nbsp;&lt;span class="author flex-self-stretch" itemprop="author"&gt;&lt;a class="url fn" href="https://github.com/zephyrproject-rtos" rel="author" data-hovercard-type="organization" data-hovercard-url="/orgs/zephyrproject-rtos/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self"&gt;zephyrproject-rtos&lt;/a&gt;&lt;/span&gt;&lt;span class="mx-1 flex-self-stretch color-fg-muted"&gt;/&lt;/span&gt;&lt;strong class="mr-2 flex-self-stretch" itemprop="name"&gt;&lt;a href="https://github.com/zephyrproject-rtos/hal_nordic" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame"&gt;hal_nordic&lt;/a&gt;&amp;nbsp;&lt;/strong&gt;&lt;span&gt;&lt;/span&gt; repo, especcialy in nrfx_gpiote.c. So situation is unstable :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIOTE + PPI SDK v2.5.2 issue + zephyr</title><link>https://devzone.nordicsemi.com/thread/492337?ContentTypeID=1</link><pubDate>Thu, 04 Jul 2024 20:44:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f1d2818f-2e4b-43a0-9e90-b401bf976eb8</guid><dc:creator>LucaMarongiu</dc:creator><description>&lt;p&gt;Hi, when i faced the problem i also discovered that the solution i adopted was working only for SDK 2.5.2... you must perform a porting for your reference SDK, however i can put here the solution just for reference:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;	/////////// GPIOTE configuration ///////////
	// Enable a GPIOTE channel in IN mode. 
	nrfx_gpiote_input_config_t gpiote_cfg;

	gpiote_cfg.pull = NRF_GPIO_PIN_PULLUP; // Enable pullup to stabilize the input signal
	// set trigger configuration

	nrfx_gpiote_trigger_config_t trigger_cfg;

	// Set the GPIOTE channel to be triggered by a rising edge
	trigger_cfg.trigger = NRFX_GPIOTE_TRIGGER_LOTOHI;

	// Allocate a GPIOTE channel
	uint8_t in_channel;
	err = nrfx_gpiote_channel_alloc(&amp;amp;in_channel);
    if(err != NRFX_SUCCESS)
	{
		LOG_ERR(&amp;quot;Failed to allocate GPIOTE channel&amp;quot;);
		return -1;
	}
	trigger_cfg.p_in_channel = &amp;amp;in_channel;
	err = nrfx_gpiote_input_configure(pin, &amp;amp;gpiote_cfg, &amp;amp;trigger_cfg, NULL);
	if(err != NRFX_SUCCESS)
	{
		LOG_ERR(&amp;quot;Failed to configure GPIOTE input&amp;quot;);
		return -1;
	}
	// enable the trigger event without using the interrupt mode (PPI has to handle the event)
	nrfx_gpiote_trigger_enable(pin, false);
	////////////////////////////////////////////

	/////////// TIMER configuration ///////////
	// Initialize the timer in counter mode, with 32-bit width and 16MHz frequency

	nrfx_timer_config_t timer_cfg = NRFX_TIMER_DEFAULT_CONFIG(NRF_TIMER_BASE_FREQUENCY_16MHZ);

	timer_cfg.mode = NRF_TIMER_MODE_COUNTER;
	timer_cfg.bit_width = NRF_TIMER_BIT_WIDTH_32;
	err = nrfx_timer_init(&amp;amp;timer_inst, &amp;amp;timer_cfg, NULL);
	if(err != NRFX_SUCCESS)
	{
		LOG_ERR(&amp;quot;Failed to initialize timer&amp;quot;);
		return -1;
	}
	///////////////////////////////////////////

	/////////// PPI configuration ///////////
	// Set up a PPI channel to connect the GPIOTE event to the timer COUNT task
	uint8_t gppi_ch;
	// Allocate a PPI channel
	err = nrfx_gppi_channel_alloc(&amp;amp;gppi_ch);
	if(err != NRFX_SUCCESS)
	{
		LOG_ERR(&amp;quot;Failed to allocate PPI channel&amp;quot;);
		return -1;
	}

	// Set up the PPI: connect the GPIOTE event to the timer COUNT task
	nrfx_gppi_channel_endpoints_setup(gppi_ch, nrfx_gpiote_in_event_address_get(pin), nrfx_timer_task_address_get(&amp;amp;timer_inst, NRF_TIMER_TASK_COUNT));

	nrfx_gppi_channels_enable(BIT(gppi_ch));
	///////////////////////////////////////////

	// Enable the timer
	nrfx_timer_enable(&amp;amp;timer_inst);&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIOTE + PPI SDK v2.5.2 issue + zephyr</title><link>https://devzone.nordicsemi.com/thread/492336?ContentTypeID=1</link><pubDate>Thu, 04 Jul 2024 20:41:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c65077e1-e545-425d-80f8-11fbb80b204f</guid><dc:creator>PW</dc:creator><description>&lt;p&gt;Hi. I try to make measurement of low level signal (10us-2ms).&amp;nbsp;I know I should configure both edges on gpioe, but I have problem with timer and ppi. Could you help me with gpioe, timer and ppi config? It will be work on SDK2.6.0&lt;/p&gt;
&lt;p&gt;Best regards. PW&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIOTE + PPI SDK v2.5.2 issue + zephyr</title><link>https://devzone.nordicsemi.com/thread/472764?ContentTypeID=1</link><pubDate>Thu, 07 Mar 2024 14:49:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a10c53eb-8f0e-48ae-ac32-258273fd50e0</guid><dc:creator>LucaMar</dc:creator><description>&lt;p&gt;I solved!&lt;/p&gt;
&lt;p&gt;I was assigning the wrong channel to the GPIOTE trigger configuration, I was assigning the one of the PPI channel, instead a new one needs to be allocated in this way:&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;	uint8_t out_channel;
	err = nrfx_gpiote_channel_alloc(&amp;amp;out_channel);
    NRFX_ASSERT(err == NRFX_SUCCESS);
	trigger_cfg.p_in_channel = &amp;amp;out_channel;
	err = nrfx_gpiote_input_configure(pin, &amp;amp;gpiote_cfg, &amp;amp;trigger_cfg, NULL);
	NRFX_ASSERT(err == NRFX_SUCCESS);
	nrfx_gpiote_trigger_enable( pin, false);&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIOTE + PPI SDK v2.5.2 issue + zephyr</title><link>https://devzone.nordicsemi.com/thread/472749?ContentTypeID=1</link><pubDate>Thu, 07 Mar 2024 14:22:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a7db785b-0067-4b4c-bb87-39faa11f3e32</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Conseptually it seems you are at least on the right track. For debugging maybe check that you get the IN event in the first place by just reading if the event is set in the gpiote peripheral. Also, double check that the pin used is configured as an input. To check if the timer works as intended you can also just manually write to the count task to check if it does count.&lt;/p&gt;
&lt;p&gt;I assume you have looked at the nrfx samples:&lt;br /&gt;&lt;a href="https://github.com/zephyrproject-rtos/hal_nordic/tree/master/nrfx/samples/src"&gt;https://github.com/zephyrproject-rtos/hal_nordic/tree/master/nrfx/samples/src&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>