From 0c1fe8ba137c6ac61ff2cf368ffb37e8b3ba66b9 Mon Sep 17 00:00:00 2001 From: maarten1C96 <12756980+maarten1C96@users.noreply.github.com> Date: Tue, 2 Apr 2024 17:22:55 +0200 Subject: [PATCH 01/13] fix(basic-sample): update include to resolve deprecation warning Replaced `` with `` based on the following compilation warning raised: #warning " is deprecated, include instead" [-Wcpp] Note: This change has been applied to the basic-sample only. Most likely other samples in the project might require the same update. --- exercises/basic-sample/src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/basic-sample/src/main.c b/exercises/basic-sample/src/main.c index 3772c6f..b585855 100644 --- a/exercises/basic-sample/src/main.c +++ b/exercises/basic-sample/src/main.c @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include +#include #include #include From e1d870514b1466d57492c33a5cb708e7d2f2f8f5 Mon Sep 17 00:00:00 2001 From: maarten1C96 <12756980+maarten1C96@users.noreply.github.com> Date: Tue, 2 Apr 2024 17:41:43 +0200 Subject: [PATCH 02/13] feat(docs/zephyr-setup/macos): add note for navigation shortcut to basic-sample in macOS setup guide Convenient for when already having Git cloned everything some other moment, and you just want to build and flash the basic sample from the correct directory. --- docs/1-zephyr-setup/setup/mac-os.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/1-zephyr-setup/setup/mac-os.md b/docs/1-zephyr-setup/setup/mac-os.md index 68ac2c8..080193d 100644 --- a/docs/1-zephyr-setup/setup/mac-os.md +++ b/docs/1-zephyr-setup/setup/mac-os.md @@ -60,6 +60,7 @@ west flash {: .note } > If you've previously made a build for a different board, remove the old build first: `rm -rf build` +> For convenience, full path to the basic-sample page: `cd ~/zephyrproject/zephyr-rtos-tutorial/exercises/basic-sample` - Verify the serial output: From 450eba74955b07630d9a4b783c87861880364ec3 Mon Sep 17 00:00:00 2001 From: maarten1C96 <12756980+maarten1C96@users.noreply.github.com> Date: Wed, 3 Apr 2024 23:09:42 +0200 Subject: [PATCH 03/13] docs(zephyr-structure.md): Adjust relative path for image in zephyr-structure.md To ensure the image displays correctly in the web version of the tutorial, I added two parent directory references to the path '/images/2-introduction/sample-folder.png'. --- docs/2-introduction/zephyr-structure.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/2-introduction/zephyr-structure.md b/docs/2-introduction/zephyr-structure.md index 0165757..c048260 100644 --- a/docs/2-introduction/zephyr-structure.md +++ b/docs/2-introduction/zephyr-structure.md @@ -11,7 +11,7 @@ nav_order: 10 Before we start writing our first applications in Zephyr, it might be a good step to take a look at the folder structure that Zephyr provides us. -![sample-folder](/images/2-introduction/sample-folder.png) +![sample-folder](../../images/2-introduction/sample-folder.png) Let's go one-by-one: From e816c2e888037cbbadcb600df37079adb6398204 Mon Sep 17 00:00:00 2001 From: maarten1C96 <12756980+maarten1C96@users.noreply.github.com> Date: Wed, 3 Apr 2024 23:25:40 +0200 Subject: [PATCH 04/13] chore(.gitignore): update ignored files and directories --- .gitignore | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 6bdbce9..c3e4fad 100644 --- a/.gitignore +++ b/.gitignore @@ -56,4 +56,8 @@ tags _site .jekyll-cache -vendor \ No newline at end of file +vendor + +.DS_Store +.vscode/ +.history/ \ No newline at end of file From fb296653a40f19087333bacf20f5305b70f9493f Mon Sep 17 00:00:00 2001 From: maarten1C96 <12756980+maarten1C96@users.noreply.github.com> Date: Thu, 4 Apr 2024 00:27:10 +0200 Subject: [PATCH 05/13] docs(zephyr-structure.md): Adjust relative path for images in zephyr-structure.md To ensure all images on the zephyr-structure.md display correct in the web version of the tutorial, I added two parent directory references to the following paths as well: ![k-config](../../images/2-introduction/k-config.png) ![guiconfig](../../images/2-introduction/guiconfig.png) ![basic-sample](../../images/2-introduction/basic-sample.png) --- docs/2-introduction/zephyr-structure.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/2-introduction/zephyr-structure.md b/docs/2-introduction/zephyr-structure.md index c048260..2cacd48 100644 --- a/docs/2-introduction/zephyr-structure.md +++ b/docs/2-introduction/zephyr-structure.md @@ -28,7 +28,7 @@ This file will be used by [CMake](https://en.wikipedia.org/wiki/CMake) to set up ### prj.conf This is you Kconfig file. **Important!** This file will contain any *additional* settings you want set for your particular Zephyr build. Depending on your particular application, you might want to (for example) include a TCP/IP stack or make some changes to the scheduler. We'll explore some of these options throughout the tutorial. -![k-config](/images/2-introduction/k-config.png) +![k-config](../../images/2-introduction/k-config.png) Right now it's pretty empty, since for `basic-sample` we don't require any "fancy" functionality, just the basic Zephyr kernel. The only additional functionality we set is `CONFIG_PRINTK`, which allows us to use the `printk` function to output to the serial port (which is then displayed on your computer screen using Coolterm). @@ -36,9 +36,9 @@ If you're ever unsure about what a particular config setting does, you have 2 op - Use [google](https://www.google.com/search?client=firefox-b-d&q=zephyr+CONFIG_PRINTK): usually Zephyr Documentation is one of the first links - Use the `guiconfig`: in your `basic-sample` folder execute `west build -t guiconfig`. This will show you a menu of all the possible configuration settings and a small description of what each one does. (Use `Jump to` to find a particular config) -![guiconfig](/images/2-introduction/guiconfig.png) +![guiconfig](../../images/2-introduction/guiconfig.png) ### src Where the magic happens! This folder should contain all of your custom application code. For now it contains one file: `main.c`, which prints out a message to the serial port and then sleeps for 1 second. -![basic-sample](/images/2-introduction/basic-sample.png) \ No newline at end of file +![basic-sample](../../images/2-introduction/basic-sample.png) \ No newline at end of file From 097b0b3b8b7c46e370dfdbe94177371948110b4d Mon Sep 17 00:00:00 2001 From: maarten1C96 <12756980+maarten1C96@users.noreply.github.com> Date: Sat, 6 Apr 2024 15:22:19 +0200 Subject: [PATCH 06/13] fix(docs): Update all image paths in project documentation All image paths that include `images/` and `svg-images/` should now be referenced correctly. These path edits are based on testing them within my webbrowser, but couldn't test on my own fork directly (still need to figure out how to make GitHub Pages work myself). --- docs/1-zephyr-setup/install/linux.md | 6 +++--- docs/1-zephyr-setup/install/mac-os.md | 6 +++--- docs/1-zephyr-setup/setup/mac-os.md | 12 ++++++------ docs/3-threads/commands.md | 10 +++++----- docs/3-threads/exercise.md | 20 ++++++++++---------- docs/3-threads/introduction.md | 8 ++++---- docs/4-gpio/introduction.md | 2 +- docs/5-scheduling/exercise.md | 6 +++--- docs/5-scheduling/introduction.md | 6 +++--- docs/7-debugging/exercise.md | 6 +++--- docs/7-debugging/introduction.md | 2 +- docs/8-interrupts/exercise.md | 4 ++-- 12 files changed, 44 insertions(+), 44 deletions(-) diff --git a/docs/1-zephyr-setup/install/linux.md b/docs/1-zephyr-setup/install/linux.md index 8e446a2..6442063 100644 --- a/docs/1-zephyr-setup/install/linux.md +++ b/docs/1-zephyr-setup/install/linux.md @@ -84,7 +84,7 @@ $ west build -p always -b esp32 samples/hello_world/ The `-p` option does a pristine build. It is used to build when there is any changes done to the CMake. A successful build looks like this -![success_build_hello_world](/images/1-zephyr-setup/hello_world_build_success.png) +![success_build_hello_world](../../images/1-zephyr-setup/hello_world_build_success.png) Now flash the board with ``` $ west flash @@ -94,7 +94,7 @@ To open the serial monitor $ west espressif monitor ``` You should see the similar output -![hello_world_success_output](/images/1-zephyr-setup/hello_world_output.png) +![hello_world_success_output](../../images/1-zephyr-setup/hello_world_output.png) ## 4) Building the blinky Now, let's try to blink the builtin LED on ESP32. The sample is in `zephyr/samples/basic/blinky` @@ -102,7 +102,7 @@ Now, let's try to blink the builtin LED on ESP32. The sample is in `zephyr/sampl $ west build -p -b esp32 samples/basic/blinky ``` If you encounter build errors like this -![blinky_build_error](/images/1-zephyr-setup/blinky_build_errors.png) +![blinky_build_error](../../images/1-zephyr-setup/blinky_build_errors.png) It means that we need to add an overlay file with the board support. This file can be added for any unsupported board with the `.overlay`.
Create an `esp32.overlay` file in `zephyr/samples/basic/blinky/` and add the following contents ```dtc diff --git a/docs/1-zephyr-setup/install/mac-os.md b/docs/1-zephyr-setup/install/mac-os.md index 64a690f..a3130da 100644 --- a/docs/1-zephyr-setup/install/mac-os.md +++ b/docs/1-zephyr-setup/install/mac-os.md @@ -92,7 +92,7 @@ echo $ZEPHYR_TOOLCHAIN_VARIANT echo $GNUARMEMB_TOOLCHAIN_PATH ``` -![env_var_check](/images/1-zephyr-setup/env-var-check.png) +![env_var_check](../../images/1-zephyr-setup/env-var-check.png) ## 5) Build the Blinky sample @@ -103,7 +103,7 @@ cd ~/zephyrproject/zephyr/samples/basic/blinky west build -b # for example: nucleo_l552ze_q ``` A successful build looks like this: -![succes_build](/images/1-zephyr-setup/success-build.png) +![succes_build](../../images/1-zephyr-setup/success-build.png) {: .note } > If you get a CMake error, this can usually be resolved by clearing the previous build: `rm -rf build` @@ -115,7 +115,7 @@ west flash ``` A successful flash looks like this: -![succes_flash](/images/1-zephyr-setup/success-flash.png) +![succes_flash](../../images/1-zephyr-setup/success-flash.png) {: .warning} > Some boards will require installing an additional `pyocd` package! diff --git a/docs/1-zephyr-setup/setup/mac-os.md b/docs/1-zephyr-setup/setup/mac-os.md index 080193d..66b9996 100644 --- a/docs/1-zephyr-setup/setup/mac-os.md +++ b/docs/1-zephyr-setup/setup/mac-os.md @@ -18,19 +18,19 @@ nav_order: 1 - Port: `usbmodemxxxxx` - Baudrate: `115200` -![coolterm-1](/images/1-zephyr-setup/coolterm-1.png) +![coolterm-1](../../images/1-zephyr-setup/coolterm-1.png) - `Terminal`: check "Filter ASCII Escape Sequences" and press `Ok` -![coolterm-2](/images/1-zephyr-setup/coolterm-2.png) +![coolterm-2](../../images/1-zephyr-setup/coolterm-2.png) - `File -> Save`: Save this configuration under `~/zephyrproject` -![coolterm-settings](/images/1-zephyr-setup/coolterm-settings.png) +![coolterm-settings](../../images/1-zephyr-setup/coolterm-settings.png) - `Connect` -![coolterm-connect](/images/1-zephyr-setup/coolterm-connect.png) +![coolterm-connect](../../images/1-zephyr-setup/coolterm-connect.png) ## 2) VSCode @@ -64,8 +64,8 @@ west flash - Verify the serial output: -![coolterm-3](/images/1-zephyr-setup/coolterm-3.png) +![coolterm-3](../../images/1-zephyr-setup/coolterm-3.png) Your final setup should look something like this: -![final-setup](/images/1-zephyr-setup/final-setup.png) \ No newline at end of file +![final-setup](../../images/1-zephyr-setup/final-setup.png) \ No newline at end of file diff --git a/docs/3-threads/commands.md b/docs/3-threads/commands.md index 95a069f..dd93029 100644 --- a/docs/3-threads/commands.md +++ b/docs/3-threads/commands.md @@ -67,22 +67,22 @@ K_THREAD_DEFINE(my_tid, MY_STACK_SIZE, ### k_thread_start() A thread must be created before it can be used. -![k_thread_im](/svg-images/threads/thread-start.png) +![k_thread_im](../../svg-images/threads/thread-start.png) ### k_thread_abort() Abort a thread. Thread is taken off all kernel queues. -![k_thread_im](/svg-images/threads/thread-abort.png) +![k_thread_im](../../svg-images/threads/thread-abort.png) ### k_sleep() A thread can prevent itself from executing for a specified amount of time. A sleeping thread becomes executable automatically once the time limit is reached. -![k_thread_im](/svg-images/threads/thread-sleep.png) +![k_thread_im](../../svg-images/threads/thread-sleep.png) ### k_thread_suspend() Prevent a thread from executing for an indefinite period of time. Once suspended, use k_thread_resume() to re-start. -![k_thread_im](/svg-images/threads/thread-suspend.png) +![k_thread_im](../../svg-images/threads/thread-suspend.png) ### k_thread_join() Sleep until a thread exits. @@ -92,6 +92,6 @@ For example: - thread_a is responsible for processing data from this interface - As long as thread_b has not exited, thread_a can't start, so we'll use k_thread_join(thread_b, timeout) in this case. -![k_thread_im](/svg-images/threads/thread-join.png) +![k_thread_im](../../svg-images/threads/thread-join.png) diff --git a/docs/3-threads/exercise.md b/docs/3-threads/exercise.md index 7a2bf12..12eb080 100644 --- a/docs/3-threads/exercise.md +++ b/docs/3-threads/exercise.md @@ -36,11 +36,11 @@ For solving the exercises I recommend you create your own folder inside `zephyr- - Use `k_thread_create()` to create a thread - Implement the following -![thread-start](/svg-images/threads/thread-start.png) +![thread-start](../../svg-images/threads/thread-start.png) - Output the following serial using `printk()` -![thread-start](/images/threads/thread-start.png) +![thread-start](../../images/threads/thread-start.png) solution: `exercises/threads/thread-start` @@ -54,11 +54,11 @@ solution: `exercises/threads/thread-start-define` - Implement the following -![thread-abort](/svg-images/threads/thread-abort.png) +![thread-abort](../../svg-images/threads/thread-abort.png) - Output the following serial using `printk()` -![thread-abort](/images/threads/thread-abort.png) +![thread-abort](../../images/threads/thread-abort.png) solution: `exercises/threads/thread-abort` @@ -66,11 +66,11 @@ solution: `exercises/threads/thread-abort` - Implement the following -![thread-sleep](/svg-images/threads/thread-sleep.png) +![thread-sleep](../../svg-images/threads/thread-sleep.png) - Output the following serial using `printk()` -![thread-sleep](/images/threads/thread-sleep.png) +![thread-sleep](../../images/threads/thread-sleep.png) solution: `exercises/threads/thread-sleep` @@ -78,11 +78,11 @@ solution: `exercises/threads/thread-sleep` - Implement the following -![thread-sleep](/svg-images/threads/thread-suspend.png) +![thread-sleep](../../svg-images/threads/thread-suspend.png) - Output the following serial using `printk()` -![thread-sleep](/images/threads/thread-suspend.png) +![thread-sleep](../../images/threads/thread-suspend.png) solution: `exercises/threads/thread-suspend` @@ -90,10 +90,10 @@ solution: `exercises/threads/thread-suspend` - Implement the following -![thread-join](/svg-images/threads/thread-join.png) +![thread-join](../../svg-images/threads/thread-join.png) - Output the following serial using `printk()` -![thread-join](/images/threads/thread-join.png) +![thread-join](../../images/threads/thread-join.png) solution: `exercises/threads/thread-join` \ No newline at end of file diff --git a/docs/3-threads/introduction.md b/docs/3-threads/introduction.md index 7baaf3b..49c90b3 100644 --- a/docs/3-threads/introduction.md +++ b/docs/3-threads/introduction.md @@ -11,15 +11,15 @@ A thread is an isolated instance that is responsible for the execution of some t Some key concepts: - **Stack area**: a region of memory used for the thread's stack. The size can be adjusted as required by the thread's processing. -![thread-stack-size](/images/threads/thread-stack-size.png) +![thread-stack-size](../../images/threads/thread-stack-size.png) - **Thread control block**: for internal bookkeeping of the thread's metadata. An instance of the type `k_thread`. -![thread-control-block](/images/threads/thread-control-block.png) +![thread-control-block](../../images/threads/thread-control-block.png) - **Entry point function**: invoked when the thread is started. Up to 3 argument values can be passed to this function. -![thread-entry-point](/images/threads/thread-entry-point.png) +![thread-entry-point](../../images/threads/thread-entry-point.png) _ARG_UNUSED is needed to indicate that the 3 arguments are not used in our thread function._ @@ -41,4 +41,4 @@ Following factors can make a thread unready: The following diagram shows all the possible states a thread can find itself: -![thread_states](/images/threads/thread-states.png) \ No newline at end of file +![thread_states](../../images/threads/thread-states.png) \ No newline at end of file diff --git a/docs/4-gpio/introduction.md b/docs/4-gpio/introduction.md index bae8b72..4f930c2 100644 --- a/docs/4-gpio/introduction.md +++ b/docs/4-gpio/introduction.md @@ -20,7 +20,7 @@ When setting up any GPIO the following basic steps have to be followed: The devicetree for your particular build can be found at `build/zephyr/zephyr.dts` or for each board in `zephyrproject/zephyr/boards` For example, the red arrow indicates the device binding to toggle the green led. -![devicetree-binding](/images/gpio/devicetree-binding.png) +![devicetree-binding](../../images/gpio/devicetree-binding.png) 2) To use the device binding in our main.c file; we need to use the following defines: diff --git a/docs/5-scheduling/exercise.md b/docs/5-scheduling/exercise.md index 059a823..61cbaaa 100644 --- a/docs/5-scheduling/exercise.md +++ b/docs/5-scheduling/exercise.md @@ -12,7 +12,7 @@ Implement cooperative time slicing that puts out the following serial output (us *figure showing that thread_1, even though lower priority, doesn't yield to thread_2 (until finished)* -![serial-coop-time-slicing](/images/scheduling/serial-coop-time-slicing.png) +![serial-coop-time-slicing](../../images/scheduling/serial-coop-time-slicing.png) ## Preemptive Time Slicing @@ -21,7 +21,7 @@ Implement Preemptive time slicing that puts out the serial (using `printk()`) *figure showing the increase in thread priority and preemption and completion of each thread* -![serial-preemptive-time-slicing](/images/scheduling/serial-preemptive-time-slicing.png) +![serial-preemptive-time-slicing](../../images/scheduling/serial-preemptive-time-slicing.png) ## Time Slicing (with 3 threads) @@ -29,4 +29,4 @@ Implement time slicing with three threads (of equal priority) *figure showing the equal priority threads preempting each other* -![serial-time-slicing](/images/scheduling/serial-time-slicing.png) +![serial-time-slicing](../../images/scheduling/serial-time-slicing.png) diff --git a/docs/5-scheduling/introduction.md b/docs/5-scheduling/introduction.md index 044dc3e..2e8856d 100644 --- a/docs/5-scheduling/introduction.md +++ b/docs/5-scheduling/introduction.md @@ -77,7 +77,7 @@ The kernel supports a virtually unlimited number of thread priority levels. The Once a cooperative thread becomes the current thread, it remains the current thread until it performs an action that makes it unready. Consequently, if a cooperative thread performs lengthy computations, it may cause an unacceptable delay in the scheduling of other threads, including those of higher priority. -![cooperative](/images/scheduling/cooperative.png) +![cooperative](../../images/scheduling/cooperative.png) To overcome such problems, a cooperative thread can voluntarily relinquish the CPU from time to time to permit other threads to execute. A thread can relinquish the CPU in two ways: - Calling k_yield() puts the thread at the back of the scheduler's prioritized list of ready threads, and then invokes the scheduler. All ready threads whose priority is higher or equal to that of the yielding thread are then allowed to execute before the yielding thread is rescheduled. If no such threads exist, the scheduler immediately reschedules the yielding thread without context switching. @@ -87,11 +87,11 @@ To overcome such problems, a cooperative thread can voluntarily relinquish the C Once a preemptive thread becomes the current thread, it remains the current thread until a higher priority thread becomes ready, or until the thread performs an action that makes it unready. Consequently, if a preemptive thread performs lengthy computations, it may cause an unacceptable delay in the scheduling of other threads, including those of equal priority. -![preemptive](/images/scheduling/preemptive.png) +![preemptive](../../images/scheduling/preemptive.png) To overcome such problems, a preemptive thread can perform cooperative time slicing (as described above), or the scheduler's time slicing capability can be used to allow other threads of the same priority to execute. -![timeslicing](/images/scheduling/timeslicing.png) +![timeslicing](../../images/scheduling/timeslicing.png) The scheduler divides time into a series of time slices, where slices are measured in system clock ticks. The time slice size is configurable, but this size can be changed while the application is running. diff --git a/docs/7-debugging/exercise.md b/docs/7-debugging/exercise.md index f6dd047..5f0ec5e 100644 --- a/docs/7-debugging/exercise.md +++ b/docs/7-debugging/exercise.md @@ -40,11 +40,11 @@ The svd file can be found on the [STM](https://www.st.com/en/microcontrollers-mi *The first screen should look like this:* -![debug-starting](/images/debugging/debug-starting.png) +![debug-starting](../../images/debugging/debug-starting.png) *If you put an interrupt in the first interrupt, the execution will again be stopped at this point* -![debug-breakpoint](/images/debugging/debug-breakpoint-1.png) +![debug-breakpoint](../../images/debugging/debug-breakpoint-1.png) Notice the "Cortex Peripherals" and "Cortex Registers" on the left-hand side. @@ -61,7 +61,7 @@ west flash 3) Observe the output in the serial monitor: -![runtime-statistics](/images/debugging/runtime-statistics.png) +![runtime-statistics](../../images/debugging/runtime-statistics.png) ## Exercise 3: Core dump diff --git a/docs/7-debugging/introduction.md b/docs/7-debugging/introduction.md index baef59c..5bbdf91 100644 --- a/docs/7-debugging/introduction.md +++ b/docs/7-debugging/introduction.md @@ -22,7 +22,7 @@ To enable thread-aware debugging you'll need to add the line shown below to `zep $_TARGETNAME configure -rtos Zephyr ``` -![openocd-threads-support](/images/debugging/openocd-threads-support.png) +![openocd-threads-support](../../images/debugging/openocd-threads-support.png) A debug probe is special hardware which allows you to control execution of a Zephyr application running on a separate board. Debug probes usually allow reading and writing registers and memory, and support breakpoint debugging of the Zephyr application on your host workstation using tools like GDB. diff --git a/docs/8-interrupts/exercise.md b/docs/8-interrupts/exercise.md index 521c82f..a28b154 100644 --- a/docs/8-interrupts/exercise.md +++ b/docs/8-interrupts/exercise.md @@ -21,8 +21,8 @@ on button press: print out "isr message" User button and LED aliases can be found in the devicetree file `build/zephyr/zephyr.dts`. -![button-interrupt-alias](/images/interrupts/button-interrupt-alias.png) +![button-interrupt-alias](../../images/interrupts/button-interrupt-alias.png) Expected output: -![button-interrupt-output](/images/interrupts/button-interrupt-output.png) \ No newline at end of file +![button-interrupt-output](../../images/interrupts/button-interrupt-output.png) \ No newline at end of file From ec5b6692d4a0083350276b4698c30708fc0e7415 Mon Sep 17 00:00:00 2001 From: maarten1C96 <12756980+maarten1C96@users.noreply.github.com> Date: Sun, 7 Apr 2024 12:09:37 +0200 Subject: [PATCH 07/13] chore(.gitignore): improve ignoring of .DS_Store files globally --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index c3e4fad..2fc7002 100644 --- a/.gitignore +++ b/.gitignore @@ -58,6 +58,6 @@ _site .jekyll-cache vendor -.DS_Store +**/.DS_Store .vscode/ .history/ \ No newline at end of file From e69fc409c098f7661d5782889e3a5665094629e5 Mon Sep 17 00:00:00 2001 From: maarten1C96 <12756980+maarten1C96@users.noreply.github.com> Date: Sun, 7 Apr 2024 12:09:37 +0200 Subject: [PATCH 08/13] chore(.gitignore): improve ignoring of .DS_Store files globally --- .DS_Store | Bin 8196 -> 0 bytes .gitignore | 2 +- docs/.DS_Store | Bin 6148 -> 0 bytes images/.DS_Store | Bin 6148 -> 0 bytes 4 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 .DS_Store delete mode 100644 docs/.DS_Store delete mode 100644 images/.DS_Store diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index d4865c839dcc96811d519d586f7612b2013f6525..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8196 zcmeHMO>h)N6n-y+Ff$O+L6FP}$yQPk)F8Y0TabX8AH--_;7gD$b28Ry}X2#%zg8uCE`%&K< zFezkMhX{lSEJc8y-OE7-2h!j!Jin)=Ez|X4vFlj2qI_k=DoK_lxl(>==%|w)@-#2! zc4^sh-W$}sqp6@h>^N4jt)&i{Mt+j5?{;iYGi@X5JDa*eCWl8%TX*tZPR`a{|96Ij z!k=i8sk5{3L~~QLd1u>PQ*<^SYmPNV6R{n0bF#FtF}}O^Nan=J*;8}Rofko2@L_tX6xUQ2IvAv||sMCyhx~fx$JLl zN9VKX?2;t=nua=69p{?vtU7Oih97( zQijEJS-7<)6m?`qgv_1{26uHR>S)@@WGFUQWT&c5@R|EG*Bh8NY+BW4G`$~P zow`qw#<;dq*J)J^$*lrE9|oE6bfQ8%v_c0A!Wa=e4`<*kyaw;U1-J|!!Kd&wd<);h zb+`dP!>{l={0V=--|!DsU=?n{TCBq;K7ei5jtNZSUfhR|V=wN<5gfxqIF33#gBE7c z#ymccFW`%K8qeTad;`znd3+Zy;)i$%FXPAf30}dg_$7XaKjKefon-~O_KSX@#+%eC zzK}%M;6klz;#PExJho5ixvg~lVU6JEJ?l5rHf-J2oapE*?q$jDEu@jp9YGGCGzC)l z+qZ~`e81JmeahzL*nEIEXB?L}ao8$h9gWmW#1-a~MU6B@wn#*1R_1G!2P0&uNo<8M z-mb(YA}Cuaw5>|JOcZA2Lc3GhB@t6uh0yL%k}`kE7>Isjq(_z*mhx{|_Pq}m;R<{O z-w^9=!Y}X}{DFWHuEiRkarM}MjrcHb$2c})EAGZU#Jx`J#y;%F0URX$jpJdQz)94I zf5&|OP2&kXiKlRmc=!^&Oe}l_Uk!Np7QT(|;e`^`^%nRhBz~}vbu&X*+j8tF8sjXj z024Bx!4w#aQpD#4M&7OzQ8PQ+vLn$HZHdQtiby0VL$tQEFUb(+f*=d8Txo{j8DvqA zB>)KbJFi|LLaO2C|GmrK|KE9mhY^Jcga{N7!1A7H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0 Date: Sun, 7 Apr 2024 13:04:48 +0200 Subject: [PATCH 09/13] chore(docs): standardise image paths for both GitHub and Jekyll compatibility This commit attempts all images being properly displayed when accessed in both the GitHub web interface, as in GitHub Pages (Jekyll). So far images were only linked successfully when accessed via the GitHub web interface, but not in GitHub Pages. Important to mention thought: this change is a preliminary first test. - Added `baseurl: "/zephyr-rtos-tutorial"` to `_config.yml` to set a base path configuration for Jekyll. - Updated all image paths in the documentation to use `{{ site.baseurl }}` instead of `../../` parent references. --- _config.yml | 2 ++ docs/1-zephyr-setup/install/linux.md | 6 +++--- docs/1-zephyr-setup/install/mac-os.md | 8 ++++---- docs/1-zephyr-setup/setup/mac-os.md | 12 ++++++------ docs/2-introduction/rtos-basics.md | 2 +- docs/2-introduction/zephyr-structure.md | 8 ++++---- docs/3-threads/commands.md | 10 +++++----- docs/3-threads/exercise.md | 20 ++++++++++---------- docs/3-threads/introduction.md | 8 ++++---- docs/4-gpio/introduction.md | 2 +- docs/5-scheduling/exercise.md | 6 +++--- docs/5-scheduling/introduction.md | 6 +++--- docs/7-debugging/exercise.md | 6 +++--- docs/7-debugging/introduction.md | 2 +- docs/8-interrupts/exercise.md | 4 ++-- 15 files changed, 52 insertions(+), 50 deletions(-) diff --git a/_config.yml b/_config.yml index 7326e0f..96dd104 100644 --- a/_config.yml +++ b/_config.yml @@ -1,6 +1,8 @@ title: Zephyr Tutorial remote_theme: bedroesb/just-the-docs +baseurl: "/zephyr-rtos-tutorial" + plugins: - jekyll-relative-links - jekyll-remote-theme diff --git a/docs/1-zephyr-setup/install/linux.md b/docs/1-zephyr-setup/install/linux.md index 6442063..de35b29 100644 --- a/docs/1-zephyr-setup/install/linux.md +++ b/docs/1-zephyr-setup/install/linux.md @@ -84,7 +84,7 @@ $ west build -p always -b esp32 samples/hello_world/ The `-p` option does a pristine build. It is used to build when there is any changes done to the CMake. A successful build looks like this -![success_build_hello_world](../../images/1-zephyr-setup/hello_world_build_success.png) +![success_build_hello_world]({{ site.baseurl }}/images/1-zephyr-setup/hello_world_build_success.png) Now flash the board with ``` $ west flash @@ -94,7 +94,7 @@ To open the serial monitor $ west espressif monitor ``` You should see the similar output -![hello_world_success_output](../../images/1-zephyr-setup/hello_world_output.png) +![hello_world_success_output]({{ site.baseurl }}/images/1-zephyr-setup/hello_world_output.png) ## 4) Building the blinky Now, let's try to blink the builtin LED on ESP32. The sample is in `zephyr/samples/basic/blinky` @@ -102,7 +102,7 @@ Now, let's try to blink the builtin LED on ESP32. The sample is in `zephyr/sampl $ west build -p -b esp32 samples/basic/blinky ``` If you encounter build errors like this -![blinky_build_error](../../images/1-zephyr-setup/blinky_build_errors.png) +![blinky_build_error]({{ site.baseurl }}/images/1-zephyr-setup/blinky_build_errors.png) It means that we need to add an overlay file with the board support. This file can be added for any unsupported board with the `.overlay`.
Create an `esp32.overlay` file in `zephyr/samples/basic/blinky/` and add the following contents ```dtc diff --git a/docs/1-zephyr-setup/install/mac-os.md b/docs/1-zephyr-setup/install/mac-os.md index a3130da..a7edd47 100644 --- a/docs/1-zephyr-setup/install/mac-os.md +++ b/docs/1-zephyr-setup/install/mac-os.md @@ -92,7 +92,7 @@ echo $ZEPHYR_TOOLCHAIN_VARIANT echo $GNUARMEMB_TOOLCHAIN_PATH ``` -![env_var_check](../../images/1-zephyr-setup/env-var-check.png) +![env_var_check]({{ site.baseurl }}/images/1-zephyr-setup/env-var-check.png) ## 5) Build the Blinky sample @@ -103,7 +103,7 @@ cd ~/zephyrproject/zephyr/samples/basic/blinky west build -b # for example: nucleo_l552ze_q ``` A successful build looks like this: -![succes_build](../../images/1-zephyr-setup/success-build.png) +![succes_build]({{ site.baseurl }}/images/1-zephyr-setup/success-build.png) {: .note } > If you get a CMake error, this can usually be resolved by clearing the previous build: `rm -rf build` @@ -115,9 +115,9 @@ west flash ``` A successful flash looks like this: -![succes_flash](../../images/1-zephyr-setup/success-flash.png) +![succes_flash]({{ site.baseurl }}/images/1-zephyr-setup/success-flash.png) {: .warning} > Some boards will require installing an additional `pyocd` package! -> ![pyocd-error](../../../images/zephyr-setup/pyocd-error.png) +> ![pyocd-error]({{ site.baseurl }}/../images/zephyr-setup/pyocd-error.png) > For Nucleo L552ZE-Q: `pyocd pack install stm32l552zetxq` (see [pyocd/target_support](https://pyocd.io/docs/target_support.html#managed-packs)) \ No newline at end of file diff --git a/docs/1-zephyr-setup/setup/mac-os.md b/docs/1-zephyr-setup/setup/mac-os.md index 66b9996..8c02968 100644 --- a/docs/1-zephyr-setup/setup/mac-os.md +++ b/docs/1-zephyr-setup/setup/mac-os.md @@ -18,19 +18,19 @@ nav_order: 1 - Port: `usbmodemxxxxx` - Baudrate: `115200` -![coolterm-1](../../images/1-zephyr-setup/coolterm-1.png) +![coolterm-1]({{ site.baseurl }}/images/1-zephyr-setup/coolterm-1.png) - `Terminal`: check "Filter ASCII Escape Sequences" and press `Ok` -![coolterm-2](../../images/1-zephyr-setup/coolterm-2.png) +![coolterm-2]({{ site.baseurl }}/images/1-zephyr-setup/coolterm-2.png) - `File -> Save`: Save this configuration under `~/zephyrproject` -![coolterm-settings](../../images/1-zephyr-setup/coolterm-settings.png) +![coolterm-settings]({{ site.baseurl }}/images/1-zephyr-setup/coolterm-settings.png) - `Connect` -![coolterm-connect](../../images/1-zephyr-setup/coolterm-connect.png) +![coolterm-connect]({{ site.baseurl }}/images/1-zephyr-setup/coolterm-connect.png) ## 2) VSCode @@ -64,8 +64,8 @@ west flash - Verify the serial output: -![coolterm-3](../../images/1-zephyr-setup/coolterm-3.png) +![coolterm-3]({{ site.baseurl }}/images/1-zephyr-setup/coolterm-3.png) Your final setup should look something like this: -![final-setup](../../images/1-zephyr-setup/final-setup.png) \ No newline at end of file +![final-setup]({{ site.baseurl }}/images/1-zephyr-setup/final-setup.png) \ No newline at end of file diff --git a/docs/2-introduction/rtos-basics.md b/docs/2-introduction/rtos-basics.md index 3f50c00..0a3b46b 100644 --- a/docs/2-introduction/rtos-basics.md +++ b/docs/2-introduction/rtos-basics.md @@ -28,4 +28,4 @@ Each **thread** (or task) will use registers and memory as it executes. The whol Along with threads, you'll be using primitives such as **queues**, **mutexes** and **semaphores** for inter-thread communication. Then each RTOS provides varying levels of support for different protocols such as **TCP/IP**, **Bluetooth**, **LoRaWan**,... This makes your life easier, since now you don't need to study these protocols as in-depth. You'll get a series of API calls which should increase speed of development. -![rtos-basic-execution](../../images/2-introduction/rtos_basic_execution.gif) \ No newline at end of file +![rtos-basic-execution]({{ site.baseurl }}/images/2-introduction/rtos_basic_execution.gif) \ No newline at end of file diff --git a/docs/2-introduction/zephyr-structure.md b/docs/2-introduction/zephyr-structure.md index 2cacd48..433191e 100644 --- a/docs/2-introduction/zephyr-structure.md +++ b/docs/2-introduction/zephyr-structure.md @@ -11,7 +11,7 @@ nav_order: 10 Before we start writing our first applications in Zephyr, it might be a good step to take a look at the folder structure that Zephyr provides us. -![sample-folder](../../images/2-introduction/sample-folder.png) +![sample-folder]({{ site.baseurl }}/images/2-introduction/sample-folder.png) Let's go one-by-one: @@ -28,7 +28,7 @@ This file will be used by [CMake](https://en.wikipedia.org/wiki/CMake) to set up ### prj.conf This is you Kconfig file. **Important!** This file will contain any *additional* settings you want set for your particular Zephyr build. Depending on your particular application, you might want to (for example) include a TCP/IP stack or make some changes to the scheduler. We'll explore some of these options throughout the tutorial. -![k-config](../../images/2-introduction/k-config.png) +![k-config]({{ site.baseurl }}/images/2-introduction/k-config.png) Right now it's pretty empty, since for `basic-sample` we don't require any "fancy" functionality, just the basic Zephyr kernel. The only additional functionality we set is `CONFIG_PRINTK`, which allows us to use the `printk` function to output to the serial port (which is then displayed on your computer screen using Coolterm). @@ -36,9 +36,9 @@ If you're ever unsure about what a particular config setting does, you have 2 op - Use [google](https://www.google.com/search?client=firefox-b-d&q=zephyr+CONFIG_PRINTK): usually Zephyr Documentation is one of the first links - Use the `guiconfig`: in your `basic-sample` folder execute `west build -t guiconfig`. This will show you a menu of all the possible configuration settings and a small description of what each one does. (Use `Jump to` to find a particular config) -![guiconfig](../../images/2-introduction/guiconfig.png) +![guiconfig]({{ site.baseurl }}/images/2-introduction/guiconfig.png) ### src Where the magic happens! This folder should contain all of your custom application code. For now it contains one file: `main.c`, which prints out a message to the serial port and then sleeps for 1 second. -![basic-sample](../../images/2-introduction/basic-sample.png) \ No newline at end of file +![basic-sample]({{ site.baseurl }}/images/2-introduction/basic-sample.png) \ No newline at end of file diff --git a/docs/3-threads/commands.md b/docs/3-threads/commands.md index dd93029..8d2729c 100644 --- a/docs/3-threads/commands.md +++ b/docs/3-threads/commands.md @@ -67,22 +67,22 @@ K_THREAD_DEFINE(my_tid, MY_STACK_SIZE, ### k_thread_start() A thread must be created before it can be used. -![k_thread_im](../../svg-images/threads/thread-start.png) +![k_thread_im]({{ site.baseurl }}/svg-images/threads/thread-start.png) ### k_thread_abort() Abort a thread. Thread is taken off all kernel queues. -![k_thread_im](../../svg-images/threads/thread-abort.png) +![k_thread_im]({{ site.baseurl }}/svg-images/threads/thread-abort.png) ### k_sleep() A thread can prevent itself from executing for a specified amount of time. A sleeping thread becomes executable automatically once the time limit is reached. -![k_thread_im](../../svg-images/threads/thread-sleep.png) +![k_thread_im]({{ site.baseurl }}/svg-images/threads/thread-sleep.png) ### k_thread_suspend() Prevent a thread from executing for an indefinite period of time. Once suspended, use k_thread_resume() to re-start. -![k_thread_im](../../svg-images/threads/thread-suspend.png) +![k_thread_im]({{ site.baseurl }}/svg-images/threads/thread-suspend.png) ### k_thread_join() Sleep until a thread exits. @@ -92,6 +92,6 @@ For example: - thread_a is responsible for processing data from this interface - As long as thread_b has not exited, thread_a can't start, so we'll use k_thread_join(thread_b, timeout) in this case. -![k_thread_im](../../svg-images/threads/thread-join.png) +![k_thread_im]({{ site.baseurl }}/svg-images/threads/thread-join.png) diff --git a/docs/3-threads/exercise.md b/docs/3-threads/exercise.md index 12eb080..b151802 100644 --- a/docs/3-threads/exercise.md +++ b/docs/3-threads/exercise.md @@ -36,11 +36,11 @@ For solving the exercises I recommend you create your own folder inside `zephyr- - Use `k_thread_create()` to create a thread - Implement the following -![thread-start](../../svg-images/threads/thread-start.png) +![thread-start]({{ site.baseurl }}/svg-images/threads/thread-start.png) - Output the following serial using `printk()` -![thread-start](../../images/threads/thread-start.png) +![thread-start]({{ site.baseurl }}/images/threads/thread-start.png) solution: `exercises/threads/thread-start` @@ -54,11 +54,11 @@ solution: `exercises/threads/thread-start-define` - Implement the following -![thread-abort](../../svg-images/threads/thread-abort.png) +![thread-abort]({{ site.baseurl }}/svg-images/threads/thread-abort.png) - Output the following serial using `printk()` -![thread-abort](../../images/threads/thread-abort.png) +![thread-abort]({{ site.baseurl }}/images/threads/thread-abort.png) solution: `exercises/threads/thread-abort` @@ -66,11 +66,11 @@ solution: `exercises/threads/thread-abort` - Implement the following -![thread-sleep](../../svg-images/threads/thread-sleep.png) +![thread-sleep]({{ site.baseurl }}/svg-images/threads/thread-sleep.png) - Output the following serial using `printk()` -![thread-sleep](../../images/threads/thread-sleep.png) +![thread-sleep]({{ site.baseurl }}/images/threads/thread-sleep.png) solution: `exercises/threads/thread-sleep` @@ -78,11 +78,11 @@ solution: `exercises/threads/thread-sleep` - Implement the following -![thread-sleep](../../svg-images/threads/thread-suspend.png) +![thread-sleep]({{ site.baseurl }}/svg-images/threads/thread-suspend.png) - Output the following serial using `printk()` -![thread-sleep](../../images/threads/thread-suspend.png) +![thread-sleep]({{ site.baseurl }}/images/threads/thread-suspend.png) solution: `exercises/threads/thread-suspend` @@ -90,10 +90,10 @@ solution: `exercises/threads/thread-suspend` - Implement the following -![thread-join](../../svg-images/threads/thread-join.png) +![thread-join]({{ site.baseurl }}/svg-images/threads/thread-join.png) - Output the following serial using `printk()` -![thread-join](../../images/threads/thread-join.png) +![thread-join]({{ site.baseurl }}/images/threads/thread-join.png) solution: `exercises/threads/thread-join` \ No newline at end of file diff --git a/docs/3-threads/introduction.md b/docs/3-threads/introduction.md index 49c90b3..2a9c0cf 100644 --- a/docs/3-threads/introduction.md +++ b/docs/3-threads/introduction.md @@ -11,15 +11,15 @@ A thread is an isolated instance that is responsible for the execution of some t Some key concepts: - **Stack area**: a region of memory used for the thread's stack. The size can be adjusted as required by the thread's processing. -![thread-stack-size](../../images/threads/thread-stack-size.png) +![thread-stack-size]({{ site.baseurl }}/images/threads/thread-stack-size.png) - **Thread control block**: for internal bookkeeping of the thread's metadata. An instance of the type `k_thread`. -![thread-control-block](../../images/threads/thread-control-block.png) +![thread-control-block]({{ site.baseurl }}/images/threads/thread-control-block.png) - **Entry point function**: invoked when the thread is started. Up to 3 argument values can be passed to this function. -![thread-entry-point](../../images/threads/thread-entry-point.png) +![thread-entry-point]({{ site.baseurl }}/images/threads/thread-entry-point.png) _ARG_UNUSED is needed to indicate that the 3 arguments are not used in our thread function._ @@ -41,4 +41,4 @@ Following factors can make a thread unready: The following diagram shows all the possible states a thread can find itself: -![thread_states](../../images/threads/thread-states.png) \ No newline at end of file +![thread_states]({{ site.baseurl }}/images/threads/thread-states.png) \ No newline at end of file diff --git a/docs/4-gpio/introduction.md b/docs/4-gpio/introduction.md index 4f930c2..91804cc 100644 --- a/docs/4-gpio/introduction.md +++ b/docs/4-gpio/introduction.md @@ -20,7 +20,7 @@ When setting up any GPIO the following basic steps have to be followed: The devicetree for your particular build can be found at `build/zephyr/zephyr.dts` or for each board in `zephyrproject/zephyr/boards` For example, the red arrow indicates the device binding to toggle the green led. -![devicetree-binding](../../images/gpio/devicetree-binding.png) +![devicetree-binding]({{ site.baseurl }}/images/gpio/devicetree-binding.png) 2) To use the device binding in our main.c file; we need to use the following defines: diff --git a/docs/5-scheduling/exercise.md b/docs/5-scheduling/exercise.md index 61cbaaa..682b71d 100644 --- a/docs/5-scheduling/exercise.md +++ b/docs/5-scheduling/exercise.md @@ -12,7 +12,7 @@ Implement cooperative time slicing that puts out the following serial output (us *figure showing that thread_1, even though lower priority, doesn't yield to thread_2 (until finished)* -![serial-coop-time-slicing](../../images/scheduling/serial-coop-time-slicing.png) +![serial-coop-time-slicing]({{ site.baseurl }}/images/scheduling/serial-coop-time-slicing.png) ## Preemptive Time Slicing @@ -21,7 +21,7 @@ Implement Preemptive time slicing that puts out the serial (using `printk()`) *figure showing the increase in thread priority and preemption and completion of each thread* -![serial-preemptive-time-slicing](../../images/scheduling/serial-preemptive-time-slicing.png) +![serial-preemptive-time-slicing]({{ site.baseurl }}/images/scheduling/serial-preemptive-time-slicing.png) ## Time Slicing (with 3 threads) @@ -29,4 +29,4 @@ Implement time slicing with three threads (of equal priority) *figure showing the equal priority threads preempting each other* -![serial-time-slicing](../../images/scheduling/serial-time-slicing.png) +![serial-time-slicing]({{ site.baseurl }}/images/scheduling/serial-time-slicing.png) diff --git a/docs/5-scheduling/introduction.md b/docs/5-scheduling/introduction.md index 2e8856d..38ae98f 100644 --- a/docs/5-scheduling/introduction.md +++ b/docs/5-scheduling/introduction.md @@ -77,7 +77,7 @@ The kernel supports a virtually unlimited number of thread priority levels. The Once a cooperative thread becomes the current thread, it remains the current thread until it performs an action that makes it unready. Consequently, if a cooperative thread performs lengthy computations, it may cause an unacceptable delay in the scheduling of other threads, including those of higher priority. -![cooperative](../../images/scheduling/cooperative.png) +![cooperative]({{ site.baseurl }}/images/scheduling/cooperative.png) To overcome such problems, a cooperative thread can voluntarily relinquish the CPU from time to time to permit other threads to execute. A thread can relinquish the CPU in two ways: - Calling k_yield() puts the thread at the back of the scheduler's prioritized list of ready threads, and then invokes the scheduler. All ready threads whose priority is higher or equal to that of the yielding thread are then allowed to execute before the yielding thread is rescheduled. If no such threads exist, the scheduler immediately reschedules the yielding thread without context switching. @@ -87,11 +87,11 @@ To overcome such problems, a cooperative thread can voluntarily relinquish the C Once a preemptive thread becomes the current thread, it remains the current thread until a higher priority thread becomes ready, or until the thread performs an action that makes it unready. Consequently, if a preemptive thread performs lengthy computations, it may cause an unacceptable delay in the scheduling of other threads, including those of equal priority. -![preemptive](../../images/scheduling/preemptive.png) +![preemptive]({{ site.baseurl }}/images/scheduling/preemptive.png) To overcome such problems, a preemptive thread can perform cooperative time slicing (as described above), or the scheduler's time slicing capability can be used to allow other threads of the same priority to execute. -![timeslicing](../../images/scheduling/timeslicing.png) +![timeslicing]({{ site.baseurl }}/images/scheduling/timeslicing.png) The scheduler divides time into a series of time slices, where slices are measured in system clock ticks. The time slice size is configurable, but this size can be changed while the application is running. diff --git a/docs/7-debugging/exercise.md b/docs/7-debugging/exercise.md index 5f0ec5e..b5d1289 100644 --- a/docs/7-debugging/exercise.md +++ b/docs/7-debugging/exercise.md @@ -40,11 +40,11 @@ The svd file can be found on the [STM](https://www.st.com/en/microcontrollers-mi *The first screen should look like this:* -![debug-starting](../../images/debugging/debug-starting.png) +![debug-starting]({{ site.baseurl }}/images/debugging/debug-starting.png) *If you put an interrupt in the first interrupt, the execution will again be stopped at this point* -![debug-breakpoint](../../images/debugging/debug-breakpoint-1.png) +![debug-breakpoint]({{ site.baseurl }}/images/debugging/debug-breakpoint-1.png) Notice the "Cortex Peripherals" and "Cortex Registers" on the left-hand side. @@ -61,7 +61,7 @@ west flash 3) Observe the output in the serial monitor: -![runtime-statistics](../../images/debugging/runtime-statistics.png) +![runtime-statistics]({{ site.baseurl }}/images/debugging/runtime-statistics.png) ## Exercise 3: Core dump diff --git a/docs/7-debugging/introduction.md b/docs/7-debugging/introduction.md index 5bbdf91..13e011a 100644 --- a/docs/7-debugging/introduction.md +++ b/docs/7-debugging/introduction.md @@ -22,7 +22,7 @@ To enable thread-aware debugging you'll need to add the line shown below to `zep $_TARGETNAME configure -rtos Zephyr ``` -![openocd-threads-support](../../images/debugging/openocd-threads-support.png) +![openocd-threads-support]({{ site.baseurl }}/images/debugging/openocd-threads-support.png) A debug probe is special hardware which allows you to control execution of a Zephyr application running on a separate board. Debug probes usually allow reading and writing registers and memory, and support breakpoint debugging of the Zephyr application on your host workstation using tools like GDB. diff --git a/docs/8-interrupts/exercise.md b/docs/8-interrupts/exercise.md index a28b154..47e4289 100644 --- a/docs/8-interrupts/exercise.md +++ b/docs/8-interrupts/exercise.md @@ -21,8 +21,8 @@ on button press: print out "isr message" User button and LED aliases can be found in the devicetree file `build/zephyr/zephyr.dts`. -![button-interrupt-alias](../../images/interrupts/button-interrupt-alias.png) +![button-interrupt-alias]({{ site.baseurl }}/images/interrupts/button-interrupt-alias.png) Expected output: -![button-interrupt-output](../../images/interrupts/button-interrupt-output.png) \ No newline at end of file +![button-interrupt-output]({{ site.baseurl }}/images/interrupts/button-interrupt-output.png) \ No newline at end of file From a8ddd102f63e933f0b56728ab99a4b0a8b1eacca Mon Sep 17 00:00:00 2001 From: maarten1C96 <12756980+maarten1C96@users.noreply.github.com> Date: Sun, 7 Apr 2024 13:54:24 +0200 Subject: [PATCH 10/13] chore(docs): restore original images paths but keep _config.yml configuration - Restored image paths in documentation back to original links (`/images`), reversing the application of `{{ site.baseurl }}`. Although Jekyll should be able to process `{{ site.baseurl }}` into working images in GitHub Pages, the GitHub web interface apparently is not able to handle this. - Path evolution for clarity: - Original: /images - Attempt 1: /../../images - Attempt 2: {{ site.baseurl }}/images - This commit: /images - Purposefully kept `baseurl: "/zephyr-rtos-tutorial"` unchanged in `_config.yml`. Maybe having this line in the configuration file will already be able to solve the incorrect image paths in Jekyll. Fingers crossed... --- docs/1-zephyr-setup/install/linux.md | 6 +++--- docs/1-zephyr-setup/install/mac-os.md | 8 ++++---- docs/1-zephyr-setup/setup/mac-os.md | 12 ++++++------ docs/2-introduction/rtos-basics.md | 2 +- docs/2-introduction/zephyr-structure.md | 8 ++++---- docs/3-threads/commands.md | 10 +++++----- docs/3-threads/exercise.md | 20 ++++++++++---------- docs/3-threads/introduction.md | 8 ++++---- docs/4-gpio/introduction.md | 2 +- docs/5-scheduling/exercise.md | 6 +++--- docs/5-scheduling/introduction.md | 6 +++--- docs/7-debugging/exercise.md | 6 +++--- docs/7-debugging/introduction.md | 2 +- docs/8-interrupts/exercise.md | 4 ++-- 14 files changed, 50 insertions(+), 50 deletions(-) diff --git a/docs/1-zephyr-setup/install/linux.md b/docs/1-zephyr-setup/install/linux.md index de35b29..8e446a2 100644 --- a/docs/1-zephyr-setup/install/linux.md +++ b/docs/1-zephyr-setup/install/linux.md @@ -84,7 +84,7 @@ $ west build -p always -b esp32 samples/hello_world/ The `-p` option does a pristine build. It is used to build when there is any changes done to the CMake. A successful build looks like this -![success_build_hello_world]({{ site.baseurl }}/images/1-zephyr-setup/hello_world_build_success.png) +![success_build_hello_world](/images/1-zephyr-setup/hello_world_build_success.png) Now flash the board with ``` $ west flash @@ -94,7 +94,7 @@ To open the serial monitor $ west espressif monitor ``` You should see the similar output -![hello_world_success_output]({{ site.baseurl }}/images/1-zephyr-setup/hello_world_output.png) +![hello_world_success_output](/images/1-zephyr-setup/hello_world_output.png) ## 4) Building the blinky Now, let's try to blink the builtin LED on ESP32. The sample is in `zephyr/samples/basic/blinky` @@ -102,7 +102,7 @@ Now, let's try to blink the builtin LED on ESP32. The sample is in `zephyr/sampl $ west build -p -b esp32 samples/basic/blinky ``` If you encounter build errors like this -![blinky_build_error]({{ site.baseurl }}/images/1-zephyr-setup/blinky_build_errors.png) +![blinky_build_error](/images/1-zephyr-setup/blinky_build_errors.png) It means that we need to add an overlay file with the board support. This file can be added for any unsupported board with the `.overlay`.
Create an `esp32.overlay` file in `zephyr/samples/basic/blinky/` and add the following contents ```dtc diff --git a/docs/1-zephyr-setup/install/mac-os.md b/docs/1-zephyr-setup/install/mac-os.md index a7edd47..d37562d 100644 --- a/docs/1-zephyr-setup/install/mac-os.md +++ b/docs/1-zephyr-setup/install/mac-os.md @@ -92,7 +92,7 @@ echo $ZEPHYR_TOOLCHAIN_VARIANT echo $GNUARMEMB_TOOLCHAIN_PATH ``` -![env_var_check]({{ site.baseurl }}/images/1-zephyr-setup/env-var-check.png) +![env_var_check](/images/1-zephyr-setup/env-var-check.png) ## 5) Build the Blinky sample @@ -103,7 +103,7 @@ cd ~/zephyrproject/zephyr/samples/basic/blinky west build -b # for example: nucleo_l552ze_q ``` A successful build looks like this: -![succes_build]({{ site.baseurl }}/images/1-zephyr-setup/success-build.png) +![succes_build](/images/1-zephyr-setup/success-build.png) {: .note } > If you get a CMake error, this can usually be resolved by clearing the previous build: `rm -rf build` @@ -115,9 +115,9 @@ west flash ``` A successful flash looks like this: -![succes_flash]({{ site.baseurl }}/images/1-zephyr-setup/success-flash.png) +![succes_flash](/images/1-zephyr-setup/success-flash.png) {: .warning} > Some boards will require installing an additional `pyocd` package! -> ![pyocd-error]({{ site.baseurl }}/../images/zephyr-setup/pyocd-error.png) +> ![pyocd-error](/../images/zephyr-setup/pyocd-error.png) > For Nucleo L552ZE-Q: `pyocd pack install stm32l552zetxq` (see [pyocd/target_support](https://pyocd.io/docs/target_support.html#managed-packs)) \ No newline at end of file diff --git a/docs/1-zephyr-setup/setup/mac-os.md b/docs/1-zephyr-setup/setup/mac-os.md index 8c02968..080193d 100644 --- a/docs/1-zephyr-setup/setup/mac-os.md +++ b/docs/1-zephyr-setup/setup/mac-os.md @@ -18,19 +18,19 @@ nav_order: 1 - Port: `usbmodemxxxxx` - Baudrate: `115200` -![coolterm-1]({{ site.baseurl }}/images/1-zephyr-setup/coolterm-1.png) +![coolterm-1](/images/1-zephyr-setup/coolterm-1.png) - `Terminal`: check "Filter ASCII Escape Sequences" and press `Ok` -![coolterm-2]({{ site.baseurl }}/images/1-zephyr-setup/coolterm-2.png) +![coolterm-2](/images/1-zephyr-setup/coolterm-2.png) - `File -> Save`: Save this configuration under `~/zephyrproject` -![coolterm-settings]({{ site.baseurl }}/images/1-zephyr-setup/coolterm-settings.png) +![coolterm-settings](/images/1-zephyr-setup/coolterm-settings.png) - `Connect` -![coolterm-connect]({{ site.baseurl }}/images/1-zephyr-setup/coolterm-connect.png) +![coolterm-connect](/images/1-zephyr-setup/coolterm-connect.png) ## 2) VSCode @@ -64,8 +64,8 @@ west flash - Verify the serial output: -![coolterm-3]({{ site.baseurl }}/images/1-zephyr-setup/coolterm-3.png) +![coolterm-3](/images/1-zephyr-setup/coolterm-3.png) Your final setup should look something like this: -![final-setup]({{ site.baseurl }}/images/1-zephyr-setup/final-setup.png) \ No newline at end of file +![final-setup](/images/1-zephyr-setup/final-setup.png) \ No newline at end of file diff --git a/docs/2-introduction/rtos-basics.md b/docs/2-introduction/rtos-basics.md index 0a3b46b..fcdbe8b 100644 --- a/docs/2-introduction/rtos-basics.md +++ b/docs/2-introduction/rtos-basics.md @@ -28,4 +28,4 @@ Each **thread** (or task) will use registers and memory as it executes. The whol Along with threads, you'll be using primitives such as **queues**, **mutexes** and **semaphores** for inter-thread communication. Then each RTOS provides varying levels of support for different protocols such as **TCP/IP**, **Bluetooth**, **LoRaWan**,... This makes your life easier, since now you don't need to study these protocols as in-depth. You'll get a series of API calls which should increase speed of development. -![rtos-basic-execution]({{ site.baseurl }}/images/2-introduction/rtos_basic_execution.gif) \ No newline at end of file +![rtos-basic-execution](/images/2-introduction/rtos_basic_execution.gif) \ No newline at end of file diff --git a/docs/2-introduction/zephyr-structure.md b/docs/2-introduction/zephyr-structure.md index 433191e..0165757 100644 --- a/docs/2-introduction/zephyr-structure.md +++ b/docs/2-introduction/zephyr-structure.md @@ -11,7 +11,7 @@ nav_order: 10 Before we start writing our first applications in Zephyr, it might be a good step to take a look at the folder structure that Zephyr provides us. -![sample-folder]({{ site.baseurl }}/images/2-introduction/sample-folder.png) +![sample-folder](/images/2-introduction/sample-folder.png) Let's go one-by-one: @@ -28,7 +28,7 @@ This file will be used by [CMake](https://en.wikipedia.org/wiki/CMake) to set up ### prj.conf This is you Kconfig file. **Important!** This file will contain any *additional* settings you want set for your particular Zephyr build. Depending on your particular application, you might want to (for example) include a TCP/IP stack or make some changes to the scheduler. We'll explore some of these options throughout the tutorial. -![k-config]({{ site.baseurl }}/images/2-introduction/k-config.png) +![k-config](/images/2-introduction/k-config.png) Right now it's pretty empty, since for `basic-sample` we don't require any "fancy" functionality, just the basic Zephyr kernel. The only additional functionality we set is `CONFIG_PRINTK`, which allows us to use the `printk` function to output to the serial port (which is then displayed on your computer screen using Coolterm). @@ -36,9 +36,9 @@ If you're ever unsure about what a particular config setting does, you have 2 op - Use [google](https://www.google.com/search?client=firefox-b-d&q=zephyr+CONFIG_PRINTK): usually Zephyr Documentation is one of the first links - Use the `guiconfig`: in your `basic-sample` folder execute `west build -t guiconfig`. This will show you a menu of all the possible configuration settings and a small description of what each one does. (Use `Jump to` to find a particular config) -![guiconfig]({{ site.baseurl }}/images/2-introduction/guiconfig.png) +![guiconfig](/images/2-introduction/guiconfig.png) ### src Where the magic happens! This folder should contain all of your custom application code. For now it contains one file: `main.c`, which prints out a message to the serial port and then sleeps for 1 second. -![basic-sample]({{ site.baseurl }}/images/2-introduction/basic-sample.png) \ No newline at end of file +![basic-sample](/images/2-introduction/basic-sample.png) \ No newline at end of file diff --git a/docs/3-threads/commands.md b/docs/3-threads/commands.md index 8d2729c..95a069f 100644 --- a/docs/3-threads/commands.md +++ b/docs/3-threads/commands.md @@ -67,22 +67,22 @@ K_THREAD_DEFINE(my_tid, MY_STACK_SIZE, ### k_thread_start() A thread must be created before it can be used. -![k_thread_im]({{ site.baseurl }}/svg-images/threads/thread-start.png) +![k_thread_im](/svg-images/threads/thread-start.png) ### k_thread_abort() Abort a thread. Thread is taken off all kernel queues. -![k_thread_im]({{ site.baseurl }}/svg-images/threads/thread-abort.png) +![k_thread_im](/svg-images/threads/thread-abort.png) ### k_sleep() A thread can prevent itself from executing for a specified amount of time. A sleeping thread becomes executable automatically once the time limit is reached. -![k_thread_im]({{ site.baseurl }}/svg-images/threads/thread-sleep.png) +![k_thread_im](/svg-images/threads/thread-sleep.png) ### k_thread_suspend() Prevent a thread from executing for an indefinite period of time. Once suspended, use k_thread_resume() to re-start. -![k_thread_im]({{ site.baseurl }}/svg-images/threads/thread-suspend.png) +![k_thread_im](/svg-images/threads/thread-suspend.png) ### k_thread_join() Sleep until a thread exits. @@ -92,6 +92,6 @@ For example: - thread_a is responsible for processing data from this interface - As long as thread_b has not exited, thread_a can't start, so we'll use k_thread_join(thread_b, timeout) in this case. -![k_thread_im]({{ site.baseurl }}/svg-images/threads/thread-join.png) +![k_thread_im](/svg-images/threads/thread-join.png) diff --git a/docs/3-threads/exercise.md b/docs/3-threads/exercise.md index b151802..7a2bf12 100644 --- a/docs/3-threads/exercise.md +++ b/docs/3-threads/exercise.md @@ -36,11 +36,11 @@ For solving the exercises I recommend you create your own folder inside `zephyr- - Use `k_thread_create()` to create a thread - Implement the following -![thread-start]({{ site.baseurl }}/svg-images/threads/thread-start.png) +![thread-start](/svg-images/threads/thread-start.png) - Output the following serial using `printk()` -![thread-start]({{ site.baseurl }}/images/threads/thread-start.png) +![thread-start](/images/threads/thread-start.png) solution: `exercises/threads/thread-start` @@ -54,11 +54,11 @@ solution: `exercises/threads/thread-start-define` - Implement the following -![thread-abort]({{ site.baseurl }}/svg-images/threads/thread-abort.png) +![thread-abort](/svg-images/threads/thread-abort.png) - Output the following serial using `printk()` -![thread-abort]({{ site.baseurl }}/images/threads/thread-abort.png) +![thread-abort](/images/threads/thread-abort.png) solution: `exercises/threads/thread-abort` @@ -66,11 +66,11 @@ solution: `exercises/threads/thread-abort` - Implement the following -![thread-sleep]({{ site.baseurl }}/svg-images/threads/thread-sleep.png) +![thread-sleep](/svg-images/threads/thread-sleep.png) - Output the following serial using `printk()` -![thread-sleep]({{ site.baseurl }}/images/threads/thread-sleep.png) +![thread-sleep](/images/threads/thread-sleep.png) solution: `exercises/threads/thread-sleep` @@ -78,11 +78,11 @@ solution: `exercises/threads/thread-sleep` - Implement the following -![thread-sleep]({{ site.baseurl }}/svg-images/threads/thread-suspend.png) +![thread-sleep](/svg-images/threads/thread-suspend.png) - Output the following serial using `printk()` -![thread-sleep]({{ site.baseurl }}/images/threads/thread-suspend.png) +![thread-sleep](/images/threads/thread-suspend.png) solution: `exercises/threads/thread-suspend` @@ -90,10 +90,10 @@ solution: `exercises/threads/thread-suspend` - Implement the following -![thread-join]({{ site.baseurl }}/svg-images/threads/thread-join.png) +![thread-join](/svg-images/threads/thread-join.png) - Output the following serial using `printk()` -![thread-join]({{ site.baseurl }}/images/threads/thread-join.png) +![thread-join](/images/threads/thread-join.png) solution: `exercises/threads/thread-join` \ No newline at end of file diff --git a/docs/3-threads/introduction.md b/docs/3-threads/introduction.md index 2a9c0cf..7baaf3b 100644 --- a/docs/3-threads/introduction.md +++ b/docs/3-threads/introduction.md @@ -11,15 +11,15 @@ A thread is an isolated instance that is responsible for the execution of some t Some key concepts: - **Stack area**: a region of memory used for the thread's stack. The size can be adjusted as required by the thread's processing. -![thread-stack-size]({{ site.baseurl }}/images/threads/thread-stack-size.png) +![thread-stack-size](/images/threads/thread-stack-size.png) - **Thread control block**: for internal bookkeeping of the thread's metadata. An instance of the type `k_thread`. -![thread-control-block]({{ site.baseurl }}/images/threads/thread-control-block.png) +![thread-control-block](/images/threads/thread-control-block.png) - **Entry point function**: invoked when the thread is started. Up to 3 argument values can be passed to this function. -![thread-entry-point]({{ site.baseurl }}/images/threads/thread-entry-point.png) +![thread-entry-point](/images/threads/thread-entry-point.png) _ARG_UNUSED is needed to indicate that the 3 arguments are not used in our thread function._ @@ -41,4 +41,4 @@ Following factors can make a thread unready: The following diagram shows all the possible states a thread can find itself: -![thread_states]({{ site.baseurl }}/images/threads/thread-states.png) \ No newline at end of file +![thread_states](/images/threads/thread-states.png) \ No newline at end of file diff --git a/docs/4-gpio/introduction.md b/docs/4-gpio/introduction.md index 91804cc..bae8b72 100644 --- a/docs/4-gpio/introduction.md +++ b/docs/4-gpio/introduction.md @@ -20,7 +20,7 @@ When setting up any GPIO the following basic steps have to be followed: The devicetree for your particular build can be found at `build/zephyr/zephyr.dts` or for each board in `zephyrproject/zephyr/boards` For example, the red arrow indicates the device binding to toggle the green led. -![devicetree-binding]({{ site.baseurl }}/images/gpio/devicetree-binding.png) +![devicetree-binding](/images/gpio/devicetree-binding.png) 2) To use the device binding in our main.c file; we need to use the following defines: diff --git a/docs/5-scheduling/exercise.md b/docs/5-scheduling/exercise.md index 682b71d..059a823 100644 --- a/docs/5-scheduling/exercise.md +++ b/docs/5-scheduling/exercise.md @@ -12,7 +12,7 @@ Implement cooperative time slicing that puts out the following serial output (us *figure showing that thread_1, even though lower priority, doesn't yield to thread_2 (until finished)* -![serial-coop-time-slicing]({{ site.baseurl }}/images/scheduling/serial-coop-time-slicing.png) +![serial-coop-time-slicing](/images/scheduling/serial-coop-time-slicing.png) ## Preemptive Time Slicing @@ -21,7 +21,7 @@ Implement Preemptive time slicing that puts out the serial (using `printk()`) *figure showing the increase in thread priority and preemption and completion of each thread* -![serial-preemptive-time-slicing]({{ site.baseurl }}/images/scheduling/serial-preemptive-time-slicing.png) +![serial-preemptive-time-slicing](/images/scheduling/serial-preemptive-time-slicing.png) ## Time Slicing (with 3 threads) @@ -29,4 +29,4 @@ Implement time slicing with three threads (of equal priority) *figure showing the equal priority threads preempting each other* -![serial-time-slicing]({{ site.baseurl }}/images/scheduling/serial-time-slicing.png) +![serial-time-slicing](/images/scheduling/serial-time-slicing.png) diff --git a/docs/5-scheduling/introduction.md b/docs/5-scheduling/introduction.md index 38ae98f..044dc3e 100644 --- a/docs/5-scheduling/introduction.md +++ b/docs/5-scheduling/introduction.md @@ -77,7 +77,7 @@ The kernel supports a virtually unlimited number of thread priority levels. The Once a cooperative thread becomes the current thread, it remains the current thread until it performs an action that makes it unready. Consequently, if a cooperative thread performs lengthy computations, it may cause an unacceptable delay in the scheduling of other threads, including those of higher priority. -![cooperative]({{ site.baseurl }}/images/scheduling/cooperative.png) +![cooperative](/images/scheduling/cooperative.png) To overcome such problems, a cooperative thread can voluntarily relinquish the CPU from time to time to permit other threads to execute. A thread can relinquish the CPU in two ways: - Calling k_yield() puts the thread at the back of the scheduler's prioritized list of ready threads, and then invokes the scheduler. All ready threads whose priority is higher or equal to that of the yielding thread are then allowed to execute before the yielding thread is rescheduled. If no such threads exist, the scheduler immediately reschedules the yielding thread without context switching. @@ -87,11 +87,11 @@ To overcome such problems, a cooperative thread can voluntarily relinquish the C Once a preemptive thread becomes the current thread, it remains the current thread until a higher priority thread becomes ready, or until the thread performs an action that makes it unready. Consequently, if a preemptive thread performs lengthy computations, it may cause an unacceptable delay in the scheduling of other threads, including those of equal priority. -![preemptive]({{ site.baseurl }}/images/scheduling/preemptive.png) +![preemptive](/images/scheduling/preemptive.png) To overcome such problems, a preemptive thread can perform cooperative time slicing (as described above), or the scheduler's time slicing capability can be used to allow other threads of the same priority to execute. -![timeslicing]({{ site.baseurl }}/images/scheduling/timeslicing.png) +![timeslicing](/images/scheduling/timeslicing.png) The scheduler divides time into a series of time slices, where slices are measured in system clock ticks. The time slice size is configurable, but this size can be changed while the application is running. diff --git a/docs/7-debugging/exercise.md b/docs/7-debugging/exercise.md index b5d1289..f6dd047 100644 --- a/docs/7-debugging/exercise.md +++ b/docs/7-debugging/exercise.md @@ -40,11 +40,11 @@ The svd file can be found on the [STM](https://www.st.com/en/microcontrollers-mi *The first screen should look like this:* -![debug-starting]({{ site.baseurl }}/images/debugging/debug-starting.png) +![debug-starting](/images/debugging/debug-starting.png) *If you put an interrupt in the first interrupt, the execution will again be stopped at this point* -![debug-breakpoint]({{ site.baseurl }}/images/debugging/debug-breakpoint-1.png) +![debug-breakpoint](/images/debugging/debug-breakpoint-1.png) Notice the "Cortex Peripherals" and "Cortex Registers" on the left-hand side. @@ -61,7 +61,7 @@ west flash 3) Observe the output in the serial monitor: -![runtime-statistics]({{ site.baseurl }}/images/debugging/runtime-statistics.png) +![runtime-statistics](/images/debugging/runtime-statistics.png) ## Exercise 3: Core dump diff --git a/docs/7-debugging/introduction.md b/docs/7-debugging/introduction.md index 13e011a..baef59c 100644 --- a/docs/7-debugging/introduction.md +++ b/docs/7-debugging/introduction.md @@ -22,7 +22,7 @@ To enable thread-aware debugging you'll need to add the line shown below to `zep $_TARGETNAME configure -rtos Zephyr ``` -![openocd-threads-support]({{ site.baseurl }}/images/debugging/openocd-threads-support.png) +![openocd-threads-support](/images/debugging/openocd-threads-support.png) A debug probe is special hardware which allows you to control execution of a Zephyr application running on a separate board. Debug probes usually allow reading and writing registers and memory, and support breakpoint debugging of the Zephyr application on your host workstation using tools like GDB. diff --git a/docs/8-interrupts/exercise.md b/docs/8-interrupts/exercise.md index 47e4289..521c82f 100644 --- a/docs/8-interrupts/exercise.md +++ b/docs/8-interrupts/exercise.md @@ -21,8 +21,8 @@ on button press: print out "isr message" User button and LED aliases can be found in the devicetree file `build/zephyr/zephyr.dts`. -![button-interrupt-alias]({{ site.baseurl }}/images/interrupts/button-interrupt-alias.png) +![button-interrupt-alias](/images/interrupts/button-interrupt-alias.png) Expected output: -![button-interrupt-output]({{ site.baseurl }}/images/interrupts/button-interrupt-output.png) \ No newline at end of file +![button-interrupt-output](/images/interrupts/button-interrupt-output.png) \ No newline at end of file From 232e309fc81e99eb96a2782632f4adcf6e9ebe8e Mon Sep 17 00:00:00 2001 From: maarten1C96 <12756980+maarten1C96@users.noreply.github.com> Date: Sun, 7 Apr 2024 13:54:24 +0200 Subject: [PATCH 11/13] chore(docs): restore original image paths but keep _config.yml configuration - Restored image paths in documentation back to original links (`/images`), reversing the application of `{{ site.baseurl }}`. Although Jekyll should be able to process `{{ site.baseurl }}` into working images in GitHub Pages, the GitHub web interface apparently is not able to handle this. - Path evolution for clarity: - Original: /images - Attempt 1: /../../images - Attempt 2: {{ site.baseurl }}/images - This commit: /images - Purposefully kept `baseurl: "/zephyr-rtos-tutorial"` unchanged in `_config.yml`. Maybe having this line in the configuration file will already be able to solve the incorrect image paths in Jekyll. Fingers crossed... --- docs/1-zephyr-setup/install/linux.md | 6 +++--- docs/1-zephyr-setup/install/mac-os.md | 8 ++++---- docs/1-zephyr-setup/setup/mac-os.md | 12 ++++++------ docs/2-introduction/rtos-basics.md | 2 +- docs/2-introduction/zephyr-structure.md | 8 ++++---- docs/3-threads/commands.md | 10 +++++----- docs/3-threads/exercise.md | 20 ++++++++++---------- docs/3-threads/introduction.md | 8 ++++---- docs/4-gpio/introduction.md | 2 +- docs/5-scheduling/exercise.md | 6 +++--- docs/5-scheduling/introduction.md | 6 +++--- docs/7-debugging/exercise.md | 6 +++--- docs/7-debugging/introduction.md | 2 +- docs/8-interrupts/exercise.md | 4 ++-- 14 files changed, 50 insertions(+), 50 deletions(-) diff --git a/docs/1-zephyr-setup/install/linux.md b/docs/1-zephyr-setup/install/linux.md index de35b29..8e446a2 100644 --- a/docs/1-zephyr-setup/install/linux.md +++ b/docs/1-zephyr-setup/install/linux.md @@ -84,7 +84,7 @@ $ west build -p always -b esp32 samples/hello_world/ The `-p` option does a pristine build. It is used to build when there is any changes done to the CMake. A successful build looks like this -![success_build_hello_world]({{ site.baseurl }}/images/1-zephyr-setup/hello_world_build_success.png) +![success_build_hello_world](/images/1-zephyr-setup/hello_world_build_success.png) Now flash the board with ``` $ west flash @@ -94,7 +94,7 @@ To open the serial monitor $ west espressif monitor ``` You should see the similar output -![hello_world_success_output]({{ site.baseurl }}/images/1-zephyr-setup/hello_world_output.png) +![hello_world_success_output](/images/1-zephyr-setup/hello_world_output.png) ## 4) Building the blinky Now, let's try to blink the builtin LED on ESP32. The sample is in `zephyr/samples/basic/blinky` @@ -102,7 +102,7 @@ Now, let's try to blink the builtin LED on ESP32. The sample is in `zephyr/sampl $ west build -p -b esp32 samples/basic/blinky ``` If you encounter build errors like this -![blinky_build_error]({{ site.baseurl }}/images/1-zephyr-setup/blinky_build_errors.png) +![blinky_build_error](/images/1-zephyr-setup/blinky_build_errors.png) It means that we need to add an overlay file with the board support. This file can be added for any unsupported board with the `.overlay`.
Create an `esp32.overlay` file in `zephyr/samples/basic/blinky/` and add the following contents ```dtc diff --git a/docs/1-zephyr-setup/install/mac-os.md b/docs/1-zephyr-setup/install/mac-os.md index a7edd47..d37562d 100644 --- a/docs/1-zephyr-setup/install/mac-os.md +++ b/docs/1-zephyr-setup/install/mac-os.md @@ -92,7 +92,7 @@ echo $ZEPHYR_TOOLCHAIN_VARIANT echo $GNUARMEMB_TOOLCHAIN_PATH ``` -![env_var_check]({{ site.baseurl }}/images/1-zephyr-setup/env-var-check.png) +![env_var_check](/images/1-zephyr-setup/env-var-check.png) ## 5) Build the Blinky sample @@ -103,7 +103,7 @@ cd ~/zephyrproject/zephyr/samples/basic/blinky west build -b # for example: nucleo_l552ze_q ``` A successful build looks like this: -![succes_build]({{ site.baseurl }}/images/1-zephyr-setup/success-build.png) +![succes_build](/images/1-zephyr-setup/success-build.png) {: .note } > If you get a CMake error, this can usually be resolved by clearing the previous build: `rm -rf build` @@ -115,9 +115,9 @@ west flash ``` A successful flash looks like this: -![succes_flash]({{ site.baseurl }}/images/1-zephyr-setup/success-flash.png) +![succes_flash](/images/1-zephyr-setup/success-flash.png) {: .warning} > Some boards will require installing an additional `pyocd` package! -> ![pyocd-error]({{ site.baseurl }}/../images/zephyr-setup/pyocd-error.png) +> ![pyocd-error](/../images/zephyr-setup/pyocd-error.png) > For Nucleo L552ZE-Q: `pyocd pack install stm32l552zetxq` (see [pyocd/target_support](https://pyocd.io/docs/target_support.html#managed-packs)) \ No newline at end of file diff --git a/docs/1-zephyr-setup/setup/mac-os.md b/docs/1-zephyr-setup/setup/mac-os.md index 8c02968..080193d 100644 --- a/docs/1-zephyr-setup/setup/mac-os.md +++ b/docs/1-zephyr-setup/setup/mac-os.md @@ -18,19 +18,19 @@ nav_order: 1 - Port: `usbmodemxxxxx` - Baudrate: `115200` -![coolterm-1]({{ site.baseurl }}/images/1-zephyr-setup/coolterm-1.png) +![coolterm-1](/images/1-zephyr-setup/coolterm-1.png) - `Terminal`: check "Filter ASCII Escape Sequences" and press `Ok` -![coolterm-2]({{ site.baseurl }}/images/1-zephyr-setup/coolterm-2.png) +![coolterm-2](/images/1-zephyr-setup/coolterm-2.png) - `File -> Save`: Save this configuration under `~/zephyrproject` -![coolterm-settings]({{ site.baseurl }}/images/1-zephyr-setup/coolterm-settings.png) +![coolterm-settings](/images/1-zephyr-setup/coolterm-settings.png) - `Connect` -![coolterm-connect]({{ site.baseurl }}/images/1-zephyr-setup/coolterm-connect.png) +![coolterm-connect](/images/1-zephyr-setup/coolterm-connect.png) ## 2) VSCode @@ -64,8 +64,8 @@ west flash - Verify the serial output: -![coolterm-3]({{ site.baseurl }}/images/1-zephyr-setup/coolterm-3.png) +![coolterm-3](/images/1-zephyr-setup/coolterm-3.png) Your final setup should look something like this: -![final-setup]({{ site.baseurl }}/images/1-zephyr-setup/final-setup.png) \ No newline at end of file +![final-setup](/images/1-zephyr-setup/final-setup.png) \ No newline at end of file diff --git a/docs/2-introduction/rtos-basics.md b/docs/2-introduction/rtos-basics.md index 0a3b46b..fcdbe8b 100644 --- a/docs/2-introduction/rtos-basics.md +++ b/docs/2-introduction/rtos-basics.md @@ -28,4 +28,4 @@ Each **thread** (or task) will use registers and memory as it executes. The whol Along with threads, you'll be using primitives such as **queues**, **mutexes** and **semaphores** for inter-thread communication. Then each RTOS provides varying levels of support for different protocols such as **TCP/IP**, **Bluetooth**, **LoRaWan**,... This makes your life easier, since now you don't need to study these protocols as in-depth. You'll get a series of API calls which should increase speed of development. -![rtos-basic-execution]({{ site.baseurl }}/images/2-introduction/rtos_basic_execution.gif) \ No newline at end of file +![rtos-basic-execution](/images/2-introduction/rtos_basic_execution.gif) \ No newline at end of file diff --git a/docs/2-introduction/zephyr-structure.md b/docs/2-introduction/zephyr-structure.md index 433191e..0165757 100644 --- a/docs/2-introduction/zephyr-structure.md +++ b/docs/2-introduction/zephyr-structure.md @@ -11,7 +11,7 @@ nav_order: 10 Before we start writing our first applications in Zephyr, it might be a good step to take a look at the folder structure that Zephyr provides us. -![sample-folder]({{ site.baseurl }}/images/2-introduction/sample-folder.png) +![sample-folder](/images/2-introduction/sample-folder.png) Let's go one-by-one: @@ -28,7 +28,7 @@ This file will be used by [CMake](https://en.wikipedia.org/wiki/CMake) to set up ### prj.conf This is you Kconfig file. **Important!** This file will contain any *additional* settings you want set for your particular Zephyr build. Depending on your particular application, you might want to (for example) include a TCP/IP stack or make some changes to the scheduler. We'll explore some of these options throughout the tutorial. -![k-config]({{ site.baseurl }}/images/2-introduction/k-config.png) +![k-config](/images/2-introduction/k-config.png) Right now it's pretty empty, since for `basic-sample` we don't require any "fancy" functionality, just the basic Zephyr kernel. The only additional functionality we set is `CONFIG_PRINTK`, which allows us to use the `printk` function to output to the serial port (which is then displayed on your computer screen using Coolterm). @@ -36,9 +36,9 @@ If you're ever unsure about what a particular config setting does, you have 2 op - Use [google](https://www.google.com/search?client=firefox-b-d&q=zephyr+CONFIG_PRINTK): usually Zephyr Documentation is one of the first links - Use the `guiconfig`: in your `basic-sample` folder execute `west build -t guiconfig`. This will show you a menu of all the possible configuration settings and a small description of what each one does. (Use `Jump to` to find a particular config) -![guiconfig]({{ site.baseurl }}/images/2-introduction/guiconfig.png) +![guiconfig](/images/2-introduction/guiconfig.png) ### src Where the magic happens! This folder should contain all of your custom application code. For now it contains one file: `main.c`, which prints out a message to the serial port and then sleeps for 1 second. -![basic-sample]({{ site.baseurl }}/images/2-introduction/basic-sample.png) \ No newline at end of file +![basic-sample](/images/2-introduction/basic-sample.png) \ No newline at end of file diff --git a/docs/3-threads/commands.md b/docs/3-threads/commands.md index 8d2729c..95a069f 100644 --- a/docs/3-threads/commands.md +++ b/docs/3-threads/commands.md @@ -67,22 +67,22 @@ K_THREAD_DEFINE(my_tid, MY_STACK_SIZE, ### k_thread_start() A thread must be created before it can be used. -![k_thread_im]({{ site.baseurl }}/svg-images/threads/thread-start.png) +![k_thread_im](/svg-images/threads/thread-start.png) ### k_thread_abort() Abort a thread. Thread is taken off all kernel queues. -![k_thread_im]({{ site.baseurl }}/svg-images/threads/thread-abort.png) +![k_thread_im](/svg-images/threads/thread-abort.png) ### k_sleep() A thread can prevent itself from executing for a specified amount of time. A sleeping thread becomes executable automatically once the time limit is reached. -![k_thread_im]({{ site.baseurl }}/svg-images/threads/thread-sleep.png) +![k_thread_im](/svg-images/threads/thread-sleep.png) ### k_thread_suspend() Prevent a thread from executing for an indefinite period of time. Once suspended, use k_thread_resume() to re-start. -![k_thread_im]({{ site.baseurl }}/svg-images/threads/thread-suspend.png) +![k_thread_im](/svg-images/threads/thread-suspend.png) ### k_thread_join() Sleep until a thread exits. @@ -92,6 +92,6 @@ For example: - thread_a is responsible for processing data from this interface - As long as thread_b has not exited, thread_a can't start, so we'll use k_thread_join(thread_b, timeout) in this case. -![k_thread_im]({{ site.baseurl }}/svg-images/threads/thread-join.png) +![k_thread_im](/svg-images/threads/thread-join.png) diff --git a/docs/3-threads/exercise.md b/docs/3-threads/exercise.md index b151802..7a2bf12 100644 --- a/docs/3-threads/exercise.md +++ b/docs/3-threads/exercise.md @@ -36,11 +36,11 @@ For solving the exercises I recommend you create your own folder inside `zephyr- - Use `k_thread_create()` to create a thread - Implement the following -![thread-start]({{ site.baseurl }}/svg-images/threads/thread-start.png) +![thread-start](/svg-images/threads/thread-start.png) - Output the following serial using `printk()` -![thread-start]({{ site.baseurl }}/images/threads/thread-start.png) +![thread-start](/images/threads/thread-start.png) solution: `exercises/threads/thread-start` @@ -54,11 +54,11 @@ solution: `exercises/threads/thread-start-define` - Implement the following -![thread-abort]({{ site.baseurl }}/svg-images/threads/thread-abort.png) +![thread-abort](/svg-images/threads/thread-abort.png) - Output the following serial using `printk()` -![thread-abort]({{ site.baseurl }}/images/threads/thread-abort.png) +![thread-abort](/images/threads/thread-abort.png) solution: `exercises/threads/thread-abort` @@ -66,11 +66,11 @@ solution: `exercises/threads/thread-abort` - Implement the following -![thread-sleep]({{ site.baseurl }}/svg-images/threads/thread-sleep.png) +![thread-sleep](/svg-images/threads/thread-sleep.png) - Output the following serial using `printk()` -![thread-sleep]({{ site.baseurl }}/images/threads/thread-sleep.png) +![thread-sleep](/images/threads/thread-sleep.png) solution: `exercises/threads/thread-sleep` @@ -78,11 +78,11 @@ solution: `exercises/threads/thread-sleep` - Implement the following -![thread-sleep]({{ site.baseurl }}/svg-images/threads/thread-suspend.png) +![thread-sleep](/svg-images/threads/thread-suspend.png) - Output the following serial using `printk()` -![thread-sleep]({{ site.baseurl }}/images/threads/thread-suspend.png) +![thread-sleep](/images/threads/thread-suspend.png) solution: `exercises/threads/thread-suspend` @@ -90,10 +90,10 @@ solution: `exercises/threads/thread-suspend` - Implement the following -![thread-join]({{ site.baseurl }}/svg-images/threads/thread-join.png) +![thread-join](/svg-images/threads/thread-join.png) - Output the following serial using `printk()` -![thread-join]({{ site.baseurl }}/images/threads/thread-join.png) +![thread-join](/images/threads/thread-join.png) solution: `exercises/threads/thread-join` \ No newline at end of file diff --git a/docs/3-threads/introduction.md b/docs/3-threads/introduction.md index 2a9c0cf..7baaf3b 100644 --- a/docs/3-threads/introduction.md +++ b/docs/3-threads/introduction.md @@ -11,15 +11,15 @@ A thread is an isolated instance that is responsible for the execution of some t Some key concepts: - **Stack area**: a region of memory used for the thread's stack. The size can be adjusted as required by the thread's processing. -![thread-stack-size]({{ site.baseurl }}/images/threads/thread-stack-size.png) +![thread-stack-size](/images/threads/thread-stack-size.png) - **Thread control block**: for internal bookkeeping of the thread's metadata. An instance of the type `k_thread`. -![thread-control-block]({{ site.baseurl }}/images/threads/thread-control-block.png) +![thread-control-block](/images/threads/thread-control-block.png) - **Entry point function**: invoked when the thread is started. Up to 3 argument values can be passed to this function. -![thread-entry-point]({{ site.baseurl }}/images/threads/thread-entry-point.png) +![thread-entry-point](/images/threads/thread-entry-point.png) _ARG_UNUSED is needed to indicate that the 3 arguments are not used in our thread function._ @@ -41,4 +41,4 @@ Following factors can make a thread unready: The following diagram shows all the possible states a thread can find itself: -![thread_states]({{ site.baseurl }}/images/threads/thread-states.png) \ No newline at end of file +![thread_states](/images/threads/thread-states.png) \ No newline at end of file diff --git a/docs/4-gpio/introduction.md b/docs/4-gpio/introduction.md index 91804cc..bae8b72 100644 --- a/docs/4-gpio/introduction.md +++ b/docs/4-gpio/introduction.md @@ -20,7 +20,7 @@ When setting up any GPIO the following basic steps have to be followed: The devicetree for your particular build can be found at `build/zephyr/zephyr.dts` or for each board in `zephyrproject/zephyr/boards` For example, the red arrow indicates the device binding to toggle the green led. -![devicetree-binding]({{ site.baseurl }}/images/gpio/devicetree-binding.png) +![devicetree-binding](/images/gpio/devicetree-binding.png) 2) To use the device binding in our main.c file; we need to use the following defines: diff --git a/docs/5-scheduling/exercise.md b/docs/5-scheduling/exercise.md index 682b71d..059a823 100644 --- a/docs/5-scheduling/exercise.md +++ b/docs/5-scheduling/exercise.md @@ -12,7 +12,7 @@ Implement cooperative time slicing that puts out the following serial output (us *figure showing that thread_1, even though lower priority, doesn't yield to thread_2 (until finished)* -![serial-coop-time-slicing]({{ site.baseurl }}/images/scheduling/serial-coop-time-slicing.png) +![serial-coop-time-slicing](/images/scheduling/serial-coop-time-slicing.png) ## Preemptive Time Slicing @@ -21,7 +21,7 @@ Implement Preemptive time slicing that puts out the serial (using `printk()`) *figure showing the increase in thread priority and preemption and completion of each thread* -![serial-preemptive-time-slicing]({{ site.baseurl }}/images/scheduling/serial-preemptive-time-slicing.png) +![serial-preemptive-time-slicing](/images/scheduling/serial-preemptive-time-slicing.png) ## Time Slicing (with 3 threads) @@ -29,4 +29,4 @@ Implement time slicing with three threads (of equal priority) *figure showing the equal priority threads preempting each other* -![serial-time-slicing]({{ site.baseurl }}/images/scheduling/serial-time-slicing.png) +![serial-time-slicing](/images/scheduling/serial-time-slicing.png) diff --git a/docs/5-scheduling/introduction.md b/docs/5-scheduling/introduction.md index 38ae98f..044dc3e 100644 --- a/docs/5-scheduling/introduction.md +++ b/docs/5-scheduling/introduction.md @@ -77,7 +77,7 @@ The kernel supports a virtually unlimited number of thread priority levels. The Once a cooperative thread becomes the current thread, it remains the current thread until it performs an action that makes it unready. Consequently, if a cooperative thread performs lengthy computations, it may cause an unacceptable delay in the scheduling of other threads, including those of higher priority. -![cooperative]({{ site.baseurl }}/images/scheduling/cooperative.png) +![cooperative](/images/scheduling/cooperative.png) To overcome such problems, a cooperative thread can voluntarily relinquish the CPU from time to time to permit other threads to execute. A thread can relinquish the CPU in two ways: - Calling k_yield() puts the thread at the back of the scheduler's prioritized list of ready threads, and then invokes the scheduler. All ready threads whose priority is higher or equal to that of the yielding thread are then allowed to execute before the yielding thread is rescheduled. If no such threads exist, the scheduler immediately reschedules the yielding thread without context switching. @@ -87,11 +87,11 @@ To overcome such problems, a cooperative thread can voluntarily relinquish the C Once a preemptive thread becomes the current thread, it remains the current thread until a higher priority thread becomes ready, or until the thread performs an action that makes it unready. Consequently, if a preemptive thread performs lengthy computations, it may cause an unacceptable delay in the scheduling of other threads, including those of equal priority. -![preemptive]({{ site.baseurl }}/images/scheduling/preemptive.png) +![preemptive](/images/scheduling/preemptive.png) To overcome such problems, a preemptive thread can perform cooperative time slicing (as described above), or the scheduler's time slicing capability can be used to allow other threads of the same priority to execute. -![timeslicing]({{ site.baseurl }}/images/scheduling/timeslicing.png) +![timeslicing](/images/scheduling/timeslicing.png) The scheduler divides time into a series of time slices, where slices are measured in system clock ticks. The time slice size is configurable, but this size can be changed while the application is running. diff --git a/docs/7-debugging/exercise.md b/docs/7-debugging/exercise.md index b5d1289..f6dd047 100644 --- a/docs/7-debugging/exercise.md +++ b/docs/7-debugging/exercise.md @@ -40,11 +40,11 @@ The svd file can be found on the [STM](https://www.st.com/en/microcontrollers-mi *The first screen should look like this:* -![debug-starting]({{ site.baseurl }}/images/debugging/debug-starting.png) +![debug-starting](/images/debugging/debug-starting.png) *If you put an interrupt in the first interrupt, the execution will again be stopped at this point* -![debug-breakpoint]({{ site.baseurl }}/images/debugging/debug-breakpoint-1.png) +![debug-breakpoint](/images/debugging/debug-breakpoint-1.png) Notice the "Cortex Peripherals" and "Cortex Registers" on the left-hand side. @@ -61,7 +61,7 @@ west flash 3) Observe the output in the serial monitor: -![runtime-statistics]({{ site.baseurl }}/images/debugging/runtime-statistics.png) +![runtime-statistics](/images/debugging/runtime-statistics.png) ## Exercise 3: Core dump diff --git a/docs/7-debugging/introduction.md b/docs/7-debugging/introduction.md index 13e011a..baef59c 100644 --- a/docs/7-debugging/introduction.md +++ b/docs/7-debugging/introduction.md @@ -22,7 +22,7 @@ To enable thread-aware debugging you'll need to add the line shown below to `zep $_TARGETNAME configure -rtos Zephyr ``` -![openocd-threads-support]({{ site.baseurl }}/images/debugging/openocd-threads-support.png) +![openocd-threads-support](/images/debugging/openocd-threads-support.png) A debug probe is special hardware which allows you to control execution of a Zephyr application running on a separate board. Debug probes usually allow reading and writing registers and memory, and support breakpoint debugging of the Zephyr application on your host workstation using tools like GDB. diff --git a/docs/8-interrupts/exercise.md b/docs/8-interrupts/exercise.md index 47e4289..521c82f 100644 --- a/docs/8-interrupts/exercise.md +++ b/docs/8-interrupts/exercise.md @@ -21,8 +21,8 @@ on button press: print out "isr message" User button and LED aliases can be found in the devicetree file `build/zephyr/zephyr.dts`. -![button-interrupt-alias]({{ site.baseurl }}/images/interrupts/button-interrupt-alias.png) +![button-interrupt-alias](/images/interrupts/button-interrupt-alias.png) Expected output: -![button-interrupt-output]({{ site.baseurl }}/images/interrupts/button-interrupt-output.png) \ No newline at end of file +![button-interrupt-output](/images/interrupts/button-interrupt-output.png) \ No newline at end of file From 4e46605a9572cf751405676a5ab1748438cb23e8 Mon Sep 17 00:00:00 2001 From: maarten1C96 <12756980+maarten1C96@users.noreply.github.com> Date: Sun, 7 Apr 2024 14:16:17 +0200 Subject: [PATCH 12/13] chore(incomplete.md): copy incomplete.md to docs directory as simple solution to solve Jekyll error Because of the following error raised: "/usr/local/bundle/gems/jekyll-3.9.5/lib/jekyll/tags/include.rb:121:in `locate_include_file': Could not locate the included file 'incomplete.md' in any of ["/github/workspace/docs/_includes", "/usr/local/bundle/gems/jekyll-theme-primer-0.6.0/_includes"]. Ensure it exists in one of those directories and is not a symlink as those are not allowed in safe mode. (IOError)" --- docs/_includes/incomplete.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 docs/_includes/incomplete.md diff --git a/docs/_includes/incomplete.md b/docs/_includes/incomplete.md new file mode 100644 index 0000000..5dfc488 --- /dev/null +++ b/docs/_includes/incomplete.md @@ -0,0 +1,2 @@ +{: .warning} +This section is incomplete. You can help by [contributing](https://github.com/maksimdrachov/zephyr-rtos-tutorial). \ No newline at end of file From 675ff2202073a3315464e1f014a70c052a436a23 Mon Sep 17 00:00:00 2001 From: maarten1C96 <12756980+maarten1C96@users.noreply.github.com> Date: Sun, 7 Apr 2024 14:35:13 +0200 Subject: [PATCH 13/13] chore(_config.yml): comment out baseurl specification in Jekyll config file --- _config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_config.yml b/_config.yml index 96dd104..470b808 100644 --- a/_config.yml +++ b/_config.yml @@ -1,7 +1,7 @@ title: Zephyr Tutorial remote_theme: bedroesb/just-the-docs -baseurl: "/zephyr-rtos-tutorial" +# baseurl: "/zephyr-rtos-tutorial" plugins: - jekyll-relative-links