最終更新:aodairoboconken 2011年05月23日(月) 11:48:16履歴
開発環境はnxtOSEKインストールを参考にインストール
Xcode、X11がインストールされていること
(省略)
Wineインストール
ここからWine.appをインストール、Wine.appとWineBottler.appをApplicationsフォルダへ

wineconsoleを使うので、PATHを通す
.profileに以下の通り記述
wineconsoleを使うので、PATHを通す
.profileに以下の通り記述
export PATH=/Applications/Wine.app/Contents/Resources/bin:$PATH
Driverインストール
NeXTTool (コマンドライン版)
NeXT Tools for Mac
GNU ARM Toolchainのインストール
macportsを利用してインストール
$ sudo port install arm-elf-gcc +interwork $ cd /opt/local/bin $ sudo ln -s arm-elf-gcc-4.5.0 arm-elf-gcc $ sudo ln -s arm-elf-g++-4.5 arm-elf-g++ $ arm-elf-gcc -v Using built-in specs. COLLECT_GCC=arm-elf-gcc COLLECT_LTO_WRAPPER=/opt/local/libexec/gcc/arm-elf/4.5.0/lto-wrapper Target: arm-elf Configured with: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_cross_arm-elf-gcc/work/gcc-4.5.0/configure --prefix=/opt/local --infodir=/opt/local/share/info --mandir=/opt/local/share/man --target=arm-elf --program-prefix=arm-elf- --program-suffix=-4.5 --without-included-gettext --enable-obsolete --with-newlib --disable-__cxa_atexit --enable-multilib --enable-biendian --disable-libgfortran --with-gxx-include-dir=/opt/local/arm-elf/include/c++/4.5.0/ --enable-languages=c,c++,objc --build=x86_64-apple-darwin10 --enable-interwork Thread model: single gcc version 4.5.0 (GCC)
nxtOSEKの設定
nxtOSEKとosek_os-1.1.lzh をダウンロードして、ホームディレクトリに展開
設定
nxtOSEK/ecrobot/tool_gcc.makを修正
[追加]NeXTToolコマンドライン版の設定
nxtOSEK/ecrobot/tool_gcc.makを修正
nxtOSEK/ecrobot/ecrobot.mak および ecrobot++.makを修正
#GNUARM_ROOT = /cygdrive/C/cygwin/GNUARM GNUARM_ROOT = /opt/local
[追加]NeXTToolコマンドライン版の設定
nxtOSEK/ecrobot/tool_gcc.makを修正
#GNUARM_ROOT = /cygdrive/C/cygwin/GNUARM GNUARM_ROOT = /opt/local #NEXTTOOL_ROOT = /cygdrive/C/cygwin/nexttool NEXTTOOL_ROOT = $(HOME)/nxtOSEK/nexttool #NEXTTOOL = NeXTTool.exe NEXTTOOL = nexttool
nxtOSEK/ecrobot/ecrobot.mak および ecrobot++.makを修正
#WINECONSOLE := wineconsole WINECONSOLE := /Applications/Wine.app/Contents/Resources/bin/wineconsole .PHONY: rxeflash rxeflash: @echo "echo Executing NeXTTool to upload $(RXEBIN_TARGET)..." >./rxeflash.sh # @echo "$(WINECONSOLE) $(NEXTTOOL_ROOT)/$(NEXTTOOL) /COM=usb -download=$(RXEBIN_TARGET)" >>./rxeflash.sh @echo "$(NEXTTOOL_ROOT)/$(NEXTTOOL) /COM=usb -download=$(RXEBIN_TARGET)" >>./rxeflash.sh # @echo "$(WINECONSOLE) $(NEXTTOOL_ROOT)/$(NEXTTOOL) /COM=usb -listfiles=$(RXEBIN_TARGET)" >>./rxeflash.sh @echo "$(NEXTTOOL_ROOT)/$(NEXTTOOL) /COM=usb -listfiles=$(RXEBIN_TARGET)" >>./rxeflash.sh @echo "echo NeXTTool is terminated." >>./rxeflash.sh
動作確認
$ cd nxtOSEK/samples_c/helloworld/ $ make clean all Removing kernel config files Removing objects Removing targets Removing map files Removing upload scripts Compiling ../../ecrobot/../toppers_osek/kernel/alarm.c to alarm.o Compiling ../../ecrobot/../toppers_osek/kernel/event.c to event.o Compiling ../../ecrobot/../toppers_osek/kernel/interrupt.c to interrupt.o Compiling ../../ecrobot/../toppers_osek/kernel/osctl.c to osctl.o Compiling ../../ecrobot/../toppers_osek/kernel/resource.c to resource.o Compiling ../../ecrobot/../toppers_osek/kernel/task.c to task.o Compiling ../../ecrobot/../toppers_osek/kernel/task_manage.c to task_manage.o Compiling ../../ecrobot/../toppers_osek/config/at91sam7s-gnu/cpu_config.c to cpu_config.o Compiling ../../ecrobot/../toppers_osek/config/at91sam7s-gnu/lego_nxt/sys_config.c to sys_config.o Generating OSEK kernel config files from ./helloworld.oil Wine cannot find the FreeType font library. To enable Wine to use TrueType fonts please install a version of FreeType greater than or equal to 2.0.5. http://www.freetype.org Wine cannot find the FreeType font library. To enable Wine to use TrueType fonts please install a version of FreeType greater than or equal to 2.0.5. http://www.freetype.org Wine cannot find the FreeType font library. To enable Wine to use TrueType fonts please install a version of FreeType greater than or equal to 2.0.5. http://www.freetype.org Wine cannot find the FreeType font library. To enable Wine to use TrueType fonts please install a version of FreeType greater than or equal to 2.0.5. http://www.freetype.org err:wineconsole:WCUSER_SetFont wrong font Wine cannot find the FreeType font library. To enable Wine to use TrueType fonts please install a version of FreeType greater than or equal to 2.0.5. http://www.freetype.org Compiling kernel_cfg.c to kernel_cfg.o Compiling ../../ecrobot/../ecrobot/c/syscalls.c to syscalls.o Compiling ../../ecrobot/../ecrobot/c/ecrobot_bluetooth.c to ecrobot_bluetooth.o Compiling ../../ecrobot/../ecrobot/c/ecrobot_base.c to ecrobot_base.o Compiling ../../ecrobot/../ecrobot/c/ecrobot.c to ecrobot.o Compiling helloworld.c to helloworld.o Compiling ../../ecrobot/../toppers_osek/syslib/at91sam7s-gnu/lego_nxt/hw_sys_timer.c to hw_sys_timer.oram Assembling ../../ecrobot/../lejos_nxj/src/nxtvm/platform/nxt/vectors.s to vectors.o Assembling ../../ecrobot/../toppers_osek/config/at91sam7s-gnu/debug.S to debug.o Assembling ../../ecrobot/../toppers_osek/config/at91sam7s-gnu/lego_nxt/sys_support.S to sys_support.o Assembling ../../ecrobot/../ecrobot/c/nxt_binary_header.s to nxt_binary_header.o Assembling ../../ecrobot/../ecrobot/c/nxt_entry_point.s to nxt_entry_point.o Assembling ../../ecrobot/../ecrobot/c/ecrobot_init.s to ecrobot_init.o Assembling ../../ecrobot/../toppers_osek/config/at91sam7s-gnu/cpu_support.S to cpu_support.oram Assembling ../../ecrobot/../toppers_osek/config/at91sam7s-gnu/irq.s to irq.oram Generating binary image file: helloworld_OSEK_rom.bin Generating binary image file: helloworld_OSEK_ram.bin Generating binary image file: helloworld_OSEK.rxeNeXT Tools for Macを起動し、NXT explorerを選択
Download selected files to the NXT を押し、helloworld_OSEK.rxeをOpen
NXT側でプログラム実行→動作確認
[追加]NeXTToolコマンドライン版を使ったスクリプトによるプログラムアップロード
$ sh ./rxeflash.sh Executing NeXTTool to upload helloworld_OSEK.rxe... helloworld_OSEK.rxe=17728 NeXTTool is terminated.
このページへのコメント
OSEKでなくJSPだったらMac側で全部できませんか?
Posted by Shin Kuboaki 2011年06月23日(木) 18:59:53