Help for activating “Softdevice” with “USB CDC ACM”

Hello,

We are trying to upgrade two types of our existing projects with BLE connectivity. For simplifying this help-post, I’m referring only for the simplest project group. Basically our board has a sensor connected to an ADC which interrupts the CPU periodically with the converted results. The results are processed by the application SW on the board, and then sent to an application running on a PC, via USB connection. The PC application replies for each packet from the target, so it isn’t just a dump terminal.

So far:

1 - We bought two NRF52840 SDK board.

2 - Learned from two e-books: “Intro_to_Bluetooth_Low_Energy”   and

    “Bluetooth_5_and_Bluetooth_Low_Energy_-_A_Developer's_Guide”  (by Mohammad Afaneh).

 

3 – We added (“wired”) our ADC and sensor to one of the NRF52840 SDK boards.

4 – Implemented the “Server” role on the first nfr52840 board according to the e-book guide, i.e. using 

      sdk 14.2.0. Also our original “target side” application was added to this board SW.

 

5 – Implemented the “Client” role on the second nfr52840 board according to the e-book guide, i.e.       

       using SDK 14.2.0.

 

6 – Now we can see all characteristics exposed by our user defined service, updated by our application

      on the server board, in the debug window Segger Embedded Studio (SES), as well as in the “nrf     

      Connect” application, (Android and Windows).

 

7 – Expectedly, we want to forward this data to a PC application via USB, and optionally get some data in return from the PC.

However we are stuck here, unable to add the libraries and servers for using the USB hardware on the SDK board.  The problem according to DevZon’s experts is described on the following link:

https://devzone.nordicsemi.com/f/nordic-q-a/19550/can-nrf52840-usbd-work-with-softdevice/75998#75998

“Can nrf52840 usbd work with softdevice?”

over 2 years ago in reply to Sigurd

Hi, the reason for this is that the NRF_POWER interrupts that is set with the usb_start()/nrf_power_int_enable() function are cleared/removed when the SoftDevice is enabled. These interrupts are used to detect when the USB-cable is plugged in and out. The application has restricted access to the NRF_POWER peripheral after the SoftDevice is enabled, so it cannot set-up the interrupts after the SoftDevice is enabled. A new SoftDevice version is soon coming that will have the functionality to set-up these interrupts after the SoftDevice is enabled.

 

So we need an updated example for the “Central” role, running on SDK v15.0.0 (or v15.2.0).

It is really frustrating the usefulness of the old examples (SDK 14.2.0) inside “Bluetooth_5_and_Bluetooth_Low_Energy_-_A_Developer's_Guide”, for   SDK 15.0.0.

The migration process guide supplied by Nordic is too difficult, unacceptable, and it contradicts the Nordics boast to let the programmers be concentrated on developing their own application. Actually it took us just two days to wire our hardware sensors + ADC to the SDK board and migrating our SW to the board. The rest of the time, since my first post on DevZone at 26/08/2018 was spent on fighting with Nordic SW issues.  

  • Hi,

    “Can nrf52840 usbd work with softdevice?”

    The SoftDevice API added access to the USB power handling registers starting from s140_nrf52840_6.0.0-6.alpha. SDK 15.2 uses S140 v6.1.1, so I recommend upgrading to SDK 15.2.

    So we need an updated example for the “Central” role, running on SDK v15.0.0 (or v15.2.0).

     We have several central examples in the folder SDK15_2_folder\examples\ble_central\experimental

    Regarding the title of this post, "Help for activating “Softdevice” with “USB CDC ACM”, you might want to take a look at the example usbd_ble_uart, in the folder SDK15_2_folder\examples\peripheral\usbd_ble_uart, to see how the USBD and SoftDevice is used together. In that example USB CDC ACM is used together with the SoftDevice

    We have a migration guide for SDK 14.2 to SDK 15.0 here, but if you are struggling with the migration, you might find it easier to start with a SDK 15.2 example, and then add your application code to that example. In your case the usbd_ble_uart example could be a good starting point.