Mais conteúdo relacionado Mais de Hideki Takase (20) TOPPERS on GR-PEACH高速デモ&プロジェクトの紹介@OSC2017 Kyoto8. TOPPERSプロジェクトとは?
TOPPERS = Toyohashi OPen Platform for
Embedded and Real-time Systems
プロジェクトの活動内容
• ITRON仕様の技術開発成果を出発点としたプロジェクト
• 組込システム構築の基盤となる各種の高品質なオープンソース
ソフトウェアを開発するとともに,その利用技術を提供
組込システム分野において,Linuxのように広く使われる
オープンソースOSの構築を目指す!
プロジェクトの推進主体
• 産学官の団体と個人が参加する産学官民連携プロジェクト
• 2003年9月にNPO法人として組織化
• 以前は,名古屋大学(2002年度までは豊橋技術科学大学)高田研究室を
中心とする任意団体として活動
8
13. TOPPERS/R2CA (TOPPERS RTE/RTOS Compatible with Arduino)
•Arduinoハードウェア上でTOPPERS/ASPカーネルを実行
•組込みソフトウェア開発のエントリからのステップアップ用
さらに詳しく知りたい方は
https://dev.toppers.jp/trac_user/contrib/wiki/rtos_arduino
Qiitaにも多数の記事を公開しています
http://qiita.com/tags/R2CA
13
ArduinoでもTOPPERS!
18. 特徴
• mbed対応ボード用のライブラリ
• アプリケーションのソースコード互換性を維持
• ARM社のRTOSであるRTXを使用(デフォルト)
• 本環境では,RTXをTOPPRES/ASPに変更
主な機能
• HAL(Hardware Abstruction Layer) (mbed-src)
• EthernetInterface (EthernetInterface)
※LwIP[GPLv2]も含む
• FAT File System (FATFileSystem)
※FatFs[BSD-style License]を含む
• HTTP Server (HttpServer_snapshot)
• RPC(Remote Procedure Call) (mbed-rpc)
• I2C (i2c)
• Softwere PWM (SoftPRM)
18
使えるmbedライブラリ
リファレンス:https://developer.mbed.org/handbook/Homepage
19. 19
いろいろ選べる開発環境
種類 環境 主な対象 特徴
コマンドライン
GNU Compiler
+ OpenOCD
熟練者
従来の開発方法
ウェブコンパイラ
ルネサス
ウェブコンパイラ
入門者
中級者
○お手軽
○TOPPERSテンプレート
×デバッガなし
mbed コンパイラ 入門者
○お手軽
×デバッガなし
統合開発環境
Eclipse
中級者
熟練者
×設定が面倒(現状)
TrueSTUDIO
入門者
中級者
熟練者
○ビルド〜デバッグまで無償で
利用可能(WindowsとLinux)
×Macは来年以降
IDE for GR 入門者 ×TOPPERS未対応
その他 Blockly 入門者
○ブロックプログラミング可能
×ビルドは別環境を使用
23. 23
いろいろ試してみよう!
アプリを自作したい
• エクスプローラーの examples のどれかを
編集するか同レベルにコピペ&名前変更
• 階層構造はけっこう大事なのです
ビルドしたい
• build_target でビルド対象のアプリを指定する
• 右側メニューで「ビルド実行」
ボード上で実行したい
• GR-PEACHのPG側をmicroUSBで接続
• USBマスストレージとして認識されます
• [アプリ名].bin をMBEDにコピー
• RSTボタンを押す
• TeraTerm等でメッセージ出力も
見られます
最初のビルドはちょっと
時間掛かります,,,
ね?めっちゃ
簡単でしょ!??
24. 24
統合開発環境を使おう!
TrueSTUDIO for GR-PEACH
The debugger is now started. The IDE automatically switch from C/C++ Editing perspective to
Debug perspective. This is seen in the picture below.
Figure 17 Target is waiting for "Resume" button to be pressed
The debugger automatically stops at the temporary breakpoint configured in the startup script.
The user can click Execution Resume from this break point.
https://github.com/ncesnagoya/asp-gr_peach_gcc-mbed
A.I.Corporation による
サポート&マニュアル提供
IDE上でのプログラミング
&強力なデバッグ機能
ローカル環境で
開発できる
25. 25
統合開発環境を使おう!
詳細なマニュアル
• https://goo.gl/qgtm7h
開発環境の準備(マニュアルP.5)
• Atollic TrueSTUDIO v6.0.0以降をDL&インストール
• https://atollic.com/resources/download/
• git clone or download zip from:
• https://github.com/ncesnagoya/asp-gr_peach_gcc-mbed
• Open OCDをインストール
• https://github.com/gnu-mcu-eclipse/openocd/releases/tag/gae-0.10.0-20160110
• $ cp ${ASP_DIR}/examples/truestudio/renesas_rza1h_swd.cfg ¥
${OpenOCD_DIR}/scripts/target/
• TOPPERSコンフィギュレータをダウンロード&コピー
• http://toppers.jp/cfg-download.html
• $ cp ${CFG_DIR}/cfg.exe ${ASP_DIR}/asp-1.9.2-utf8/cfg/cfg/
• お好みのターミナルソフト(puTTY, TeraTerm等)を
インストール
• サンプルアプリをワークスペースに
インポート
ちょっと大変
そうかな,,,
でもこれだけで強力な
開発環境が手に入る!!
26. 26
せっかくならRTOSプログラミング!!
multitask_arduinoを使う
• arduino_app.h の ADDITIONAL_LOOP_NUM を増やす
• loopX() を記述する
• loop5() まで記述できます
• loopX に対応するタスクは10ms毎に周期的に切り替わります
TOPPERSの静的APIとサービスコールを使う
• app.cfg にタスクや周期ハンドラ生成の静的APIを記述する
• httpsample や sample1 が参考になると思います
• 詳しくは,users@toppers.jp か がじぇるねフォーラムで!
• https://japan.renesasrulz.com/gr_user_forum_japanese/f/toppers
いそ〇ー!
マルチタスクしようぜ!!
コノツバメハナニヲ
イッテイルンダ,,,
36. mruby on ev3rt/tecs
36
loop{
distance = $ultrasonic_sensor.distance
LCD.draw("distance = #{distance} ", 0, 6)
if distance < 15 then
$left_motor.stop
$right_motor.stop
else
$left_motor.power=30
$right_motor.power=30
end
}
rescue => e
LCD.error_puts e
end