MPSL assert (mpsl_init: MPSL ASSERT: 112, 817)

Hi all.

I have a project on nrf52840 with ble. I needed to add a nrfx timer there. I deleted everything from the main function. Added the code from the timer-counter example.
The whole program crashes in a timer interrupt.  The program crashed while processing a timer interrupt. Moreover, I made the interrupt empty, but it didn't help. Removing the bluetooth part from prj.conf helped. So far, I don't need ble in the project, but it will come in handy soon. Can you tell me how to return ble to the project?

Error:

 [00:00:29.494,415] <err> mpsl_init: MPSL ASSERT: 112, 817
 [00:00:29.494,781] <err> os: **** HARD FAULT ****
 [00:00:29.495,117] <err> os:   Fault escalation (see below)
 [00:00:29.495,483] <err> os: ARCH_EXCEPT with reason 3

 [00:00:29.495,849] <err> os: r0/a1:  0x00000003  r1/a2:  0x20003f8c  r2/a3:  0x00000001
 [00:00:29.496,368] <err> os: r3/a4:  0x00000000 r12/ip:  0x2000504c r14/lr:  0x0003bd25
 [00:00:29.496,856] <err> os:  xpsr:  0x41000018
 [00:00:29.497,222] <err> os: s[ 0]:  0x00000000  s[ 1]:  0x00000000  s[ 2]:  0x0004be28  s[ 3]:  0x20007fc0
 [00:00:29.497,863] <err> os: s[ 4]:  0x00000331  s[ 5]:  0x00000000  s[ 6]:  0x0000000a  s[ 7]:  0x00018db9
 [00:00:29.498,504] <err> os: s[ 8]:  0x00323131  s[ 9]:  0x00000000  s[10]:  0x00000000  s[11]:  0x000161e1
 [00:00:29.499,145] <err> os: s[12]:  0x20001e30  s[13]:  0x200019b0  s[14]:  0x00000000  s[15]:  0x0001692f
 [00:00:29.499,786] <err> os: fpscr:  0x00000000
 [00:00:29.500,122] <err> os: Faulting instruction address (r15/pc): 0x00038808
 [00:00:29.500,579] <err> os: >>> ZEPHYR FATAL ERROR 3: Kernel oops on CPU 0
 [00:00:29.515,777] <err> os: Fault during interrupt handling

 [00:00:29.516,143] <err> os: Current thread: 0x20003cb0 (unknown)
 [00:00:29.521,453] <err> fatal_error: Resetting system



#define TIMER_INST_IDX 0
#define TIME_TO_WAIT_MS 5000UL

static void timer_handler(nrf_timer_event_t event_type, void* p_context) {
LOG_INF("%d", __LINE__);
if (event_type == NRF_TIMER_EVENT_COMPARE0) {
LOG_INF("%d", __LINE__);
// char * p_msg = (char *)p_context;
// LOG_INF("Timer finished. Context passed to the handler: >%s<", p_msg);
}
}

static int run() {
LOG_INF("Application started");

nrfx_err_t status;
(void)status;

nrfx_timer_t timer_inst = NRFX_TIMER_INSTANCE(TIMER_INST_IDX);
uint32_t base_frequency = NRF_TIMER_BASE_FREQUENCY_GET(timer_inst.p_reg);
nrfx_timer_config_t config = NRFX_TIMER_DEFAULT_CONFIG(base_frequency);
config.bit_width = NRF_TIMER_BIT_WIDTH_32;
config.p_context = (void*)"Some context";

status = nrfx_timer_init(&timer_inst, &config, timer_handler);
NRFX_ASSERT(status == NRFX_SUCCESS);

#if defined(__ZEPHYR__)
IRQ_DIRECT_CONNECT(
NRFX_IRQ_NUMBER_GET(NRF_TIMER_INST_GET(TIMER_INST_IDX)), IRQ_PRIO_LOWEST,
NRFX_TIMER_INST_HANDLER_GET(TIMER_INST_IDX), 0);
#endif

nrfx_timer_clear(&timer_inst);
uint32_t desired_ticks = nrfx_timer_ms_to_ticks(&timer_inst, TIME_TO_WAIT_MS);
LOG_INF("Time to wait: %lu ms", TIME_TO_WAIT_MS);

nrfx_timer_extended_compare(&timer_inst, NRF_TIMER_CC_CHANNEL0, desired_ticks,
NRF_TIMER_SHORT_COMPARE0_STOP_MASK, true);

nrfx_timer_enable(&timer_inst);

int cnt{};
while (true) {
k_sleep(K_MSEC(100));
LOG_INF("Tick%d", cnt++);
}
return -1;
}



Configuration:

CONFIG_NEWLIB_LIBC=y
CONFIG_NEWLIB_LIBC_NANO=n
CONFIG_STD_CPP2B=y
CONFIG_PM_DEVICE=y
CONFIG_POWEROFF=y

CONFIG_POSIX_MAX_FDS=16
CONFIG_POSIX_API=y
CONFIG_PTHREAD_IPC=y
CONFIG_MAX_PTHREAD_COUNT=5
CONFIG_SEM_VALUE_MAX=32767
CONFIG_POSIX_CLOCK=y
CONFIG_MAX_TIMER_COUNT=5
CONFIG_POSIX_MQUEUE=y
CONFIG_MSG_COUNT_MAX=16
CONFIG_MSG_SIZE_MAX=16
CONFIG_MQUEUE_NAMELEN_MAX=16
CONFIG_EVENTFD=n

CONFIG_MAIN_STACK_SIZE=4096

CONFIG_KERNEL_INIT_PRIORITY_OBJECTS=30
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT=40
CONFIG_KERNEL_INIT_PRIORITY_DEVICE=50
CONFIG_APPLICATION_INIT_PRIORITY=90

CONFIG_FPU=y
CONFIG_FPU_SHARING=y
CONFIG_ADC=y


# Basic BT options
# CONFIG_BT=y
# CONFIG_BT_PERIPHERAL=y
# CONFIG_BT_DIS=y
# CONFIG_BT_DIS_PNP=n
# CONFIG_BT_DEVICE_NAME="DL200"
# CONFIG_BOARD_BLE_ADV_INTERVAL=388
# CONFIG_FLASH=y
# CONFIG_FLASH_PAGE_LAYOUT=y
# CONFIG_FLASH_MAP=y
# CONFIG_NVS=y
# CONFIG_SETTINGS=y
# CONFIG_BT_SETTINGS=y
# CONFIG_BT_DIS_MODEL="DL200"
# CONFIG_BT_DIS_MANUF="Greg's DL200"
# CONFIG_BT_DIS_SERIAL_NUMBER=y
# CONFIG_BT_DIS_SERIAL_NUMBER_STR="DL200A0139"
# CONFIG_BT_DIS_FW_REV=y
# CONFIG_BT_DIS_FW_REV_STR="1.0.0"
# CONFIG_BT_DIS_HW_REV=y
# CONFIG_BT_DIS_HW_REV_STR="1.0.0"
# CGMS Specific options

#Enable MCUBOOT bootloader build in the application
CONFIG_BOOTLOADER_MCUBOOT=y
#Include MCUMGR and the dependencies in the build
CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y

CONFIG_DISABLE_FLASH_PATCH=y

CONFIG_NRFX_SPIM3=y
CONFIG_BOOT_BANNER=n
CONFIG_GPIO=y
CONFIG_NRFX_TIMER0=y
CONFIG_NRFX_TIMER1=y
CONFIG_NRFX_TIMER2=y

CONFIG_ASSERT=y
CONFIG_NRFX_PWM1=y


# Config logger
CONFIG_LOG=y
CONFIG_LOG_MODE_IMMEDIATE=y
CONFIG_LOG_DEFAULT_LEVEL=3
CONFIG_LOG_BACKEND_SHOW_COLOR=y
CONFIG_LOG_INFO_COLOR_GREEN=y
CONFIG_LOG_BACKEND_UART=y
CONFIG_LOG_BACKEND_UART_OUTPUT_TEXT=y
CONFIG_USE_SEGGER_RTT=y
CONFIG_LOG_BACKEND_RTT=y
CONFIG_LOG_BACKEND_UART=n
CONFIG_LOG_RUNTIME_FILTERING=y
CONFIG_LOG_BUFFER_SIZE=2048
CONFIG_LOG_PRINTK=y
CONFIG_LOG_PROCESS_TRIGGER_THRESHOLD=0
CONFIG_COVERAGE=n
CONFIG_LOG_TAG_MAX_LEN=8

CONFIG_SPI=y
CONFIG_WS2812_STRIP_SPI=y
CONFIG_LED_STRIP=y
CONFIG_LED_STRIP_LOG_LEVEL_DBG=y
CONFIG_WS2812_STRIP=y
Parents Reply Children
No Data
Related