how to create thread in SDK?

Hello,

nRF SDK 17.0.2, keil5

how to create a thread?  for runing decode.

  

Best regards

Parents
  • Hello,

    Unfortunately, the nRF5 SDK does not natively feature an RTOS, and so there is no native support for threading either. The nRF5 SDK is a bare-metal/task-and-event based SDK by default, but there does however exists some examples in the SDK that incorporates the FreeRTOS which supports threading. In essence, if you need threading/RTOS in the nRF5 SDK you will have to utilize the FreeRTOS.

    If you are starting a new project I would strongly recommend that you start out with the nRF Connect SDK instead, which is based on the Zephyr RTOS, which innately supports threading and all the other features and benefits that comes with a RTOS.

    Best regards,
    Karl

  • Hi,

    thanks for reply,    i'm not talk about RTOS.

    in NCS i know to create a thread as follow;

    but now i've a old project using SDK17 need add thread to do some thing.

    //-------------------------create thread------------------------------------
    // Define the thread function
    void deal_thread_func(void)
    {
    	while(true)
    	{
    		..........
    		k_msleep(1);
    	}
    }
    // Initialize and start the thread
    K_THREAD_DEFINE(deal_thread, 1024, deal_thread_func, NULL, NULL, NULL, 3, 0, 0);

      

    Best regards

Reply
  • Hi,

    thanks for reply,    i'm not talk about RTOS.

    in NCS i know to create a thread as follow;

    but now i've a old project using SDK17 need add thread to do some thing.

    //-------------------------create thread------------------------------------
    // Define the thread function
    void deal_thread_func(void)
    {
    	while(true)
    	{
    		..........
    		k_msleep(1);
    	}
    }
    // Initialize and start the thread
    K_THREAD_DEFINE(deal_thread, 1024, deal_thread_func, NULL, NULL, NULL, 3, 0, 0);

      

    Best regards

Children
Related