<?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>BLE with coded PHY and CCM decryption</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/85298/ble-with-coded-phy-and-ccm-decryption</link><description>Hey, I&amp;#39;m trying to get a basic BLE with coded PHY (125Kbps) setup with on the fly encryption/decryption working but I&amp;#39;m running into a strange problem. I&amp;#39;m using a custom SDK which is why I spent a few weeks trying to figure it out my self before wasting</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 30 Mar 2022 10:42:29 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/85298/ble-with-coded-phy-and-ccm-decryption" /><item><title>RE: BLE with coded PHY and CCM decryption</title><link>https://devzone.nordicsemi.com/thread/360767?ContentTypeID=1</link><pubDate>Wed, 30 Mar 2022 10:42:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dab19f7a-f3d0-48cf-9410-f5fcc0b7eeea</guid><dc:creator>Esi</dc:creator><description>&lt;p&gt;Hey Einar, Sorry for the very late reply. Unfortunately I got Covid and had to self quarantine for a while.&lt;/p&gt;
&lt;p&gt;At last I&amp;#39;m back in the office and managed to do some testing.&lt;/p&gt;
&lt;p&gt;Thanks for sending the link for the Zephyr implementation. I went through it and couldn&amp;#39;t spot any differences at first. Then went back to the code and started to experiment some more, until I realized that by setting PCNF0.S1LEN = 0, I could get the decryption to work!.&lt;/p&gt;
&lt;p&gt;Investigating this further and going back to the reference manual, showed that S1 field is marked as &amp;quot;Reserved for future use&amp;quot; in the CCM chapter. I took this as that I can use this field for my own purposes, however this is not the case. When looking at the zephyr code, they also set the S1LEN to either 0 or 8 depending on whether the device supports CTE (which is an extension for direction finding). Since the nrf52840 doesn&amp;#39;t support direction finding, I assume the CCM module is not configured in a way to allow the use of the S1 field. If this field is transmitted by the radio, the CCM module will lag behind by 1 byte and thus not complete the decryption in sequence with the Radio module.&lt;/p&gt;
&lt;p&gt;At least that&amp;#39;s my theory.&lt;/p&gt;
&lt;p&gt;In any case, I seem to have a good work around for my problem and can continue. Thanks for all of the help!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE with coded PHY and CCM decryption</title><link>https://devzone.nordicsemi.com/thread/357180?ContentTypeID=1</link><pubDate>Wed, 09 Mar 2022 13:33:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c9d3cd78-c61e-413e-adc6-e04cd0805f17</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I am sorry for the delay. Have you looked at the &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/main/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.c"&gt;low-level implementation for Nordic in the Zephyr LL&lt;/a&gt; and used that as a reference? Unfortunately I have not had a chance to dig into it, but I suspect you may be able to find some inspiration in how things are done there.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE with coded PHY and CCM decryption</title><link>https://devzone.nordicsemi.com/thread/356380?ContentTypeID=1</link><pubDate>Fri, 04 Mar 2022 16:06:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:97a3a0c1-1ffd-4b37-9483-5e852b67f920</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;I see. I will look into how we do this in our stack implementations and get back to you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE with coded PHY and CCM decryption</title><link>https://devzone.nordicsemi.com/thread/356126?ContentTypeID=1</link><pubDate>Thu, 03 Mar 2022 16:19:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:206b4d54-61c2-4fd3-a705-c8f3125e0566</guid><dc:creator>Esi</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Yeah, if I start the decryption after the payload has been received, even if the CCM module is configured to operate as fast as possible (2 Mbps, which in theory should be safe since we have received all of the payload), it will still end up taking some time for the whole packet to be decrypted. During this time, the radio can&amp;#39;t be used to receive the next packet which prevents me from receiving packets end to end which in turn affects the throughput.&lt;/p&gt;
&lt;p&gt;In theory, the radio can be configured to receive the next packet while the CCM is busy decrypting the previous one by changing the packet pointer in the RADIO peripheral, but it becomes complex to manage. I was hoping to avoid that.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE with coded PHY and CCM decryption</title><link>https://devzone.nordicsemi.com/thread/356119?ContentTypeID=1</link><pubDate>Thu, 03 Mar 2022 15:58:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:24786e2b-1e94-4d0c-a0d7-acfcb408905c</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I see.&lt;/p&gt;
&lt;p&gt;Regarding the question I must admit I have not been able to find an explanation for why you need to trigger trigger CRYPT from the PAYLOAD event? Is there any issue doing that (other than using a PPI channel)?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE with coded PHY and CCM decryption</title><link>https://devzone.nordicsemi.com/thread/355914?ContentTypeID=1</link><pubDate>Wed, 02 Mar 2022 22:03:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ebe3c0cf-3aa2-4b5d-9e3c-454e08764d5a</guid><dc:creator>Esi</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;That&amp;#39;s a fair question. We are not going to develop the Bluetooth LE stack from scratch. The idea is to develop a rather simple proprietary communication protocol that uses BLE LR modulation for long range and noise immunity. Other than the PHY layer, all other MAC and application layers will be different and much simpler than what&amp;#39;s required for the BLE stack.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE with coded PHY and CCM decryption</title><link>https://devzone.nordicsemi.com/thread/355854?ContentTypeID=1</link><pubDate>Wed, 02 Mar 2022 14:33:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:892693e3-bbfd-4763-a651-08aba71cfec5</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I have not&amp;nbsp;had a chance to look at this today, but will take a look tomorrow. In the mean time, may I ask why you are writing your own Bluetooth LE stack (which is a huge task)?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>