LoginSignup
1
2

More than 5 years have passed since last update.

petalinux / microzed > C. アプリケーションプログラムの作成

Last updated at Posted at 2015-11-08
動作確認
CentOS 6.5

以下の作業でプロジェクトのテンプレートを作成する
<project-root>は本例では ~/petaLinux/workspace/Avnet-MicroZed-z7010-v2014.2 に対応する

$ cd <project-root>
$ petalinux-create -t apps --template c --name myapp
ファイルが <project-root>/components/apps/myapp フォルダに作成される。

この中のmyapp.cにアプリケーションプログラムを作成する。

作成したアプリケーションを以下の手順でビルドする。

1 . 作成したアプリケーションをビルドに含めるようにする

$ petalinux-config -c rootfs

表示されるメニューにおいて Apps > myappを選択し、設定を保存してメニューを終了する。

2 . アプリケーションを含めてビルドをする

$ petalinux-build

アプリケーションだけを修正した場合は、以下の方法がビルド作業が早く済む

$ petalinux-build -c rootfs/myapp
$ petalinux-build -x package

3 . 以上で作成されたファイル (images/linux)をもとに、BOOT.binとimage.ubを作成してmicroSDにコピーして起動に使用する。

*** 留意点 *** アプリケーションがヘッダファイルをincludeしている場合、ヘッダファイルのみを変更しても上記のビルドにヘッダファイル変更が反映されないようだ。これを防ぐために、ソースファイルを更新する必要がある

4 . 作成したアプリの実行は以下の手順で行う。

$ cd /bin
$ ./myapp
1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2