Hi,
I am using sdk 14.2.0.
i am using freeRTOS,created 3 threads.
all are running fine,but just for while(2 - 3 minutes).
after that, all the threads stoped.
may be deadlock situation occurs.here the snippet:
/*************************************************************/
static void led_thread(void * arg)
{
UNUSED_PARAMETER(arg);
while (1)
{
all_led_off();
printf("\r\nLED OFF \r\n");
vTaskDelay(1000);
all_led_on();
printf("\r\nLED ON \r\n");
vTaskDelay(1000);
}
vTaskDelete( NULL );
}
-------------------------------
static void audio_thread(void * arg)
{
UNUSED_PARAMETER(arg);
printf("%d\r\n",airtel_size);
while(1)
{
play_audio();
vTaskDelay(1000);
printf("audio\r\n");
}
vTaskDelete( NULL );
}
----------------------------------
static void vib_motor_thread(void * arg)
{
UNUSED_PARAMETER(arg);
while(1)
{
pwm_update_duty_cycle(100);
printf("\r\nmotor start \r\n");
vTaskDelay(5000);
pwm_stop();
printf("\r\nmotor stop \r\n");
vTaskDelay(3000);
pwm_start();
}
vTaskDelete( NULL );
}
/************************************************************************************/
main.c
---------
if (pdPASS != xTaskCreate(led_thread, "LED", 256, NULL, 1, &m_led_thread))
{
APP_ERROR_HANDLER(NRF_ERROR_NO_MEM);
}
if (pdPASS != xTaskCreate(audio_thread, "AUDIO", 256, NULL, 1, &m_audio_thread))
{
APP_ERROR_HANDLER(NRF_ERROR_NO_MEM);
}
if (pdPASS != xTaskCreate(vib_motor_thread, "VIB_MOTOR", 256, NULL, 1, &m_vib_motor_thread))
{
APP_ERROR_HANDLER(NRF_ERROR_NO_MEM);
}
// Activate deep sleep mode.
SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
// Start FreeRTOS scheduler.
vTaskStartScheduler();
what might be the problem???
please guide me.
Thanks
Amarjeet