<?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>Add new button on nrf5340 Audio DK fail</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/96179/add-new-button-on-nrf5340-audio-dk-fail</link><description>Hello, 
 I want to add an extra button on nrf5340 Audio DK. 
 I use P1.14 as the pin of this new button and set it in the overlay file. 
 
 The default buttons use DT_GPIO_PIN to get the pin cell value, but according to the settings in gpio.h, DT_GPIO_PIN</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 06 Feb 2023 02:26:48 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/96179/add-new-button-on-nrf5340-audio-dk-fail" /><item><title>RE: Add new button on nrf5340 Audio DK fail</title><link>https://devzone.nordicsemi.com/thread/408160?ContentTypeID=1</link><pubDate>Mon, 06 Feb 2023 02:26:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3be683f5-ad8a-4044-88c3-fcb6a0a44f5d</guid><dc:creator>LandyWang</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I see.&lt;/p&gt;
&lt;p&gt;Thank you for your assistance.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Add new button on nrf5340 Audio DK fail</title><link>https://devzone.nordicsemi.com/thread/407999?ContentTypeID=1</link><pubDate>Fri, 03 Feb 2023 12:32:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9ffc9fc2-6896-407f-8b25-2059e4344a78</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I looked a bit more into the code. Unfortunately, it seems like the Audio application&amp;#39;s button_handler module only supports GPIO port 0. So you either need to modify this module yourself, or wait until we add support for this.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/main/applications/nrf5340_audio/src/modules/button_handler.c#L193"&gt;https://github.com/nrfconnect/sdk-nrf/blob/main/applications/nrf5340_audio/src/modules/button_handler.c#L193&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Add new button on nrf5340 Audio DK fail</title><link>https://devzone.nordicsemi.com/thread/407872?ContentTypeID=1</link><pubDate>Fri, 03 Feb 2023 02:14:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:912f965e-644b-4cc2-807e-ea57d871a768</guid><dc:creator>LandyWang</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;It works.Thank you very much.&lt;/p&gt;
&lt;p&gt;But after I add BUTTON_6 to my button configure and flash to the nrf5340 audio dk board,it occurrs error:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1675390395357v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Here is the code I add:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;const static struct btn_config btn_cfg[] = {
	{
		.btn_name = STRINGIFY(BUTTON_VOLUME_DOWN),
		.btn_pin = BUTTON_VOLUME_DOWN,
		.btn_cfg_mask = DT_GPIO_FLAGS(DT_ALIAS(sw0), gpios),
	},
	{
		.btn_name = STRINGIFY(BUTTON_VOLUME_UP),
		.btn_pin = BUTTON_VOLUME_UP,
		.btn_cfg_mask = DT_GPIO_FLAGS(DT_ALIAS(sw1), gpios),
	},
	{
		.btn_name = STRINGIFY(BUTTON_PLAY_PAUSE),
		.btn_pin = BUTTON_PLAY_PAUSE,
		.btn_cfg_mask = DT_GPIO_FLAGS(DT_ALIAS(sw2), gpios),
	},
	{
		.btn_name = STRINGIFY(BUTTON_4),
		.btn_pin = BUTTON_4,
		.btn_cfg_mask = DT_GPIO_FLAGS(DT_ALIAS(sw3), gpios),
	},
	{
		.btn_name = STRINGIFY(BUTTON_5),
		.btn_pin = BUTTON_5,
		.btn_cfg_mask = DT_GPIO_FLAGS(DT_ALIAS(sw4), gpios),
	},
	{
		.btn_name = STRINGIFY(BUTTON_6),
		.btn_pin = BUTTON_6,
		.btn_cfg_mask = DT_GPIO_FLAGS(DT_ALIAS(bkey), gpios),
	}
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;How to enable this pin?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Add new button on nrf5340 Audio DK fail</title><link>https://devzone.nordicsemi.com/thread/407762?ContentTypeID=1</link><pubDate>Thu, 02 Feb 2023 12:33:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b73167a-325a-482c-a225-e561f59817d2</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Try adding&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;#include &amp;lt;soc.h&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;to the file where you have this:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;enum button_pin_names {
	BUTTON_VOLUME_DOWN = DT_GPIO_PIN(DT_ALIAS(sw0), gpios),
	BUTTON_VOLUME_UP = DT_GPIO_PIN(DT_ALIAS(sw1), gpios),
	BUTTON_PLAY_PAUSE = DT_GPIO_PIN(DT_ALIAS(sw2), gpios),
	BUTTON_4 = DT_GPIO_PIN(DT_ALIAS(sw3), gpios),
	BUTTON_5 = DT_GPIO_PIN(DT_ALIAS(sw4), gpios),
	BUTTON_6 = NRF_DT_GPIOS_TO_PSEL(DT_ALIAS(bkey), gpios),
};&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Add new button on nrf5340 Audio DK fail</title><link>https://devzone.nordicsemi.com/thread/407720?ContentTypeID=1</link><pubDate>Thu, 02 Feb 2023 09:49:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1dd5b36f-6d9e-4df5-bd57-04e5c2d192a3</guid><dc:creator>LandyWang</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I do pristine build every time, but the error still occurs.&lt;/p&gt;
&lt;p&gt;I am using nrf5340_audio application, and my overlay file name is nrf5340_audio_dk_nrf5340_cpuapp.overlay.&lt;/p&gt;
&lt;p&gt;I compared your test sample with my audio application, and there is no difference in the BUTTON_6 part.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Add new button on nrf5340 Audio DK fail</title><link>https://devzone.nordicsemi.com/thread/407714?ContentTypeID=1</link><pubDate>Thu, 02 Feb 2023 09:24:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b58cdded-0803-437b-bd47-2c54cae57241</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Try doing a pristine build.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1675329863524v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;It works fine here testing with NCS 2.2.0&lt;/p&gt;
&lt;p&gt;My test sample:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/3264.hello_5F00_world.zip"&gt;devzone.nordicsemi.com/.../3264.hello_5F00_world.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Add new button on nrf5340 Audio DK fail</title><link>https://devzone.nordicsemi.com/thread/407663?ContentTypeID=1</link><pubDate>Thu, 02 Feb 2023 01:19:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e29343a1-7e8e-4a11-8a20-63c277b7fb71</guid><dc:creator>LandyWang</dc:creator><description>&lt;p&gt;Thank you for your reply.&lt;br /&gt;But it doesn&amp;#39;t work，I get an error during building: identifier &amp;#39;DT_N_S_buttons_S_button_6&amp;#39; undeclared here (not in a function).&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1675300748157v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Add new button on nrf5340 Audio DK fail</title><link>https://devzone.nordicsemi.com/thread/407629?ContentTypeID=1</link><pubDate>Wed, 01 Feb 2023 17:00:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2288787a-1573-4f7c-adf2-17d223477c7f</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You can use&amp;nbsp;NRF_DT_GPIOS_TO_PSEL() instead.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;BUTTON_6 = NRF_DT_GPIOS_TO_PSEL(DT_ALIAS(bkey), gpios),&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/main/soc/arm/nordic_nrf/common/soc_nrf_common.h#L95"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/main/soc/arm/nordic_nrf/common/soc_nrf_common.h#L95&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>