Zephyr RTOS: How to create threads

  1. Using the kernel API
__syscall k_tid_t 
k_thread_create(struct k_thread *new_thread,
k_thread_stack_t *stack,
size_t stack_size,
k_thread_entry_t entry,
void *p1,
void *p2,
void *p3,
int prio,
uint32_t options,
k_timeout_t delay);
  • delay — Scheduling delay, or K_NO_WAIT (for no delay).
K_THREAD_DEFINE(thread_id, STACKSIZE, thread_entry_point, NULL, NULL, NULL, PRIORITY, 0, 0);

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store