<?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>Problem with Event and Interrupt in NRF52 !</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/26820/problem-with-event-and-interrupt-in-nrf52</link><description>Hi Forum!
I have to understand NRF52 chip for my job! I used to work with STM32 before. It has &amp;quot;Interrupt&amp;quot; (e.g when I receive one byte via SPI, It generates one &amp;quot;SPI_Rx_Interrupt&amp;quot;. I can implement my code in the callback function(read this byte, toggle</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 12 Nov 2018 14:35:53 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/26820/problem-with-event-and-interrupt-in-nrf52" /><item><title>RE: Problem with Event and Interrupt in NRF52 !</title><link>https://devzone.nordicsemi.com/thread/156920?ContentTypeID=1</link><pubDate>Mon, 12 Nov 2018 14:35:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8c3f19ee-7117-44d7-abff-e53347fefbf3</guid><dc:creator>huaha</dc:creator><description>&lt;p&gt;My question about events and interrupts:&lt;br /&gt;Are the event handlers called within interrupt context?&lt;br /&gt;In other words: Is my execution time within event handler limited like within interrupt?&lt;br /&gt;&lt;br /&gt;(I know in common Interrupt Routines there are usually only few lines of code. In event handlers I see sometimes complex calls that last for a while)&lt;br /&gt;&lt;br /&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with Event and Interrupt in NRF52 !</title><link>https://devzone.nordicsemi.com/thread/105422?ContentTypeID=1</link><pubDate>Tue, 14 Nov 2017 08:30:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b7b127bc-99ce-4900-abc0-30a1e9c51e84</guid><dc:creator>KaiserYamate</dc:creator><description>&lt;p&gt;Yes. You are right. I have to read more document. :) I am going come back :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with Event and Interrupt in NRF52 !</title><link>https://devzone.nordicsemi.com/thread/105421?ContentTypeID=1</link><pubDate>Tue, 14 Nov 2017 08:23:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e2965c6d-6ace-4b09-8897-310db145519d</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Finally before you will keep asking pretty basic questions please take a break, find some good explanation of BLE stack architecture and basic procedures, read it few more times (I guess you read it already but repeating might help) and then also read couple of times Soft Device specification and message sequence charts. For example your last question about &lt;code&gt;BLE_GAP_EVT_CONNECT&lt;/code&gt; is answered by one of these charts.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with Event and Interrupt in NRF52 !</title><link>https://devzone.nordicsemi.com/thread/105420?ContentTypeID=1</link><pubDate>Tue, 14 Nov 2017 08:21:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:02025e66-cb03-4ac7-8359-67f118e3666d</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;(2/2)&lt;/p&gt;
&lt;p&gt;Now sorry if I misunderstand your English but is it correct that you don&amp;#39;t want to use Nordic stack and SDK? This is possible but then please keep in mind:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Developing your own BLE stack - even to do some basic things - is task which solid SW development team can do in 1 or 2 years. Yes, if you are genius programmer you can do your own minimalistic version alone in few months but it&amp;#39;s bloody work and overall unnecessary.&lt;/li&gt;
&lt;li&gt;Or you simply use some stack and API which is available. You have obvious choice of Nordic Soft Device and then you very likely want to use Nordic nRF5 SDK (but you don&amp;#39;t need to use many things, you can stay with just SD API headers if you really want). Or you can go with some open source variants like Zephyr. Or you can try to buy/license some proprietary stack for nRF52 . But still you need some standard interface to it = some kind of SDK.&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with Event and Interrupt in NRF52 !</title><link>https://devzone.nordicsemi.com/thread/105419?ContentTypeID=1</link><pubDate>Tue, 14 Nov 2017 08:18:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fa663735-0401-472a-88df-a166414c7915</guid><dc:creator>KaiserYamate</dc:creator><description>&lt;p&gt;can you tell me what is occur in two nrf52( one central and one peripheral) to have BLE_GAP_EVT_CONNECTED  event? :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with Event and Interrupt in NRF52 !</title><link>https://devzone.nordicsemi.com/thread/105418?ContentTypeID=1</link><pubDate>Tue, 14 Nov 2017 08:16:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e8144774-7bd0-4798-8585-6d48adb9613a</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;nRF52 chips is definitely interesting, it just comes with price: you need to write the software in certain way in order to get all the potential out of it (also I don&amp;#39;t get how this point relates to the questions and answers in this thread but anyway it&amp;#39;s nice to know that you like nRF52;).&lt;/p&gt;
&lt;p&gt;To your second question: you need to understand there are 3 basic components to achieve full BLE functionality.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;HW which has 2.4GHz front-end which can achieve all the features required by BLE spec.&lt;/li&gt;
&lt;li&gt;BLE stack because you need at least LL and L2CAP layers and 99% of applications use whole stack including Security Manager, ATT, GATT and GAP.&lt;/li&gt;
&lt;li&gt;Your APP which gives the stack specific profile configuration to really do something useful (otherwise BLE stack is useless and device won&amp;#39;t do anything without top layer). To achieve this here comes SDK combining stack API and HW abstraction.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;(1/2)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with Event and Interrupt in NRF52 !</title><link>https://devzone.nordicsemi.com/thread/105416?ContentTypeID=1</link><pubDate>Tue, 14 Nov 2017 08:11:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:109b2ba1-a9cc-4406-8989-1928cf14fd53</guid><dc:creator>KaiserYamate</dc:creator><description>&lt;ol&gt;
&lt;li&gt;I want to use NRF52. I think this chip is exciting. :)&lt;/li&gt;
&lt;li&gt;Yes. I interest into low-level interrupt. I want to know how can 2 nrf52 chip can connect(step by step) via BLE :). I don&amp;#39;t want dependent example on the SDK.&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with Event and Interrupt in NRF52 !</title><link>https://devzone.nordicsemi.com/thread/105415?ContentTypeID=1</link><pubDate>Tue, 14 Nov 2017 07:27:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0d19fa12-5e1e-419a-bbb8-0af90f6147f4</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;No, these are only BLE GAP layer events. If you go to other Soft Device header files you can see many more. The meaning is in the comments and on Infocenter (Soft Device &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.sds/dita/softdevices/s130/s130sds.html?cp=2_3_1_0"&gt;specification&lt;/a&gt; and &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v5.0.0/modules.html?cp=2_3_1_1_0_2"&gt;API&lt;/a&gt;), you can spend many hours studying Nordic stack API (if you really want to use it, there are of course other alternatives). Btw. event&amp;#39;s you are looking to right now are high-level SW things, I&amp;#39;ve thought from your initial question that are interested into low-level HW interrupts;)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with Event and Interrupt in NRF52 !</title><link>https://devzone.nordicsemi.com/thread/105417?ContentTypeID=1</link><pubDate>Tue, 14 Nov 2017 02:44:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:923394d1-2b1f-46aa-be00-dc9dd29bd2b9</guid><dc:creator>KaiserYamate</dc:creator><description>&lt;p&gt;Hi endnode. I was consider all example in the SDK. You are right. I can use event of nrf52 :) Thank for your help. Now I have some new question with softdevice. I hope you can help me!!!&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;enum BLE_GAP_EVTS
{
  BLE_GAP_EVT_CONNECTED  = BLE_GAP_EVT_BASE,    /**&amp;lt; Connection established.                         \n See @ref ble_gap_evt_connected_t.            */
  BLE_GAP_EVT_DISCONNECTED,                     /**&amp;lt; Disconnected from peer.                         \n See @ref ble_gap_evt_disconnected_t.         */
  BLE_GAP_EVT_CONN_PARAM_UPDATE,                /**&amp;lt; Connection Parameters updated.                  \n See @ref ble_gap_evt_conn_param_update_t.    */
  BLE_GAP_EVT_SEC_PARAMS_REQUEST,               /**&amp;lt; Request to provide security parameters.         \n Reply with @ref sd_ble_gap_sec_params_reply.  \n See @ref ble_gap_evt_sec_params_request_t. */
  BLE_GAP_EVT_SEC_INFO_REQUEST,                 /**&amp;lt; Request to provide security information.        \n Reply with @ref sd_ble_gap_sec_info_reply.    \n See @ref ble_gap_evt_sec_info_request_t.   */
  BLE_GAP_EVT_PASSKEY_DISPLAY,                  /**&amp;lt; Request to display a passkey to the user.       \n In LESC Numeric Comparison, reply with @ref sd_ble_gap_auth_key_reply. \n See @ref ble_gap_evt_passkey_display_t. */
  BLE_GAP_EVT_KEY_PRESSED,                      /**&amp;lt; Notification of a keypress on the remote device.\n See @ref ble_gap_evt_key_pressed_t           */
  BLE_GAP_EVT_AUTH_KEY_REQUEST,                 /**&amp;lt; Request to provide an authentication key.       \n Reply with @ref sd_ble_gap_auth_key_reply.    \n See @ref ble_gap_evt_auth_key_request_t.   */
  BLE_GAP_EVT_LESC_DHKEY_REQUEST,               /**&amp;lt; Request to calculate an LE Secure Connections DHKey. \n Reply with @ref sd_ble_gap_lesc_dhkey_reply.  \n See @ref ble_gap_evt_lesc_dhkey_request_t */
  BLE_GAP_EVT_AUTH_STATUS,                      /**&amp;lt; Authentication procedure completed with status. \n See @ref ble_gap_evt_auth_status_t.          */
  BLE_GAP_EVT_CONN_SEC_UPDATE,                  /**&amp;lt; Connection security updated.                    \n See @ref ble_gap_evt_conn_sec_update_t.      */
  BLE_GAP_EVT_TIMEOUT,                          /**&amp;lt; Timeout expired.                                \n See @ref ble_gap_evt_timeout_t.              */
  BLE_GAP_EVT_RSSI_CHANGED,                     /**&amp;lt; RSSI report.                                    \n See @ref ble_gap_evt_rssi_changed_t.         */
  BLE_GAP_EVT_ADV_REPORT,                       /**&amp;lt; Advertising report.                             \n See @ref ble_gap_evt_adv_report_t.           */
  BLE_GAP_EVT_SEC_REQUEST,                      /**&amp;lt; Security Request.                               \n See @ref ble_gap_evt_sec_request_t.          */
  BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST,        /**&amp;lt; Connection Parameter Update Request.            \n Reply with @ref sd_ble_gap_conn_param_update. \n See @ref ble_gap_evt_conn_param_update_request_t. */
  BLE_GAP_EVT_SCAN_REQ_REPORT,                  /**&amp;lt; Scan request report.                            \n See @ref ble_gap_evt_scan_req_report_t. */
  BLE_GAP_EVT_PHY_UPDATE,                       /**&amp;lt; PHY have been updated                           \n See @ref ble_gap_evt_phy_update_t.           */
  BLE_GAP_EVT_DATA_LENGTH_UPDATE_REQUEST,       /**&amp;lt; Data Length Update request.                     \n Reply with @ref sd_ble_gap_data_length_update.\n See @ref ble_gap_evt_data_length_update_request_t. */
  BLE_GAP_EVT_DATA_LENGTH_UPDATE,               /**&amp;lt; LL Data Channel PDU payload length updated.     \n See @ref ble_gap_evt_data_length_update_t. */
};
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;above code is in the ble_gap.h file.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;They are ALL OF EVENT can occur, aren&amp;#39;t they? ( do have any exception when I connect?)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;how can I know sense of event? ( example. I can know BLE_GAP_EVT_CONNECTED occur when connection is establish. But I can&amp;#39;t know when does BLE_GAP_EVT_PASSKEY_DISPLAY occur  ...). I want to know sense of all event. do have any document for me?&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Thanks you!!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with Event and Interrupt in NRF52 !</title><link>https://devzone.nordicsemi.com/thread/105413?ContentTypeID=1</link><pubDate>Sat, 11 Nov 2017 17:26:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:67bd50dc-35a3-429c-ba4f-a25546976b89</guid><dc:creator>KaiserYamate</dc:creator><description>&lt;p&gt;I was use 1 hour to read your comment and consider the example. I think you are correct. But I have to read the code and program longer to understand all. I was confirm my evolution tomorrow. Thanks for your useful reply !&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with Event and Interrupt in NRF52 !</title><link>https://devzone.nordicsemi.com/thread/105414?ContentTypeID=1</link><pubDate>Sat, 11 Nov 2017 16:20:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:da81d8b1-b6db-436d-87de-2835164d05b1</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;And one more specific of nRF5x platform is this &amp;quot;Task and Event&amp;quot; mechanism where you can use different events of different feature blocks (basically interrupts) and link some tasks to any other part of the system once these events happen. You cannot really invent your own because these are more or less HW related but you can through register program some flow (e.g. when SPIM ENDTX happens you can lounch some completely unrelated tasks e.g. PWM or RTC or TIMER start). This might be unique to nRF5 platform but not so much difficult to understand.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with Event and Interrupt in NRF52 !</title><link>https://devzone.nordicsemi.com/thread/105412?ContentTypeID=1</link><pubDate>Sat, 11 Nov 2017 16:16:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:70c52fe9-866e-4ea5-8179-e51e83b4e6dd</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Of course there are interrupts under the hood! It&amp;#39;s ARM Cortex-M, no magic, so of course HW is giving interrupt calls to execute certain parts of SW if such interrupt happens and there is some interrupt handler configured.&lt;/p&gt;
&lt;p&gt;However most of these low-level interrupts are consumed by the stack (Nordic Soft Device or other if you choose) or by drivers which are using HAL. Therefore all typical SW constructions in example FW projects on nRF5x platform you will see &amp;quot;event handlers&amp;quot; registered in various init functions and then implementing handling of these events as they come asynchronously from lower layers. Under this live interrupts but that&amp;#39;s very similar to STM32 HAL and SDK modules, isn&amp;#39;t it?&lt;/p&gt;
&lt;p&gt;Finally to how hard is it to understand e.g. SPI Master functionality on nRF52 chip:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;You can open &lt;code&gt;examples\peripheral\spi\main.c&lt;/code&gt; and use &lt;code&gt;nrf_drv_spi&lt;/code&gt; driver module as per example. it has one event handler and then few events and function calls which do everything what you ask for: starting transfer, callback when transfer is over. What more you would need?&lt;/li&gt;
&lt;li&gt;Alternatively if you don&amp;#39;t like Nordic SPI Master driver then go to &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/spim.html?cp=2_1_0_30#concept_j35_hv2_wr"&gt;chip specification&lt;/a&gt; and see what registers and interrupts are available to build your own flow on lower level. In the end you will read that these &amp;quot;events&amp;quot; are just interrupts which get enabled/disabled/cleared as usually. You can also see how Nordic do it in their driver in &lt;code&gt;components\drivers_nrf\spi_master\nrf_drv_spi.c&lt;/code&gt; file.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;And you can go on for all the HW peripherals like SPI/TWI/I2C/RADIO/UART/I2S/PWM/PDM...&lt;/p&gt;
&lt;p&gt;With this knowledge could you give us feedback if there is still something unclear about similarities between nRF5 and STM32 chip designs and SDKs or if it&amp;#39;s OK now?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>