Skip to content

fpiot/mbed-ats

Repository files navigation

ATS programing on mbed Build Status

Application Design

Hardware: mbed LPC1768

  • CPU: NXP LPC1768 (ARM Cortex-M3 32-bit)
  • Flash ROM: 512 KiB
  • RAM: 32 KiB

Also you could get compatible boards.

Setup environment

Install summon-arm-toolchain.

$ git clone https://github.com/vedderb/summon-arm-toolchain.git
$ apt-get install flex bison libgmp3-dev libmpfr-dev libncurses5-dev \
  libmpc-dev autoconf texinfo build-essential libftdi-dev zlib1g-dev \
  git zlib1g-dev python-yaml
$ cd summon-arm-toolchain/
$ ./summon-arm-toolchain
$ export PATH=$HOME/sat/bin:$PATH

Mac OS X

Install gmp package.

$ brew install gmp

Install GNU toolchain from ARM Cortex-M & Cortex-R processors https://launchpad.net/gcc-arm-embedded.

$ wget https://launchpad.net/gcc-arm-embedded/4.8/4.8-2014-q1-update/+download/gcc-arm-none-eabi-4_8-2014q1-20140314-mac.tar.bz2
$ tar xf gcc-arm-none-eabi-4_8-2014q1-20140314-mac.tar.bz2
$ cp -a gcc-arm-none-eabi-4_8-2014q1 /usr/local/gcc-arm-none-eabi
$ export PATH=$PATH:/usr/local/gcc-arm-none-eabi/bin
$ which arm-none-eabi-gcc
/usr/local/gcc-arm-none-eabi/bin/arm-none-eabi-gcc

Windows

T.B.D.

How to build

Install ATS2 http://www.ats-lang.org/.

$ sudo apt-get install libgmp-dev
$ wget http://downloads.sourceforge.net/project/ats2-lang/ats2-lang/ats2-postiats-0.0.8/ATS2-Postiats-0.0.8.tgz
$ tar xf ATS2-Postiats-0.0.8.tgz
$ cd ATS2-Postiats-0.0.8
$ ./configure
$ make
$ sudo make install
$ export PATSHOME=/usr/local/lib/ats2-postiats-0.0.8

Compile the ATS source code for mbed.

$ cd mbed-ats
$ make
$ file demos/blink_ats/blink_ats.elf
demos/blink_ats/blink_ats.elf: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, not stripped

Write to the flash

Upgrade firmware. Use rev 141212 or later firmware, to support CMSIS-DAP. (Detail: http://mbed.org/handbook/Firmware-LPC1768-LPC11U24)

Install pyOCD. (Detail: http://mbed.org/blog/entry/Debugging-from-GDB-using-pyOCD/)

$ sudo apt-get install python libusb-1.0-0-dev
$ git clone https://github.com/walac/pyusb.git
$ cd pyusb
$ sudo python setup.py install
$ git clone https://github.com/mbedmicro/pyOCD.git
$ cd pyOCD
$ sudo python setup.py install

In one terminal, start the connection to the board.

$ sudo python pyOCD/test/gdb_test.py

In another terminal, connect to the debugger and flash program.

$ cd mbed-ats/demos/blink_ats
$ make gdbwrite

How to debug using gdb

T.B.D.

=== Original README ===

======= mbed SDK

Build Status

The mbed Software Development Kit (SDK) is a C/C++ microcontroller software platform relied upon by tens of thousands of developers to build projects fast.

The SDK is licensed under the permissive Apache 2.0 licence, so you can use it in both commercial and personal projects with confidence.

The mbed SDK has been designed to provide enough hardware abstraction to be intuitive and concise, yet powerful enough to build complex projects. It is built on the low-level ARM CMSIS APIs, allowing you to code down to the metal if needed. In addition to RTOS, USB and Networking libraries, a cookbook of hundreds of reusable peripheral and module libraries have been built on top of the SDK by the mbed Developer Community.

Documentation

Supported Microcontrollers and Boards

View all on the mbed Platforms page.

NXP:

Freescale:

STMicroelectronics:

Nordic:

Renesas:

Silicon Labs:

Supported Toolchains and IDEs

API Documentation

Community

For discussing the development of the mbed SDK itself (Addition/support of microcontrollers/toolchains, build and test system, Hardware Abstraction Layer API, etc) please join our mbed-devel mailing list.

For every topic regarding the use of the mbed SDK, rather than its development, please post on the mbed.org forum, or the mbed.org Q&A.

For reporting issues in the mbed libraries please open a ticket on the issue tracker of the relevant mbed official library.