Skip to content

Latest commit

 

History

History
99 lines (61 loc) · 2.06 KB

exercise.md

File metadata and controls

99 lines (61 loc) · 2.06 KB
layout title parent
post
3.4 Exercises
3. Threads

Exercises

For solving the exercises I recommend you create your own folder inside zephyr-rtos-tutorial which contains the following filetree.

.
└── my-exercises
    ├── threads
    │   ├── thread-start
    │   ├── thread-start-define
    │   ├── thread-abort
    │   ├── thread-sleep
    │   ├── thread-suspend
    │   └── thread-join
    ├── gpio
    ├── scheduling
    ├── debugging
    ├── interrupts
    ├── timers
    ├── mutexes
    ├── semaphores
    ├── logging
    └── networking

thread creation: main

  • Use k_thread_create() to create a thread
  • Implement the following

thread-start

  • Output the following serial using printk()

thread-start

solution: exercises/threads/thread-start

thread creation: define

  • Same as previous, but this time using K_THREAD_DEFINE to create thread

solution: exercises/threads/thread-start-define

thread abort

  • Implement the following

thread-abort

  • Output the following serial using printk()

thread-abort

solution: exercises/threads/thread-abort

thread sleep

  • Implement the following

thread-sleep

  • Output the following serial using printk()

thread-sleep

solution: exercises/threads/thread-sleep

thread suspend

  • Implement the following

thread-sleep

  • Output the following serial using printk()

thread-sleep

solution: exercises/threads/thread-suspend

thread join

  • Implement the following

thread-join

  • Output the following serial using printk()

thread-join

solution: exercises/threads/thread-join