mbed Blog RSS Feed

mbed fest 2013 WEST

mbed fest 2013 WEST was held on April 13th 2013 in Osaka. NXP fan (in Japan) has sent us this report of the event.

NXP fan (in Japan) wrote:

mbed-fest 2013 WEST was held in Osaka on 13-Apr-2013 (@ ROBOBA, Nipponbashi, Osaka). /media/uploads/nxpfan/_scaled_img_5992s.jpg

This was a first time user meeting was in west Japan area. Attended 30+ people enjoyed to share information about mbed.
This meeting was organised by eXodusino. Thank you very much!

Presentation sessions were done by 8 people they told about..

  • And we had special guest from Freescale semiconductor to introduce FRDM KL25Z.

/media/uploads/nxpfan/_scaled_dsc_9367.jpg /media/uploads/nxpfan/_scaled_dsc_9412.jpg

And in this mbed-fest, we had a hands-on session as usual for who never had experience on mbed.
And attendees got many presents in raffles time. We are so happy with goodies from mbed.org, ARM-Japan, Suga Koubou, @ytsuboi, @minicube and NXP.

/media/uploads/nxpfan/_scaled_bhtal4wceaaosra.jpg

/media/uploads/nxpfan/_scaled_dsc_9397.jpg /media/uploads/nxpfan/_scaled_dsc_9399.jpg /media/uploads/nxpfan/_scaled_dsc_9398.jpg /media/uploads/nxpfan/_scaled_dsc_9400.jpg /media/uploads/nxpfan/_scaled_dsc_9401.jpg

This was one of most exciting user meeting. We hope to hold user meeting in this area again!

The events page of the cookbook can be used to easily find events or add one that you're organising. If you are organising an mbed related event and would like to share information about it on the blog please contact us.

Prototype the Internet of Things (Free hardware up for grabs!)

Following our announcement that mbed.org now supports the Freescale FRDM KL25Z, I got a call from Jim Carver at Avnet, who was keen to tell me about their new Wi-Go module for the the FRDM KL25Z, which has been designed for prototyping "Internet of Things" applications.

/media/uploads/chris/wi-go_system.png

The module has a sensor for just about everything you might want to sense :

  • 3 Axis accelerometer for 3D acceleration (MMA8451Q)
  • Magnetometer for compass direction (MAG3110)
  • Altimeter based elevation (MPL3115A2)
  • Air Pressure (MPL3115A2)
  • Temperature (MPL3115A2)
  • Ambient Light Level (TEMT6200)
  • Serial flash memory (S25FL216K)
  • Wi-Fi Communications module (LBWA1ZZVK7)

It also includes an 800mAH LiPo battery, which is capable of powering the module for a substantial length of time, and can also be recharged from USB connector. This makes it great for prototyping untethered nodes for IoT Applications.

Jim has allocated 5 of these Wi-Go modules for mbed users who want to prototype something IoT. We'll send then free of charge, to the successful applicants, and in mbed tradition all we ask in return is a cookbook page with a published, documented library, and a hello world program.

There are 8 sensors which need cookbook page + library, and 5 boards to give away, so applicants must be willing to write more than one!

If you would like to apply, please email support@mbed.org with your mbed user name, and which of the components listed below you'd like to develop for.

Of course, if you just want to buy one straight away and get started on your own IoT projects, they are also available to sale here :

There's even prizes! ...

Programs exported from the mbed online compiler in MDK format are eligible to enter the Avnet Wi-Go Design Challenge - there are some great prizes up fro grabs, with the first prize being an 11" MacBook Air

Debugging from GDB using pyOCD!

We are pleased to release a python library which allows to drive the Debug Access Port of Cortex-M microcontrollers over CMSIS-DAP!

What can be achieved with pyOCD?

  • Debugging using GDB, as a gdbserver is integrated on the library
  • Writing python applications that can communicate with the CMSIS-DAP and coresight debug interface:
    • read/write memory
    • read/write core registers
    • set breakpoints
    • flash new binary
    • run/stop/step the execution
  • Act as a great reference to show how the CMSIS-DAP protocol works

Currently, the library works on Windows (using pyWinUSB as backend) and on Linux (using pyUSB as backend).

Quick overview

Use python to control your mbed platform

from pyOCD.board import MbedBoard

board = MbedBoard.chooseBoard()

target = board.target
flash = board.flash

target.resume()
target.halt()
print "pc: 0x%X" % target.readCoreRegister("pc")
    pc: 0xA64

target.step()
print "pc: 0x%X" % target.readCoreRegister("pc")
    pc: 0xA30

flash.flashBinary("binaries/l1_lpc1768.bin")

print "pc: 0x%X" % target.readCoreRegister("pc")
    pc: 0x10000000

target.reset()
target.halt()
print "pc: 0x%X" % target.readCoreRegister("pc")
    pc: 0xAAC

board.uninit()

Use GDB to debug your mbed projects

Before using GDB, a .elf file has to be generated with a GCC toolchain.

  • Python code to start a GDB server on port 3333

from pyOCD.gdbserver import GDBServer
from pyOCD.board import MbedBoard

board = MbedBoard.chooseBoard()

# start gdbserver on port 3333
gdb = GDBServer(board, 3333)
  • Debug the target from GDB:

arm-none-eabi-gdb l1_lpc1768.elf

<gdb> target remote localhost:3333
<gdb> load
<gdb> continue

Get Started

All the source code is available on our git repository under workspace_tools/debugger

You can quickly get started with pyOCD by reading the README. It provides all the information that you need to know concerning the dependencies, installation and how to use the library. There are even some sample programs to get started even quicker!

Conclusion

pyOCD provides a simple and efficient solution to debug mbed platforms over CMSIS-DAP.

We expect quite soon the support of all the mbed platforms in OpenOCD as well. There is even a fork of OpenOCD adding CMSIS-DAP support: cmsis-dap support in OpenOCD

Have fun with pyOCD!

Full debugging interface on mbed-enabled platforms!

800

We are pleased to announce we have added CMSIS-DAP support to the mbed HDK firmware for the following targets:

  • mbed NXP LPC1768
  • mbed NXP LPC11U24
  • FRDM-KL25Z

The new firmware upgrade, in addition to a drag n drop flash programming and a virtual serial port interface, provide a CMSIS-DAP interface in order to fully debug your platform for tools that support the CMSIS-DAP protocol.

This, combined with the exporting to toolchain features, means if and when you transition to a full debug toolchain as part of productisation, you don't need to change your hardware to:

  • set breakpoints to stop the program at some event or at a specified instruction to examine the current state
  • step by step execute a program to track the control flow
  • check variables values
  • inspect and modify memory contents

You can now upgrade your board very easily to support full CMSIS-DAP debug. Just select your board and follow the instructions:

Whilst the Online IDE doesn't support a debugger, here is an example of using this new feature with uVision MDK:

In this post, I would like to explain in more detail how CMSIS-DAP works.

What is CMSIS-DAP?

CMSIS-DAP provides a standardized way to access the Coresight Debug Access Port (DAP) of an ARM Cortex microcontroller via USB. CMSIS-DAP is generally implemented as an on-board interface chip, providing direct USB connection from a development board to a debugger running on a host computer on one side, and over JTAG (Joint Test Action Group) or SWD (Serial Wire Debug) to the target device to access the Coresight DAP on the other.

Why the need for CMSIS-DAP?

Before the CMSIS-DAP standard, a lot of USB wigglers implemented their own protocols. With this configuration, the host debugger has to be aware of these different protocols and has to implement all of them, which produces a lot of fragmentation and re-inventing the wheel. At the same time, the protocols were usually defined at the JTAG level, meaning they are slow. CMSIS-DAP provides a standardised interface for debuggers that is defined at the Coresight DAP level, allowing for a standard interface and fast driverless implementations.

How CMSIS-DAP can be integrated?

The CMSIS-DAP firmware has been implemented as part of the mbed HDK. In addition to the existing Mass Storage and the Virtual Serial port interfaces, a new HID endpoint is used to establish a CMSIS-DAP communication with a debugger. We chose to use a HID communication as HID drivers are built-in in all Operating Systems, there is no need for a specific driver to be installed on the host computer.

/media/uploads/samux/cmsis-dap-6.png

This means all mbed-enabled boards now have CMSIS-DAP built in (even ones already sold via a firmware upgrade), and if you implement the mbed HDK as part of your own development board or product, CMSIS-DAP will be freely available on that too!

Overview of the CMSIS-DAP standard

Packets are exchanged between the host debugger and the Interface Chip. Basically, the host sends a command and the debug unit sends the response of the command.

Different types of commands can be issued by the host:

  • General Commands: request information and control the debug unit. Also used to connect/disconnect the debug unit.
  • Common SWD/JTAG commands: used for instance to set the clock speed
  • SWD specific commands: configure the parameters for SWD mode
  • JTAG specific commands: configure the JTAG device chain
  • Transfer Commands: read/write CoreSight registers. These commands are independent of the transport (SWD or JTAG)

Example: Read memory over CMSIS-DAP

Let's say that a debugger needs to read the value at a specific location in memory. The following commands have to be sent by the host:

  • Transfer Command: write the CSW register (Control/Status Word Register). This will configure the transfer (32bits/16bits/8bits transfer)
  • Transfer Command: write the TAR register (Transfer Address Register) with the address of the memory location
  • Transfer Command: read the DRW register (Data Read/Write register) to read the value at the location specified earlier

Use CMSIS-DAP to debug your projects

To use it, you just need to update the firmware on your board (don't worry, it is easily upgraded and reverted) and connect with a CMSIS-DAP compliant toolchain. We've been using MDK as one of our test toolchains which has CMSIS-DAP support in it publicly from MDK uVision 4.60. To find out more about enabling your board with CMSIS-DAP, installing Keil MDK and debugging your first applications, please see the following page:

We'll be announcing more supported toolchains and scripts as they become available!

USBHost library now in Beta!

We are pleased to release a new library: USBHost!

/media/uploads/samux/_scaled_usb_host_app_board.jpg

About the USBHost library

A USBHost library has been developed in order to communicate with USB devices. Currently, the library supports:

  • USB mice
  • USB keyboards
  • Mass storage devices
  • Virtual serial port devices

In addition to the drivers already implemented, the USBHost stack provides some cool features of USB such as:

  • Hub auto-detection
    • You can use exactly the same code if you are using a hub to connect a usb device to an mbed
  • Plug n Play support
    • You can detect when a device is attached and detached to and from the usb bus

Where to get started?

Hardware details and helloWorld examples are provided in order to get started quickly with the USBHost library:

Community contribution

It would be great if the USBHost stack development involves several developers. There is plenty of work to be done such as:

  • core modification by adding support of isochronous transfer
  • develop drivers on top of the USBHost stack:
    • Bluetooth class
    • Webcam class
    • ...

Any contribution from the mbed community would be greatly appreciated!

Have fun with USBHost!