This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

USB performance evaluation on nRF52840

Hi, I have  a question on USB performance of nRF52840. I have Rigado BMD-340(s) and I have to verify the maximum data rate supported on USB interface. Its says 12 mbps in the spec but I still need to test it to verify. I'm not very familiar with USB interface. What would be the best way to measure this performance? Are any of the USB peripheral examples good to test maximum data rate of USB? According to my calculations I need ~9Mbs data rate. Can you please help with this? Any help will be greatly appreciated. Thank you. Asli

  • Hi again, I looked up the link and tried to use libusb on host side (PC) and usbd_cdc_acm example on the nRF52840 to send and receive data. Unfortunately it didn't work. Can you please help me with debugging? I'll try to describe what I did and add my questions along.  

    Here's what I'm trying to do .

    1. With BusHound, when I connect the Rigado board to my PC I see below:

    Bus Type: (USB 1.0 mode) (Is this showing that USB on nrF52840 is not USB2.0 compliant or why is it USB 1.0 mode?)

    Bus Speed: 12 megabit

    Power Drawn : 500 miliamps @5.0 volts

    Endpoint 0: Type=CTL Class=02 SubClass=02 Protocol=01 MaxPacket=8

    Endpoint 1 OUT: Type=BULK Class=0a SubClass=00 Protocol=00 MaxPacket=40

    Endpoint 1 IN: Type=BULK Class=0a SubClass=00 Protocol=00 MaxPacket=40

    Endpoint 2 IN: Type =INT Class=02 SubClass=02 Protocol=01 MaxPacket=40

    Hardware ID: USB\VID_1925&PID_520F&REV_0100

    With Device Manager I see Nordic COM port under Ports and USB Composite Device under USB controllers

    2. On host side I'm using libusb  'libusb_bulk_transfer' function to send data to Endpoint 1 OUT read from Endpoint IN 1 of nRF52840. Is this a valid approach? I thought I could use these endpoints to read and write data from/to of the usb device.
    I can open the device using vid and pid and claim the interface getting the device handle but can't proceed further with writing and reading data (As an additional note I had to install libusb drivers, otherwise I couldn't open the device but after installing it, I only see libusbK Devices/ nRF52 USB CDC Demo on Device Manager, Is this OK?)


    3. On nRF52840 side I'm using usbd_cdc_acm example. I modified the example to read and write 64 bytes of data using app_usbd_cdc_acm_read and app_usbd_cdc_acm_write functions. But it's failing in the first app_usbd_cdc_acm_read function call due to invalid state check in the file app_usbd_cdc_acm.c line#986 as in below

    if (0U == (p_cdc_acm_ctx->line_state & APP_USBD_CDC_ACM_LINE_STATE_DTR))
    {
    /*Port is not opened*/
    return NRF_ERROR_INVALID_STATE;
    }

    I modified tx/rx buffer sizes according to data length written and read but not sure what else to configure to be able to use cdc-data interface. 

    Can you please help with this? As I mentioned before I'm a newbie in usb and nordic and any help will be greatly appreciated.

    Thank you and Best Regards,
    Asli

  • If it's still actual for You or somebody else. You can reach ~9Mb/s you need (exacltly - 1023000 B/s max) only using ISO transfers, bulk transfer gives no more ~768kB/s(12 blocks * 64B per 1ms frame) since bulk endpoints  has no double buffering on 52840.

Related