<?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>NRF52833 USB HID KEYBOARD</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/113463/nrf52833-usb-hid-keyboard</link><description>HI Q&amp;amp;A 
 typedef struct { uint8_t mods; uint8_t reserved; uint8_t keys[KEYBOARD_REPORT_KEYS]; }report_keyboard_t; 
 report_keyboard_t key_report={0}; 
 #define HID_KBD_INTERFACE 0 #define HID_MOUSE_INTERFACE 1 #define HID_EXTRA_INTERFACE 2 
 
 void hid_kbd_user_ev_handler</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 02 Aug 2024 05:59:17 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/113463/nrf52833-usb-hid-keyboard" /><item><title>RE: NRF52833 USB HID KEYBOARD</title><link>https://devzone.nordicsemi.com/thread/496753?ContentTypeID=1</link><pubDate>Fri, 02 Aug 2024 05:59:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c1be8311-22e3-48db-aa3f-b14fdb108681</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;No problem. I&amp;#39;m&amp;nbsp;glad to hear you got it figured out. I just want to add that we recommend the nRF Connect SDK for all new projects.&amp;nbsp;For further information, see:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/nrf-connect-sdk-and-nrf5-sdk-statement"&gt;(+) nRF Connect SDK and nRF5 SDK statement - Blogs - Nordic Blog - Nordic DevZone (nordicsemi.com)&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Otherwise, please feel free to close this case at your convenience.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52833 USB HID KEYBOARD</title><link>https://devzone.nordicsemi.com/thread/496747?ContentTypeID=1</link><pubDate>Fri, 02 Aug 2024 02:58:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a94ccda1-af8f-4bcf-9ce4-a33328883353</guid><dc:creator>zbxiong</dc:creator><description>&lt;p&gt;Hi Hieu&lt;/p&gt;
&lt;p&gt;After tracing the above problems, it is found that when a key value error occurs, the pointer of the &lt;span style="color:#3366ff;"&gt;app_usbd_hid_generic_in_report_set(&amp;amp;m_app_hid_kbd,report,sizeof(report))&lt;/span&gt; function points to a change in the report buffer address.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span style="color:#3366ff;"&gt;key_report&lt;/span&gt;&amp;nbsp;is defined as static so that there are no key-value errors.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;span style="color:#3366ff;"&gt;static report_keyboard_t&amp;nbsp; key_report={0};&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;It was a small mistake that caused a lot of trouble.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thank you for your reply.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52833 USB HID KEYBOARD</title><link>https://devzone.nordicsemi.com/thread/496462?ContentTypeID=1</link><pubDate>Wed, 31 Jul 2024 17:34:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:961e1b06-b54d-44cf-b12d-4e1036b3b043</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi zbxiong,&lt;/p&gt;
&lt;p&gt;What is the value of sizeof(*report) in your&amp;nbsp;usb_kbd_keys_send() function?&amp;nbsp;Depends on the&amp;nbsp;organization of the code, it might not work like you think it would.&lt;/p&gt;
&lt;p&gt;Another point to look out is check if your H key is properly debounced.&amp;nbsp;You might want to check if your&amp;nbsp;report queue is working correctly, see if the &amp;quot;3&amp;quot; and &amp;quot;E&amp;quot; coincide with when m_report_pending is set.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52833 USB HID KEYBOARD</title><link>https://devzone.nordicsemi.com/thread/496105?ContentTypeID=1</link><pubDate>Tue, 30 Jul 2024 01:24:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c73527bd-8b47-4580-84e5-4905b7a7c959</guid><dc:creator>zbxiong</dc:creator><description>&lt;p&gt;Hi Hieu&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;thanks for your reply！&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;APP_USBD_CLASS_TYPEDEF(app_usbd_hid_generic, \&lt;br /&gt; APP_USBD_HID_GENERIC_CONFIG(0, (NRF_DRV_USBD_EPIN1, NRF_DRV_USBD_EPOUT1)), \&lt;br /&gt; APP_USBD_HID_GENERIC_INSTANCE_SPECIFIC_DEC, \&lt;br /&gt; APP_USBD_HID_GENERIC_DATA_SPECIFIC_DEC \&lt;br /&gt;);&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void usb_kbd_keys_send(report_keyboard_t *report)  
{
    ret_code_t err_code;

    if (!NRF_USBD-&amp;gt;ENABLE)
    {
        return;
    }
    if (!usb_started){
        return;
    }

    if(!kbd_report_queue_is_empty())
    {
        NRF_LOG_INFO(&amp;quot;usb buffer in&amp;quot;);
        memcpy(kbd_report_queue[kbd_report_queue_wp], report, KEYBOARD_REPORT_SIZE);
        kbd_report_queue_wp++;
        kbd_report_queue_wp %= KBD_REP_QUEUE_LEN;
        kbd_key_buffer_send();
        return;
    }
    if (m_report_pending)
    {
        NRF_LOG_INFO(&amp;quot;usb buffer in&amp;quot;);
        memcpy(kbd_report_queue[kbd_report_queue_wp], report, KEYBOARD_REPORT_SIZE);
        kbd_report_queue_wp++;
        kbd_report_queue_wp %= KBD_REP_QUEUE_LEN;
    }
    else
    {         
         
        err_code =app_usbd_hid_generic_in_report_set(    //app_usbd_hid_generic_in_report_set
               &amp;amp;m_app_hid_kbd,
               report,
               sizeof(*report)); 
                 
        if(err_code == NRF_SUCCESS)
            m_report_pending = true;  

        if(err_code == NRF_ERROR_BUSY){
            NRF_LOG_INFO(&amp;quot;usb buffer in&amp;quot;);
            memcpy(kbd_report_queue[kbd_report_queue_wp], report, KEYBOARD_REPORT_SIZE);
            kbd_report_queue_wp++;
            kbd_report_queue_wp %= KBD_REP_QUEUE_LEN;
        }
        else if(err_code == NRF_SUCCESS){
        m_report_pending = true;        
        }
        else{
           APP_ERROR_CHECK(err_code);
        }
    }
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1722301931532v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;lsquo;H&amp;rsquo; is I pressed the key 50 times &amp;lsquo;3&amp;rsquo; and &amp;lsquo;E&amp;rsquo; are random displays.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52833 USB HID KEYBOARD</title><link>https://devzone.nordicsemi.com/thread/496050?ContentTypeID=1</link><pubDate>Mon, 29 Jul 2024 15:02:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7b70c46e-9a79-4cfa-a9fb-48ab74fba956</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi zbxiong,&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;usb_kbd_keys_send()&lt;/span&gt; is not a function in our SDK, so it is not possible for me to tell what is wrong here.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Please give&amp;nbsp;me some more information about your implementation.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Also, please use the Insert &amp;gt; Code feature to send code snippets.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Hieu&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>