<?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>How to store peer data in BLE peripheral to use after the BLE peripheral reboots?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/104422/how-to-store-peer-data-in-ble-peripheral-to-use-after-the-ble-peripheral-reboots</link><description>Hi everyone, I am currently working on developing a BLE Mouse. I have started with the ble_app_hids_mouse example. I have a custom board which have 6 mouse buttons and a power on/off switch. I have connected the mouse board to my laptop and the mouse</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 09 Oct 2023 14:29:48 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/104422/how-to-store-peer-data-in-ble-peripheral-to-use-after-the-ble-peripheral-reboots" /><item><title>RE: How to store peer data in BLE peripheral to use after the BLE peripheral reboots?</title><link>https://devzone.nordicsemi.com/thread/449382?ContentTypeID=1</link><pubDate>Mon, 09 Oct 2023 14:29:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aa4b9483-4b3e-4e0e-8f61-0cdf34527493</guid><dc:creator>mirhamza708</dc:creator><description>&lt;p&gt;Okay guys i have solved my problem by using the app button instead of the bsp. Also i and not using the ble button module (i just created my own functionality with the app buttons.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to store peer data in BLE peripheral to use after the BLE peripheral reboots?</title><link>https://devzone.nordicsemi.com/thread/449226?ContentTypeID=1</link><pubDate>Fri, 06 Oct 2023 17:33:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:216fc154-288a-44a3-a880-e56135632fb1</guid><dc:creator>mirhamza708</dc:creator><description>&lt;p&gt;Yes, that&amp;#39;s exactly the problem.&lt;pre class="ui-code" data-mode="text"&gt;static void buttons_leds_init(bool * p_erase_bonds)
{
    ret_code_t err_code;
    bsp_event_t startup_event;

    err_code = bsp_init(BSP_INIT_LEDS | BSP_INIT_BUTTONS , bsp_event_handler);
//
    APP_ERROR_CHECK(err_code);

    //err_code = bsp_btn_ble_init(NULL, &amp;amp;startup_event);
    //APP_ERROR_CHECK(err_code);

    *p_erase_bonds = (startup_event == BSP_EVENT_CLEAR_BONDING_DATA);
    NRF_LOG_INFO(&amp;quot;%d&amp;quot;,startup_event);
}
&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I commented the two lines and now it works. I power cycled the board and I am able to connect. But now I need a little help in understanding the BLE buttons IDs. In the bsp_btn_ble.h I have these defines as shown in the code below I don&amp;#39;t get where does this ID comes from like how is it actually connected to my actual buttons because I want to use one button on the mouse board, which when I press, should remove the bonding data or maybe some other function.&lt;br /&gt;&lt;br /&gt;code snippet from bsp_btn_ble.h file&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#define BTN_ID_WAKEUP             0  /**&amp;lt; ID of button used to wake up the application. */
#define BTN_ID_SLEEP              0  /**&amp;lt; ID of button used to put the application into sleep mode. */
#define BTN_ID_DISCONNECT         0  /**&amp;lt; ID of button used to gracefully terminate a connection on long press. */
#define BTN_ID_WAKEUP_BOND_DELETE 1  /**&amp;lt; ID of button used to wake up the application and delete all bonding information. */
#define BTN_ID_WHITELIST_OFF      1  /**&amp;lt; ID of button used to turn off usage of the whitelist. */&lt;/pre&gt;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;I have only defined 6 buttons in my custom_board_mouse.h file which looks like this&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#define BUTTONS_NUMBER 6

#define BUTTON_1       2
#define BUTTON_2       3
#define BUTTON_3       4
#define BUTTON_4       5
#define BUTTON_5       12
#define BUTTON_6       28

#define BUTTON_PULL    NRF_GPIO_PIN_PULLUP

#define BUTTONS_ACTIVE_STATE 0

#define BUTTONS_LIST { BUTTON_1, BUTTON_2, BUTTON_3, BUTTON_4, BUTTON_5, BUTTON_6 }

#define BSP_BUTTON_0   BUTTON_1
#define BSP_BUTTON_1   BUTTON_2
#define BSP_BUTTON_2   BUTTON_3
#define BSP_BUTTON_3   BUTTON_4
#define BSP_BUTTON_4   BUTTON_5
#define BSP_BUTTON_5   BUTTON_6&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;How do I know which button from my custom_board_mouse.h file is given the ID of the, for example,&amp;nbsp;BTN_ID_WAKEUP_BOND_DELETE. Or more importantly, how do i&amp;nbsp;assign one of my buttons from&amp;nbsp;&lt;span&gt;custom_board_mouse.h file as&amp;nbsp;BTN_ID_WAKEUP_BOND_DELETE.&lt;br /&gt;&lt;br /&gt;Thank you so much for answering my previous question. If you give me some insight on this I would be really grateful.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to store peer data in BLE peripheral to use after the BLE peripheral reboots?</title><link>https://devzone.nordicsemi.com/thread/449209?ContentTypeID=1</link><pubDate>Fri, 06 Oct 2023 14:43:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6b5f3982-77c6-476f-a53a-042b5f62ae7a</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;There is no fundamental difference between a pin reset and a power-cycle when it comes to retaining the bonds, which is stored in flash, so I am&amp;nbsp;suprised&amp;nbsp;you see a difference in behavior. Is there any other difference between these two cases when you test?&lt;/p&gt;
&lt;p&gt;Also, the SDK examples use a button hat is read at startup, and if pressed, bonds are deleted. Could that be the case here? Either that the button is pressed (if testing on a DK), or that this features is kept in the firmware even if your custom HW does not use this pin (so it is floating), or it is held low, for instance? You can see this code by searching for &amp;quot;delete_bonds&amp;quot; in main.c.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to store peer data in BLE peripheral to use after the BLE peripheral reboots?</title><link>https://devzone.nordicsemi.com/thread/449121?ContentTypeID=1</link><pubDate>Fri, 06 Oct 2023 07:30:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4682638f-7449-4111-bcb3-5fe792b6b725</guid><dc:creator>mirhamza708</dc:creator><description>&lt;p&gt;I will add some more information that I just found out, If I reset the board with the reset push button then the peer data remains there and I can connect back to my laptop after push button reset. But after a power reset I am unable to reconnect.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>