This file is subject to the terms and conditions defined in file 'LICENSE.txt', which is part of this source code package.
The project contains the co_await version of a minimal K22F application. It is to be compared to the protothreads version to measure the overhead of task switching.
This version uses an external timer; it is otherwise the same as k22fawaitmin.
An oscilloscope is used to measure the time taken for a complete sequence.
To build the project, ensure that the active build configuration is DebugLLVM_NS
, then build the project.
To run the project:
- Check that the development board is connected to a breadboard as shown in the diagram.
- Ensure that an oscilloscope is connected to the breadboard as shown in the diagram.
- Ensure that the development board is connected to the PC's USB port.
- Select the project in the Project Explorer.
Run
>Debug Configurations...
- Select
GDB PEMicro Interface Debugging
. - Press the
New launch configuration
button. - Select the
Main
tab. - Set C/C++ Application to
DebugLLVM_NS/k22awaitmin_xt.elf
- Select the
Debugger
tab. - Set Interface to
OpenSDA Embedded Debug - USB Port
- If no device is selected, press
Select Device
. NXP
>K2x
>K22FN512M12
- Press
Apply
thenClose
.
- Press the Debug tool, or
F11
. - If prompted, select the debug configuration
/k22awaitmin_xt/DebugLLVM_NS/k22awaitmin_xt.elf
. - If prompted for a configuration, select
gdbserver
.
The steps below were used to create the project.
- Kinetis Design Studio 3.2.0
- File > New > Processor Expert Project...
- Project name =
k22awaitmin_xt
- Boards > Kinetis > FRDM-K22F
- Kinetis SDK = None; Processor Expert = True
- Target compiler = GNU C Compiler
Follow the instructions in the main ProjectConfig.md to alter the tool chain to use LLVM/clang.
Follow the instructions in the main ProjectConfig.md to change the CPU component clock speed and to add the Bit1 component.
Add the following files from Shared/Sources
:
- main_cpp.cpp
- task_test.cpp
- min_services.cpp
extern void main_cpp();
...
main_cpp();
Invoking: Cross ARM GNU Print Size
arm-none-eabi-size --format=berkeley "k22awaitmin_xt.elf"
text data bss dec hex filename
3920 144 1080 5144 1418 k22awaitmin_xt.elf
Finished building: k22awaitmin_xt.siz