This project is experimental implementation.
See this: https://github.com/mruby/mruby
Very low-cost ARM processor board.
See this: http://www.st.com/web/en/catalog/tools/PF252419
- get Codesourcery toolchain for ARM processor.
- setup your environment variable PATH to make 'arm-none-eabi-gcc' can run.
- get 'mruby' source code from github.
- build 'libmruby'.
- get 'mirb-stm32f4discovery' source code.
commands:
$ git clone https://github.com/mruby/mruby.git
$ cd mruby
$ vi build_config.rb
$ make
$ cd ..
$ git clone https://github.com/crimsonwoods/mirb-stm32f4discovery.git
edit your 'build_config.rb' to build 'libmruby'.
append cross-build settings.
like this:
MRuby::CrossBuild.new('stm32f407') do |conf|
toolchain :gcc
conf.bins = %w() # target is just only 'libmruby.a'.
conf.cc do |cc|
cc.command = 'arm-none-eabi-gcc'
cc.flags = %w(
-MD -Os
-mthumb -mcpu=cortex-m3 -nostdlib -mfloat-abi=softfp -mfpu=fpv4-sp-d16
-fsigned-char -fno-inline -ffunction-sections -mlittle-endian)
cc.defines = %w(
MRB_HEAP_PAGE_SIZE=256
POOL_PAGE_SIZE=1000
MRB_STR_BUF_MIN_SIZE=32
MRB_PARSER_BUF_SIZE=256)
end
conf.archiver do |ar|
ar.command = 'arm-none-eabi-ar'
end
end
commands:
$ cd mirb-stm32f4discovery
$ make CROSS_COMPILE=arm-none-eabi-
if build succeeded, you will get an executable binary file 'build/mirb.bin'.
Use STM32 ST-LINK Utility.
"USART2" is assigned as standard input/output port.
On STM32F4 Discovery board, 'PA3' and 'PA2' is assigned as "USART2" (PA2=USART2_TX / PA3=USART2_RX).
You can connect level conversion board to that pins.
MIT License