0
fun mruby develoment with Eclipse2013/04/19Team yamanekkoMasayoshi TakahashiYurie Yamane使用Eclipse快樂的mruby開發
自我介紹●山根ゆりえ(Yurie Yamane)●高橋征義(Masayoshi Takahashi)self introduction
RubyConf 2012our talks
RubyConf Taiwan 2012our talks
自我介紹Team Yamanekko
ebook publisher
今天的主題Todays Topic
mrubyhttp://mrb.h2so5.net/
輕量型RubyMinimal Ruby
嵌入式RubyeMededdable Ruby
用途“Embedded?”
用途● 嵌入其他應用軟件● 嵌入式系統into applicationfor embedded systems
用途● 嵌入其他應用軟件● 嵌入式系統for embedded systems
FM3 (Fujitsu, Cortex M3)http://www.kumikomi.net/interface/contents/fm3.phptarget boards weve tried
GR-SAKURA (Renesas, RX63N)http://japan.renesas.com/products/promotion/gr/index.jsptarget boards weve tried
RubyConf 2012our talks
RubyConf Taiwan 2012our talks
大江戶Ruby會議03our talkshttp://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 Wo...
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 mrub...
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 Discoveryhttp://www.st.com/web/catalog/tools/FM116/SC959/SS1532/PF252419now we use STM32F4 discovery・ARM (Cor...
mruby的特徵●embeddable●configurable●pluggable
embeddableRubylibmrubyC/C++ app/usr/bin/rubyCRuby mruby
CRubyRuby Interpreter*.rb (your code)*.rb (stdlib) ext
mrubymrubyVM*.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-numer...
configurable● MRB_USE_FLOAT● MRB_INT64● MRB_NAN_BOXING● MRB_ENDIAN_BIG● MRB_FUNCALL_ARGC_MAX●MRB_HEAP_PAGE_SIZE● MRB_USE_I...
開發環境● Eclipse + CDT● YAGARTO GNU ARM toolchain● st-util● mruby tools plugindevelopment 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● EclipseCDThttp://www.eclipse.org/downloads/● GDBServerhttps://github.com/texane/stlink● YAGARTO GNU ARM too...
The process1. create mrbgem for LED control2.create mrubylibrary(include LED control gem)3.create STM32F4Discovery project...
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-DiscoverysLED port from ruby
CREATE NEW mrbgem WIZARD● mrbgem wizard can create necessary files, directoryconstitution 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 inthe project of STM32f4
CREATE STM32F4DISCOVERYSPROJECT● Get example from STMicroelectronicss site● Get STM32F4-Discovery example from emb4funs si...
STM32F4-DISCOVERY● Get example code from STMicroelectronicss sitehttp://www.st.com/web/en/catalog/tools/PF257904stsw-stm32...
gccs file● .ld, makefile .s etchttp://www.emb4fun.de/arm/examples/index.htmlSTM32F4-Discovery.zipSTM32F4-Discovery/prj/stm...
CREATE STM32F4DISCOVERYSPROJECT● 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 endingtag● Two ways...
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 brinkGreen on -> Orange on -> Red on -> Blue on -> all off● 10times repeat
結論更快樂的mruby開發!ConclusionHappy mruby Hacking!
謝謝!
使用Eclipse快樂的mruby開發
使用Eclipse快樂的mruby開發
Upcoming SlideShare
Loading in...5
×

使用Eclipse快樂的mruby開發

1,926

Published on

Published in: Technology
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,926
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
8
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Transcript of "使用Eclipse快樂的mruby開發"

  1. 1. fun mruby develoment with Eclipse2013/04/19Team yamanekkoMasayoshi TakahashiYurie Yamane使用Eclipse快樂的mruby開發
  2. 2. 自我介紹●山根ゆりえ(Yurie Yamane)●高橋征義(Masayoshi Takahashi)self introduction
  3. 3. RubyConf 2012our talks
  4. 4. RubyConf Taiwan 2012our talks
  5. 5. 自我介紹Team Yamanekko
  6. 6. ebook publisher
  7. 7. 今天的主題Todays Topic
  8. 8. mrubyhttp://mrb.h2so5.net/
  9. 9. 輕量型RubyMinimal Ruby
  10. 10. 嵌入式RubyeMededdable Ruby
  11. 11. 用途“Embedded?”
  12. 12. 用途● 嵌入其他應用軟件● 嵌入式系統into applicationfor embedded systems
  13. 13. 用途● 嵌入其他應用軟件● 嵌入式系統for embedded systems
  14. 14. FM3 (Fujitsu, Cortex M3)http://www.kumikomi.net/interface/contents/fm3.phptarget boards weve tried
  15. 15. GR-SAKURA (Renesas, RX63N)http://japan.renesas.com/products/promotion/gr/index.jsptarget boards weve tried
  16. 16. RubyConf 2012our talks
  17. 17. RubyConf Taiwan 2012our talks
  18. 18. 大江戶Ruby會議03our talkshttp://www.flickr.com/photos/igaiga/8564676738/
  19. 19. 回顧Retrospective
  20. 20. 我們的目標= 快樂的mruby開發Our goals is mruby for fun
  21. 21. 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
  22. 22. http://www.flickr.com/photos/29638108@N06/8030322376/
  23. 23. mruby on embedded system● get board● get JTAG cable● connect wire● configure OpenOCD● (....)● (...we have not touched mruby...)mruby for embedded is pretty hard
  24. 24. http://www.flickr.com/photos/everexplore/8536595421/
  25. 25. 我們需要更容易的開發環境We need more easy-to-use environment
  26. 26. http://www.pageplugins.com/generators/fordummies/
  27. 27. “For Dummies” ???●指令碼語言(mruby!!)● 不使用軟銲、不使用面包板●硬體(cross)除錯器● GUI整合開發環境● 便利的工具
  28. 28. 開發板: STM32F4 Discoveryhttp://www.st.com/web/catalog/tools/FM116/SC959/SS1532/PF252419now we use STM32F4 discovery・ARM (Coretex M4)・1MB Flash, 192KB RAM・4 LED・1 switch・on board STLINK
  29. 29. mruby的特徵●embeddable●configurable●pluggable
  30. 30. embeddableRubylibmrubyC/C++ app/usr/bin/rubyCRuby mruby
  31. 31. CRubyRuby Interpreter*.rb (your code)*.rb (stdlib) ext
  32. 32. mrubymrubyVM*.rb (stdlib)*.rb (your code)Bytecode(C String)C/C++
  33. 33. 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-evalstandard mrbgems
  34. 34. 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
  35. 35. 開發環境● Eclipse + CDT● YAGARTO GNU ARM toolchain● st-util● mruby tools plugindevelopment tools
  36. 36. 我們的軟件● mrbgem generator (eclipse plugin)● mruby-LED class (extensional library)which tools/library we created
  37. 37. Our sample mruby code● LED control class (mruby)● porting C library into mruby● Create mrbgem control LED port library
  38. 38. List of tools● EclipseCDThttp://www.eclipse.org/downloads/● GDBServerhttps://github.com/texane/stlink● YAGARTO GNU ARM toolchainhttp://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!
  39. 39. The process1. create mrbgem for LED control2.create mrubylibrary(include LED control gem)3.create STM32F4Discovery project4.create ruby program5.execute
  40. 40. Create new mruby project
  41. 41. USE EGit● mruby is distributed on Github● Clone mruby repository
  42. 42. mruby project was created● create mruby project with cloned mruby
  43. 43. CREATE CUSTOM mrbgems● create the mrbgem to control STM32F4-DiscoverysLED port from ruby
  44. 44. CREATE NEW mrbgem WIZARD● mrbgem wizard can create necessary files, directoryconstitution and template files
  45. 45. add your code to your mrbgem
  46. 46. build_config.rb● Write MRuby::CrossBuild with mruby-led
  47. 47. Build mruby● Project -> Build Project● mruby library was created. use this library inthe project of STM32f4
  48. 48. CREATE STM32F4DISCOVERYSPROJECT● Get example from STMicroelectronicss site● Get STM32F4-Discovery example from emb4funs site● Do necessary modifications
  49. 49. STM32F4-DISCOVERY● Get example code from STMicroelectronicss sitehttp://www.st.com/web/en/catalog/tools/PF257904stsw-stm32068.zip● unzip -> STM32F4-Discovery_FW_V1.1.0
  50. 50. gccs file● .ld, makefile .s etchttp://www.emb4fun.de/arm/examples/index.htmlSTM32F4-Discovery.zipSTM32F4-Discovery/prj/stm32f4xxxg_flash.ldSTM32F4-Discovery/src/syscalls.cSTM32F4-Discovery/makefileSTM32F4-Discovery/cmsis/device/startup_stm32f4xx.s
  51. 51. CREATE STM32F4DISCOVERYSPROJECT● Create new makefile project with existing code
  52. 52. modify makefile● Include path● Use mruby library● Increase Heap size <- the most important point!● etc...
  53. 53. Write ruby code● Insert “beginning tag” and “ending tag”● write ruby cord in between beginning tag and endingtag● Two ways to embed ruby code1.Use menu bar2.Use tool barInsert ruby code in .c fileInsert .rb file name in .c file/* <ruby->...<-ruby> *//* <rubyfile->aaa.rb<-rubyfile> */
  54. 54. Rubycode -> bytecode use mrbc● to generate executable mruby code
  55. 55. Build● Create elf file●
  56. 56. debug● 1. run -> externalTools -> “ST-Link”● 2. run -> debug as -> “STM32F4-Discovery Build”
  57. 57. GDBServer infomation● Remote debugging●
  58. 58. Debug information● Debug configurations● To input Remote target
  59. 59. To start GDBServer● Select ST-Link setting from External tools menu
  60. 60. debug
  61. 61. DEMO● LED brinkGreen on -> Orange on -> Red on -> Blue on -> all off● 10times repeat
  62. 62. 結論更快樂的mruby開發!ConclusionHappy mruby Hacking!
  63. 63. 謝謝!
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×