Crash in sd_clock_hfclk_is_running on Soft Device S140, 7.3.0

Hi, I recently noticed crashing in sd_clock_hfclk_is_running() on a nrf52840 using SoftDevice S140 7.3.0. This is the callstack:

??@0x00000ac4 (Unknown Source:0)

<signal handler called>@0xffffffe9 (Unknown Source:0)

sd_clock_hfclk_is_running@0x000276ae (.../nRF5_SDK_17.1.0_ddde560/components/softdevice/s140/headers/nrf_soc.h:720)

I'm using the following to enable the hfclk whenever I enable QSPI to avoid errata 244:

sd_clock_hfclk_request();
uint32_t isHfclkRunning = 0;
do {
  APP_ERROR_CHECK(sd_clock_hfclk_is_running(&isHfclkRunning));
} while (!isHfclkRunning);
I can trigger this somewhat reliably if I unplug and plug usb power while this code triggers.
Any tips on how I can avoid this issue?
Thanks,
Jeff
Parents
  • Looks like generic case where USB handlers works from USB IRQ (APP_USBD_CONFIG_EVENT_QUEUE_ENABLE is 0) and USB IRQ is higher (<4) than SoftDevice's SVC IRQ (==4).

  • Interesting theory, but my APP_USBD_CONFIG_EVENT_QUEUE_ENABLE is not explicitly defined, but set to 1 in config/nrf52840/config/sdk_config.h and NRFX_USBD_CONFIG_IRQ_PRIORITY is set to 6

    The full set of defines I make explicitly regarding USB are:

    #define APP_USBD_ENABLED 1
    #define APP_USBD_CONFIG_SELF_POWERED 0
    #define APP_USBD_CONFIG_SOF_HANDLING_MODE APP_USBD_SOF_HANDLING_INTERRUPT
    #define APP_USBD_CONFIG_POWER_EVENTS_PROCESS 0
    #define APP_USBD_HID_ENABLED 1
    #define APP_USBD_HID_GENERIC_ENABLED 1
    #define APP_USBD_STRING_SERIAL globalSerialNumber
    #define APP_USBD_STRING_SERIAL_EXTERN 1
    #define APP_USBD_STRINGS_MANUFACTURER APP_USBD_STRINGS_MANUFACTURER
    #define APP_USBD_STRINGS_MANUFACTURER_EXTERN 1
    #define APP_USBD_STRINGS_PRODUCT APP_USBD_STRINGS_PRODUCT
    #define APP_USBD_STRINGS_PRODUCT_EXTERN 1

    #define NRFX_USBD_ENABLED 1
    #define APP_USBD_CDC_ACM_ENABLED 1
     
    The rest are from config/nrf52840/config/sdk_config.h
Reply
  • Interesting theory, but my APP_USBD_CONFIG_EVENT_QUEUE_ENABLE is not explicitly defined, but set to 1 in config/nrf52840/config/sdk_config.h and NRFX_USBD_CONFIG_IRQ_PRIORITY is set to 6

    The full set of defines I make explicitly regarding USB are:

    #define APP_USBD_ENABLED 1
    #define APP_USBD_CONFIG_SELF_POWERED 0
    #define APP_USBD_CONFIG_SOF_HANDLING_MODE APP_USBD_SOF_HANDLING_INTERRUPT
    #define APP_USBD_CONFIG_POWER_EVENTS_PROCESS 0
    #define APP_USBD_HID_ENABLED 1
    #define APP_USBD_HID_GENERIC_ENABLED 1
    #define APP_USBD_STRING_SERIAL globalSerialNumber
    #define APP_USBD_STRING_SERIAL_EXTERN 1
    #define APP_USBD_STRINGS_MANUFACTURER APP_USBD_STRINGS_MANUFACTURER
    #define APP_USBD_STRINGS_MANUFACTURER_EXTERN 1
    #define APP_USBD_STRINGS_PRODUCT APP_USBD_STRINGS_PRODUCT
    #define APP_USBD_STRINGS_PRODUCT_EXTERN 1

    #define NRFX_USBD_ENABLED 1
    #define APP_USBD_CDC_ACM_ENABLED 1
     
    The rest are from config/nrf52840/config/sdk_config.h
Children
No Data
Related