<?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>Using Zephyr and Bluetooth (and other peripherals)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/69597/using-zephyr-and-bluetooth-and-other-peripherals</link><description>I have an application that is running on using nRF52840 and FreeRTOS. I am considering transitioning to nRF5340. For now, it appears that this also means transitioning from FreeRTOS to Zephyr. 
 I&amp;#39;m attempting to evaluate the nRF5340 using the nRF5340</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 05 Jan 2021 03:49:19 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/69597/using-zephyr-and-bluetooth-and-other-peripherals" /><item><title>RE: Using Zephyr and Bluetooth (and other peripherals)</title><link>https://devzone.nordicsemi.com/thread/287376?ContentTypeID=1</link><pubDate>Tue, 05 Jan 2021 03:49:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c1f1f178-36f6-4e57-b87b-055d3831566b</guid><dc:creator>CktDesigner</dc:creator><description>&lt;p&gt;Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using Zephyr and Bluetooth (and other peripherals)</title><link>https://devzone.nordicsemi.com/thread/287174?ContentTypeID=1</link><pubDate>Mon, 04 Jan 2021 10:26:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a6a36b4f-ce4b-4945-877f-1a6c58084b98</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I made an example with spi some time ago:&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/66488/using-spi-with-ppi-in-zephyr/272139#272139"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/66488/using-spi-with-ppi-in-zephyr/272139#272139&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I am thinking you may be missing the&amp;nbsp;IRQ_CONNECT() if you want to use nrfx directly.&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using Zephyr and Bluetooth (and other peripherals)</title><link>https://devzone.nordicsemi.com/thread/287095?ContentTypeID=1</link><pubDate>Sun, 03 Jan 2021 19:41:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6fbf54e6-2e0d-49a8-9a79-14bf90364487</guid><dc:creator>CktDesigner</dc:creator><description>&lt;p&gt;OK, thanks.&amp;nbsp; &amp;nbsp; I looked at the example you linked to.&lt;/p&gt;
&lt;p&gt;Is the DeviceTree overlay file required, or can the nrfxlib calls defining peripheral instances, etc. be used directly?&lt;/p&gt;
&lt;p&gt;Also, any comment on the other question from the earlier entry (how to determine the number of free BLE notify buffers available)?&lt;/p&gt;
&lt;p&gt;Update:&lt;/p&gt;
&lt;p&gt;After a lot of reading and trial/error, I was able to get the nrfx TWIM driver interface to work using C calls to initialize and initiate transfers, but only in blocking mode.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;From the example you linked to in DevZone, I found that prj.conf should have:&lt;/p&gt;
&lt;p&gt;# I2C&lt;br /&gt;#CONFIG_I2C=y&lt;br /&gt;#CONFIG_I2C_NRFX=y&lt;br /&gt;#CONFIG_I2C_1=y&lt;br /&gt;CONFIG_NRFX_TWIM1=y&lt;/p&gt;
&lt;p&gt;but after some trial/error found that only the last statement is really needed, so the first 3 CONFIG_ statements are commented out.&lt;/p&gt;
&lt;p&gt;Here is the code segment I used to declare and initialize the interface:&lt;/p&gt;
&lt;div class="evolution-code-editor theme-clouds"&gt;
&lt;div class=" ace_editor ace-clouds"&gt;
&lt;div class="ace_scroller"&gt;
&lt;div class="ace_content"&gt;
&lt;div class="ace_layer ace_text-layer"&gt;
&lt;div class="ace_line"&gt;&lt;/div&gt;
&lt;div class="evolution-code-editor theme-clouds"&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void
i2cHandler(nrfx_twim_evt_t const *evtPtr, void *contextPtr) {
  printk(&amp;quot;TWIM Event\n&amp;quot;);
}

  // I2C instance
nrfx_twim_t i2c1= NRFX_TWIM_INSTANCE(1);

void main(void) {
  int err;

  // Initialize interfaces

  // I2C configure
  nrfx_twim_config_t i2cConfig = {
    .scl =                 I2C_SCL_PIN,
    .sda =                 I2C_SDA_PIN,
    .frequency =           NRF_TWIM_FREQ_400K,
    .interrupt_priority =  NRFX_TWIM_DEFAULT_CONFIG_IRQ_PRIORITY,
    .hold_bus_uninit =     false
  };
  err= nrfx_twim_init(&amp;amp;i2c1,
                      &amp;amp;i2cConfig,
                      (nrfx_twim_evt_handler_t)i2cHandler,
                      //NULL,
                      NULL);
  if(NRFX_SUCCESS != err) {
    printk(&amp;quot;I2C driver init failed: %d\n&amp;quot;, err);
  }
  nrfx_twim_enable(&amp;amp;i2c1);&lt;/pre&gt;&lt;br /&gt;
&lt;div class=" ace_editor ace-clouds"&gt;
&lt;div class="ace_gutter"&gt;
&lt;div class="ace_layer ace_gutter-layer ace_folding-enabled"&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;where I2C_SCL_PIN is defined as&amp;nbsp;(NRF_GPIO_PIN_MAP(0,27)), etc.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;And here is a snip of code where I write to an I2C peripheral to initialize it.&lt;/p&gt;
&lt;div class="evolution-code-editor theme-clouds"&gt;&lt;a class="fullscreen" href="https://devzone.nordicsemi.com/support/261978"&gt;&lt;/a&gt;
&lt;div class=" ace_editor ace-clouds"&gt;
&lt;div class="ace_scroller"&gt;
&lt;div class="ace_content"&gt;
&lt;div class="ace_layer ace_text-layer"&gt;
&lt;div class="ace_line"&gt;&lt;span class="ace_punctuation ace_operator"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="evolution-code-editor theme-clouds"&gt;
&lt;div class=" ace_editor ace-clouds"&gt;
&lt;div class="ace_scroller"&gt;
&lt;div class="ace_content"&gt;
&lt;div class="ace_layer ace_text-layer"&gt;&lt;/div&gt;
&lt;div class="ace_layer ace_marker-layer"&gt;&lt;/div&gt;
&lt;div class="ace_layer ace_cursor-layer ace_hidden-cursors"&gt;
&lt;div class="ace_cursor"&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;  #define LM75A_ADDR       0x48
  #define LM75A_REG_CONF   0x01
  #define LM75A_REG_TEMP   0x00
  uint8_t initWrite[] = { LM75A_REG_CONF, 0x00 };
  uint8_t readWrite[] = { LM75A_REG_TEMP };
  uint8_t readBuf[2];
  nrfx_twim_xfer_desc_t lm75aInit = {
    .type             = NRFX_TWIM_XFER_TX,
    .address          = LM75A_ADDR,
    .primary_length   = sizeof(initWrite),
    .secondary_length = 0,
    .p_primary_buf    = initWrite,
    .p_secondary_buf  = NULL
  };
  nrfx_twim_xfer_desc_t lm75aRead = {
    .type             = NRFX_TWIM_XFER_TXRX,
    .address          = LM75A_ADDR,
    .primary_length   = sizeof(readWrite),
    .secondary_length = 2,
    .p_primary_buf    = readWrite,
    .p_secondary_buf  = readBuf
  };
#if 1
  err= nrfx_twim_xfer(i2cPtr,&amp;amp;lm75aInit,0);
  if(NRFX_SUCCESS != err) {
    printk(&amp;quot;TWIM error during init!\n&amp;quot;);
  }
#endif&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ace_scrollbar ace_scrollbar-v"&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;This only works when the first &amp;quot;NULL&amp;quot; is uncommented, and the i2cHandler statement is commented out in the &amp;quot;init&amp;quot; statement (making TWIM run in blocking mode).&amp;nbsp; So the interface works in blocking mode.&lt;/p&gt;
&lt;p&gt;But if I run with the &amp;quot;init&amp;quot; as shown above (i2cHandler declared and the &amp;quot;NULL&amp;quot; commented out, so it should run in non-blocking mode), a run-time error is reported:&lt;/p&gt;
&lt;div class="evolution-code-editor theme-clouds"&gt;
&lt;div class=" ace_editor ace-clouds"&gt;
&lt;div class="ace_scroller"&gt;
&lt;div class="ace_content"&gt;
&lt;div class="ace_layer ace_text-layer"&gt;
&lt;div class="ace_line"&gt;&lt;span class="ace_invisible ace_invisible_space ace_invalid"&gt;&lt;/span&gt;&lt;span class="ace_invisible ace_invisible_space ace_invalid"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="ace_line"&gt;&lt;span class="ace_invisible ace_invisible_space ace_invalid"&gt;&lt;pre class="ui-code" data-mode="text"&gt;[00:00:00.345,550] &#x1B;[1;31m&amp;lt;err&amp;gt; os: &amp;gt;&amp;gt;&amp;gt; ZEPHYR FATAL ERROR 1: Unhandled interrupt on CPU 0&#x1B;[0m
[00:00:00.345,581] &#x1B;[1;31m&amp;lt;err&amp;gt; os: Current thread: 0x200024a0 (BT ECC)&#x1B;[0m
[00:00:00.760,314] &#x1B;[1;31m&amp;lt;err&amp;gt; fatal_error: Resetting system&#x1B;[0m
*** Booting Zephyr OS build v2.4.0-ncs2  ***
[00:00:00.336,914] &#x1B;[0m&amp;lt;inf&amp;gt; sdc_hci_driver: SoftDevice Controller build revision: 
cf 5c 0f 11 88 9c d7 02  15 27 c7 c3 ca 60 19 85 |.\...... .&amp;#39;...`..
b7 c4 50 e3                                      |..P.             &#x1B;[0m
[00:00:00.340,545] &#x1B;[0m&amp;lt;inf&amp;gt; bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)&#x1B;[0m
[00:00:00.340,545] &#x1B;[0m&amp;lt;inf&amp;gt; bt_hci_core: HW Variant: nRF52x (0x0002)&#x1B;[0m
[00:00:00.340,545] &#x1B;[0m&amp;lt;inf&amp;gt; bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 207.3932 Build 3617359889&#x1B;[0m
[00:00:00.342,071] &#x1B;[0m&amp;lt;inf&amp;gt; bt_hci_core: Identity: d4:7d:d9:fe:63:8d (random)&#x1B;[0m
[00:00:00.342,102] &#x1B;[0m&amp;lt;inf&amp;gt; bt_hci_core: HCI: version 5.2 (0x0b) revision 0x1123, manufacturer 0x0059&#x1B;[0m
[00:00:00.342,102] &#x1B;[0m&amp;lt;inf&amp;gt; bt_hci_core: LMP: version 5.2 (0x0b) subver 0x1123&#x1B;[0m&lt;/pre&gt;&lt;/span&gt;&lt;span class="ace_invisible ace_invisible_space ace_invalid"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="ace_line"&gt;&lt;br /&gt;&lt;span class="ace_invisible ace_invisible_space ace_invalid"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="ace_line"&gt;&lt;span class="ace_invisible ace_invisible_space ace_invalid"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="ace_line"&gt;&lt;span class="ace_invisible ace_invisible_space ace_invalid"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="ace_line"&gt;&lt;span class="ace_invisible ace_invisible_space ace_invalid"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="ace_line"&gt;&lt;span class="ace_invisible ace_invisible_space ace_invalid"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="ace_line"&gt;&lt;span class="ace_invisible ace_invisible_space ace_invalid"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="ace_line"&gt;&lt;span class="ace_invisible ace_invisible_space ace_invalid"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="ace_line"&gt;&lt;span class="ace_invisible ace_invisible_space ace_invalid"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="ace_line"&gt;&lt;span class="ace_invisible ace_invisible_space ace_invalid"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;and the board (nRF52840-DK) reboots (and everything repeats as the error occurs again).&lt;/p&gt;
&lt;p&gt;It looks like Zephyr is receiving an interrupt (presumably the TWIM completion) that it is not ready for.&amp;nbsp; &amp;nbsp;I suspect that I haven&amp;#39;t properly initialized something, but am unsure what...&amp;nbsp; &amp;nbsp; I suspect that there has to be some linkage between the HW interrupt and the TWIM driver.&lt;/p&gt;
&lt;p&gt;I was expecting &amp;quot;i2cHandler&amp;quot; to be called when the I2C xfr completed.&lt;/p&gt;
&lt;p&gt;Can you give me some pointers?&lt;/p&gt;
&lt;p&gt;Thanks...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using Zephyr and Bluetooth (and other peripherals)</title><link>https://devzone.nordicsemi.com/thread/286887?ContentTypeID=1</link><pubDate>Tue, 29 Dec 2020 21:16:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:68763d11-588d-4b28-a8d4-923907f5947c</guid><dc:creator>CktDesigner</dc:creator><description>&lt;p&gt;OK, thanks.&amp;nbsp; &amp;nbsp; I looked at the example you linked to.&lt;/p&gt;
&lt;p&gt;Is the DeviceTree overlay file required, or can the nrfxlib calls defining peripheral instances, etc. be used directly?&lt;/p&gt;
&lt;p&gt;Also, any comment on the other question from the earlier entry (how to determine the number of free BLE notify buffers available)?&lt;/p&gt;
&lt;p&gt;Update:&lt;/p&gt;
&lt;p&gt;After a lot of reading and trial/error, I was able to get the nrfx TWIM driver interface to work using C calls to initialize and initiate transfers, but only in blocking mode.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;From the example you linked to in DevZone, I found that prj.conf should have:&lt;/p&gt;
&lt;p&gt;# I2C&lt;br /&gt;#CONFIG_I2C=y&lt;br /&gt;#CONFIG_I2C_NRFX=y&lt;br /&gt;#CONFIG_I2C_1=y&lt;br /&gt;CONFIG_NRFX_TWIM1=y&lt;/p&gt;
&lt;p&gt;but after some trial/error found that only the last statement is really needed, so the first 3 CONFIG_ statements are commented out.&lt;/p&gt;
&lt;p&gt;Here is the code segment I used to declare and initialize the interface:&lt;/p&gt;
&lt;div class="evolution-code-editor theme-clouds"&gt;
&lt;div class=" ace_editor ace-clouds"&gt;
&lt;div class="ace_scroller"&gt;
&lt;div class="ace_content"&gt;
&lt;div class="ace_layer ace_text-layer"&gt;
&lt;div class="ace_line"&gt;&lt;/div&gt;
&lt;pre class="ui-code" data-mode="c_cpp"&gt;void
i2cHandler(nrfx_twim_evt_t const *evtPtr, void *contextPtr) {
  printk(&amp;quot;TWIM Event\n&amp;quot;);
}

  // I2C instance
nrfx_twim_t i2c1= NRFX_TWIM_INSTANCE(1);

void main(void) {
  int err;

  // Initialize interfaces

  // I2C configure
  nrfx_twim_config_t i2cConfig = {
    .scl =                 I2C_SCL_PIN,
    .sda =                 I2C_SDA_PIN,
    .frequency =           NRF_TWIM_FREQ_400K,
    .interrupt_priority =  NRFX_TWIM_DEFAULT_CONFIG_IRQ_PRIORITY,
    .hold_bus_uninit =     false
  };
  err= nrfx_twim_init(&amp;amp;i2c1,
                      &amp;amp;i2cConfig,
                      (nrfx_twim_evt_handler_t)i2cHandler,
                      //NULL,
                      NULL);
  if(NRFX_SUCCESS != err) {
    printk(&amp;quot;I2C driver init failed: %d\n&amp;quot;, err);
  }
  nrfx_twim_enable(&amp;amp;i2c1);&lt;/pre&gt;&lt;/div&gt;
&lt;div class="ace_layer ace_marker-layer"&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;where I2C_SCL_PIN is defined as&amp;nbsp;(NRF_GPIO_PIN_MAP(0,27)), etc.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;And here is a snip of code where I write to an I2C peripheral to initialize it.&lt;/p&gt;
&lt;div class="evolution-code-editor theme-clouds"&gt;&lt;a class="fullscreen" href="https://devzone.nordicsemi.com/support/261978"&gt;&lt;/a&gt;
&lt;div class=" ace_editor ace-clouds"&gt;
&lt;div class="ace_scroller"&gt;
&lt;div class="ace_content"&gt;
&lt;div class="ace_layer ace_text-layer"&gt;
&lt;div class="ace_line"&gt;&lt;span class="ace_punctuation ace_operator"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;pre class="ui-code" data-mode="c_cpp"&gt; #define LM75A_ADDR       0x48
  #define LM75A_REG_CONF   0x01
  #define LM75A_REG_TEMP   0x00
  uint8_t initWrite[] = { LM75A_REG_CONF, 0x00 };
  uint8_t readWrite[] = { LM75A_REG_TEMP };
  uint8_t readBuf[2];
  nrfx_twim_xfer_desc_t lm75aInit = {
    .type             = NRFX_TWIM_XFER_TX,
    .address          = LM75A_ADDR,
    .primary_length   = sizeof(initWrite),
    .secondary_length = 0,
    .p_primary_buf    = initWrite,
    .p_secondary_buf  = NULL
  };
  nrfx_twim_xfer_desc_t lm75aRead = {
    .type             = NRFX_TWIM_XFER_TXRX,
    .address          = LM75A_ADDR,
    .primary_length   = sizeof(readWrite),
    .secondary_length = 2,
    .p_primary_buf    = readWrite,
    .p_secondary_buf  = readBuf
  };
#if 1
  err= nrfx_twim_xfer(i2cPtr,&amp;amp;lm75aInit,0);
  if(NRFX_SUCCESS != err) {
    printk(&amp;quot;TWIM error during init!\n&amp;quot;);
  }
#endif&lt;/pre&gt;
&lt;div class="ace_scrollbar ace_scrollbar-v"&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;This only works when the first &amp;quot;NULL&amp;quot; is uncommented, and the i2cHandler statement is commented out in the &amp;quot;init&amp;quot; statement (making TWIM run in blocking mode).&amp;nbsp; So the interface works in blocking mode.&lt;/p&gt;
&lt;p&gt;If I run with the &amp;quot;init&amp;quot; as shown above (i2cHandler declared and the &amp;quot;NULL&amp;quot; commented out, so it should run in non-blocking mode), a run-time error is reported:&lt;/p&gt;
&lt;div class="evolution-code-editor theme-clouds"&gt;
&lt;div class=" ace_editor ace-clouds"&gt;
&lt;div class="ace_scroller"&gt;
&lt;div class="ace_content"&gt;
&lt;div class="ace_layer ace_text-layer"&gt;
&lt;div class="ace_line"&gt;[00:00:00.345,550] &lt;span class="ace_invisible ace_invisible_space ace_invalid"&gt;&amp;middot;&lt;/span&gt;[1;31m&amp;lt;err&amp;gt; os: &amp;gt;&amp;gt;&amp;gt; ZEPHYR FATAL ERROR 1: Unhandled interrupt on CPU 0&lt;span class="ace_invisible ace_invisible_space ace_invalid"&gt;&amp;middot;&lt;/span&gt;[0m&lt;/div&gt;
&lt;div class="ace_line"&gt;[00:00:00.345,581] &lt;span class="ace_invisible ace_invisible_space ace_invalid"&gt;&amp;middot;&lt;/span&gt;[1;31m&amp;lt;err&amp;gt; os: Current thread: 0x200024a0 (BT ECC)&lt;span class="ace_invisible ace_invisible_space ace_invalid"&gt;&amp;middot;&lt;/span&gt;[0m&lt;/div&gt;
&lt;div class="ace_line"&gt;[00:00:00.760,314] &lt;span class="ace_invisible ace_invisible_space ace_invalid"&gt;&amp;middot;&lt;/span&gt;[1;31m&amp;lt;err&amp;gt; fatal_error: Resetting system&lt;span class="ace_invisible ace_invisible_space ace_invalid"&gt;&amp;middot;&lt;/span&gt;[0m&lt;/div&gt;
&lt;div class="ace_line"&gt;*** Booting Zephyr OS build v2.4.0-ncs2 ***&lt;/div&gt;
&lt;div class="ace_line"&gt;[00:00:00.336,914] &lt;span class="ace_invisible ace_invisible_space ace_invalid"&gt;&amp;middot;&lt;/span&gt;[0m&amp;lt;inf&amp;gt; sdc_hci_driver: SoftDevice Controller build revision:&lt;/div&gt;
&lt;div class="ace_line"&gt;cf 5c 0f 11 88 9c d7 02 15 27 c7 c3 ca 60 19 85 |.\...... .&amp;#39;...`..&lt;/div&gt;
&lt;div class="ace_line"&gt;b7 c4 50 e3 |..P. &lt;span class="ace_invisible ace_invisible_space ace_invalid"&gt;&amp;middot;&lt;/span&gt;[0m&lt;/div&gt;
&lt;div class="ace_line"&gt;[00:00:00.340,545] &lt;span class="ace_invisible ace_invisible_space ace_invalid"&gt;&amp;middot;&lt;/span&gt;[0m&amp;lt;inf&amp;gt; bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)&lt;span class="ace_invisible ace_invisible_space ace_invalid"&gt;&amp;middot;&lt;/span&gt;[0m&lt;/div&gt;
&lt;div class="ace_line"&gt;[00:00:00.340,545] &lt;span class="ace_invisible ace_invisible_space ace_invalid"&gt;&amp;middot;&lt;/span&gt;[0m&amp;lt;inf&amp;gt; bt_hci_core: HW Variant: nRF52x (0x0002)&lt;span class="ace_invisible ace_invisible_space ace_invalid"&gt;&amp;middot;&lt;/span&gt;[0m&lt;/div&gt;
&lt;div class="ace_line"&gt;[00:00:00.340,545] &lt;span class="ace_invisible ace_invisible_space ace_invalid"&gt;&amp;middot;&lt;/span&gt;[0m&amp;lt;inf&amp;gt; bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 207.3932 Build 3617359889&lt;span class="ace_invisible ace_invisible_space ace_invalid"&gt;&amp;middot;&lt;/span&gt;[0m&lt;/div&gt;
&lt;div class="ace_line"&gt;[00:00:00.342,071] &lt;span class="ace_invisible ace_invisible_space ace_invalid"&gt;&amp;middot;&lt;/span&gt;[0m&amp;lt;inf&amp;gt; bt_hci_core: Identity: d4:7d:d9:fe:63:8d (random)&lt;span class="ace_invisible ace_invisible_space ace_invalid"&gt;&amp;middot;&lt;/span&gt;[0m&lt;/div&gt;
&lt;div class="ace_line"&gt;[00:00:00.342,102] &lt;span class="ace_invisible ace_invisible_space ace_invalid"&gt;&amp;middot;&lt;/span&gt;[0m&amp;lt;inf&amp;gt; bt_hci_core: HCI: version 5.2 (0x0b) revision 0x1123, manufacturer 0x0059&lt;span class="ace_invisible ace_invisible_space ace_invalid"&gt;&amp;middot;&lt;/span&gt;[0m&lt;/div&gt;
&lt;div class="ace_line"&gt;[00:00:00.342,102] &lt;span class="ace_invisible ace_invisible_space ace_invalid"&gt;&amp;middot;&lt;/span&gt;[0m&amp;lt;inf&amp;gt; bt_hci_core: LMP: version 5.2 (0x0b) subver 0x1123&lt;span class="ace_invisible ace_invisible_space ace_invalid"&gt;&amp;middot;&lt;/span&gt;[0m&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ace_layer ace_marker-layer"&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;and the board (nRF52840-DK) reboots (and everything repeats as the error occurs again).&lt;/p&gt;
&lt;p&gt;It looks like Zephyr is receiving an interrupt (presumably the TWIM completion) that it is not ready for.&amp;nbsp; &amp;nbsp;I suspect that I haven&amp;#39;t properly initialized something, but am unsure what...&amp;nbsp; &amp;nbsp; I suspect that there has to be some linkage between the HW interrupt and the TWIM driver.&lt;/p&gt;
&lt;p&gt;I was expecting &amp;quot;i2cHandler&amp;quot; to be called when the I2C xfr completed.&lt;/p&gt;
&lt;p&gt;Can you give me some pointers?&lt;/p&gt;
&lt;p&gt;Thanks...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using Zephyr and Bluetooth (and other peripherals)</title><link>https://devzone.nordicsemi.com/thread/286867?ContentTypeID=1</link><pubDate>Tue, 29 Dec 2020 14:38:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:de853d1c-2785-427b-9552-c71ec0c45897</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Maybe you can check out:&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/65900/change-sda-and-scl-pin-for-i2c1-on-nrf5340/269646#269646"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/65900/change-sda-and-scl-pin-for-i2c1-on-nrf5340/269646#269646&lt;/a&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using Zephyr and Bluetooth (and other peripherals)</title><link>https://devzone.nordicsemi.com/thread/286196?ContentTypeID=1</link><pubDate>Tue, 22 Dec 2020 02:51:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2f92ad8b-dddb-4f4a-95de-fe8e42bb7370</guid><dc:creator>CktDesigner</dc:creator><description>&lt;p&gt;Hi Kenneth,&lt;/p&gt;
&lt;p&gt;Is there an example that shows how to configure using an nrfxlib peripheral driver (for example TWIM) with Zephyr?&amp;nbsp; (I tried adding the line: CONFIG_I2C_NRFX=1 to the prj.conf file.)&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using Zephyr and Bluetooth (and other peripherals)</title><link>https://devzone.nordicsemi.com/thread/285720?ContentTypeID=1</link><pubDate>Thu, 17 Dec 2020 20:24:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9fa2935a-9faf-44ef-99fe-849996243571</guid><dc:creator>CktDesigner</dc:creator><description>&lt;p&gt;Hi Kenneth,&lt;/p&gt;
&lt;p&gt;Thanks for the links.&amp;nbsp; &amp;nbsp;Even though I had spent a lot of time reading, I missed some of these documents (perhaps due to looking in the Zephyr links instead of the Nordic/Zephyr links).&lt;/p&gt;
&lt;p&gt;I am still a bit confused on using Notifications when using BLE with Zephyr.&amp;nbsp; &amp;nbsp; Under nRF5 SDK, a callback (BLE_GATTS_EVT_HVN_TX_COMPLETE) indicates how many notifications have been sent (by traversing the pointer properly (p_ble_evt-&amp;gt;evt.gatts_evt.params.hvn_tx_complete.count)) during a connection interval. This allows one to monitor how many TX buffers are being used/available.&amp;nbsp; (My application under nRF5 FreeRTOS was overrunning the buffers...)&lt;/p&gt;
&lt;p&gt;Under Zephyr, I see that a callback can be requested when sending a notification (&lt;span&gt;bt_gatt_notify_cb).&amp;nbsp; &amp;nbsp; The callback indicates that the notification has been sent, but I don&amp;#39;t see a way to get a count of how many have been sent.&amp;nbsp; &amp;nbsp; Can I assume that this callback will occur for each notification (and that if multiple notifications are sent in a single connection interval, multiple callbacks will occur)?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks again!&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using Zephyr and Bluetooth (and other peripherals)</title><link>https://devzone.nordicsemi.com/thread/285644?ContentTypeID=1</link><pubDate>Thu, 17 Dec 2020 13:32:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:059a3a42-7182-4379-98bb-ceb1a6cc134a</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The mass-production silicon of the nRF5340 is now available, so I recommend to order a new nRF5340-DK:&lt;br /&gt;&lt;a href="https://www.digikey.no/product-detail/en/nordic-semiconductor-asa/NRF5340-DK/1490-NRF5340-DK-ND/13544603"&gt;https://www.digikey.no/product-detail/en/nordic-semiconductor-asa/NRF5340-DK/1490-NRF5340-DK-ND/13544603&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The nRF5340 Preview DK (PDK) is not really recommended anymore for development.&lt;/p&gt;
&lt;p&gt;To get started with the nRF5340-DK you must use the nRF Connect SDK (NCS). The NCS is using the Zephyr RTOS:&lt;br /&gt;&lt;a href="http://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.4.1/nrf/getting_started.html"&gt;http://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.4.1/nrf/getting_started.html&lt;br /&gt;&lt;/a&gt;&lt;a href="http://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.4.1/nrf/ug_nrf5340.html"&gt;http://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.4.1/nrf/ug_nrf5340.html#&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can choose between using the zephyr BLE controller or the nordic softdevice controller:&lt;br /&gt;&lt;a href="http://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.4.1/nrf/ug_ble_controller.html"&gt;http://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.4.1/nrf/ug_ble_controller.html#&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Typically&amp;nbsp;you can find that bluetooth sample applications in nrf/samples/bluetooth are using nordic softdevice controller, while sample applications in zephyr/samples/bluetooth are using zephyr BLE controller. Typically you choose nordic softdevice controller by setting&amp;nbsp;&lt;span&gt;CONFIG_BT_LL_SOFTDEVICE_DEFAULT&lt;/span&gt;&lt;span&gt;=y in prj.conf. I suggest to continue to use the softdevice controller.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If you are familiar with nRF5 SDK you may find this blog post useful:&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/nordic/nrf-connect-sdk-guides/b/software/posts/building-a-ble-application-on-ncs-comparing-and-contrasting-to-softdevice-based-ble-applications"&gt;https://devzone.nordicsemi.com/nordic/nrf-connect-sdk-guides/b/software/posts/building-a-ble-application-on-ncs-comparing-and-contrasting-to-softdevice-based-ble-applications&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I suggest to look at the throughput example on how to&amp;nbsp;adjust ATT MTU, DLE and PHY:&lt;br /&gt;&lt;a href="http://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.4.1/nrf/samples/bluetooth/throughput/README.html"&gt;http://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.4.1/nrf/samples/bluetooth/throughput/README.html&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The zephyr native drivers are good to use if you want to use any of the ready-made libraries in zephyr that rely on the api of the native drivers, if&amp;nbsp;you don&amp;#39;t need those, then&amp;nbsp;you may as well use the nrfx directly. I do not believe the libraries in nRF5 SDK are ported to NCS, I don&amp;#39;t know how easy this will be.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If you are&amp;nbsp;trying out the nRF5340 make sure to program the network&amp;nbsp;core&amp;nbsp;with the HCI RPMsg sample (using the BLE controller you want to use):&lt;br /&gt;&lt;a href="http://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.4.1/nrf/ug_nrf5340.html#network-samples"&gt;http://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.4.1/nrf/ug_nrf5340.html#network-samples&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Then the application&amp;nbsp;core&amp;nbsp;can be programmed with the BLE sample application, you can also find this described here:&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/nordic/nrf-connect-sdk-guides/b/getting-started/posts/nrf-connect-sdk-tutorial---part-1-ncs-v1-4-0#h67sk646yl2d1o7b0c616t5mlg1flcovq"&gt;https://devzone.nordicsemi.com/nordic/nrf-connect-sdk-guides/b/getting-started/posts/nrf-connect-sdk-tutorial---part-1-ncs-v1-4-0#h67sk646yl2d1o7b0c616t5mlg1flcovq&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;In general you may find these tutorials useful to get started:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/nordic/nrf-connect-sdk-guides/b/getting-started/posts/nrf-connect-sdk-tutorial"&gt;https://devzone.nordicsemi.com/nordic/nrf-connect-sdk-guides/b/getting-started/posts/nrf-connect-sdk-tutorial&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;a href="https://devzone.nordicsemi.com/nordic/nrf-connect-sdk-guides/b/getting-started/posts/ncs-ble-tutorial-part-1-custom-service-in-peripheral-role"&gt;https://devzone.nordicsemi.com/nordic/nrf-connect-sdk-guides/b/getting-started/posts/ncs-ble-tutorial-part-1-custom-service-in-peripheral-role&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;a href="https://devzone.nordicsemi.com/nordic/nrf-connect-sdk-guides/b/getting-started/posts/nus-on-ncs-the-nordic-uart-service-with-the-nrf-connect-sdk"&gt;https://devzone.nordicsemi.com/nordic/nrf-connect-sdk-guides/b/getting-started/posts/nus-on-ncs-the-nordic-uart-service-with-the-nrf-connect-sdk&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Kenbeth&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using Zephyr and Bluetooth (and other peripherals)</title><link>https://devzone.nordicsemi.com/thread/285407?ContentTypeID=1</link><pubDate>Wed, 16 Dec 2020 15:40:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8dfffa54-b137-45d8-8429-3e824cf3c7b6</guid><dc:creator>CktDesigner</dc:creator><description>&lt;p&gt;One additional question:&lt;/p&gt;
&lt;p&gt;When using S140 in my nRF52840 application, in order to get higher performance when using Notifications, I increased the size of the HVN TX queue.&amp;nbsp; I keep track of the number of available queue slots (as recommended in the Nordic documentation), only issuing a Notification when a slot is available.&amp;nbsp; &amp;nbsp; Is there an equivalent mechanism when using the Zephyr bluetooth interface?&amp;nbsp; If so, can you point to documentation (or an example on how to maximize throughput using Notifications in Zephyr)?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>