SlideShare a Scribd company logo
fun mruby develoment with Eclipse
2013/04/19
Team yamanekko
Masayoshi Takahashi
Yurie Yamane
使用Eclipse快樂的mruby開發
自我介紹
●
山根ゆりえ(Yurie Yamane)
●
高橋征義(Masayoshi Takahashi)
self introduction
RubyConf 2012
our talks
RubyConf Taiwan 2012
our talks
自我介紹
Team Yamanekko
ebook publisher
使用Eclipse快樂的mruby開發
使用Eclipse快樂的mruby開發
今天的主題
Today's Topic
mruby
http://mrb.h2so5.net/
輕量型Ruby
Minimal Ruby
嵌入式Ruby
eMededdable Ruby
用途
“Embedded?”
用途
● 嵌入其他應用軟件
● 嵌入式系統
into application
for embedded systems
用途
● 嵌入其他應用軟件
● 嵌入式系統
for embedded systems
FM3 (Fujitsu, Cortex M3)
http://www.kumikomi.net/interface/contents/fm3.php
target boards we've tried
GR-SAKURA (Renesas, RX63N)
http://japan.renesas.com/products/promotion/gr/index.jsp
target boards we've tried
RubyConf 2012
our talks
RubyConf Taiwan 2012
our talks
大江戶Ruby會議03
our talks
http://www.flickr.com/photos/igaiga/8564676738/
回顧
Retrospective
我們的目標
= 快樂的mruby開發
Our goals is mruby for fun
mruby on Mac OS X
$ git clone https://github.com/mruby/mruby.git
$ ruby ./minirake
$ ./bin/mruby -e 'p "Hello World!"'
"Hello World!"
$
mruby for PCs is not so hard
http://www.flickr.com/photos/29638108@N06/8030322376/
mruby on embedded system
● get board
● get JTAG cable
● connect wire
● configure OpenOCD
● (....)
● (...we have not touched mruby...)
mruby for embedded is pretty hard
http://www.flickr.com/photos/everexplore/8536595421/
我們需要更容易的開發環境
We need more easy-to-use environment
http://www.pageplugins.com/generators/fordummies/
“For Dummies” ???
●
指令碼語言(mruby!!)
● 不使用軟銲、不使用面包板
●
硬體(cross)除錯器
● GUI整合開發環境
● 便利的工具
開發板: STM32F4 Discovery
http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/PF252419
now we use STM32F4 discovery
・ARM (Coretex M4)
・1MB Flash, 192KB RAM
・4 LED
・1 switch
・on board STLINK
mruby的特徵
●
embeddable
●
configurable
●
pluggable
embeddable
Ruby
libmruby
C/C++ app/usr/bin/ruby
CRuby mruby
CRuby
Ruby Interpreter
*.rb (your code)
*.rb (stdlib) ext
mruby
mrubyVM
*.rb (stdlib)
*.rb (your code)Bytecode
(C String)
C/C++
pluggable
● mruby-sprintf
● mruby-print
● mruby-math
● mruby-time
● mruby-struct
● mruby-enum-ext
● mruby-string-ext
● mruby-numeric-ext
● mruby-array-ext
● mruby-hash-ext
● mruby-random
● mruby-eval
standard mrbgems
configurable
● MRB_USE_FLOAT
● MRB_INT64
● MRB_NAN_BOXING
● MRB_ENDIAN_BIG
● MRB_FUNCALL_ARGC_MAX
●
MRB_HEAP_PAGE_SIZE
● MRB_USE_IV_SEGLIST
● MRB_IVHASH_INIT_SIZE
● MRB_IREP_ARRAY_INIT_SIZE
● KHASH_DEFAULT_SIZE
● POOL_ALIGNMENT
● POOL_PAGE_SIZE
● MRB_STR_BUF_MIN_SIZE
● MRB_PARSER_BUF_SIZE
● MRB_PARSER_BUF_SIZE
● ENABLE_DEBUG
#define in mrbconf.h
開發環境
● Eclipse + CDT
● YAGARTO GNU ARM toolchain
● st-util
● mruby tools plugin
development tools
我們的軟件
● mrbgem generator (eclipse plugin)
● mruby-LED class (extensional library)
which tools/library we created
Our sample mruby code
● LED control class (mruby)
● porting C library into mruby
● Create mrbgem control LED port library
List of tools
● EclipseCDT
http://www.eclipse.org/downloads/
● GDBServer
https://github.com/texane/stlink
● YAGARTO GNU ARM toolchain
http://www.yagarto.de/
● STM32board firmware package(example code)
http://www.st.com/web/en/catalog/tools/PF257904
● mruby tools plugin (Eclipse plugin)
github(https://github.com/yamanekko) coming soon!
The process
1. create mrbgem for LED control
2.create mrubylibrary(include LED control gem)
3.create STM32F4Discovery project
4.create ruby program
5.execute
Create new mruby project
USE EGit
● mruby is distributed on Github
● Clone mruby repository
mruby project was created
● create mruby project with cloned mruby
CREATE CUSTOM mrbgems
● create the mrbgem to control STM32F4-Discovery's
LED port from ruby
CREATE NEW mrbgem WIZARD
● mrbgem wizard can create necessary files, directory
constitution and template files
add your code to your mrbgem
build_config.rb
● Write MRuby::CrossBuild with mruby-led
Build mruby
● Project -> Build Project
● mruby library was created. use this library in
the project of STM32f4
CREATE STM32F4DISCOVERY'S
PROJECT
● Get example from STMicroelectronics's site
● Get STM32F4-Discovery example from emb4fun's site
● Do necessary modifications
STM32F4-DISCOVERY
● Get example code from STMicroelectronics's site
http://www.st.com/web/en/catalog/tools/PF257904
stsw-stm32068.zip
● unzip -> STM32F4-Discovery_FW_V1.1.0
gcc's file
● .ld, makefile .s etc
http://www.emb4fun.de/arm/examples/index.html
STM32F4-Discovery.zip
STM32F4-Discovery/prj/stm32f4xxxg_flash.ld
STM32F4-Discovery/src/syscalls.c
STM32F4-Discovery/makefile
STM32F4-Discovery/cmsis/device/startup_stm32f4xx.s
CREATE STM32F4DISCOVERY'S
PROJECT
● Create new makefile project with existing code
modify makefile
● Include path
● Use mruby library
● Increase Heap size <- the most important point!
● etc...
Write ruby code
● Insert “beginning tag” and “ending tag”
● write ruby cord in between beginning tag and ending
tag
● Two ways to embed ruby code
1.Use menu bar
2.Use tool bar
Insert ruby code in .c file
Insert .rb file name in .c file
/* <ruby->
...
<-ruby> */
/* <rubyfile->
aaa.rb
<-rubyfile> */
Rubycode -> bytecode use mrbc
● to generate executable mruby code
Build
● Create elf file
●
debug
● 1. run -> externalTools -> “ST-Link”
● 2. run -> debug as -> “STM32F4-Discovery Build”
GDBServer infomation
● Remote debugging
●
Debug information
● Debug configurations
● To input Remote target
To start GDBServer
● Select ST-Link setting from External tools menu
debug
DEMO
● LED brink
Green on -> Orange on -> Red on -> Blue on -> all off
● 10times repeat
結論
更快樂的mruby開發!
Conclusion
Happy mruby Hacking!
謝謝!

More Related Content

PPTX
Opensourceman ( url for slides with animations https://goo.gl/R638tW )
PDF
Parallelizing CI using Docker Swarm-Mode
ODP
Introduction to Vim 8.0
PDF
Introduction to IoT.JS
PDF
Custom angular libraries
PDF
Atmosphere packages and the chuck norris effect
PDF
Dockerizing Applications
PPTX
Mono Repo
Opensourceman ( url for slides with animations https://goo.gl/R638tW )
Parallelizing CI using Docker Swarm-Mode
Introduction to Vim 8.0
Introduction to IoT.JS
Custom angular libraries
Atmosphere packages and the chuck norris effect
Dockerizing Applications
Mono Repo

What's hot (20)

PDF
A Close Look at ARM Code Size
PPTX
From NodeJS to Rust
PPTX
Master the Monorepo
PDF
Ruby JIT Compilation - Mykhail Bortnyk
PPTX
Ruby JIT Compilation
PPTX
Advantages and disadvantages of a monorepo
PPTX
Microfrontends Monoreops & Trunkbased based
PDF
How we do python
PDF
Docker from a team perspective
PDF
Creando microservicios con java micro profile y tomee - CUNORI 2020
PDF
Docker at MoneyBird
PDF
Madrid .NET Meetup: Microsoft open sources .NET!
PDF
Oktavia Search Engine - pyconjp2014
PDF
TDD with Spock @xpdays_ua
PDF
Skyfall b sides-c00-l-ed5-sp-2013
PDF
GitBucket: Open source self-hosting Git server built by Scala
PDF
Perl hosting for beginners - Cluj.pm March 2013
DOCX
Bsdtw17: lightning talks/wip sessions
PDF
Docker workshop
PDF
[FOSDEM 2020] Lazy distribution of container images
A Close Look at ARM Code Size
From NodeJS to Rust
Master the Monorepo
Ruby JIT Compilation - Mykhail Bortnyk
Ruby JIT Compilation
Advantages and disadvantages of a monorepo
Microfrontends Monoreops & Trunkbased based
How we do python
Docker from a team perspective
Creando microservicios con java micro profile y tomee - CUNORI 2020
Docker at MoneyBird
Madrid .NET Meetup: Microsoft open sources .NET!
Oktavia Search Engine - pyconjp2014
TDD with Spock @xpdays_ua
Skyfall b sides-c00-l-ed5-sp-2013
GitBucket: Open source self-hosting Git server built by Scala
Perl hosting for beginners - Cluj.pm March 2013
Bsdtw17: lightning talks/wip sessions
Docker workshop
[FOSDEM 2020] Lazy distribution of container images
Ad

Viewers also liked (6)

PDF
How to control physical devices with mruby
PDF
STM32F4 for 智慧型電動輪椅系統Part1
PDF
Stm32 f4 first touch
PDF
STM32 F4 (PWM,SPI And ADC Test Examples)
PDF
2016-09-eclipse-iot-cf-summit
PPTX
présentation STM32
How to control physical devices with mruby
STM32F4 for 智慧型電動輪椅系統Part1
Stm32 f4 first touch
STM32 F4 (PWM,SPI And ADC Test Examples)
2016-09-eclipse-iot-cf-summit
présentation STM32
Ad

Similar to 使用Eclipse快樂的mruby開發 (20)

PDF
mRuby - Powerful Software for Embedded System Development
PDF
mruby/c and data-flow programming for small devices
PDF
Now is the time to create your own (m)Ruby computer
PDF
Rapid IoT prototyping with mruby
PDF
How to debug mruby (rubyconftw2014)
PDF
Open the door of embedded systems to IoT! mruby on LEGO Mindstorms (R)
PDF
It's a Jungle Out There – IoT and MRuby
PDF
Hacking and Forensics on the Go - 44CON 2012
PDF
Polstra 44con2012
ODP
The Deck by Phil Polstra GrrCON2012
PDF
Building Bricks with MRuby: A Journey to MRuby on LEGO Robots
PDF
ruby2600 - an Atari 2600 emulator written in Ruby
PPTX
PDF
Shrink to grow
PDF
From Silicon to Software - IIT Madras
PPT
Raspberry Pi for IPRUG
PDF
RVM and Ruby Interpreters @ RSC Roma 03/2011
PDF
Using Eclipse and Lua for the Internet of Things - EclipseDay Googleplex 2012
PDF
IoT with Ruby/mruby - RubyWorld Conference 2015
ODP
Ruby C extensions at the Ruby drink-up of Sophia, April 2012
mRuby - Powerful Software for Embedded System Development
mruby/c and data-flow programming for small devices
Now is the time to create your own (m)Ruby computer
Rapid IoT prototyping with mruby
How to debug mruby (rubyconftw2014)
Open the door of embedded systems to IoT! mruby on LEGO Mindstorms (R)
It's a Jungle Out There – IoT and MRuby
Hacking and Forensics on the Go - 44CON 2012
Polstra 44con2012
The Deck by Phil Polstra GrrCON2012
Building Bricks with MRuby: A Journey to MRuby on LEGO Robots
ruby2600 - an Atari 2600 emulator written in Ruby
Shrink to grow
From Silicon to Software - IIT Madras
Raspberry Pi for IPRUG
RVM and Ruby Interpreters @ RSC Roma 03/2011
Using Eclipse and Lua for the Internet of Things - EclipseDay Googleplex 2012
IoT with Ruby/mruby - RubyWorld Conference 2015
Ruby C extensions at the Ruby drink-up of Sophia, April 2012

More from yamanekko (11)

PDF
Model2code mruby 2018
PDF
Ev3rt and mruby-ev3rt 2018ver
PDF
mruby can be more lightweight
PDF
Rubykaigi2016 High Tech Seat in mruby
PDF
Domo Arigato, Mr(uby) Roboto
PDF
RubyKaigi2015 making robots-with-mruby
PDF
mrubyでETロボコンに出よう
PDF
Writing mruby Debugger
PDF
ルネサスナイト
PDF
Tokyurubykaigi05
PDF
RubyConfの話の続きのおはなし
Model2code mruby 2018
Ev3rt and mruby-ev3rt 2018ver
mruby can be more lightweight
Rubykaigi2016 High Tech Seat in mruby
Domo Arigato, Mr(uby) Roboto
RubyKaigi2015 making robots-with-mruby
mrubyでETロボコンに出よう
Writing mruby Debugger
ルネサスナイト
Tokyurubykaigi05
RubyConfの話の続きのおはなし

Recently uploaded (20)

PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
cuic standard and advanced reporting.pdf
PDF
KodekX | Application Modernization Development
PDF
Machine learning based COVID-19 study performance prediction
PPTX
Spectroscopy.pptx food analysis technology
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Electronic commerce courselecture one. Pdf
PDF
Encapsulation theory and applications.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Review of recent advances in non-invasive hemoglobin estimation
Spectral efficient network and resource selection model in 5G networks
Reach Out and Touch Someone: Haptics and Empathic Computing
Chapter 3 Spatial Domain Image Processing.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Mobile App Security Testing_ A Comprehensive Guide.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Per capita expenditure prediction using model stacking based on satellite ima...
cuic standard and advanced reporting.pdf
KodekX | Application Modernization Development
Machine learning based COVID-19 study performance prediction
Spectroscopy.pptx food analysis technology
MIND Revenue Release Quarter 2 2025 Press Release
Diabetes mellitus diagnosis method based random forest with bat algorithm
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Electronic commerce courselecture one. Pdf
Encapsulation theory and applications.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Review of recent advances in non-invasive hemoglobin estimation

使用Eclipse快樂的mruby開發