2019/08/15

Zephyr (3)

別のディレクトリにhello_worldをコピーしてやってみよう。

$ cp -r ~/zephyrproject/zephyr/samples/hello_world ~/prog/zephyr/
$ source ~/zephyrproject/zephyr/zephyr-env.sh
$ cd ~/prog/zephyr
$ mv hello_world hello_zephyr
(hello_zephyr/src/main.cを編集)

$ west build -b qemu_x86 hello_zephyr
$ west build -t run

-- west build: build configuration:
       source directory: /home/xxxx/prog/zephyr/hello_zephyr
       build directory: /mnt/c/Prog/zephyr/build
       BOARD: qemu_x86 (origin: CMakeCache.txt)
-- west build: running target run
[0/1] To exit from QEMU enter: 'CTRL+a, x'[QEMU] CPU: qemu32,+nx,+pae
Optimal CONFIG_X86_MMU_PAGE_POOL_PAGES 9
***** Booting Zephyr OS build v2.0.0-rc1-10-g10ffef93e639 *****
Hello Zephyr! qemu_x86

 

なお、ZEPHYR_TOOLCHAIN_VARIANTとかPATHの設定は済ませているものとする。
環境変数BOARDにqemu_x86を設定しておくと、もう少し楽になる。


では、qemuのArm版をインストールして動かしてみよう。

sudo apt install qemu-system-arm

~/.zepherrcも編集

01: #BOARD=reel_board
02: BOARD=qemu_cortex_m3
03: export ZEPHYR_TOOLCHAIN_VARIANT=gnuarmemb
04: export GNUARMEMB_TOOLCHAIN_PATH=/home/xxxx/gcc-arm-none-eabi-8-2019-q3-update
  

 

$ west build hello_zephyr --pristine
$ west build -t run

[0/1] To exit from QEMU enter: 'CTRL+a, x'[QEMU] CPU: cortex-m3
qemu-system-arm: warning: nic stellaris_enet.0 has no peer
***** Booting Zephyr OS build v2.0.0-rc1-10-g10ffef93e639 *****
Hello Zephyr! qemu_cortex_m3

動いたんだと思う。

0 件のコメント:

コメントを投稿

コメントありがとうございます。
スパムかもしれない、と私が思ったら、
申し訳ないですが勝手に削除することもあります。

注: コメントを投稿できるのは、このブログのメンバーだけです。