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

USBD and 802.15.4 hfclk conflict

Hello,

I'm having difficulty with an app which combines USB (CDC ACM) and 802.15.4 using Softdevice (15.3). The issue appears to be related to hfclk, which is started to have RAAL active. Following the example (examples/peripheral/usbd_cdc_acm) the program initializes USBD before Softdevice, which works fine. However, when then launching 802.15.4 which needs hfclk, the USB device is lost.

The program could be written to use these two alternately (switching between USB and 802.15.4) except that app_usbd_uninit() is not implemented -- and I don't think this would make sense, because you want the connection between the nRF52840 and the PC (Linux, Mac, Windows) to persist. 

I wonder if there is some way to coach these two features, USB and 802.15.4, to share the high frequency clock.

- T 

  • Hi Ted,

    Sorry for the very late reply. You may be using the wrong clock driver, could you try to attach nrf_802154_clock_sdk.c to your makefile and compile again? See also the answer from Andreas in the other case you have opened.

    Best Regards,

    Marjeris

  • I did use  nrf_802154_clock_sdk.c when trying to combine USB and 802.15.4 with Softdevice. I conjecture that the reason USB and BLE using Softdevice works is that BLE does not use the high-frequency clock. However, 802.15.4 needs to use the high-frequency clock (hfclk) which is explained in the arbiter section of the Multiprotocol document.

    In the case that Softdevice is not used, the combination of 802.15.4 and USB is possible, as I found in my latest reply to that other case. Without Softdevice, there is no muiltiprotocol and no need for the arbiter.

  • Hi Ted,

    Is your application (802.15.4+USB+Softdevice) working now? It was not so clear in your answer if you are still having trouble with this.

    Ted Herman said:
    I conjecture that the reason USB and BLE using Softdevice works is that BLE does not use the high-frequency clock.

    I didn't understood what you mean with this. You must use a source of HFCLK when using BLE, if not the radio will not work at all.

    Both the 802.15.4 and Softdevice, but also the USB will use the nrf clock drv, this is the same as the SDK driver, maybe this should have been explain more explicit on the "Handling high-frequency clock" section of the Multiprotocol document.

    Ted Herman said:
    Without Softdevice, there is no muiltiprotocol and no need for the arbiter.

    The arbiter is for managing the radio. The high frecuency clock is managed by the nrf clk drv (nrf_802154_clock_sdk.c).

    Maybe attaching some logs will help us to have a better understanding of what is causing problems.

    Best Regards,

    Marjeris

Related