SDK version: 14.2.0
I use "ble_app_hrs_freertos" as code base and modify it to create a "ble_app_template_freertos" project.
"softdevice_task" is already in this project (uxPriority = 2).
I can use "xTaskCreate" to create a new task "task1" and the uxPriority is 1, and work normally.
And I modify "softdevice_task" uxPriority to 5, and "task1" uxPriority is 1 it works normally too.
But when I add a new task "task2" and the uxPriority set to 2, the system not work.
And I found when this project only have "softdevice_task"(uxPriority = 5) and "task1"(uxPriority = 2), it doesn't work too.
How to solve this issue?
The code config below doesn't work.
int main(void)
{
bool erase_bonds;
clock_init();
if (pdPASS != xTaskCreate(task1_thread, "TASK1", 128, p_context, 1, &m_task1_thread))
{
APP_ERROR_HANDLER(NRF_ERROR_NO_MEM);
}
if (pdPASS != xTaskCreate(task2_thread, "TASK2", 128, p_context, 2, &m_task2_thread))
{
APP_ERROR_HANDLER(NRF_ERROR_NO_MEM);
}
// Activate deep sleep mode.
SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
// Configure and initialize the BLE stack.
ble_stack_init();
// Initialize modules.
timers_init();
buttons_leds_init(&erase_bonds);
gap_params_init();
gatt_init();
advertising_init();
services_init();
sensor_simulator_init();
conn_params_init();
peer_manager_init();
application_timers_start();
// Create a FreeRTOS task for the BLE stack.
// The task will run advertising_start() before entering its loop.
nrf_sdh_freertos_init(advertising_start, &erase_bonds);
// Start FreeRTOS scheduler.
vTaskStartScheduler();
while (true)
{
APP_ERROR_HANDLER(NRF_ERROR_FORBIDDEN);
}
}