Skip to content

crimsonwoods/mirb-stm32f4discovery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published