Hi:
We use freeRTOS + tinyUSB + nRF52SDK develope central Application on nRF52840 DK board.
we enable SoftDevice first(it return NRF_SUCCESS). then init the USB Power event detect. but run after run vTaskStartScheduler(). it will got "SOFTDEVICE: INVALID MEMORY ACCESS" issue. the PC is exit app_util_critical_region_exit(), the info = 0x01,
it show the PERREGION[0].SUBSTATWA = 0x00000001.
the Clock & Power module peripheral 0x40000000 -- 0x40001000 be written. But all the USB power event handler & detect all by call SoftDevice APIs.
like:
sd_power_usbdetected_enable(true);
sd_power_usbpwrrdy_enable(true);
sd_power_usbremoved_enable(true);
sd_power_usbregstatus_get(&usb_reg);
sd_clock_hfclk_request();
....
The FreeRTOS config:
#define configTICK_SOURCE FREERTOS_USE_RTC
#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 0xf
#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY _PRIO_APP_HIGH
#define configKERNEL_INTERRUPT_PRIORITY configLIBRARY_LOWEST_INTERRUPT_PRIORITY
#define configMAX_SYSCALL_INTERRUPT_PRIORITY configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY
set "#define NRF_CLOCK_ENABLED 1" in the sdk_config.h for FreeRTOS ticker timer.
what's right file for use FreeRTOS with SoftDevice for Clock & Power ?