<?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>Two Button function coverage problem</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/110165/two-button-function-coverage-problem</link><description>Hey I&amp;#39;ve got this project that requires two buttons. In normal mode, these buttons react to the Ready pin switch signals. when it goes into sleep mode (where it controls other MCUs going to sleep), the UART Rx changes to act as a button to wake up based</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 26 Jun 2024 11:44:37 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/110165/two-button-function-coverage-problem" /><item><title>RE: Two Button function coverage problem</title><link>https://devzone.nordicsemi.com/thread/490857?ContentTypeID=1</link><pubDate>Wed, 26 Jun 2024 11:44:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c9169647-1c24-4dfe-8fca-0458a0908e51</guid><dc:creator>Naeem Maroof</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Apologies for the delayed response.&lt;/p&gt;
&lt;p&gt;Is there any update at your end?&lt;/p&gt;
[quote user="cheiron"]I tried copying a new &amp;quot;BLE central UART&amp;quot; example without making any modifications, and after flashing it , I couldn&amp;#39;t see the Bluetooth using nRF Connect[/quote]
&lt;p&gt;Please follow the instruction given on the&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.6.1/nrf/samples/bluetooth/central_uart/README.html#testing"&gt;Testing&lt;/a&gt;&amp;nbsp;section of the sample. You would require a peripheral (step 6) to connect&amp;nbsp; with.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Two Button function coverage problem</title><link>https://devzone.nordicsemi.com/thread/488403?ContentTypeID=1</link><pubDate>Wed, 12 Jun 2024 03:25:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:be94ca23-37c3-4ab5-b0b3-bacf7a3e2a0a</guid><dc:creator>ITEK</dc:creator><description>&lt;p&gt;I didn&amp;#39;t make any changes to the BLE-related subroutines, except for turning off Uarte in the original example program. After receiving your message, I tried copying a new &amp;quot;BLE central UART&amp;quot; example without making any modifications, and after flashing it , I couldn&amp;#39;t see the Bluetooth using nRF Connect.&lt;/p&gt;
&lt;p&gt;Could you please test it for me to see if there&amp;#39;s an issue?&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s the link to the example program: [&lt;a href="https://github.com/ItekRD/test"&gt;insert link&lt;/a&gt;]&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Two Button function coverage problem</title><link>https://devzone.nordicsemi.com/thread/488284?ContentTypeID=1</link><pubDate>Tue, 11 Jun 2024 10:29:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8b9ec80c-4b7a-47d2-99f0-c708cb0973f9</guid><dc:creator>Naeem Maroof</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I downloaded the code from your repo, and button1 is working before and after the connection.&lt;/p&gt;
&lt;p&gt;However, when I send those characters (80 03...) through ble, it results into hard-fault&lt;/p&gt;
&lt;p&gt;it is caused in line 857 (uart_tx)&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/pastedimage1718101767129v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Two Button function coverage problem</title><link>https://devzone.nordicsemi.com/thread/487653?ContentTypeID=1</link><pubDate>Thu, 06 Jun 2024 08:35:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb91c476-6a96-46ae-be21-82f3101d23ca</guid><dc:creator>ITEK</dc:creator><description>&lt;p&gt;I&amp;#39;ve tried a method that seems to work in testing, but I still have some concerns and would like to confirm a few things before proceeding.&lt;/p&gt;
&lt;p&gt;First, I&amp;#39;d like to ask if your data is being sent and received via Bluetooth or through UART or UARTE. In the example program, the Bluetooth functionality hasn&amp;#39;t been modified, nor does it include the issue demonstration code.&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s the approach I took: I combined the button code from the &amp;quot;Button Sample&amp;quot; and &amp;quot;BLE LED Button Service&amp;quot; examples.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;1.After resetting the DK, the &amp;quot;CapReadyPinInit&amp;quot; function initializes the button, and I test it to ensure it works. This part of the code comes from the Button Sample.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;2.When I send &amp;quot;80 03 02 35 23 81&amp;quot; via UARTE, it directly initializes the buttons from the &amp;quot;BLE LED Button Service&amp;quot; example.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;err = dk_buttons_init(button_changed);
if (err) {
    LOG_ERR(&amp;quot;Cannot init buttons (err: %d)&amp;quot;, err);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The button actions are handled in the &amp;quot;button_changed&amp;quot; function. This setup meets the project&amp;#39;s requirements during testing.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;3. When I send &amp;quot;80 03 02 35 23 81&amp;quot; via UARTE again, I first disable the buttons with:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;err = dk_buttons_init(NULL);
if (err) {
    LOG_ERR(&amp;quot;Cannot init buttons (err: %d)&amp;quot;, err);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;4. Then, I reinitialize &amp;quot;CapReadyPinInit&amp;quot;. This approach works in testing,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;but I have some doubts. Although both parts come from example programs, could there be stability issues when combining them? Or is it likely stable since both are from example programs?&lt;/p&gt;
&lt;p&gt;And I&amp;#39;ve updated the code on GitHub. Sorry for the inconvenience. Could you please take another look at it? Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Two Button function coverage problem</title><link>https://devzone.nordicsemi.com/thread/487012?ContentTypeID=1</link><pubDate>Mon, 03 Jun 2024 03:33:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:12ab5f8d-6e57-4ec3-a119-0d6cf8c79dde</guid><dc:creator>ITEK</dc:creator><description>&lt;p&gt;I might not have been very clear in my previous description. Here&amp;#39;s the ideal behavior I&amp;#39;m aiming for:&lt;/p&gt;
&lt;p&gt;1.When I reset the DK, LED1 starts blinking, indicating that the chip is working properly.&lt;br /&gt;2.Button1 should toggle LED4, while Button2 does nothing.&lt;br /&gt;When I connect to the device and send the HEX data &amp;quot;80 03 02 35 23 81&amp;quot;, 3.Button1 should still control LED4, and now Button2 should toggle LED3.&lt;br /&gt;4.Sending the same HEX data &amp;quot;80 03 02 35 23 81&amp;quot; again should revert to Button1 controlling LED4, and Button2 doing nothing.&lt;br /&gt;5This should cycle between steps 2 and 4.&lt;/p&gt;
&lt;p&gt;However, during my testing, here&amp;#39;s what I observed:&lt;/p&gt;
&lt;p&gt;1.When I reset the DK, LED1 starts blinking, indicating that the chip is working properly.&lt;br /&gt;2.Button1 toggles LED4, while Button2 does nothing.&lt;br /&gt;When I connect to the device and send the HEX data &amp;quot;80 03 02 35 23 81&amp;quot;, 3.Button1 stops working, and Button2 toggles LED3.&lt;br /&gt;4.Sending the HEX data &amp;quot;80 03 02 35 23 81&amp;quot; again results in both Button1 and Button2 not working.&lt;br /&gt;5.Sending the HEX data &amp;quot;80 03 02 35 23 81&amp;quot; again makes Button2 toggle LED3, but Button1 remains non-functional.&lt;br /&gt;6.Sending the HEX data &amp;quot;80 03 02 35 23 81&amp;quot; again returns to step 4, cycling through steps 4 to 6.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;This process does not cause the device to reset, and I couldn&amp;#39;t reproduce the reset issue after multiple attempts.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;To check the code for the two buttons, search for &amp;quot;deButtonFunction&amp;quot; within the #if #endif section (lines 76 to 174). You&amp;#39;ll notice that CapReadyPinInit (lines 97 to 124) and RxButtonEn (lines 147 to 174) have almost identical content. This code is derived from the Button Sample example. Button actions can be seen in CapRdyButtonInterrupt (lines 83 to 96) and RxButtonInterrupt (lines 83 to 96). UART functionality is within the #if deMCU_URFunc section (lines 178 to 348), with data handling in lines 263 to 303 and actions in lines 178 to 221. The reset might be caused here, though I couldn&amp;#39;t reproduce it to confirm.&lt;/p&gt;
&lt;p&gt;If the issue is with button debugging,&lt;span style="color:#ff0000;"&gt; I want to use the declarations and debugging from the &amp;quot;BLE LED Button service&amp;quot; example.&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;How can I disable the Button functionality?&lt;/span&gt; Which parts should I modify or disable, given that my project needs to switch between Rx and Button modes on the same pin?&lt;/p&gt;
&lt;p&gt;By the way, I&amp;#39;m using the nRF52840-DK board for testing.&lt;/p&gt;
&lt;p&gt;Please assist with this. Thank you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Two Button function coverage problem</title><link>https://devzone.nordicsemi.com/thread/486239?ContentTypeID=1</link><pubDate>Tue, 28 May 2024 14:53:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:deecee84-d95a-4970-86d2-afaa80acdd3b</guid><dc:creator>Naeem Maroof</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I have tried to go through your code, but I cannot review your whole code, it is not a short code.&lt;/p&gt;
&lt;p&gt;Also, when I flashed, I see different behavior than what you have described:&lt;/p&gt;
&lt;p&gt;When I reset the DK,&lt;/p&gt;
&lt;p&gt;LED4 is ON&lt;/p&gt;
&lt;p&gt;LED1 starts blinking&lt;/p&gt;
&lt;p&gt;if I press Button1 then LED4 toggles&lt;/p&gt;
&lt;p&gt;(meaning Button1 is working and in the callback we are toggling LED4)&lt;/p&gt;
&lt;p&gt;if I press Button2 in this state, it does nothing,&lt;/p&gt;
&lt;p&gt;next,&lt;/p&gt;
&lt;p&gt;when I connect with the device, LED2 turns ON,&lt;/p&gt;
&lt;p&gt;I can still use BUTTON1 to toggle LED4&lt;/p&gt;
&lt;p&gt;Button2 still does nothing,&lt;/p&gt;
&lt;p&gt;next,&lt;/p&gt;
&lt;p&gt;when I send that data &amp;quot;&lt;span&gt;80 03 02 35 23 81&amp;quot; through RX characteristic, the device resets.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;You should probably debug your code by seeing how things go on.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Also, maybe your Button2 is not configured properly.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Can you first just test your buttons.&amp;nbsp;Can you just show the sample code for buttons that produce that issue?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Two Button function coverage problem</title><link>https://devzone.nordicsemi.com/thread/485699?ContentTypeID=1</link><pubDate>Fri, 24 May 2024 01:00:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:764c0897-efce-401f-9b17-4f1096a96ca2</guid><dc:creator>ITEK</dc:creator><description>&lt;p&gt;Thank you for your response. The issue with the chip reset has been resolved. Unfortunately, when testing the required functionality with version 2.6.1, I&amp;rsquo;m still encountering the same problems as with 2.5.2.&lt;/p&gt;
&lt;p&gt;Using the nrf52840 development board, after powering it on and pressing Button1, LED4 lights up. After sending the command 80 03 02 35 23 81, LED2 lights up, and when Button2 is pressed, LED3 lights up. However, Button1 stops working and doesn&amp;rsquo;t respond. In the project, both buttons are supposed to work simultaneously.&lt;/p&gt;
&lt;p&gt;Could you please assist with this? I&amp;rsquo;ve updated and uploaded the code.&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s the link:&lt;a style="font-family:inherit;" href="https://github.com/ItekRD/TwoButtonProblem"&gt;https://github.com/ItekRD/TwoButtonProblem&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="vertical-align:inherit;"&gt;&lt;span style="vertical-align:inherit;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Two Button function coverage problem</title><link>https://devzone.nordicsemi.com/thread/485147?ContentTypeID=1</link><pubDate>Tue, 21 May 2024 13:32:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:681408ce-efad-47ce-b843-c989808743cd</guid><dc:creator>Naeem Maroof</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Apologies for the delayed response.&lt;/p&gt;
&lt;p&gt;The issue is coming from &lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;configure_gpio()&lt;/span&gt; function that calls &lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;dk_buttons_init()&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;This function would initialize buttons as on the DK.&lt;/p&gt;
&lt;p&gt;As you can see that on the DK (nrf52840dk), pins 11, 12, 24 and 25 are used for the four buttons.&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/pastedimage1716298074333v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;When you are calling the &lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;configure_gpio&lt;/span&gt;() function, three of the DK buttons are initialized while initializing the 4th one which you have defined gives error; of course this is not as on the DK, this is your definition.&lt;/p&gt;
&lt;p&gt;Error is also &amp;quot;Unsupported pin&amp;quot; that is pin 8.&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/pastedimage1716298044664v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Hope if provides you direction in your debugging.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Naeem&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Two Button function coverage problem</title><link>https://devzone.nordicsemi.com/thread/484800?ContentTypeID=1</link><pubDate>Fri, 17 May 2024 05:04:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:15833ac9-105d-47cd-81b0-393ad103c6b6</guid><dc:creator>ITEK</dc:creator><description>&lt;p&gt;it&amp;#39;s been a while, and I haven&amp;#39;t received a reply yet. Can you give me an update on the current status? Is there any additional information or materials you need from me?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Two Button function coverage problem</title><link>https://devzone.nordicsemi.com/thread/482156?ContentTypeID=1</link><pubDate>Tue, 07 May 2024 05:12:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9fbf8fa5-2620-4e2d-82f1-0148dd18919c</guid><dc:creator>ITEK</dc:creator><description>&lt;p&gt;Hi there! Sorry for the delayed response; work&amp;#39;s been keeping me busy. After seeing your reply, I made several attempts to create a new project and use NCS 2.5.2 to present the issues I mentioned. However, after selecting &amp;quot;create a new application&amp;quot; -&amp;gt; &amp;quot;Copy a sample&amp;quot; -&amp;gt; &amp;quot;BLE UART service,&amp;quot; the project I created couldn&amp;#39;t include three files: &amp;quot;uart_async_adapter.h,&amp;quot; &amp;quot;zephyr/usb/usb_device.h,&amp;quot; and &amp;quot;&amp;lt;soc.h&amp;gt;.&amp;quot; I tried to troubleshoot this on my own, but the problem persisted.&lt;/p&gt;
&lt;p&gt;So, I decided to upgrade to NCS version 2.6.1 to see if I could resolve the issues. However, I encountered a new problem. After burning the code into the MCU, it kept resetting itself continuously, and I received a UR message:&lt;/p&gt;
&lt;p&gt;&lt;span class="hljs-attr"&gt;&lt;pre class="ui-code" data-mode="text"&gt;1: *** Booting nRF Connect SDK 3758bcbfa5cd ***\r\n

ASSERTION FAIL [(cfg-&amp;gt;port_pin_mask &amp;amp; (gpio_port_pins_t)(1UL &amp;lt;&amp;lt; (pin))) != 0U] @ WEST_TOPDIR/zephyr/include/zephyr/drivers/gpio.h:1001\r\n

Unsupported pin\r\n [16:17:54.2484378]&amp;#160;&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Since I need to switch between Rx and Button modes to complete the project, I&amp;#39;m in need of assistance.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/ItekRD/TwoButtonProblem"&gt;Here&amp;#39;s the complete project for NCS 2.6.1.&lt;/a&gt; If you still need the project for NCS 2.5.2, just let me know.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Two Button function coverage problem</title><link>https://devzone.nordicsemi.com/thread/478742?ContentTypeID=1</link><pubDate>Mon, 15 Apr 2024 11:24:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:56c8a826-8397-4940-86c4-f87bebd4e6bc</guid><dc:creator>Naeem Maroof</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Could it be due to some value you assign in the&amp;nbsp;CapSwReadyPin(), or due to initialization of global variables? I am not sure.&lt;/p&gt;
&lt;p&gt;Can you provide a minimally complete project that I can compile in NCS 2.5.2 and flash on the DK and test?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Two Button function coverage problem</title><link>https://devzone.nordicsemi.com/thread/478574?ContentTypeID=1</link><pubDate>Fri, 12 Apr 2024 13:37:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c86cb9e9-d031-48b9-b816-0c7ceacae58b</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hello ITEK,&lt;/p&gt;
&lt;p&gt;One of our engineers will look into this and follow up with you soon.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>