Skip to content

Board: Phytec phyWAVE KW22

SergeantBlubb edited this page Mar 31, 2015 · 37 revisions

Manufacturer

Designed and produced by PHYTEC Messtechnik GmbH, D-55129 Mainz.

Components

MCU MKW22D512 CM4, 32-bit, 64kB RAM
Light (CLS15-22C/L213x/TR8)
Pressure (MPL3115A2)
Tri-axis accelerometer (MMA8652FC)
Tri-axis magnetometer (MAG3110FCR1)
IR-Termopile Sensor (TMP006)
Humidity Sensor (HDC1000)
RGB-LED
Capacitive Button
1x User-Button
Integrated IEEE802.15.4(2006)-compliant radio at 2.4 GHz, 250kBit/s Support for dual PAN ID mode

Layout / Hardware

phyWAVE-A-Eval-Board with equipped phyWAVE-KW22 processor/radio-module.

Phytec PBA-D-01 PhyWave

Details

The PCB-pieces with the mounted sensors can be separated from the eval-board to capture sensor-values from specific spatial points.

Implementation Status

Device ID Supported Comments
MCU MKW22D512 yes mainline
Low-level driver GPIO yes PR
PWM yes PR
UART yes PR
I2C yes PR
SPI yes PR
USB no
RTT yes PR
RNG yes PR
Timer yes PR
Radio Chip integrated partly, waiting for ng_netdev PR
Humidity Sensor HDC1000 yes mainline
Pressure Sensor MPL3115A2 yes mainline
Accelerometer MMA8652FC yes mainline
Magnetometer MAG3110FCR1 yes mainline
Light Sensor CLS15-22C/L213x/TR8 yes WIP
IR-Termopile Sensor TMP006 yes mainline
Capacitive Button PCB no planned

Toolchains

See ARM Family

Working:

Debugging

In order to program (flash) and debug the node you need OpenOCD and an ARM version of gdb (arm-none-eabi-gdb), which provided by most toolchains. Most Linux distributions provide also a package for OpenOCD. The required configuration files are provided by RIOT. Since version 0.9 of OpenOCD the target microcontroller MKW22D512 is supported. The following section describes how to install OpenOCD and set up a gdb-debugging session.

Setup the Environment

The debugging setting consists of openocd and GDB. Additionally one can use CGDB frontend for GDB or you can use Nemiver for a more fancy looking.

  • Various libraries:
    Command for installing them in Ubuntu 14.04:
    sudo apt-get install libudev-dev libusb-1.0-0-dev libfox-1.6-dev autotools-dev autoconf automake libtool gdb-arm-none-eabi gcc-arm-none-eabi cgdb libhidapi-hidraw0 libusb-dev libhidapi-dev libhidapi-hidraw0-dbg
    Command for installing them in Fedora 21 /CentOS 7:
    sudo yum install libudev-devel libusb-devel fox autoconf automake libtool cgdb hidapi-devel libftdi-devel systemd-devel arm-none-eabi-gdb arm-none-eabi-gcc
    For building openOCD it is possible that you need also (Fedora 21 / CentOS 7):
    sudo yum install mpfr-devel flex gmp-devel libmpc-devel texinfo bison ncurses-libs ncurses-devel expat expat-devel make gcc gcc-c++ Install openocd with the following steps (it is possible that you must use 'sudo', it depends on your rights for the installed Development-Tools):
clone git://git.code.sf.net/p/openocd/code
./bootstrap
./configure --enable-cmsis-dap
make
sudo make install

Add hidraw permissions:

  • Open /etc/udev/rules.d/99-hidraw-permissions.rules and append:
`KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0664", GROUP="plugdev"
ls -l /dev/hidraw*`

Debug Steps

  • Build RIOT for the phyWAVE (pba-d-01) board
    Navigate to the appropriate application inside the RIOT folder structure you want to build. Build, debug or flash with:
BOARD=pba-d-01 make
BOARD=pba-d-01 make flash
BOARD=pba-d-01 make debug
BOARD=pba-d-01 make reset
BOARD=pba-d-01 make term (to start the terminal connection to the board)

Important hints

Missleading openocd terminal print

When perform "BOARD=pba-d-01 make flash" and the target is getting flashed, openocd prints the following message:

flash configuration field erased, please reset the device

Do not reset the device, the terminal print is missleading!!!
If one is disconnecting the target, or shutting down openocd during flash the target will be locked!!

Check for fitting .elf file

To prevent the risk of device locking, there is a automatic test that validates if the .elf-file was built with a fitting board-configuration. This automatic test is executed when perform "make debug" or "make flash".
The successful test is indicated before flash or debug with the following print:

Flash configuration tested... [OK]

If the test fails, the flash or debug process will abort.

Reflash the target in case of an empty or wrong image

If the target-flash is empty or there is a wrong config loaded to the flash, openocd won't work in the described way above. One can fix this following:

  • push and hold reset and start openocd in the RIOT-application build-directory.
openocd -f ../../boards/pba-d-01/dist/mkw22d512.cfg
telnet localhost 4444
reset halt
  • release reset
flash write_image erase examples/hello-world/bin/pba-d-01/hello-world.elf
Clone this wiki locally