Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/crimsonwoods/mirb-stm32f4discovery

mirb (an interpreter of mruby) port to STM32F4 Discovery board.
https://github.com/crimsonwoods/mirb-stm32f4discovery

Last synced: about 2 months ago
JSON representation

mirb (an interpreter of mruby) port to STM32F4 Discovery board.

Lists

README

        

mirb-stm32f4discovery
====

This project is __experimental__ implementation.

What's 'mruby'
----
See this: https://github.com/mruby/mruby

What's 'STM32F4 Discovery'
----
Very low-cost ARM processor board.



See this: http://www.st.com/web/en/catalog/tools/PF252419

Ready to build
----

1. get Codesourcery toolchain for ARM processor.
2. setup your environment variable PATH to make 'arm-none-eabi-gcc' can run.
3. get 'mruby' source code from github.
4. build 'libmruby'.
5. 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 'build_config.rb'
----
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

How to build
----

commands:

$ cd mirb-stm32f4discovery
$ make CROSS_COMPILE=arm-none-eabi-

if build succeeded, you will get an executable binary file 'build/mirb.bin'.

How to run
----
Use STM32 ST-LINK Utility.

Console Input/Output
----
"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.

License
----
MIT License