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

USBD on nRF52840 dongle

Hi,

I modified your USBD BLE UART Example by commenting out the button and LED code to run on a dongle with J-Link debugger soldered on.

I removed the bootloader and set NRF_UICR->REGOUT0 to 3.3V, to ensure proper voltage.

The example runs, all USBD-functions return NRF_SUCCESS when starting up. Also the virtual comport is listed on the PC.

When sending data from a terminal, nothing happens. the cdc_acm_user_ev_handler is never fired.

Is there someting I'm missing?

Working with nRF5_SDK_15.2.0 and debugging with SES.

Best regards

Gerry

Parents
  • Hi Gerry,

    It is clear that many things work since the device enumerates correctly on the PC. Can you upload your project here so that I can see what you have modified from the example? I suspect we will find an error there, though I do not have any specific ideas without knowing more.

  • Hi Einar

    Thanks for your support. I've attached the modified example.

    usbd_ble_uart.zip

  • Hi,

    I now replaced the code for 3.0V with gpio_output_voltage_setup() in components\boards\boards.c and made a chip erase ("Erase all" in SES)

    I also tried to toggle an LED in cdc_acm_user_ev_handler. This is really never fired.

    After some more debugging, I found, that if I connect BLE with the Nordic UART App. and send some characters, I end up in the nus_data_handler. When app_usbd_cdc_acm_write is called there, it returns 8 = NRF_ERROR_INVALID_STATE

            // Send data through CDC ACM
            ret_code_t ret = app_usbd_cdc_acm_write(&m_app_cdc_acm,
                                                    m_nus_data_array,
                                                    length);
            if(ret != NRF_SUCCESS)
            {
                NRF_LOG_INFO("CDC ACM unavailable, data received: %s", m_nus_data_array);
            }

    could it be a problem of the dongle? I have 2 brand new dongles here. Have you ever tried to run this on a nRF52840 dongle?

  • Hi,

    I was not able to reproduce the exact error you describe here. However, I tested now and did get an obvious error when sending data from the PC over the USB-UART (CDC). You have commented out the call to ble_nus_data_send() in the handling of APP_USBD_CDC_ACM_USER_EVT_RX_DONE , but you continue to check the uninitialized ret variable repeatedly. This triggers an error in my test (though it might fail differently or not at all for you, depending on what happens to be in memory).

  • Hi,

    I changed this, thanks for the input. The behavior is still the same. I now tried with the original (unchanged) example on a nRF52840 DK and I have the exact same issue. When I send some characters to the virtual comport the terminal program gets stuck. Could this be a driver issue? I also tried another USB-port and uninstalled the driver. When I plug in USB, the driver is installed autom. and shows no errors. 

    I'm using Windows10 and this terminal program

  • Hi,

    It is expected that you get the same behavior using a DK and a dongle.

    Gerry said:
    When I send some characters to the virtual comport the terminal program gets stuck. Could this be a driver issue?

    I am not sure. Is there a pattern? Always the same number of characters? Or something else?

    Gerry said:
    I'm using Windows10 and this terminal program

    It should not matter, but could you test with PuTTY? 

  • Hi,

    PuTTY was a good idea. Everything works fine with PuTTY even on the dongle. Sadly, this seems to be the only terminal it's working with. I also have an own PC-application written in c# that works fine with my application on the nRF52840 DK, but not with the USBD BLE UART example.

    In the end, I will have to communicate from/to that custom PC-application to the dongle.

    Do you have an idea, what could cause this problem? There must be a difference in this virtual com ports right?

Reply
  • Hi,

    PuTTY was a good idea. Everything works fine with PuTTY even on the dongle. Sadly, this seems to be the only terminal it's working with. I also have an own PC-application written in c# that works fine with my application on the nRF52840 DK, but not with the USBD BLE UART example.

    In the end, I will have to communicate from/to that custom PC-application to the dongle.

    Do you have an idea, what could cause this problem? There must be a difference in this virtual com ports right?

Children
Related