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

task threads blocking the device connection.

I'm using the NRF52840 SDK 15.0.0

I have 2 task threads and 5 ble services.

Now what happens is when I'm trying to connect the device with 2 tasks and ble services I'm unable to connect/pair the nrf52 device.

When I comment on one task the device getting paired.

  TASK_MANAGER_CONFIG_STACK_SIZE 4096 

can anyone help me what was the mistake I'm done?

 

Parents Reply
  • it doesn't look like they are using the task manager. They are using the FreeRTOS API. 

    I think you brought up a good point though. For two tasks at the same level, one will need to yield. In FreeRTOS you have the option to yield or add a delay. They delay effectively provides the yield. They have a delay in the device thread. They are missing a yield or a delay in the oled_thread. 

    Try adding taskYield or vTaskDelay() to oled_thread.

    I'm not convinced this will solve the issue though. The connection process happens through interrupts, which supersede tasks in priority. They had a problem with the connection process.

Children
No Data
Related