Skip to content

Latest commit

 

History

History
91 lines (62 loc) · 2.6 KB

readme.md

File metadata and controls

91 lines (62 loc) · 2.6 KB

k22fawaitmin_xt

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.

Build & run

Build

To build the project, ensure that the active build configuration is DebugLLVM_NS, then build the project.

Prepare to run

To run the project:

  1. Check that the development board is connected to a breadboard as shown in the diagram.
  2. Ensure that an oscilloscope is connected to the breadboard as shown in the diagram.
  3. Ensure that the development board is connected to the PC's USB port.

Prepare to run/debug

  1. Select the project in the Project Explorer.
  2. Run > Debug Configurations...
  3. Select GDB PEMicro Interface Debugging.
  4. Press the New launch configuration button.
  5. Select the Main tab.
  6. Set C/C++ Application to DebugLLVM_NS/k22awaitmin_xt.elf
  7. Select the Debugger tab.
  8. Set Interface to OpenSDA Embedded Debug - USB Port
  9. If no device is selected, press Select Device.
  10. NXP > K2x > K22FN512M12
  11. Press Apply then Close.

Debug

  1. Press the Debug tool, or F11.
  2. If prompted, select the debug configuration /k22awaitmin_xt/DebugLLVM_NS/k22awaitmin_xt.elf.
  3. If prompted for a configuration, select gdbserver.

Project setup

The steps below were used to create the project.

Create project

  1. Kinetis Design Studio 3.2.0
  2. File > New > Processor Expert Project...
  3. Project name = k22awaitmin_xt
  4. Boards > Kinetis > FRDM-K22F
  5. Kinetis SDK = None; Processor Expert = True
  6. Target compiler = GNU C Compiler

Tool-chain

Follow the instructions in the main ProjectConfig.md to alter the tool chain to use LLVM/clang.

Components

Follow the instructions in the main ProjectConfig.md to change the CPU component clock speed and to add the Bit1 component.

Project development

Add the following files from Shared/Sources:

  • main_cpp.cpp
  • task_test.cpp
  • min_services.cpp

main.c

extern void main_cpp();
...
  main_cpp();

Size

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