eLua the light-weight language on STM32F4Discovery.

sorry. japanese only.
作り中
stm32f4disco connects a uSDcard via SPI2
↓の変更で想定しているSTM32F4-discoveryボードと周辺の接続図

eLuaをstm32f4discoveryで動作させた時のメモ

変更追加の概要

コンソールポートの変更 src/platform/stm32f4/platform_conf.h(43行近辺) console用ポートをUSART3(CON_UART_ID=2)へ変更 src/platform/stm32f4/platform.c(430行近辺) console用ポートをPD9(RX3)PD8(TX3)へアタッチするよう変更 MMC/SD FatFSの有効化 src/platform/stm32f4/platform_conf.h(19行近辺) #define BUILD_MMCFSを有効にする src/platform/stm32f4/platform_conf.h(145行近辺) SPI2を使用し,nCSはPD10を使用するように変更 nMDにPD11を使用するように追加 src/platform/stm32f4/platform.c(340行近辺) SPI2用ポートのうちSCLK2をPB13からPB10へアタッチ先の変更 src/elua_mmc.c nMD(MediaDetect) スイッチをチェックして内部状態をNOMEDIA状態へセットするように変更 低消費電力モードでSWDリンクが切れるのを防止する src/platform/stm32f4/platform.c(220行近辺) デバッグポートの設定をしている所にデバッグサポート用のレジスタ設定を追加 #if defined(ENABLE_JTAG_SWD) || defined(ENABLE_TRACE) 〜 #endif の間に以下の行を追加する。 DBGMCU->CR |= DBGMCU_CR_DBG_SLEEP | DBGMCU_CR_DBG_STOP; romfs/ディレクトリにluaスクリプトを放り込んでビルドすると。ROMFSに組み込んでくれる! ADC_ID=12でPC2からの入力として使用できる ed用にregexライブラリSLREを組み込む テキストエディタ GNU edを組み込んでみた To Do rm,mvコマンドの実装(間違ってファイルを作ると消すのが大変なんで...) text-LCD,Ethernet周りの実装 elua_stm32f4disco.tgz ソースアーカイブ ↓で作成した実行バイナリ(USART3(PD9/Rx3,PD8/Tx3)=115200N81,MMCSDcard w/SPI2で構成) elua_lua_stm32f407vg.hex elua_lua_stm32f407vg.bin elua_lua_stm32f407vg.elf OpenOCDやSTlinkユティリティなどを使ってフラッシュ(0x08000000-)に焼いて実行します。

eLuaのソースツリー取得からビルド&アップロードまでのログ

$ git clone git://github.com/jsnyder/elua.git Cloning into 'elua'... remote: Counting objects: 15298, done. remote: Compressing objects: 100% (3812/3812), done. remote: Total 15298 (delta 11746), reused 14943 (delta 11447) Receiving objects: 100% (15298/15298), 9.00 MiB | 127 KiB/s, done. Resolving deltas: 100% (11746/11746), done. $ cd elua $ git branch -a * master remotes/origin/HEAD -> origin/master remotes/origin/SiM3U1xx_altpins remotes/origin/SiM3U1xx_memdebug remotes/origin/SiM3U1xx_port remotes/origin/SiM3U1xx_sliptest remotes/origin/SiM3U1xx_usbcdc remotes/origin/bikeNomad-master remotes/origin/coco remotes/origin/dl remotes/origin/eagle_mmc remotes/origin/elua_with_own_libc remotes/origin/ints remotes/origin/lm3s_qei remotes/origin/lm3s_usb_cdc remotes/origin/lm3sgames remotes/origin/lpc24xx remotes/origin/luarpc remotes/origin/master remotes/origin/mux remotes/origin/omniext remotes/origin/onlinehelp remotes/origin/post0.8 remotes/origin/pre0.7 remotes/origin/pre0.8 remotes/origin/remotefs remotes/origin/remotefs_int remotes/origin/rpc-socket remotes/origin/tlsf_from_rtportal $ git checkout -b remotes/origin/bikeNomad-master Switched to a new branch 'remotes/origin/bikeNomad-master' $ git checkout bikeNomad-master Branch bikeNomad-master set up to track remote branch bikeNomad-master from origin. Switched to a new branch 'bikeNomad-master' $ git pull Already up-to-date. (ここでいろいろと修正する) $ scons board=STM32F4DSCY -c scons: Reading SConscript files ... Checking whether the C compiler works(cached) yes WARNING: unable to determine version from repository scons: done reading SConscript files. scons: Cleaning targets ... Removed src/main.o Removed src/romfs.o Removed src/semifs.o Removed src/xmodem.o Removed src/shell.o Removed src/term.o Removed src/common.o Removed src/common_tmr.o Removed src/buf.o Removed src/elua_adc.o Removed src/dlmalloc.o Removed src/salloc.o Removed src/luarpc_elua_uart.o Removed src/elua_int.o Removed src/linenoise.o Removed src/common_uart.o Removed src/eluarpc.o Removed src/elua_mmc.o Removed src/mmcfs.o Removed src/fatfs/ff.o Removed src/fatfs/ccsbcs.o Removed src/ed-1.7/buffer.o Removed src/ed-1.7/carg_parser.o Removed src/ed-1.7/global.o Removed src/ed-1.7/io.o Removed src/ed-1.7/main.o Removed src/ed-1.7/main_loop.o Removed src/ed-1.7/regex.o Removed src/ed-1.7/slre.o Removed src/platform/stm32f4/FWLib/library/src/misc.o Removed src/platform/stm32f4/FWLib/library/src/stm32f4xx_adc.o Removed src/platform/stm32f4/FWLib/library/src/stm32f4xx_can.o Removed src/platform/stm32f4/FWLib/library/src/stm32f4xx_crc.o Removed src/platform/stm32f4/FWLib/library/src/stm32f4xx_cryp.o Removed src/platform/stm32f4/FWLib/library/src/stm32f4xx_cryp_aes.o Removed src/platform/stm32f4/FWLib/library/src/stm32f4xx_cryp_des.o Removed src/platform/stm32f4/FWLib/library/src/stm32f4xx_cryp_tdes.o Removed src/platform/stm32f4/FWLib/library/src/stm32f4xx_dac.o Removed src/platform/stm32f4/FWLib/library/src/stm32f4xx_dbgmcu.o Removed src/platform/stm32f4/FWLib/library/src/stm32f4xx_dcmi.o Removed src/platform/stm32f4/FWLib/library/src/stm32f4xx_dma.o Removed src/platform/stm32f4/FWLib/library/src/stm32f4xx_exti.o Removed src/platform/stm32f4/FWLib/library/src/stm32f4xx_flash.o Removed src/platform/stm32f4/FWLib/library/src/stm32f4xx_fsmc.o Removed src/platform/stm32f4/FWLib/library/src/stm32f4xx_gpio.o Removed src/platform/stm32f4/FWLib/library/src/stm32f4xx_hash.o Removed src/platform/stm32f4/FWLib/library/src/stm32f4xx_hash_md5.o Removed src/platform/stm32f4/FWLib/library/src/stm32f4xx_hash_sha1.o Removed src/platform/stm32f4/FWLib/library/src/stm32f4xx_i2c.o Removed src/platform/stm32f4/FWLib/library/src/stm32f4xx_iwdg.o Removed src/platform/stm32f4/FWLib/library/src/stm32f4xx_pwr.o Removed src/platform/stm32f4/FWLib/library/src/stm32f4xx_rcc.o Removed src/platform/stm32f4/FWLib/library/src/stm32f4xx_rng.o Removed src/platform/stm32f4/FWLib/library/src/stm32f4xx_rtc.o Removed src/platform/stm32f4/FWLib/library/src/stm32f4xx_sdio.o Removed src/platform/stm32f4/FWLib/library/src/stm32f4xx_spi.o Removed src/platform/stm32f4/FWLib/library/src/stm32f4xx_syscfg.o Removed src/platform/stm32f4/FWLib/library/src/stm32f4xx_tim.o Removed src/platform/stm32f4/FWLib/library/src/stm32f4xx_usart.o Removed src/platform/stm32f4/FWLib/library/src/stm32f4xx_wwdg.o Removed src/platform/stm32f4/system_stm32f4xx.o Removed src/platform/stm32f4/startup_stm32f4xx.o Removed src/platform/stm32f4/stm32f4xx_it.o Removed src/platform/stm32f4/platform.o Removed src/platform/stm32f4/platform_int.o Removed src/platform/stm32f4/cpu.o Removed src/platform/cortex_utils.o Removed src/platform/arm_cortex_interrupts.o Removed src/newlib/devman.o Removed src/newlib/stubs.o Removed src/newlib/genstd.o Removed src/newlib/stdtcp.o Removed src/elua_uip.o Removed src/uip/uip_arp.o Removed src/uip/uip.o Removed src/uip/uiplib.o Removed src/uip/dhcpc.o Removed src/uip/psock.o Removed src/uip/resolv.o Removed src/uip/uip-neighbor.o Removed src/lua/lapi.o Removed src/lua/lcode.o Removed src/lua/ldebug.o Removed src/lua/ldo.o Removed src/lua/ldump.o Removed src/lua/lfunc.o Removed src/lua/lgc.o Removed src/lua/llex.o Removed src/lua/lmem.o Removed src/lua/lobject.o Removed src/lua/lopcodes.o Removed src/lua/lparser.o Removed src/lua/lstate.o Removed src/lua/lstring.o Removed src/lua/ltable.o Removed src/lua/ltm.o Removed src/lua/lundump.o Removed src/lua/lvm.o Removed src/lua/lzio.o Removed src/lua/lauxlib.o Removed src/lua/lbaselib.o Removed src/lua/ldblib.o Removed src/lua/liolib.o Removed src/lua/lmathlib.o Removed src/lua/loslib.o Removed src/lua/ltablib.o Removed src/lua/lstrlib.o Removed src/lua/loadlib.o Removed src/lua/linit.o Removed src/lua/lua.o Removed src/lua/lrotable.o Removed src/lua/legc.o Removed src/modules/pio.o Removed src/modules/spi.o Removed src/modules/tmr.o Removed src/modules/pd.o Removed src/modules/uart.o Removed src/modules/term.o Removed src/modules/pwm.o Removed src/modules/lpack.o Removed src/modules/bit.o Removed src/modules/net.o Removed src/modules/cpu.o Removed src/modules/adc.o Removed src/modules/can.o Removed src/modules/luarpc.o Removed src/modules/bitarray.o Removed src/modules/elua.o Removed src/modules/i2c.o Removed src/remotefs/remotefs.o Removed src/remotefs/client.o Removed src/remotefs/elua_os_io.o Removed src/remotefs/elua_rfs.o Removed elua_lua_stm32f407vg.elf scons: done cleaning targets. $ scons board=STM32F4DSCY prog scons: Reading SConscript files ... Checking whether the C compiler worksyes WARNING: unable to determine version from repository ********************************* Compiling eLua ... CPU: STM32F407VG Board: STM32F4DSCY Platform: stm32f4 Allocator: multiple Boot Mode: standard Target: lua Toolchain: codesourcery ROMFS mode: verbatim Version: unknown ********************************* Building ROM File System... Done, total size is 1 bytes scons: done reading SConscript files. scons: Building targets ... arm-none-eabi-gcc -o src/main.o -c -mcpu=cortex-m4 -mthumb -mlittle-endian -Os -fomit-frame-pointer -ffunction-sections -fdata-sections -fno-strict-aliasing -Wa ll -g -DELUA_BOARD=STM32F4DSCY -DELUA_PLATFORM=STM32F4 -D__BUFSIZ__=128 -DELUA_CPU=STM32F407VG -DELUA_CPU_STM32F407VG -DELUA_BOARD_STM32F4DSCY -DELUA_PLATFORM_S TM32F4 -DUSE_MULTIPLE_ALLOCATOR -DLUA_PACK_VALUE -DELUA_ENDIAN_LITTLE -DLUA_OPTIMIZE_MEMORY=2 -DFORSTM32F407VG -DFORSTM32F4DSCY -Dgcc -DUSE_STDPERIPH_DRIVER -DS TM32F4XX -DCORTEX_M4 -Iinc -Iinc/newlib -Iinc/remotefs -Isrc/platform -Isrc/lua -Isrc/modules -Isrc/platform/stm32f4 -Isrc/uip -Isrc/fatfs -Isrc/platform/stm32f 4/FWLib/library/inc src/main.c :(中略) arm-none-eabi-gcc -o src/remotefs/elua_rfs.o -c -mcpu=cortex-m4 -mthumb -mlittle-endian -Os -fomit-frame-pointer -ffunction-sections -fdata-sections -fno-strict -aliasing -Wall -g -DELUA_BOARD=STM32F4DSCY -DELUA_PLATFORM=STM32F4 -D__BUFSIZ__=128 -DELUA_CPU=STM32F407VG -DELUA_CPU_STM32F407VG -DELUA_BOARD_STM32F4DSCY -DEL UA_PLATFORM_STM32F4 -DUSE_MULTIPLE_ALLOCATOR -DLUA_PACK_VALUE -DELUA_ENDIAN_LITTLE -DLUA_OPTIMIZE_MEMORY=2 -DFORSTM32F407VG -DFORSTM32F4DSCY -Dgcc -DUSE_STDPERI PH_DRIVER -DSTM32F4XX -DCORTEX_M4 -Iinc -Iinc/newlib -Iinc/remotefs -Isrc/platform -Isrc/lua -Isrc/modules -Isrc/platform/stm32f4 -Isrc/uip -Isrc/fatfs -Isrc/pl atform/stm32f4/FWLib/library/inc src/remotefs/elua_rfs.c arm-none-eabi-gcc -o elua_lua_stm32f407vg.elf -mcpu=cortex-m4 -mthumb -Wl,-e,Reset_Handler -Wl,-static -nostartfiles -nostdlib -T src/platform/stm32f4/stm32.ld -Wl,--gc-sections -Wl,--allow-multiple-definition -Wl,-Map=elua_lua_stm32f407vg.map src/main.o src/romfs.o src/semifs.o src/xmodem.o src/shell.o src/term.o src/ common.o src/common_tmr.o src/buf.o src/elua_adc.o src/dlmalloc.o src/salloc.o src/luarpc_elua_uart.o src/elua_int.o src/linenoise.o src/common_uart.o src/eluar pc.o src/elua_mmc.o src/mmcfs.o src/fatfs/ff.o src/fatfs/ccsbcs.o src/platform/stm32f4/FWLib/library/src/misc.o src/platform/stm32f4/FWLib/library/src/stm32f4xx _adc.o src/platform/stm32f4/FWLib/library/src/stm32f4xx_can.o src/platform/stm32f4/FWLib/library/src/stm32f4xx_crc.o src/platform/stm32f4/FWLib/library/src/stm3 2f4xx_cryp.o src/platform/stm32f4/FWLib/library/src/stm32f4xx_cryp_aes.o src/platform/stm32f4/FWLib/library/src/stm32f4xx_cryp_des.o src/platform/stm32f4/FWLib/ library/src/stm32f4xx_cryp_tdes.o src/platform/stm32f4/FWLib/library/src/stm32f4xx_dac.o src/platform/stm32f4/FWLib/library/src/stm32f4xx_dbgmcu.o src/platform/ stm32f4/FWLib/library/src/stm32f4xx_dcmi.o src/platform/stm32f4/FWLib/library/src/stm32f4xx_dma.o src/platform/stm32f4/FWLib/library/src/stm32f4xx_exti.o src/pl atform/stm32f4/FWLib/library/src/stm32f4xx_flash.o src/platform/stm32f4/FWLib/library/src/stm32f4xx_fsmc.o src/platform/stm32f4/FWLib/library/src/stm32f4xx_gpio .o src/platform/stm32f4/FWLib/library/src/stm32f4xx_hash.o src/platform/stm32f4/FWLib/library/src/stm32f4xx_hash_md5.o src/platform/stm32f4/FWLib/library/src/st m32f4xx_hash_sha1.o src/platform/stm32f4/FWLib/library/src/stm32f4xx_i2c.o src/platform/stm32f4/FWLib/library/src/stm32f4xx_iwdg.o src/platform/stm32f4/FWLib/li brary/src/stm32f4xx_pwr.o src/platform/stm32f4/FWLib/library/src/stm32f4xx_rcc.o src/platform/stm32f4/FWLib/library/src/stm32f4xx_rng.o src/platform/stm32f4/FWL ib/library/src/stm32f4xx_rtc.o src/platform/stm32f4/FWLib/library/src/stm32f4xx_sdio.o src/platform/stm32f4/FWLib/library/src/stm32f4xx_spi.o src/platform/stm32 f4/FWLib/library/src/stm32f4xx_syscfg.o src/platform/stm32f4/FWLib/library/src/stm32f4xx_tim.o src/platform/stm32f4/FWLib/library/src/stm32f4xx_usart.o src/plat form/stm32f4/FWLib/library/src/stm32f4xx_wwdg.o src/platform/stm32f4/system_stm32f4xx.o src/platform/stm32f4/startup_stm32f4xx.o src/platform/stm32f4/stm32f4xx_ it.o src/platform/stm32f4/platform.o src/platform/stm32f4/platform_int.o src/platform/stm32f4/cpu.o src/platform/cortex_utils.o src/platform/arm_cortex_interrup ts.o src/newlib/devman.o src/newlib/stubs.o src/newlib/genstd.o src/newlib/stdtcp.o src/elua_uip.o src/uip/uip_arp.o src/uip/uip.o src/uip/uiplib.o src/uip/dhcp c.o src/uip/psock.o src/uip/resolv.o src/uip/uip-neighbor.o src/lua/lapi.o src/lua/lcode.o src/lua/ldebug.o src/lua/ldo.o src/lua/ldump.o src/lua/lfunc.o src/lu a/lgc.o src/lua/llex.o src/lua/lmem.o src/lua/lobject.o src/lua/lopcodes.o src/lua/lparser.o src/lua/lstate.o src/lua/lstring.o src/lua/ltable.o src/lua/ltm.o s rc/lua/lundump.o src/lua/lvm.o src/lua/lzio.o src/lua/lauxlib.o src/lua/lbaselib.o src/lua/ldblib.o src/lua/liolib.o src/lua/lmathlib.o src/lua/loslib.o src/lua /ltablib.o src/lua/lstrlib.o src/lua/loadlib.o src/lua/linit.o src/lua/lua.o src/lua/lrotable.o src/lua/legc.o src/modules/pio.o src/modules/spi.o src/modules/t mr.o src/modules/pd.o src/modules/uart.o src/modules/term.o src/modules/pwm.o src/modules/lpack.o src/modules/bit.o src/modules/net.o src/modules/cpu.o src/modu les/adc.o src/modules/can.o src/modules/luarpc.o src/modules/bitarray.o src/modules/elua.o src/modules/i2c.o src/remotefs/remotefs.o src/remotefs/client.o src/r emotefs/elua_os_io.o src/remotefs/elua_rfs.o -lc -lgcc -lm progfunc_stm32(["prog"], ["elua_lua_stm32f407vg.elf"]) text data bss dec hex filename 259872 524 4148 264544 40960 elua_lua_stm32f407vg.elf Generating binary image... scons: done building targets. $ arm-none-eabi-gdb elua_lua_stm32f407vg.elf -ex 'target remote localhost:3333' -ex 'monitor reset init' -ex 'load' -ex 'disconnect' -ex 'quit' GNU gdb (Sourcery CodeBench Lite 2011.09-69) 7.2.50.20100908-cvs Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "--host=i686-mingw32 --target=arm-none-eabi". For bug reporting instructions, please see: ... Reading symbols from d:\cygwin\tmp\stm32\elua\elua_lua_stm32f407vg.elf...done. Remote debugging using localhost:3333 0x0800c0f0 in Reset_Handler () target state: halted target halted due to debug-request, current mode: Thread xPSR: 0x01000000 pc: 0x0800c0f0 msp: 0x20020000 Loading section .text, size 0x3f718 lma 0x8000000 Loading section .data, size 0x20c lma 0x803f718 Loading section .ARM.exidx, size 0x8 lma 0x803f924 Start address 0x800c0f0, load size 260396 Transfer rate: 23 KB/sec, 11836 bytes/write. Ending remote debugging. $ 実行時のコンソールログ eLua v0.8 Copyright (C) 2007-2011 www.eluaproject.net eLua# ? Invalid command, type 'help' for help eLua# help Shell commands: exit - exit from this shell help - print this help ls or dir - lists filesystems files and sizes cat or type - lists file contents lua [args] - run Lua with the given arguments recv [path] - receive a file via XMODEM. If path is given save it there, otherwise run it. cp <src> <dst> - copy source file 'src' to 'dst' wofmt - format the internal WOFS ed [args] - run 'ed' text editor with the given arguments ver - print eLua version eLua# ls /wo Total on /wo: 0 bytes /rom hangman.lua 3554 bytes info.lua 141 bytes life.lua 2919 bytes Total on /rom: 6614 bytes /mmc DCIM <DIR> MISC <DIR> PRIVATE <DIR> MP3z <DIR> 512 <DIR> test.bas 126 bytes life.lua 3018 bytes info.lua 141 bytes Total on /mmc: 3285 bytes eLua# lua /rom/info.lua Press CTRL+Z to exit Lua I'm running on platform STM32F4 The CPU is a STM32F407VG The board name is STM32F4DSCY eLua# wofmt Formatting the internal WOFS will DESTROY ALL THE FILES FROM WOFS. Are you sure you want to continue? [y/n] y Formatting ... done. eLua# ls /wo Total on /wo: 0 bytes /rom hangman.lua 3554 bytes info.lua 141 bytes life.lua 2919 bytes Total on /rom: 6614 bytes /mmc DCIM <DIR> MISC <DIR> PRIVATE <DIR> MP3z <DIR> 512 <DIR> test.bas 126 bytes life.lua 3018 bytes info.lua 141 bytes Total on /mmc: 3285 bytes eLua# cp /rom/info.lua /wo/test.lua 141 bytes copied eLua# ls /wo test.lua 141 bytes Total on /wo: 141 bytes /rom hangman.lua 3554 bytes info.lua 141 bytes life.lua 2919 bytes Total on /rom: 6614 bytes /mmc DCIM <DIR> MISC <DIR> PRIVATE <DIR> MP3z <DIR> 512 <DIR> test.bas 126 bytes life.lua 3018 bytes info.lua 141 bytes Total on /mmc: 3285 bytes eLua# lua /wo/test.lua Press CTRL+Z to exit Lua I'm running on platform STM32F4 The CPU is a STM32F407VG The board name is STM32F4DSCY eLua# help Shell commands: exit - exit from this shell help - print this help ls or dir - lists filesystems files and sizes cat or type - lists file contents lua [args] - run Lua with the given arguments recv [path] - receive a file via XMODEM. If path is given save it there, otherwise run it. cp <src> <dst> - copy source file 'src' to 'dst' wofmt - format the internal WOFS ed [args] - run 'ed' text editor with the given arguments ver - print eLua version eLua# rm /wo.lua Invalid command, type 'help' for help eLua# rm /wo/test.lua Invalid command, type 'help' for help eLua# cat /wo/test.lua print( "I'm running on platform " .. pd.platform() ) print( "The CPU is a " .. pd.cpu() ) print( "The board name is " .. pd.board() ) eLua# ed -V GNU Ed 1.7 Copyright (C) 1994 Andrew L. Moore. Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. eLua# ed -h GNU Ed - The GNU line editor. Usage: ed [options] [file] Options: -h, --help display this help and exit -V, --version output version information and exit -G, --traditional run in compatibility mode -l, --loose-exit-status exit with 0 status even if a command fails -p, --prompt=STRING use STRING as an interactive prompt -r, --restricted run in restricted mode -s, --quiet, --silent suppress diagnostics -v, --verbose be verbose Report bugs to . Ed home page: http://www.gnu.org/software/ed/ed.html General help using GNU software: http://www.gnu.org/gethelp eLua# ed /mmc/info.lua 137 ,l print( "I'm running on platform " .. pd.platform() )\r$ print( "The CPU is a " .. pd.cpu() )\r$ print( "The board name is " .. pd.board() )\r$ /CPU print( "The CPU is a " .. pd.cpu() ) s/CPU/MPU/ . print( "The MPU is a " .. pd.cpu() ) ,p print( "I'm running on platform " .. pd.platform() ) print( "The MPU is a " .. pd.cpu() ) print( "The board name is " .. pd.board() ) ,n 1 print( "I'm running on platform " .. pd.platform() ) 2 print( "The MPU is a " .. pd.cpu() ) 3 print( "The board name is " .. pd.board() ) 1d ,l print( "The MPU is a " .. pd.cpu() )\r$ print( "The board name is " .. pd.board() )\r$ $x ,l print( "The MPU is a " .. pd.cpu() )\r$ print( "The board name is " .. pd.board() )\r$ print( "I'm running on platform " .. pd.platform() )\r$ wq write stream(1,3); 137 eLua# cat /mmc/info.lua print( "The MPU is a " .. pd.cpu() ) print( "The board name is " .. pd.board() ) print( "I'm running on platform " .. pd.platform() ) eLua# lua /mmc/info.lua Press CTRL+Z to exit Lua The MPU is a STM32F407VG The board name is STM32F4DSCY I'm running on platform STM32F4 eLua# eLua# eLua# lua Press CTRL+Z to exit Lua Lua 5.1.4 Copyright (C) 1994-2011 Lua.org, PUC-Rio > print ( 355 / 113.0) 3.141592920354 > sin(0) stdin:1: attempt to call global 'sin' (a nil value) stack traceback: stdin:1: in main chunk [C]: ? > print ( sin(0)) stdin:1: attempt to call global 'sin' (a nil value) stack traceback: stdin:1: in main chunk [C]: ? > print ( math.sin(0)) 0 > print ( math.cos(0)) 1 > print ( math.cos(355/113/2)) -1.3338209464125e-07 > print ( math.sin(355/113/2)) 0.99999999999999 > eLua# [ご注意] ・このページの記載事項については,一切無保証です。
inserted by FC2 system