<?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>DTM test not returning any packets</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/72433/dtm-test-not-returning-any-packets</link><description>We have the following setup: - Both nRF52832 and nRF52840 chips in our product 
 - The nRF52832 is a module while the nRF52840 is the chip integrated directly onto our PCB 
 - SDK 15.0.0 (and integrating ble_dtm.c into our test firmware) 
 - Our devices</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 11 Mar 2021 15:37:04 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/72433/dtm-test-not-returning-any-packets" /><item><title>RE: DTM test not returning any packets</title><link>https://devzone.nordicsemi.com/thread/299328?ContentTypeID=1</link><pubDate>Thu, 11 Mar 2021 15:37:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f47d92a2-7d07-462e-a84c-ba72bc823d78</guid><dc:creator>Alex Crombie</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;H&amp;aring;kon,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I have added debugging to dtm_wait() and have also reverted the code to wake up only on events (rather than busy looping) while running the 1M test you proposed.&lt;br /&gt;&lt;br /&gt;I mistakenly used the wrong channel and had the device in RX waking up every so often in the RX state:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;Radio - STATE: 0, MODE: 3, FREQ: 42, TX POWER: 0
cmd: 1(0x01), freq: 20(0x14), length: 1(01), payload: 0(0x00)
Ret: 0 Evt: 0
Radio - STATE: 1, MODE: 3, FREQ: 42, TX POWER: 0
94474: Radio - STATE: 3, MODE: 3, FREQ: 42, TX POWER: 0
95000: Radio - STATE: 3, MODE: 3, FREQ: 42, TX POWER: 0
95500: Radio - STATE: 3, MODE: 3, FREQ: 42, TX POWER: 0
96500: Radio - STATE: 3, MODE: 3, FREQ: 42, TX POWER: 0
97500: Radio - STATE: 3, MODE: 3, FREQ: 42, TX POWER: 0
98000: Radio - STATE: 3, MODE: 3, FREQ: 42, TX POWER: 0
99000: Radio - STATE: 3, MODE: 3, FREQ: 42, TX POWER: 0
99477: Radio - STATE: 3, MODE: 3, FREQ: 42, TX POWER: 0
cmd: 3(0x03), freq: 0(0x00), length: 0(00), payload: 0(0x00)
Ret: 0 Evt: 32768
&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;However in the case where the channel is correct, the device is waking up periodically in the disabled state.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;cmd: 1(0x01), freq: 19(0x13), length: 1(01), payload: 0(0x00)
Ret: 0 Evt: 0
Radio - STATE: 1, MODE: 3, FREQ: 40, TX POWER: 0
513041: Radio - STATE: 0, MODE: 3, FREQ: 40, TX POWER: 0
513045: Radio - STATE: 0, MODE: 3, FREQ: 40, TX POWER: 0
513046: Radio - STATE: 0, MODE: 3, FREQ: 40, TX POWER: 0
513046: Radio - STATE: 0, MODE: 3, FREQ: 40, TX POWER: 0
513047: Radio - STATE: 0, MODE: 3, FREQ: 40, TX POWER: 0
513048: Radio - STATE: 0, MODE: 3, FREQ: 40, TX POWER: 0
513048: Radio - STATE: 0, MODE: 3, FREQ: 40, TX POWER: 0
513049: Radio - STATE: 0, MODE: 3, FREQ: 40, TX POWER: 0
513050: Radio - STATE: 0, MODE: 3, FREQ: 40, TX POWER: 0
513500: Radio - STATE: 0, MODE: 3, FREQ: 40, TX POWER: 0
514500: Radio - STATE: 0, MODE: 3, FREQ: 40, TX POWER: 0
515000: Radio - STATE: 0, MODE: 3, FREQ: 40, TX POWER: 0
516000: Radio - STATE: 0, MODE: 3, FREQ: 40, TX POWER: 0
517000: Radio - STATE: 0, MODE: 3, FREQ: 40, TX POWER: 0
517500: Radio - STATE: 0, MODE: 3, FREQ: 40, TX POWER: 0
518044: Radio - STATE: 0, MODE: 3, FREQ: 40, TX POWER: 0
518500: Radio - STATE: 0, MODE: 3, FREQ: 40, TX POWER: 0
cmd: 3(0x03), freq: 0(0x00), length: 0(00), payload: 0(0x00)
Ret: 0 Evt: 32768
&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;When I first implemented this firmware, I must have missed the need to call dtm_wait(). Having added this to our code it now works correctly.&lt;br /&gt;&lt;br /&gt;Thank you very much for your help and time&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DTM test not returning any packets</title><link>https://devzone.nordicsemi.com/thread/299221?ContentTypeID=1</link><pubDate>Thu, 11 Mar 2021 11:26:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e64fbf3e-4e19-4cd2-b123-35a1a8e1c326</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Alex Crombie"]I have tried this and the same thing is happening. The TX waking time is faster as you described above due to the shorter packet length, but the RX when performing the test with both a packet length of 37 bytes and 1 byte showed identical results where it would ramp up to RX and then stay disabled returning a packet count of 0[/quote]
&lt;p&gt;Have you tried debugging to see if the NRF_RADIO-&amp;gt;TASKS_RXEN in dtm_wait() is continuously called?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DTM test not returning any packets</title><link>https://devzone.nordicsemi.com/thread/299200?ContentTypeID=1</link><pubDate>Thu, 11 Mar 2021 10:07:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:740d9378-89e5-404f-b63a-188a93664f85</guid><dc:creator>Alex Crombie</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;H&amp;aring;kon,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
[quote userid="2115" url="~/f/nordic-q-a/72433/dtm-test-not-returning-any-packets/298992#298992"]If you update to a newer ble_dtm, the power-setting bug should be fixed.[/quote]
&lt;p&gt;I thought that is probably the case.&lt;/p&gt;
[quote userid="2115" url="~/f/nordic-q-a/72433/dtm-test-not-returning-any-packets/298992#298992"]Could you try with&amp;nbsp;another test setup, for instance: channel 2440, 1MBit, 37 bytes payload length?[/quote]
&lt;p&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;I have tried this and the same thing is happening. The TX waking time is faster as you described above due to the shorter packet length, but the RX when performing the test with both a packet length of 37 bytes and 1 byte showed identical results where it would ramp up to RX and then stay disabled returning a packet count of 0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DTM test not returning any packets</title><link>https://devzone.nordicsemi.com/thread/298992?ContentTypeID=1</link><pubDate>Wed, 10 Mar 2021 13:00:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:daa16ad2-9e62-4d6d-a18f-86fb890773fa</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Alex Crombie"]It appears to be alternating between between disabled and Transmitting. As the sampling on occurs when an event wakes the&amp;nbsp;nRF up I am missing the ramp up stage for the TX. Interestingly it appears the TX state occurs once a second or so based on events waking the nRF device up.[/quote]
&lt;p&gt;This is expected. The DTM protocol states that each slot should be setup in a n*625 (n=1..4, based on payload length). When the transmission is finished, it will return to idle state and await for the next slot to occur.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Alex Crombie"]It starts by going into the RX ramp up state and then stays in RX mode for a very short amount of time (I estimate this to be maybe ~12ms) before going to disabled for the remainder of the time[/quote]
&lt;p&gt;The receiver should work similar as the TX part, meaning that it should be disabled upon valid NRF_RADIO-&amp;gt;EVENTS_END event, and restart the RX again in the function &amp;quot;dtm_wait()&amp;quot;. Very strange that it does not restart into RX mode here.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Alex Crombie"]There appears to be a bug in the setting of the TX power first and then starting the radio in 2M mode:[/quote]
&lt;p&gt;If you update to a newer ble_dtm, the power-setting bug should be fixed.&lt;/p&gt;
&lt;p&gt;This bug should not affect the RX test.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Alex Crombie"]It starts by going into the RX ramp up state and then stays in RX mode for a very short amount of time (I estimate this to be maybe ~12ms) before going to disabled for the remainder of the time[/quote]
&lt;p&gt;&amp;nbsp;Could you try with&amp;nbsp;another test setup, for instance: channel 2440, 1MBit, 37 bytes payload length?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DTM test not returning any packets</title><link>https://devzone.nordicsemi.com/thread/298700?ContentTypeID=1</link><pubDate>Tue, 09 Mar 2021 12:34:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:abde3aa3-c271-4e7c-88d6-d68d232fc26c</guid><dc:creator>Alex Crombie</dc:creator><description>[quote userid="2115" url="~/f/nordic-q-a/72433/dtm-test-not-returning-any-packets/298688#298688"]Which SDK version have you based your firmware on?[/quote]
&lt;p&gt;We are using Version 15.0.0.&lt;/p&gt;
[quote userid="2115" url="~/f/nordic-q-a/72433/dtm-test-not-returning-any-packets/298688#298688"]&lt;p&gt;STATE:&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/radio.html?cp=4_2_0_22_13_24#register.STATE"&gt;https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/radio.html?cp=4_2_0_22_13_24#register.STATE&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;MODE:&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/radio.html?cp=4_2_0_22_13_10#register.MODE"&gt;https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/radio.html?cp=4_2_0_22_13_10#register.MODE&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;FREQ:&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/radio.html?cp=4_2_0_22_13_8#register.FREQUENCY"&gt;https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/radio.html?cp=4_2_0_22_13_8#register.FREQUENCY&lt;/a&gt;&lt;/p&gt;[/quote]
&lt;p&gt;Thank you for this, I will check what values these returns.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;One thing I have noticed when running the commands in the order given above and also the ones from the logs is that when setting the PHY in the transmit test (0x0208) it returns 4(DTM_ERROR_ILLEGAL_CONFIGURATION) from the dtm_cmd() function and the event is&amp;nbsp;1. I have added debugging to ensure that I am not somehow corrupting the commands, but all the values seem fine, so I am not sure how I am getting into this code path.&lt;/p&gt;
&lt;p&gt;Using the logging in my previous reply for the command above i am getting:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;cmd: 0(0x00), freq: 2(0x02), length: 2(02), payload: 0(0x00)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The logging added in ble_dtm.c&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;else if (freq == LE_TEST_SETUP_SET_PHY)
{
    SEGGER_RTT_printf(0, &amp;quot;PHY: 1M=%u, 2M=%u, CS8=%u, CS2=%u, actual=%u\n&amp;quot;,
                      LE_PHY_1M, LE_PHY_2M, LE_PHY_LE_CODED_S8, LE_PHY_LE_CODED_S2,
                      length);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The result from this logging is pretty much as expected:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;PHY: 1M=1, 2M=2, CS8=3, CS2=4, actual=2&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Given that the length matches the 2M PHY interface the case for LE_PHY_2M performs an explicit return of radio_init(). It appears it must be something in the validation of the configuration&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;# echo 0x0208 &amp;gt; $DTM
# DTM Result: 4
DTM Event: 1&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;There appears to be a bug in the setting of the TX power first and then starting the radio in 2M mode:&lt;/p&gt;
&lt;p&gt;Bitwise the power calculation is correct however the fact that it is assigned to a signed int8 causes the issues later when assigning it to m_tx_power:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;int8_t new_power8 = (int8_t)(new_tx_power &amp;amp; 0xFF);

// The two most significant bits are not sent in the 6 bit field of the DTM command.
// These two bits are 1&amp;#39;s if and only if the tx_power is a negative number.
// All valid negative values have the fourth most significant bit as 1.
// All valid positive values have the fourth most significant bit as 0.
// By checking this bit, the two most significant bits can be determined.
new_power8 = (new_power8 &amp;amp; 0x30) != 0 ? (new_power8 | 0xC0) : new_power8;
...
m_tx_power = new_power8;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;m_tx_power is&amp;nbsp;defined as an int32_t which would result in a negative tx power level (i.e -8 being&amp;nbsp;0xFFFFFFF8).&lt;/p&gt;
&lt;p&gt;When&amp;nbsp;dtm_radio_validate() is called with the signed value and attempts to perform a comparison with a valid power level it fails due to&amp;nbsp;RADIO_TXPOWER_TXPOWER_Neg8dBm being defined as:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define RADIO_TXPOWER_TXPOWER_Neg8dBm (0xF8UL) /*!&amp;lt; -8 dBm */&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;If m_tx_power were to have been masked to 0xFF this would have worked correctly&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;However even with that fix, the RX test is still not reporting any packets&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;EDIT 2:&amp;nbsp;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;When logging the state of the radio, the transmitter seems to be doing sensible stuff while the test is enabled:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;170000: Radio - STATE: 0, MODE: 4, FREQ: 42, TX POWER: 248
170500: Radio - STATE: 11, MODE: 4, FREQ: 42, TX POWER: 248
171500: Radio - STATE: 0, MODE: 4, FREQ: 42, TX POWER: 248
172000: Radio - STATE: 11, MODE: 4, FREQ: 42, TX POWER: 248
173000: Radio - STATE: 0, MODE: 4, FREQ: 42, TX POWER: 248
173500: Radio - STATE: 11, MODE: 4, FREQ: 42, TX POWER: 248
174500: Radio - STATE: 0, MODE: 4, FREQ: 42, TX POWER: 248
175000: Radio - STATE: 11, MODE: 4, FREQ: 42, TX POWER: 248
176000: Radio - STATE: 0, MODE: 4, FREQ: 42, TX POWER: 248
176500: Radio - STATE: 11, MODE: 4, FREQ: 42, TX POWER: 248
177500: Radio - STATE: 0, MODE: 4, FREQ: 42, TX POWER: 248
178000: Radio - STATE: 11, MODE: 4, FREQ: 42, TX POWER: 248
179000: Radio - STATE: 0, MODE: 4, FREQ: 42, TX POWER: 248
179500: Radio - STATE: 11, MODE: 4, FREQ: 42, TX POWER: 248
180500: Radio - STATE: 0, MODE: 4, FREQ: 42, TX POWER: 248
181000: Radio - STATE: 11, MODE: 4, FREQ: 42, TX POWER: 248
182000: Radio - STATE: 0, MODE: 4, FREQ: 42, TX POWER: 248
182500: Radio - STATE: 11, MODE: 4, FREQ: 42, TX POWER: 248
183500: Radio - STATE: 0, MODE: 4, FREQ: 42, TX POWER: 248
184000: Radio - STATE: 11, MODE: 4, FREQ: 42, TX POWER: 248
185000: Radio - STATE: 0, MODE: 4, FREQ: 42, TX POWER: 248
185500: Radio - STATE: 11, MODE: 4, FREQ: 42, TX POWER: 248
186500: Radio - STATE: 0, MODE: 4, FREQ: 42, TX POWER: 248
187000: Radio - STATE: 11, MODE: 4, FREQ: 42, TX POWER: 248
188000: Radio - STATE: 0, MODE: 4, FREQ: 42, TX POWER: 248
188500: Radio - STATE: 11, MODE: 4, FREQ: 42, TX POWER: 248
189500: Radio - STATE: 0, MODE: 4, FREQ: 42, TX POWER: 248
190000: Radio - STATE: 11, MODE: 4, FREQ: 42, TX POWER: 248&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;It appears to be alternating between between disabled and Transmitting. As the sampling on occurs when an event wakes the&amp;nbsp;nRF up I am missing the ramp up stage for the TX. Interestingly it appears the TX state occurs once a second or so based on events waking the nRF device up.&lt;/p&gt;
&lt;p&gt;For the RX the situation is very different:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;cmd: 1(0x01), freq: 20(0x14), length: 1(01), payload: 0(0x00)
Ret: 0 Evt: 0
Radio - STATE: 1, MODE: 4, FREQ: 42, TX POWER: 0
152936: Radio - STATE: 1, MODE: 4, FREQ: 42, TX POWER: 0
152936: Radio - STATE: 3, MODE: 4, FREQ: 42, TX POWER: 0
152936: Radio - STATE: 3, MODE: 4, FREQ: 42, TX POWER: 0
152946: Radio - STATE: 0, MODE: 4, FREQ: 42, TX POWER: 0
152946: Radio - STATE: 0, MODE: 4, FREQ: 42, TX POWER: 0
152947: Radio - STATE: 0, MODE: 4, FREQ: 42, TX POWER: 0
152947: Radio - STATE: 0, MODE: 4, FREQ: 42, TX POWER: 0
152947: Radio - STATE: 0, MODE: 4, FREQ: 42, TX POWER: 0
152947: Radio - STATE: 0, MODE: 4, FREQ: 42, TX POWER: 0
152947: Radio - STATE: 0, MODE: 4, FREQ: 42, TX POWER: 0
152947: Radio - STATE: 0, MODE: 4, FREQ: 42, TX POWER: 0
152947: Radio - STATE: 0, MODE: 4, FREQ: 42, TX POWER: 0
152947: Radio - STATE: 0, MODE: 4, FREQ: 42, TX POWER: 0
152947: Radio - STATE: 0, MODE: 4, FREQ: 42, TX POWER: 0
152947: Radio - STATE: 0, MODE: 4, FREQ: 42, TX POWER: 0
152947: Radio - STATE: 0, MODE: 4, FREQ: 42, TX POWER: 0
152947: Radio - STATE: 0, MODE: 4, FREQ: 42, TX POWER: 0
152947: Radio - STATE: 0, MODE: 4, FREQ: 42, TX POWER: 0
152947: Radio - STATE: 0, MODE: 4, FREQ: 42, TX POWER: 0
152947: Radio - STATE: 0, MODE: 4, FREQ: 42, TX POWER: 0
152974: Radio - STATE: 0, MODE: 4, FREQ: 42, TX POWER: 0
152974: Radio - STATE: 0, MODE: 4, FREQ: 42, TX POWER: 0
152975: Radio - STATE: 0, MODE: 4, FREQ: 42, TX POWER: 0
...
153930: Radio - STATE: 0, MODE: 4, FREQ: 42, TX POWER: 0
153930: Radio - STATE: 0, MODE: 4, FREQ: 42, TX POWER: 0
Ret: 0 Evt: 32768 &amp;lt;- 1 second has passed and the RX test terminated&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;It starts by going into the RX ramp up state and then stays in RX mode for a very short amount of time (I estimate this to be maybe ~12ms) before going to disabled for the remainder of the time&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DTM test not returning any packets</title><link>https://devzone.nordicsemi.com/thread/298688?ContentTypeID=1</link><pubDate>Tue, 09 Mar 2021 12:10:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d9155368-235c-4af5-94fc-b5ee179dd69b</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi Alex,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
[quote user="Alex Crombie"]The nRF&amp;nbsp;chip is slaved to the CPU embedded in our product and it only has connectivity to the CPU via I2C, and the SWD interface for debug purposes. Thus the only way we can send DTM commands is from userspace in the CPU via I2C.[/quote]
&lt;p&gt;Understood. The translation layer looks to be minimalistic, so I assume&amp;nbsp;there&amp;#39;s little issues there.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Alex Crombie"]We definitely know that the commands for TX are operating correctly (including constant tone mode) and have verified this with a spectrum analyser.&amp;nbsp;[/quote]
&lt;p&gt;&amp;nbsp;This is good. I assume then its the RX that is misbehaving.&lt;/p&gt;
[quote user="Alex Crombie"]&lt;p&gt;As mentioned above we have checked that the device enters TX. I will check the current consumption but is there a way to check if the device has entered RX mode correctly (from a software standpoint) or some other definitive way of knowing?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;As a comparison of your logs to what we are sending the TX is pretty much identical except in your logs the tx power is set first then the top 2 bits of the packet length.&lt;/p&gt;[/quote]
&lt;p&gt;When the RADIO is in RX mode, you can read the register contents of the NRF_RADIO peripheral:&lt;/p&gt;
&lt;p&gt;STATE:&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/radio.html?cp=4_2_0_22_13_24#register.STATE"&gt;https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/radio.html?cp=4_2_0_22_13_24#register.STATE&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;MODE:&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/radio.html?cp=4_2_0_22_13_10#register.MODE"&gt;https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/radio.html?cp=4_2_0_22_13_10#register.MODE&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;FREQ:&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/radio.html?cp=4_2_0_22_13_8#register.FREQUENCY"&gt;https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/radio.html?cp=4_2_0_22_13_8#register.FREQUENCY&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;.STATE will give you if its actually running RX mode, .MODE will give you the modulation, and .FREQUENCY gives you the listening channel (2400 + register-value)&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Alex Crombie"]In terms of the RX we don&amp;#39;t explicitly set the TX power, and we don&amp;#39;t explicitly set the modulation index also the receive packet length in the receive test is set to 1 rather than max as per the TX test. Should any of these have an affect on receiving packets?[/quote]
&lt;p&gt;&amp;nbsp;This is not a problem. RX does not have a transmit function, or a &amp;quot;gain&amp;quot; setting. The things that are required is the modulation scheme (BLE 2MBIT for instance) and the listening frequency.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Alex Crombie"]Another thing I noticed is that the logs don&amp;#39;t contain the results from the end of the test, are these reporting the correct numbers as well?[/quote]
&lt;p&gt;My apologies, I didn&amp;#39;t stop the test when providing logs. Here&amp;#39;s the snippet that ends the test when 0 packets are received:&lt;/p&gt;
&lt;p&gt;2021-03-09T12:00:10.229Z INFO Ending test&lt;br /&gt;2021-03-09T12:00:10.231Z DEBUG DTM Transport: Create test end CMD&lt;br /&gt;2021-03-09T12:00:10.231Z DEBUG DTM Transport: Sending data: 0xC0 0x00&lt;br /&gt;2021-03-09T12:00:10.250Z DEBUG DTM Transport: Receiving data: 0x80 0x00&lt;br /&gt;2021-03-09T12:00:10.255Z INFO Receiver test finished successfully. Received 0 packets.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s a RX log on 2442MHz (BLE2MBIT), and successfully receiving&amp;nbsp;~4k packets :&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;2021-03-09T12:08:34.562Z INFO Running device setup
2021-03-09T12:08:34.562Z DEBUG DTM Transport: Create setup CMD with control: 0
2021-03-09T12:08:34.562Z DEBUG DTM Transport: Create setup CMD with parameter: 0
2021-03-09T12:08:34.562Z DEBUG DTM Transport: Create setup CMD with dc type: 00
2021-03-09T12:08:34.562Z DEBUG DTM Transport: Sending data: 0x00 0x00
2021-03-09T12:08:34.569Z DEBUG DTM Transport: Receiving data: 0x00 0x00
2021-03-09T12:08:34.569Z DEBUG DTM Transport: Create tx power CMD: 0
2021-03-09T12:08:34.570Z DEBUG DTM Transport: Sending data: 0x80 0x0B
2021-03-09T12:08:34.575Z DEBUG DTM Transport: Receiving data: 0x00 0x00
2021-03-09T12:08:34.576Z DEBUG DTM Transport: Create setup CMD with control: 1
2021-03-09T12:08:34.576Z DEBUG DTM Transport: Create setup CMD with parameter: 0
2021-03-09T12:08:34.576Z DEBUG DTM Transport: Create setup CMD with dc type: 00
2021-03-09T12:08:34.576Z DEBUG DTM Transport: Sending data: 0x01 0x00
2021-03-09T12:08:34.582Z DEBUG DTM Transport: Receiving data: 0x00 0x00
2021-03-09T12:08:34.583Z DEBUG DTM Transport: Create setup CMD with control: 3
2021-03-09T12:08:34.583Z DEBUG DTM Transport: Create setup CMD with parameter: 0
2021-03-09T12:08:34.583Z DEBUG DTM Transport: Create setup CMD with dc type: 00
2021-03-09T12:08:34.583Z DEBUG DTM Transport: Sending data: 0x03 0x00
2021-03-09T12:08:34.591Z DEBUG DTM Transport: Receiving data: 0x00 0x00
2021-03-09T12:08:34.591Z DEBUG DTM Transport: Create setup CMD with control: 2
2021-03-09T12:08:34.591Z DEBUG DTM Transport: Create setup CMD with parameter: 2
2021-03-09T12:08:34.591Z DEBUG DTM Transport: Create setup CMD with dc type: 00
2021-03-09T12:08:34.592Z DEBUG DTM Transport: Sending data: 0x02 0x08
2021-03-09T12:08:34.598Z DEBUG DTM Transport: Receiving data: 0x00 0x00
2021-03-09T12:08:34.598Z INFO Starting test
2021-03-09T12:08:34.608Z DEBUG DTM Transport: Create receiver CMD with frequency: 2442
2021-03-09T12:08:34.608Z DEBUG DTM Transport: Create receiver CMD with length: 1
2021-03-09T12:08:34.608Z DEBUG DTM Transport: Create receiver CMD with packet type: 0
2021-03-09T12:08:34.614Z DEBUG DTM Transport: Sending data: 0x54 0x04
2021-03-09T12:08:34.620Z DEBUG DTM Transport: Receiving data: 0x00 0x00
2021-03-09T12:08:37.520Z INFO Ending test
2021-03-09T12:08:37.520Z DEBUG DTM Transport: Create test end CMD
2021-03-09T12:08:37.520Z DEBUG DTM Transport: Sending data: 0xC0 0x00
2021-03-09T12:08:37.540Z DEBUG DTM Transport: Receiving data: 0x92 0x40
2021-03-09T12:08:37.544Z INFO Receiver test finished successfully. Received 4672 packets.&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Which SDK version have you based your firmware on?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DTM test not returning any packets</title><link>https://devzone.nordicsemi.com/thread/298439?ContentTypeID=1</link><pubDate>Mon, 08 Mar 2021 14:57:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:38afd23b-3d67-4f65-b864-735130c14c2f</guid><dc:creator>Alex Crombie</dc:creator><description>[quote userid="2115" url="~/f/nordic-q-a/72433/dtm-test-not-returning-any-packets/298399#298399"]&amp;nbsp;Is there a specific reason for not using UART with DTM? How do you interface the nRF? Using a USB-&amp;gt;I2C bridge?[/quote]
&lt;p&gt;The nRF&amp;nbsp;chip is slaved to the CPU embedded in our product and it only has connectivity to the CPU via I2C, and the SWD interface for debug purposes. Thus the only way we can send DTM commands is from userspace in the CPU via I2C.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="2115" url="~/f/nordic-q-a/72433/dtm-test-not-returning-any-packets/298399#298399"]Do you parse the response data from the DUT? Command-wise, this looks OK.[/quote]
&lt;p&gt;The I2C command structure is a very thin wrapper around the interface provided by ble_dtm:&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;dtm_cmd_t cmd = ((action-&amp;gt;parameter &amp;gt;&amp;gt; 14) &amp;amp; 0x03);
dtm_freq_t freq = ((action-&amp;gt;parameter &amp;gt;&amp;gt; 8) &amp;amp; 0x3f);
uint32_t length = ((action-&amp;gt;parameter &amp;gt;&amp;gt; 2) &amp;amp; 0x3f);
dtm_pkt_type_t payload = (action-&amp;gt;parameter &amp;amp; 0x3);
dtm_event_t evt;

SEGGER_RTT_printf( 0, &amp;quot;cmd: %u(0x%02x), freq: %u(0x%02x), length: %u(%02x), payload: %u(0x%02x)\n&amp;quot;,
                   cmd, cmd,
                   freq, freq,
                   length, length,
                   payload, payload);

uint32_t ret = dtm_cmd(cmd, freq, length, payload);
mcu_ctrl_add_event_w_extra(EVT_DTM_COMMAND_RESULT, 0, (uint16_t)ret, clock_get_elapsed_ms());

if (dtm_event_get(&amp;amp;evt)) {
    mcu_ctrl_add_event_w_extra(EVT_DTM_EVENT, 0, (uint16_t)evt, clock_get_elapsed_ms());
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;In the above code snippet the `mcu_ctrl_add_event*()` functions push a bit of data up the I2C lines, in this case first the result then the dtm event.&amp;nbsp;&amp;nbsp;The `action-&amp;gt;parameter` is a 32bit value. We definitely know that the commands for TX are operating correctly (including constant tone mode) and have verified this with a spectrum analyser.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The receiver test is run as follows, which I believe should be quite close to the python test runner in AN34:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;# echo 0x0000 &amp;gt; $DTM &amp;amp;&amp;amp; echo 0x010c &amp;gt; $DTM &amp;amp;&amp;amp; echo 0x0208 &amp;gt; $DTM &amp;amp;&amp;amp; echo 0x54fc &amp;gt; $DTM &amp;amp;&amp;amp; sleep 1 &amp;amp;&amp;amp; echo 0xc000 &amp;gt; $DTM
DTM Result: 0
DTM Event: 0
DTM Result: 0
DTM Event: 0
DTM Result: 0
DTM Event: 0
DTM Result: 0
DTM Event: 0
# DTM Result: 0
DTM Event: 32768&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Within 1s I would expect 1600 packets to be received which should come nowhere close to overflowing the packet report.&lt;/p&gt;
[quote userid="2115" url="~/f/nordic-q-a/72433/dtm-test-not-returning-any-packets/298399#298399"]Have you checked that the devices enter its respective RX and TX mode? If you do not have a spectrum analyzer, you can look at the current consumption when the nRF enters RX or TX mode.[/quote]
&lt;p&gt;As mentioned above we have checked that the device enters TX. I will check the current consumption but is there a way to check if the device has entered RX mode correctly (from a software standpoint) or some other definitive way of knowing?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;As a comparison of your logs to what we are sending the TX is pretty much identical except in your logs the tx power is set first then the top 2 bits of the packet length.&lt;br /&gt;In terms of the RX we don&amp;#39;t explicitly set the TX power, and we don&amp;#39;t explicitly set the modulation index also the receive packet length in the receive test is set to 1 rather than max as per the TX test. Should any of these have an affect on receiving packets?&lt;br /&gt;&lt;br /&gt;Another thing I noticed is that the logs don&amp;#39;t contain the results from the end of the test, are these reporting the correct numbers as well?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Alex&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DTM test not returning any packets</title><link>https://devzone.nordicsemi.com/thread/298399?ContentTypeID=1</link><pubDate>Mon, 08 Mar 2021 13:43:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9b986ff7-9482-40f6-8ec3-8441ff2746c0</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]As the nRF52 chips are already integrated into our product we have implemented the DTM interface over I2C rather than serial.[/quote]
&lt;p&gt;&amp;nbsp;Is there a specific reason for not using UART with DTM? How do you interface the nRF? Using a USB-&amp;gt;I2C bridge?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]1) Is there anything wrong in the setup and commands used?[/quote]
&lt;p&gt;Do you parse the response data from the DUT? Command-wise, this looks OK.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s the log file from entering TX/RX with your specified settings taken from nRF Connect for desktop -&amp;gt; direct test mode application:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/dtm_5F00_rx_5F00_2Mbit_5F00_2442MHz.txt"&gt;devzone.nordicsemi.com/.../dtm_5F00_rx_5F00_2Mbit_5F00_2442MHz.txt&lt;/a&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/dtm_5F00_tx_5F00_min8dbm_5F00_2Mbit_5F00_2442MHz.txt"&gt;devzone.nordicsemi.com/.../dtm_5F00_tx_5F00_min8dbm_5F00_2Mbit_5F00_2442MHz.txt&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Could it be that you are parsing the data in the reverse byte order?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]2) Any Idea why ending any test always returns the packet count as 0?[/quote]
&lt;p&gt;Have you checked that the devices enter its respective RX and TX mode? If you do not have a spectrum analyzer, you can look at the current consumption when the nRF enters RX or TX mode.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>