This example implements the Dining Philosophers Problem sample application on the EFM32-SLSTK3401A board (ARM Cortex-M4F).
EFM32-SLSTK3401A board
The DPP example is located in the directory qpcpp/examples/arm-cm/dpp_efm32-slstk3401a and includes versions for cooperative QV kernel, the preemptive QK kernel, and the preemptive dual mode QXK RTOS kernel each provided for the ARM-KEIL, GNU-ARM, and IAR-ARM. The following annotated directory listing describes the contents of the example folder:
qpcpp/
+-examples/
| +-arm-cm/
| | +-dpp_efm32-slstk3401a/
| | | +-lint/
| | | | +-lin.bat
| | | | +-options.lnt
| | | +-qk/
| | | | +-arm/
| | | | | +-dpp-qk.uvprojx
| | | | +-gnu/
| | | | | +-Makefile
| | | | +-iar/
| | | | | +-dpp-qk.eww
| | | | +-bsp.cpp
| | | | +-main.cpp
| | | +-qv/
| | | | +-arm/
| | | | | +-dpp-qk.uvprojx
| | | | +-gnu/
| | | | | +-Makefile
| | | | +-iar/
| | | | | +-blinky-qk.eww
| | | | +-bsp.cpp
| | | | +-main.cpp
| | | +-qxk/
| | | | +-arm/
| | | | | +-dpp-qk.uvprojx
| | | | +-gnu/
| | | | | +-Makefile
| | | | +-iar/
| | | | | +-dpp-qk.eww
| | | | +-bsp.cpp
| | | | +-main.cpp
| | | | +-test.cpp
| | | +-qspyview/
| | | | +-dpp.tcl
| | | | +-qspyview.bat
Features Demonstrated
- cooperative QV kernel
- with ARM-KEIL toolchain
- with GNU-ARM toolchain
- with IAR-ARM toolchain
- preemptive run-to-completion QK kernel
- with ARM-KEIL toolchain
- with GNU-ARM toolchain
- with IAR-ARM toolchain
- preemptive dual-mode QXK kernel
- with ARM-KEIL toolchain
- with GNU-ARM toolchain
- with IAR-ARM toolchain
- QP/Spy software tracing (output)
- QP/Spy software tracing (input QS-RX)
- Unit Testing with QUTest
- Windows emulation with GUI (multithreaded)
- Windows emulation with GUI (single threaded, win32-qv)
Running the Example
Once programmed into the board, the example rapidly toggles the LED1 from the idle loop (LED1 glows) and toggles LED0 as the Philosophers change their state. Additionally, you can depress and hold the BTN0 button (left) to PAUSE the application (Table transitions into the "paused" state). Releasing the BTN0 button causes transition back to the "serving" state.
QP/Spy Software Tracing
The application also demonstrates QP/Spy software tracing output and input. To exercise this feature, you need to build and upload the Spy build configuration into the board.