my k_work or main loop seem to be starved by BLE

I'm using nRF connect SDK2.9.0. I don't create my threads. Instead, I have a GPIO interrupt and a k_timer interrupt, each doing their own job.

In my timer expiry function, I submit a work to the workqueue that do temperature sensing and PID control.

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Timer structure
static struct k_timer my_timer;
// thread context: temperature control and data transmission (temperature and ad5940)
static void temprt_work_handler(struct k_work *work);
K_WORK_DEFINE(temprt_work, temprt_work_handler);
// thread context: read ad5940 data
static void ECAFE_work_handler(struct k_work *work);
K_WORK_DEFINE(ECAFE_work, ECAFE_work_handler);
// Timer callback function
// timer callback should not do too much operation, otherwise will block other functions like ADC read
void timer_expiry_function(struct k_timer *timer_id)
{
// Do minimal, non-blocking things here, then submit work.
k_work_submit(&temprt_work);
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

In contrast, I didn't submit my work directly in my GPIO interrupt callback handler. Instead, I set a global flag to 1 interrupt callback handler, and inspect the flag in the main loop:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
while (1) {
/* Check if interrupt flag which will be set when interrupt occurred. */
if(AD5940_GetMCUIntFlag())
{
AD5940_ClrMCUIntFlag(); /* Clear this flag */
LOG_INF("AD5940 INT flag on\n");
k_work_submit(&ECAFE_work);
}
//k_sleep(K_MSEC(delay_in_ms));
k_usleep(200);
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Now, my problem is that if I enable BLE, my k_timer work is executed properly, but my ECAFE_work is never executed, although I can see the GPIO interrupt triggered and flag is set to 1. It seems that the flag inspection part in my main-loop is never executed. 

In my prj.conf I didn't set anything related to thread and priority. I'm wondering what's the default priority for my work queue and for the BLE? Could you help me identify the problem? Thank you very much.