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

got "SOFTDEVICE: INVALID MEMORY ACCESS" Error on nRF52840

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 ? 

Parents
  • Sorry, Found real caused NRF_ERROR_SDM_INCORRECT_INTERRUPT_CONFIGURATION issue. Because we want use tinyUSB in Keil. we are use the "--gnu" compile option.

    but this will cause nrf_section_iter_init() use these codes:  it seem predefined "__GNUC__" macro

     #if defined(__GNUC__) 
    p_iter->p_item = p_iter->p_set->section.p_start;
    if (p_iter->p_item == p_iter->p_set->section.p_end)
    {
    p_iter->p_item = NULL;
    }
    #else

    it'll cause missing disable POWER_CLOCK IRQ by sdh_state_observer_notify(NRF_SDH_EVT_STATE_ENABLE_PREPARE), because it can not found sdh_state_observers/....

Reply
  • Sorry, Found real caused NRF_ERROR_SDM_INCORRECT_INTERRUPT_CONFIGURATION issue. Because we want use tinyUSB in Keil. we are use the "--gnu" compile option.

    but this will cause nrf_section_iter_init() use these codes:  it seem predefined "__GNUC__" macro

     #if defined(__GNUC__) 
    p_iter->p_item = p_iter->p_set->section.p_start;
    if (p_iter->p_item == p_iter->p_set->section.p_end)
    {
    p_iter->p_item = NULL;
    }
    #else

    it'll cause missing disable POWER_CLOCK IRQ by sdh_state_observer_notify(NRF_SDH_EVT_STATE_ENABLE_PREPARE), because it can not found sdh_state_observers/....

Children
No Data
Related