<?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>usbd_hid_composite not working on Mac?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/61706/usbd_hid_composite-not-working-on-mac</link><description>Hi my USB keyboard application works on Windows and Linux but not on a MacBook Air with macOS Sierra 10.12.6. So I did step back and tried the combined HID example nRF5_SDK_16.0.0_98a08e2/examples/peripheral/usbd_hid_composite/hex/usbd_hid_composite_pca10056</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 30 Jun 2020 09:23:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/61706/usbd_hid_composite-not-working-on-mac" /><item><title>RE: usbd_hid_composite not working on Mac?</title><link>https://devzone.nordicsemi.com/thread/257517?ContentTypeID=1</link><pubDate>Tue, 30 Jun 2020 09:23:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:acf5d612-ef1a-4034-964f-d0a24b7e250b</guid><dc:creator>peterz</dc:creator><description>&lt;p&gt;Hi Kenneth&lt;/p&gt;
&lt;p&gt;you made my day!&lt;br /&gt;Both the original example and my own application work on the MacBook I have for testing.&lt;br /&gt;I&amp;#39;ll try other Apple machines as soon as possible but for now - GREAT!&lt;/p&gt;
&lt;p&gt;have as much fun as I do :-)&lt;br /&gt;Peter&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: usbd_hid_composite not working on Mac?</title><link>https://devzone.nordicsemi.com/thread/257508?ContentTypeID=1</link><pubDate>Tue, 30 Jun 2020 08:40:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d918a56a-f3ab-4f9a-a969-4363bb1d6ad4</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hello Peter,&lt;/p&gt;
&lt;p&gt;Einar is on vacation, so I am taking over the case.&lt;/p&gt;
&lt;p&gt;Could you please&amp;nbsp;try to&amp;nbsp;insert a new line in app_usbd_hid_kbd.c, function hid_kbd_on_idle(), just below&amp;nbsp;NRF_DRV_USBD_TRANSFER_IN(...), around line 543:&lt;/p&gt;
&lt;p&gt;(void)hid_kbd_transfer_next(p_kbd);&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This inserted function updates the USB keyboard buffer to make sure that each &amp;quot;idle&amp;quot; transfer reflects the actual keyboard state.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Please let me know the result.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;br /&gt;Kenneth&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: usbd_hid_composite not working on Mac?</title><link>https://devzone.nordicsemi.com/thread/256275?ContentTypeID=1</link><pubDate>Mon, 22 Jun 2020 17:20:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2d961266-d4bf-4dfd-a29b-5e98498832e5</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Peter,&lt;/p&gt;
&lt;p&gt;Thanks for the update. I do not have any updates from our side yet, unfortunately.&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: usbd_hid_composite not working on Mac?</title><link>https://devzone.nordicsemi.com/thread/255768?ContentTypeID=1</link><pubDate>Thu, 18 Jun 2020 12:34:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:04e88bda-8b3f-41ab-8bb7-bee98cf5939f</guid><dc:creator>peterz</dc:creator><description>&lt;p&gt;Hi Einar&lt;/p&gt;
&lt;p&gt;comparing Windows vs MacOS is interesting, but it hasn&amp;#39;t really helped me (yet).&lt;/p&gt;
&lt;p&gt;In the code I didn&amp;#39;t find evidence that STALLED would have interesting effects.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m still surprised that SDK16 with vendor Nordic produces HID IN periodic reports. I see no stimulus and no reason why they should be sent.&lt;/p&gt;
&lt;p&gt;summary: no real progress on my side&lt;/p&gt;
&lt;p&gt;Peter&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: usbd_hid_composite not working on Mac?</title><link>https://devzone.nordicsemi.com/thread/255207?ContentTypeID=1</link><pubDate>Tue, 16 Jun 2020 09:58:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:12cfd5ed-9e9a-4b38-90c4-590931031854</guid><dc:creator>peterz</dc:creator><description>&lt;p&gt;Hi Einar&lt;/p&gt;
&lt;p&gt;thanks - Windows uses a different approach at startup.&lt;br /&gt;MacOS probes just 8 bytes of Device Descriptor to discover the buffer size, then restarts reading Device Descriptor with buffer size 64.&lt;/p&gt;
&lt;p&gt;Windows fetches the Device Descriptor with 64 byte and then applies RESET, Set Address and re-fetches the Device Descriptor.&lt;/p&gt;
&lt;p&gt;Interesting STALLED transfer at 3.784.&lt;/p&gt;
&lt;p&gt;@ 3.783: get Serial Number string in ENGLISH_US right away without checking for supported languages.&lt;/p&gt;
&lt;p&gt;@ 3.862: asking for only 4 bytes of string ???&lt;br /&gt;Is this a check if the string is delivered but the content is not of interest?&lt;/p&gt;
&lt;p&gt;daily business is calling - I continue later&lt;/p&gt;
&lt;p&gt;Peter&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: usbd_hid_composite not working on Mac?</title><link>https://devzone.nordicsemi.com/thread/255198?ContentTypeID=1</link><pubDate>Tue, 16 Jun 2020 09:28:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d2ab55a8-0e63-4b1e-bb84-f5d2758e52fe</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Peter,&lt;/p&gt;
&lt;p&gt;Here is a USB analyzer trace&amp;nbsp;of the unmodified SDK 16&amp;nbsp;composite HID example and Windows 10: &lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-360d8ef0d7c4407385502944782a8355/usbd_5F00_hid_5F00_composite_5F00_pca10056_5F00_sdk_5F00_16_5F00_windows_5F00_10.zip"&gt;devzone.nordicsemi.com/.../usbd_5F00_hid_5F00_composite_5F00_pca10056_5F00_sdk_5F00_16_5F00_windows_5F00_10.zip&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: usbd_hid_composite not working on Mac?</title><link>https://devzone.nordicsemi.com/thread/255111?ContentTypeID=1</link><pubDate>Tue, 16 Jun 2020 00:20:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ce9ed497-f793-43e2-ae0c-2d3ccfd072fb</guid><dc:creator>peterz</dc:creator><description>&lt;p&gt;Hi Einar&lt;/p&gt;
&lt;p&gt;just in case you create a dump when connected to a Windows or Linux system - I would like to compare SDK16 on Windows with SDK16 on MacOS.&lt;/p&gt;
&lt;p&gt;Peter&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: usbd_hid_composite not working on Mac?</title><link>https://devzone.nordicsemi.com/thread/254914?ContentTypeID=1</link><pubDate>Mon, 15 Jun 2020 08:35:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:180b592e-55b0-491b-b7c8-e429061736c2</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Peter,&lt;/p&gt;
&lt;p&gt;We were also looking at the packet lengths. However, changing&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;            APP_USBD_CLASS_DESCRIPTOR_WRITE(LSB_16(NRF_DRV_USBD_EPSIZE)); // wMaxPacketSize LSB
            APP_USBD_CLASS_DESCRIPTOR_WRITE(MSB_16(NRF_DRV_USBD_EPSIZE)); // wMaxPacketSize MSB&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;to&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;            APP_USBD_CLASS_DESCRIPTOR_WRITE(8); // wMaxPacketSize LSB
            APP_USBD_CLASS_DESCRIPTOR_WRITE(0); // wMaxPacketSize MSB&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;in&amp;nbsp;app_usbd_hid_mouse.c and&amp;nbsp;app_usbd_hid_kbd.c died not have an effect, at lest. (I might have been long shot, though).&lt;/p&gt;
&lt;p&gt;The SDK team has allocated time to analyze this issue in more detail, and I will let you know when they make progress. Please continue to let me know if you have any new findings.&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: usbd_hid_composite not working on Mac?</title><link>https://devzone.nordicsemi.com/thread/254852?ContentTypeID=1</link><pubDate>Sun, 14 Jun 2020 12:03:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f85a20f2-682a-4f1f-bbb1-ba2796900ea5</guid><dc:creator>peterz</dc:creator><description>&lt;p&gt;Hi Einar&lt;/p&gt;
&lt;p&gt;further analyzing the dumps: I see SDK14 sets wMaxPacketSize == 8 in the IN Endpoint Descriptor for both mouse and keyboard while SDK16 sets wMaxPacketSize == 64&lt;/p&gt;
&lt;p&gt;wild speculation: the internal buffer is only 8 bytes long, but gets cleared 64 bytes deep (array index out of bounds). this would overwrite memory. The additional request for some Apple specific feature (vendor ID Apple) leads to STALLED because the requested feature is not implement and restores some of the overwritten values.&lt;br /&gt;wild speculations, but for the moment I it&amp;#39;s the most promising trail I see. I have to check that in the code.&lt;/p&gt;
&lt;p&gt;Not yet clear: does the host activate boot protocol or not ?&lt;/p&gt;
&lt;p&gt;And I see the precompiled hex version in SDK14 does not set SUBLANGUAGE for the strings, it&amp;#39;s just ENGLISH. I don&amp;#39;t know if this is legal - it HAS an impact on host behaviour, but I do not think this should lead to trouble. Also I see variations in the order the interfaces are set up: I assume that the host spawns a thread per interface&lt;/p&gt;
&lt;p&gt;best regards&lt;br /&gt;Peter&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: usbd_hid_composite not working on Mac?</title><link>https://devzone.nordicsemi.com/thread/254797?ContentTypeID=1</link><pubDate>Fri, 12 Jun 2020 18:06:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:261bd78f-1802-4ea4-8e1a-8a861d56e0a4</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Peter,&lt;/p&gt;
&lt;p&gt;Sounds good. Please let me know if you make any progress. I will update this&amp;nbsp;thread&amp;nbsp;when we have some results.&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: usbd_hid_composite not working on Mac?</title><link>https://devzone.nordicsemi.com/thread/254578?ContentTypeID=1</link><pubDate>Thu, 11 Jun 2020 23:19:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1958dd92-de8b-4e2c-8f83-6a777ee4c2ab</guid><dc:creator>peterz</dc:creator><description>&lt;p&gt;Hi Einar&lt;/p&gt;
&lt;p&gt;thank you very much for the analyzer traces, they are VERY helpful. I have to be cautious with interpretation for I&amp;#39;m a beginner and it&amp;#39;s not clear what is cause and what is consequence. In the traces SDK16 with Nordic vendor id I see the start of the famous 4-transfers-with-20ms-pause loop I saw on my oscilloscope.&lt;/p&gt;
&lt;p&gt;Interesting detail: the very first group (at 7.673 141) appears spontaneously 12.3 ms after the last &amp;quot;Class request&amp;quot; and is only 3 IN reports long (not 4).&lt;/p&gt;
&lt;p&gt;Comparing this to Apple vendor id: the time between the last &amp;quot;Class request&amp;quot; and the last &amp;quot;Get Descriptor&amp;quot; is 9.5ms. And the last &amp;quot;Class request&amp;quot; appears only for Apple vendor id - it might be asking for an Apple specific feature - and gets answered with STALLED (maybe because it is not implemented).&lt;/p&gt;
&lt;p&gt;This might give me 2 clues:&lt;br /&gt;a) STALLED might execute code which resets something in the driver&lt;br /&gt;b) there might be some timeout in the range of 10-12ms which expires before the last &amp;quot;Get Descriptor&amp;quot; call appears&lt;/p&gt;
&lt;p&gt;Before reading those traces I expected to have more interaction when macOS tries to identify an unknown keyboard. Now I see it&amp;#39;s the other way around: there is one more request when macOS tries to get some additional information it expects from an Apple keyboard but not from a third party product. This makes sense.&lt;/p&gt;
&lt;p&gt;enough for today - I will try to understand more the next days&lt;/p&gt;
&lt;p&gt;best regards&lt;br /&gt;Peter&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: usbd_hid_composite not working on Mac?</title><link>https://devzone.nordicsemi.com/thread/253826?ContentTypeID=1</link><pubDate>Mon, 08 Jun 2020 13:48:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2aa15ab6-addd-4bd4-a0c6-cef604a8a0a3</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Peter,&lt;/p&gt;
&lt;p&gt;I am seeing the same thing. For reference I attach hex files and&amp;nbsp;USB analyzer traces:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-360d8ef0d7c4407385502944782a8355/USB-composite.zip"&gt;devzone.nordicsemi.com/.../USB-composite.zip&lt;/a&gt;.&amp;nbsp;I do not have any progress though, unfortunately.&lt;/p&gt;
&lt;p&gt;Update: We are continuing to look into this and will update this thread when I have more information.&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: usbd_hid_composite not working on Mac?</title><link>https://devzone.nordicsemi.com/thread/253756?ContentTypeID=1</link><pubDate>Mon, 08 Jun 2020 11:05:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c4bcd9c6-701e-4198-bdfb-838bd469f473</guid><dc:creator>peterz</dc:creator><description>&lt;p&gt;Hi Einar&lt;/p&gt;
&lt;p&gt;the code in SDK 16 compared to SDK 14 is a complete rewrite, adding timestamp makes little sense.&lt;/p&gt;
&lt;p&gt;I compiled usbd_hid_composite example from nRF5_SDK_16.0.0_98a08e2 modifying sdk_config.h to get RTT debug output. Below to find the debug output when I connect to Windows 8.1, Linux, MacBook.&lt;/p&gt;
&lt;p&gt;The sequences are quite different, depending on OS. Looking at the code I&amp;#39;m surprised most of the seuqnece&lt;br /&gt;APP_USBD_EVT_DRV_RESET&lt;br /&gt;APP_USBD_EVT_DRV_RESET&lt;br /&gt;APP_USBD_EVT_DRV_RESET&lt;br /&gt;APP_USBD_EVT_DRV_RESET&lt;br /&gt;APP_USBD_EVT_DRV_RESET&lt;br /&gt;APP_USBD_EVT_STATE_CHANGED&lt;br /&gt;APP_USBD_EVT_STATE_CHANGED&lt;br /&gt;is this the consequence of (unwanted?) recursion?&lt;/p&gt;
&lt;p&gt;usbd_core_state_set(app_usbd_state_t state) does more than it says&lt;br /&gt;&lt;br /&gt;I&amp;#39;m stuck on this for 2 weeks now and the more I dig into it the less I think this is a Mac issue.&lt;br /&gt;Peter&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;here comes the debug RTT output when I just connect the devkit (no buttons pressed)&lt;/p&gt;
&lt;p&gt;debug output when plugged into Windows 8.1&lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: USBD HID composite example started.&lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: enter main loop&lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: USB power detected&lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: USB ready&lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: usbd_user_ev_handler APP_USBD_EVT_STATE_CHANGED&lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: usbd_user_ev_handler STARTED&lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: usbd_user_ev_handler SUSPEND&lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: usbd_user_ev_handler RESUME&lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: usbd_user_ev_handler APP_USBD_EVT_DRV_RESET&lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: usbd_user_ev_handler APP_USBD_EVT_STATE_CHANGED&lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: usbd_user_ev_handler APP_USBD_EVT_DRV_RESET&lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: usbd_user_ev_handler APP_USBD_EVT_DRV_RESET&lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: usbd_user_ev_handler APP_USBD_EVT_STATE_CHANGED&lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: usbd_user_ev_handler APP_USBD_EVT_STATE_CHANGED&lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: hid_kbd_user_ev_handler OUT report&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;debug output when plugged into a Linux machine&lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: USBD HID composite example started.&lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: enter main loop&lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: USB power detected&lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: USB ready&lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: usbd_user_ev_handler APP_USBD_EVT_STATE_CHANGED&lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: usbd_user_ev_handler STARTED&lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: usbd_user_ev_handler SUSPEND&lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: usbd_user_ev_handler RESUME&lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: usbd_user_ev_handler APP_USBD_EVT_DRV_RESET&lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: usbd_user_ev_handler APP_USBD_EVT_STATE_CHANGED&lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: usbd_user_ev_handler APP_USBD_EVT_DRV_RESET&lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: usbd_user_ev_handler APP_USBD_EVT_STATE_CHANGED&lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: usbd_user_ev_handler APP_USBD_EVT_STATE_CHANGED&lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: hid_kbd_user_ev_handler OUT report&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;debug output when plugged into a old, slow MacBook Air with El Capitan&lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: USBD HID composite example started.&lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: enter main loop&lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: USB power detected&lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: USB ready&lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: usbd_user_ev_handler APP_USBD_EVT_STATE_CHANGED&lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: usbd_user_ev_handler STARTED&lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: usbd_user_ev_handler SUSPEND&lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: usbd_user_ev_handler RESUME&lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: usbd_user_ev_handler APP_USBD_EVT_DRV_RESET&lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: usbd_user_ev_handler APP_USBD_EVT_STATE_CHANGED&lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: usbd_user_ev_handler SUSPEND&lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: usbd_user_ev_handler RESUME&lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: usbd_user_ev_handler APP_USBD_EVT_DRV_RESET&lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: usbd_user_ev_handler APP_USBD_EVT_DRV_RESET&lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: usbd_user_ev_handler APP_USBD_EVT_DRV_RESET&lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: usbd_user_ev_handler APP_USBD_EVT_DRV_RESET&lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: usbd_user_ev_handler APP_USBD_EVT_DRV_RESET&lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: usbd_user_ev_handler APP_USBD_EVT_STATE_CHANGED&lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: usbd_user_ev_handler APP_USBD_EVT_STATE_CHANGED&lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: hid_kbd_user_ev_handler IN report&lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: hid_kbd_user_ev_handler IN report&lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: hid_kbd_user_ev_handler IN report&lt;br /&gt;......... same line repeated many times per second .......&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: usbd_hid_composite not working on Mac?</title><link>https://devzone.nordicsemi.com/thread/253462?ContentTypeID=1</link><pubDate>Fri, 05 Jun 2020 09:20:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7427853c-e16c-43ba-8a7f-760aeb71b262</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Peter,&lt;/p&gt;
[quote user="zankl"]the results I get make me think of timing and race conditions. I would like to add some debug output messages with high resolution timestamps.[/quote]
&lt;p&gt;That seems sensible.&lt;/p&gt;
[quote user="zankl"]What can I use as reference timer, is there something like System.getTimeMicroseconds() ?[/quote]
&lt;p&gt;The easiest is to use the &lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/rtc.html?cp=4_0_0_5_21"&gt;RTC&lt;/a&gt;, and just start it and read the COUNTER register to get a timestamp. However, this is only 32.768 kHz. Since the example already uses the &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/lib_timer.html"&gt;app_timer&lt;/a&gt;, all you need to do in this case is to modify sdk_config.h so that&amp;nbsp;APP_TIMER_CONFIG_RTC_FREQUENCY is 0 (to get a higher accuracy), and set&amp;nbsp;APP_TIMER_KEEPS_RTC_ACTIVE to 1. Then you can call&amp;nbsp;app_timer_cnt_get() to get the counter value.&lt;/p&gt;
&lt;p&gt;If you need higher accuracy than what you get with the RTC, then you must use a &lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/timer.html?cp=4_0_0_5_29"&gt;TIMER&lt;/a&gt;. In that case, you&amp;nbsp;cannot read the counter register directly, so you need to capture it to a CC register, and read it from there.&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: usbd_hid_composite not working on Mac?</title><link>https://devzone.nordicsemi.com/thread/253453?ContentTypeID=1</link><pubDate>Fri, 05 Jun 2020 08:47:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8f900548-a8c3-4341-a33b-47bf125f5308</guid><dc:creator>peterz</dc:creator><description>&lt;p&gt;Hi Einar&lt;/p&gt;
&lt;p&gt;the results I get make me think of timing and race conditions. I would like to add some debug output messages with high resolution timestamps. What can I use as reference timer, is there something like System.getTimeMicroseconds() ?&lt;/p&gt;
&lt;p&gt;best regrads&lt;br /&gt;Peter&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: usbd_hid_composite not working on Mac?</title><link>https://devzone.nordicsemi.com/thread/253244?ContentTypeID=1</link><pubDate>Thu, 04 Jun 2020 10:30:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:be0a9ae7-d3ff-40b6-a1c9-fdcebc095aa5</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Peter,&lt;/p&gt;
&lt;p&gt;I am sorry for the late reply. Yes, I get the same results. The example from SDK 14 works (including 14.2). I am not close to properly understanding the issue, though.&lt;/p&gt;
&lt;p&gt;Br,&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: usbd_hid_composite not working on Mac?</title><link>https://devzone.nordicsemi.com/thread/253223?ContentTypeID=1</link><pubDate>Thu, 04 Jun 2020 09:36:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a92bba1-3ddb-46c9-8302-4edb82b111d1</guid><dc:creator>peterz</dc:creator><description>&lt;p&gt;Hi Einar&lt;/p&gt;
&lt;p&gt;do you get the same result?&lt;br /&gt;The usbd_hid_composite example from SDK 14 works fine with macOS.&lt;br /&gt;The same example from SDK 15 fails.&lt;/p&gt;
&lt;p&gt;best regards&lt;br /&gt;Peter&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: usbd_hid_composite not working on Mac?</title><link>https://devzone.nordicsemi.com/thread/252495?ContentTypeID=1</link><pubDate>Fri, 29 May 2020 22:31:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d9167557-d0a9-4204-a460-6ff0335996ba</guid><dc:creator>peterz</dc:creator><description>&lt;p&gt;Hi Einar&lt;/p&gt;
&lt;p&gt;looking through the code I realized there is a legacy mapping. This inspired me to a test - bingo!&lt;/p&gt;
&lt;p&gt;I tested usbd_hid_composite_pca10056.hex with 2 MacBooks: an old version (2010) and a younger, more powerful model.&lt;/p&gt;
&lt;p&gt;SDK_14.0.0_3bcc1f7&amp;nbsp; works perfectly with both machines!&lt;/p&gt;
&lt;p&gt;SDK_15.2.0_9412b96 and SDK_16.0.0_98a08e2 on newer MacBook: mouse is working but keyboard is dead. LED3 is toggling too fast to see it flicker.&lt;/p&gt;
&lt;p&gt;SDK_15.2.0_9412b96 and SDK_16.0.0_98a08e2 on the slower, older MacBook: mouse is working but keyboard is NOT completely dead. LED3 is flickering. The buttons produce g and G but only with a probability of about 15%&lt;/p&gt;
&lt;p&gt;Either the nrfx driver rewrite broke something or a sleeping bug was wakened. And the difference between the 2 machines raises questions about timing / race conditions. This might be hard to find :-(&lt;/p&gt;
&lt;p&gt;best regards&lt;/p&gt;
&lt;p&gt;Peter&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: usbd_hid_composite not working on Mac?</title><link>https://devzone.nordicsemi.com/thread/252412?ContentTypeID=1</link><pubDate>Fri, 29 May 2020 12:39:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8f158d7d-54ca-4867-8d13-693201b85fc7</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Petter,&lt;/p&gt;
&lt;p&gt;Thank you for sharing your thoughts. We don&amp;#39;t know more about this than you do, but&amp;nbsp; we would very much like to get this sorted out. I am sorry I have not had the chance to look properly into it yet, but I will&amp;nbsp;try to dig into it as soon as possible.&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: usbd_hid_composite not working on Mac?</title><link>https://devzone.nordicsemi.com/thread/252344?ContentTypeID=1</link><pubDate>Fri, 29 May 2020 09:32:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5089bb0c-6179-4b48-aa0a-2836e67cb675</guid><dc:creator>peterz</dc:creator><description>&lt;p&gt;Hi Einar&lt;br /&gt;although I&amp;#39;m learning a lot of details about USB implementation I&amp;#39;m still far from being competent.&lt;br /&gt;I&amp;#39;m further developing my hypothesis of about what might happen.&lt;br /&gt;&lt;br /&gt;With an Apple vendorID the application on the devkit works. I trust you on this, I didn&amp;#39;t try it myself.&lt;br /&gt;In forums I find evidence that setting an Apple vendorID circumvents the &amp;quot;foreign keyboard detection&amp;quot; process.&lt;br /&gt;&lt;br /&gt;This detection process grabs the USB device before the keyboard can really talk to the system.&lt;br /&gt;During detection keystroke events do not appear in the system and the detection complains if I press a key on the internal keyboard.&lt;br /&gt;After detection the keyboard should be cleanly handed over to the system. So it wouldn&amp;#39;t be a surprise if the detection process would perform some kind of (soft) reset on the keyboard before handing it over to make sure it is in a clearly defined state.&lt;br /&gt;&lt;br /&gt;a candidate for such a &amp;quot;reset&amp;quot; might be app_usbd_core.c line 820&lt;br /&gt;static ret_code_t setup_device_req_set_configuration()&lt;br /&gt;&lt;br /&gt;which calls app_usbd.c line 1888&lt;br /&gt;void app_usbd_all_iface_select_0()&lt;br /&gt;&lt;br /&gt;USB spec: setting configuration resets the data toggling to Data0.&lt;br /&gt;I also find that remark also in the. Might app_usbd_all_iface_select_0() reset too many EP, the wrong EP, whatever?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;why does the application work properly on other OS?&lt;br /&gt;this &amp;quot;soft reset&amp;quot; never happens in Windows or Linux context.&lt;br /&gt;The keyboard detetction is the first and only time this happens.&lt;br /&gt;&lt;br /&gt;as I said before: all this is hypothetical, pure speculation.&lt;br /&gt;I&amp;#39;m just sharing my thoughts&lt;br /&gt;&lt;br /&gt;best regards&lt;br /&gt;Peter&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: usbd_hid_composite not working on Mac?</title><link>https://devzone.nordicsemi.com/thread/252284?ContentTypeID=1</link><pubDate>Thu, 28 May 2020 20:19:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d37bf868-b10a-480f-8e5d-7d965050beca</guid><dc:creator>peterz</dc:creator><description>&lt;p&gt;Hi Einar&lt;/p&gt;
&lt;p&gt;I did more research and finally found something that looks interesting enough to have a closer look&lt;/p&gt;
&lt;p&gt;&lt;a href="https://web.archive.org/web/20130615145009/http://www.totalphase.com/solutions/wp/debugging_usb/"&gt;https://web.archive.org/web/20130615145009/http://www.totalphase.com/solutions/wp/debugging_usb/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;there is a section about &amp;quot;finding problems in Data Bit Toggling&amp;quot; which caught my eye. My understanding is still poor - I think I understood that wrong toggling could lead to message repetition - this could be a clue.&lt;/p&gt;
&lt;p&gt;best regards&lt;/p&gt;
&lt;p&gt;Peter&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: usbd_hid_composite not working on Mac?</title><link>https://devzone.nordicsemi.com/thread/252056?ContentTypeID=1</link><pubDate>Thu, 28 May 2020 00:11:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:16c379ba-04e7-4384-bfdb-e35d8aef9ab4</guid><dc:creator>peterz</dc:creator><description>&lt;p&gt;Hi Einar&lt;/p&gt;
&lt;p&gt;thanks for your support - don&amp;#39;t worry, it is not urgent, I still have a lot of other issues to solve.&lt;/p&gt;
&lt;p&gt;What I did today: forum research and some trials - no effect yet. I even added 80mA power load and a bit of capacity by adding a USB cable between devkit and MacBook (inspired by some keyboard problem discussions in Apple forums where people solved weird problems by putting a memory stick into the keyboard or adding cables)&lt;/p&gt;
&lt;p&gt;Switching on/off the mouse part does not make a difference - actually I use&lt;/p&gt;
&lt;p&gt;#define PROPAGATE_PROTOCOL&amp;nbsp; 0&lt;br /&gt;#define CONFIG_HAS_MOUSE&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/p&gt;
&lt;p&gt;I realize I don&amp;#39;t know enough about the boot protocol. Using our product in a BIOS does not make any sense, so I think I could remove the boot protocol. And also I don&amp;#39;t yet understand the event propagation. I see what it does but the intention behind it...?&lt;/p&gt;
&lt;p&gt;enough for today - best regards&lt;/p&gt;
&lt;p&gt;Peter&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: usbd_hid_composite not working on Mac?</title><link>https://devzone.nordicsemi.com/thread/251993?ContentTypeID=1</link><pubDate>Wed, 27 May 2020 14:07:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e367482-95c6-4dc0-b78d-07e6eb80ca00</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Peter,&lt;/p&gt;
&lt;p&gt;I have also seen that the&amp;nbsp;hid_kbd_user_ev_handler() is called repeatedly. We believe that this issue is likely due to a missing feature at the application level of the&amp;nbsp;usbd_hid_composite example, but we are not sure what MacOS expects the application to do. I will try to get some insight into this, hopefully, this week, but I cannot promise anything. Please let me know what you find during your investigation.&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: usbd_hid_composite not working on Mac?</title><link>https://devzone.nordicsemi.com/thread/251791?ContentTypeID=1</link><pubDate>Tue, 26 May 2020 20:33:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3e307df1-e0f1-4bfe-8648-260dd5af9962</guid><dc:creator>peterz</dc:creator><description>&lt;p&gt;Hi Einar&lt;/p&gt;
&lt;p&gt;Wireshark can capture USB on a Mac - bad luck - the MacBook Air I have for testing is too old for it to work :-(&lt;/p&gt;
&lt;p&gt;I added a lot of NRF_LOG everywhere in the code. To get output I had to add NRF_LOG_DEFAULT_BACKENDS_INIT() in main().&lt;/p&gt;
&lt;p&gt;To my surprise hid_kbd_user_ev_handler(APP_USBD_HID_USER_EVT_IN_REPORT_DONE) was constantly called. It felt like an inifinite loop. In the code I could only find one call in app_usbd_hid.c line 428 function endpoint_in_event_handler().&lt;/p&gt;
&lt;p&gt;you mentioned that changing vendorID to Apple eliminates the problem. I have no experience in this area but somehow I have to fix this, so I try a hypothesis: with an Apple vendorID the &amp;quot;foreign keyboard identification&amp;quot; process is skipped - even if the keyboard is not in an internal list of known Apple keyboards you cannot ask your customer what keyboard he connected if it comes from Apple too - that would be embarassing ;-)&lt;/p&gt;
&lt;p&gt;So the problem might be the keyboard detection process itself which might behave differently. This might lead to a non-reset of a flag or a missing ACK and as a consequence to an infinite repetition of the IN report (?)&lt;/p&gt;
&lt;p&gt;Maybe you can use Wireshark on a Mac or you have a hint what I should look for. I&amp;#39;ll try to dive deeper into the code with a fresh mind tomorrow.&lt;/p&gt;
&lt;p&gt;best regards&lt;/p&gt;
&lt;p&gt;Peter&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: usbd_hid_composite not working on Mac?</title><link>https://devzone.nordicsemi.com/thread/251745?ContentTypeID=1</link><pubDate>Tue, 26 May 2020 14:16:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:90b821dc-3cd9-4e8f-9e65-c47e596ce16a</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Peter,&lt;/p&gt;
&lt;p&gt;Yes, this definitely has to be fixed. Using Apple&amp;#39;s Vendor ID is not an option for an end product, but the fact that it makes things work is an interesting observation. I do not have an explanation for why this happens at the moment, though, nor a proper fix yet.&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>