Skip to content

InstallationAndBuilding

Yutaka Matsubara edited this page Jul 16, 2016 · 1 revision

Setting for development environment

Get ARM tool chain

Please visit to http://gnuarmeclipse.github.io/toolchain/install/ and install ARM Tool chain.

Get kernel source code

Type the following command in your terminal, or download the zip file and unzip it.

Get the kernel configurator for TOPPERS kernel

$ cd asp-gr_peach_gcc-mbed/asp-1.9.2-utf8/cfg/cfg

For MacOS X

$ tar zxvf cfg-osx-static-1_9_5.tar.gz

For Linux

$ tar zxvf cfg-linux-static-1_9_5.gz

Source code

You can get the source code of the kernel configurator at http://toppers.jp/cfg-download.html. Please read TOPPERS License (http://toppers.jp/en/license.html) before re-distribution of your modified source code.

Building example programs

$ cd asp-gr_peach_gcc-mbed/examples/blinky

$ make depend; make

When compile is completed, a binary file (asp.bin) will be generated.

For MacOS, copy the .bin file to your GR-PEACH by the following command.

$ cp -X asp.bin /Volumes/MBED

If you use another OS, change the destination in the above command.

httpsample (example for http server)

$ cd asp-gr_peach_gcc-mbed/examples/blinky

$ make depend; make

Connect your GR-PEACH and your PC by using an Ethernet cable. You can find the IP address assigned to your GR-PEACH in the serial output. Please check the serial output, then access the IP address (e.x. http://192.168.2.30/web_top.htm) by your web browser.

Multiple loops program for Arduino programming style.

To run this program, type the following commands.

$ cd asp-gr_peach_gcc-mbed/examples/multitask_arduino

$ make depend; make

As you know, Arduino provides simple setup-loop programming style. The setup() is called at once when the program starts. After the function, loop() is called. In this example, multiple loop functions can be defined such like loop1(), loop2(), …​ , and loop5() in addition to loop(). You should specify the number of additional loop you use by 'ADDITIONAL_LOOP_NUM' macro defined in arduino_app.h. For example, '#define LOOP_NUM 2' means that you need to define loop1() and loop2() in the cpp file. Note that you don’t need to add CRE_TSK, which is static API to create a task, in multitask_arduino.cfg because they are defined in ./mbed-lib/arduino-lib/core/arduino_main.cfg.

In default, every loop functions including loop() have the same priority (LOOP_PRI = 5). If you expect that every loop functions run concurrently, use a cyclic handler and irot_rdq() service call as used in this sample.

For more detail specification, refer the specification of TOPPERS/ASP kernel.

Display serial output from GR-PEACH.

At first, you need to check device name of the serial port by 'ls /dev/tty.usbmodem'. If the name is tty.usbmodem1412, you can see serial output by the following command.

$ screen /dev/tty.usbmodem1412 115200

To exit the screen, type Ctrl A+K.