SlideShare a Scribd company logo
Functional MCU programming
Metasepi Project / Kiwamu Okabe
Who am I ?
☆ http://www.masterq.net/
☆ Twitter: @master_q
☆ Organizer of Metasepi Project
☆ A developer of Ajhc Haskell compiler
☆ A Debian Maintainer
☆ 10 years' experience in developing
OS using NetBSD
Kick off workshop at Nagoya !
Functional MCU programing workshop
☆ At Nagoya
☆ Meeting minutes
http://metasepi.org/posts/2014-01-05-mbed_fp_0.html

☆ Now planning the next workshop...
Why functional lang for MCU?
☆ Internet of Things (IoT)
☆ We will live in IoT world
☆ Can't debug IoT device on the field
☆ Should avoid runtime error
☆ We need strong type !
What is functional app?
Choice of cross compiler
Cross compiler: (A)jhc
http://ajhc.metasepi.org/
☆ Language: Haskell
☆ Haskell language is major !
☆ Need GC heap = Need more memory
☆ Experience running on MCU
ARM Cortex-M
https://github.com/ajhc/demo-cortex-m3
Cross compiler: ATS
http://www.ats-lang.org/
☆ Language: ML
☆ Optional GC = Need low memory
☆ No experience running on MCU
☆ Document translated into Japanese
http://jats-ug.metasepi.org/
Cross compiler: Rust
http://www.rust-lang.org/
☆ Language: Own syntax like C or JS
☆ Optional GC = Need low memory
☆ Experience running on MCU
ARM Cortex-M
https://github.com/neykov/armboot

☆ Developing by Mozilla
☆ @pirapira knows the detail of it
Choice of MCU board
Which MCU? Of course mbed!?
Why?
☆ Major
☆ 32bit
☆ Large memory size (> 20kB)
☆ Debugger
☆ Ethernet
Which board is good for us...
☆ mbed LPC1768 (¥5,200)
RAM 32kB+32kB
Ethernet
https://mbed.org/platforms/mbed-LPC1768/

☆ Seeeduino Arch Pro ($43.41)
RAM 32kB+32kB
Ethernet
http://www.seeedstudio.com/depot/arch-pro-p-1677.html

☆ FRDM-KL46Z (¥1,634)
RAM 32kB
No Ethernet
http://www.freescale.com/webapp/sps/site/prod_summary.jsp?
code=FRDM-KL46Z
Choice of debugger
gdbserver: pyOCD
https://github.com/mbedmicro/pyOCD
☆ Only for MCU using CMSIS-DAP
☆ But now support only mbed LPC1768
☆ In future, support more board ?
gdbserver: OpenOCD
http://openocd.sourceforge.net/
☆ Comming CMSIS-DAP support!
☆ Need HIDAPI library
http://www.signal11.us/oss/hidapi/
OpenOCD enabling CMSIS-DAP
$
$
$
$
$
$

git clone git://github.com/signal11/hidapi.git
cd hidapi
./bootstrap
./configure
make
sudo make install

$ git clone https://github.com/master-q/openocd.git
$ cd openocd
$ git checkout masterq-mbedfest-201401
$ ./bootstrap
$ ./configure --enable-cmsis-dap
--ship-Olimex ARM-JTAG-EW Programmer
yes (auto)
CMSIS-DAP Compliant Debugger
yes
$ make
Some time the following FRDM-KL46Z patch is useful.
http://permalink.gmane.org/gmane.comp.debugging.openocd.devel/24258
On mbed LPC1768
$ sudo ./src/openocd -f tcl/board/mbed-lpc1768.cfg
$ arm-none-eabi-gdb
(gdb) target remote
(gdb) monitor reset
(gdb) load

Blink.elf
localhost:3333
halt

Push hard rest button.
(gdb) c

But too slow...
Transfer rate: 50 bytes/sec, 3818 bytes/write.

:(
On Seeeduino Arch Pro
Same as mbed LPC1768.
On FRDM-KL46Z
Use project at https://github.com/0xc0170/kinetis_klxx_gcc.
$ sudo ./src/openocd -f tcl/board/frdm-kl46z.cfg
--snip-cortex_m reset_config sysresetreq
Info : CMSIS-DAP: FW Version = 1.0
Info : SWCLK/TCK = 0 SWDIO/TMS = 1 TDI = 0 TDO = 0 nTRST = 0
nRESET = 1
Info : DAP_SWJ Sequence (reset: 50+ '1' followed by 0)
Info : CMSIS-DAP: Interface ready
Info : clock speed 100 kHz
Info : IDCODE 0x0bc11477
Info : MKL46Z256VLL4.cpu: hardware has 2 breakpoints, 2 watchpoints
Info : accepting 'gdb' connection from 3333
Warn : Cannot communicate... target not halted.
Error: auto_probe failed
Error: Connect failed. Consider setting up a gdb-attach event for
the target to prepare.
Error: attempted 'gdb' connection rejected

X(
Be a hacker such as ねむいさん
http://nemuisan.blog.bai.ne.jp/
☆ OpenOCD hacker
☆ There is his patch at following URL
http://nemuisan.blog.bai.ne.jp/?eid=192848#OPENOCD
Functional programming fanzine
☆ http://www.paraiso-lang.org/ikmsm/
☆ About Haskell or OCaml or . . .
☆ About Ajhc in C84 book
☆ About Android app with Haskell in
C85 book
☆ Call me if you read it!
http://www.paraiso-lang.org/ikmsm/books/c85.html

More Related Content

What's hot

Understanding how concurrency work in os
Understanding how concurrency work in osUnderstanding how concurrency work in os
Understanding how concurrency work in os
GenchiLu1
 
Open-Source Analytics Stack on MongoDB, with Schema, Pierre-Alain Jachiet and...
Open-Source Analytics Stack on MongoDB, with Schema, Pierre-Alain Jachiet and...Open-Source Analytics Stack on MongoDB, with Schema, Pierre-Alain Jachiet and...
Open-Source Analytics Stack on MongoDB, with Schema, Pierre-Alain Jachiet and...
Pôle Systematic Paris-Region
 
2008-12-21 Rubinius
2008-12-21 Rubinius2008-12-21 Rubinius
2008-12-21 Rubinius
Lin Jen-Shin
 
Everyday tools and tricks for scaling Node.js
Everyday tools and tricks for scaling Node.jsEveryday tools and tricks for scaling Node.js
Everyday tools and tricks for scaling Node.js
Nikolay Stoitsev
 
Go at Skroutz
Go at SkroutzGo at Skroutz
Go at Skroutz
AgisAnastasopoulos
 
gRPC
gRPC gRPC
Dev + DevOps для PHP розробника
Dev + DevOps для PHP розробникаDev + DevOps для PHP розробника
Dev + DevOps для PHP розробника
phpfriendsclub
 
Web Development: Making it the right way
Web Development: Making it the right wayWeb Development: Making it the right way
Web Development: Making it the right way
Yagiz Nizipli
 
PHP and node.js Together
PHP and node.js TogetherPHP and node.js Together
PHP and node.js Together
Chris Tankersley
 
My talk at LVEE 2016
My talk at LVEE 2016My talk at LVEE 2016
My talk at LVEE 2016
Alex Chistyakov
 
Librerías Opensoure de Square
Librerías Opensoure de Square Librerías Opensoure de Square
Librerías Opensoure de Square
betabeers
 
Php4android TDC 2011
Php4android TDC 2011Php4android TDC 2011
Php4android TDC 2011
Kinn Julião
 
Serverless Preview Environments @ Boston DevOps
Serverless Preview Environments @ Boston DevOpsServerless Preview Environments @ Boston DevOps
Serverless Preview Environments @ Boston DevOps
Joseph Lust
 
Taking containers from development to production
Taking containers from development to productionTaking containers from development to production
Taking containers from development to production
Suraj Deshmukh
 
Integrating Node.js with PHP
Integrating Node.js with PHPIntegrating Node.js with PHP
Integrating Node.js with PHP
Lee Boynton
 
Hybrid Application Development
Hybrid Application DevelopmentHybrid Application Development
Hybrid Application Development
Yagiz Nizipli
 
Docker in Production: Reality, Not Hype - DevOps Chicago
Docker in Production: Reality, Not Hype - DevOps ChicagoDocker in Production: Reality, Not Hype - DevOps Chicago
Docker in Production: Reality, Not Hype - DevOps Chicago
bridgetkromhout
 
Its easy! contributing to open source - Devnexus 2020
Its easy! contributing to open source - Devnexus 2020Its easy! contributing to open source - Devnexus 2020
Its easy! contributing to open source - Devnexus 2020
César Hernández
 
Es fácil contribuir al open source - Bolivia JUG 2020
Es fácil contribuir al open source - Bolivia JUG 2020Es fácil contribuir al open source - Bolivia JUG 2020
Es fácil contribuir al open source - Bolivia JUG 2020
César Hernández
 
Front-end development automation with Grunt
Front-end development automation with GruntFront-end development automation with Grunt
Front-end development automation with Grunt
benko
 

What's hot (20)

Understanding how concurrency work in os
Understanding how concurrency work in osUnderstanding how concurrency work in os
Understanding how concurrency work in os
 
Open-Source Analytics Stack on MongoDB, with Schema, Pierre-Alain Jachiet and...
Open-Source Analytics Stack on MongoDB, with Schema, Pierre-Alain Jachiet and...Open-Source Analytics Stack on MongoDB, with Schema, Pierre-Alain Jachiet and...
Open-Source Analytics Stack on MongoDB, with Schema, Pierre-Alain Jachiet and...
 
2008-12-21 Rubinius
2008-12-21 Rubinius2008-12-21 Rubinius
2008-12-21 Rubinius
 
Everyday tools and tricks for scaling Node.js
Everyday tools and tricks for scaling Node.jsEveryday tools and tricks for scaling Node.js
Everyday tools and tricks for scaling Node.js
 
Go at Skroutz
Go at SkroutzGo at Skroutz
Go at Skroutz
 
gRPC
gRPC gRPC
gRPC
 
Dev + DevOps для PHP розробника
Dev + DevOps для PHP розробникаDev + DevOps для PHP розробника
Dev + DevOps для PHP розробника
 
Web Development: Making it the right way
Web Development: Making it the right wayWeb Development: Making it the right way
Web Development: Making it the right way
 
PHP and node.js Together
PHP and node.js TogetherPHP and node.js Together
PHP and node.js Together
 
My talk at LVEE 2016
My talk at LVEE 2016My talk at LVEE 2016
My talk at LVEE 2016
 
Librerías Opensoure de Square
Librerías Opensoure de Square Librerías Opensoure de Square
Librerías Opensoure de Square
 
Php4android TDC 2011
Php4android TDC 2011Php4android TDC 2011
Php4android TDC 2011
 
Serverless Preview Environments @ Boston DevOps
Serverless Preview Environments @ Boston DevOpsServerless Preview Environments @ Boston DevOps
Serverless Preview Environments @ Boston DevOps
 
Taking containers from development to production
Taking containers from development to productionTaking containers from development to production
Taking containers from development to production
 
Integrating Node.js with PHP
Integrating Node.js with PHPIntegrating Node.js with PHP
Integrating Node.js with PHP
 
Hybrid Application Development
Hybrid Application DevelopmentHybrid Application Development
Hybrid Application Development
 
Docker in Production: Reality, Not Hype - DevOps Chicago
Docker in Production: Reality, Not Hype - DevOps ChicagoDocker in Production: Reality, Not Hype - DevOps Chicago
Docker in Production: Reality, Not Hype - DevOps Chicago
 
Its easy! contributing to open source - Devnexus 2020
Its easy! contributing to open source - Devnexus 2020Its easy! contributing to open source - Devnexus 2020
Its easy! contributing to open source - Devnexus 2020
 
Es fácil contribuir al open source - Bolivia JUG 2020
Es fácil contribuir al open source - Bolivia JUG 2020Es fácil contribuir al open source - Bolivia JUG 2020
Es fácil contribuir al open source - Bolivia JUG 2020
 
Front-end development automation with Grunt
Front-end development automation with GruntFront-end development automation with Grunt
Front-end development automation with Grunt
 

Viewers also liked

start_printf: dev/ic/com.c comstart()
start_printf: dev/ic/com.c comstart()start_printf: dev/ic/com.c comstart()
start_printf: dev/ic/com.c comstart()
Kiwamu Okabe
 
Build OS X Apps on Travis CI
Build OS X Apps on Travis CIBuild OS X Apps on Travis CI
Build OS X Apps on Travis CI
Kiwamu Okabe
 
Play, Slick, play2-authの間で討死
Play, Slick, play2-authの間で討死Play, Slick, play2-authの間で討死
Play, Slick, play2-authの間で討死
Kiwamu Okabe
 
Functional MCU programming #0: Development environment
Functional MCU programming #0: Development environmentFunctional MCU programming #0: Development environment
Functional MCU programming #0: Development environment
Kiwamu Okabe
 
Safer IoT using functional language
Safer IoT using functional languageSafer IoT using functional language
Safer IoT using functional language
Kiwamu Okabe
 
Real-time OS system state captured by ATS language
Real-time OS system state captured by ATS languageReal-time OS system state captured by ATS language
Real-time OS system state captured by ATS language
Kiwamu Okabe
 

Viewers also liked (6)

start_printf: dev/ic/com.c comstart()
start_printf: dev/ic/com.c comstart()start_printf: dev/ic/com.c comstart()
start_printf: dev/ic/com.c comstart()
 
Build OS X Apps on Travis CI
Build OS X Apps on Travis CIBuild OS X Apps on Travis CI
Build OS X Apps on Travis CI
 
Play, Slick, play2-authの間で討死
Play, Slick, play2-authの間で討死Play, Slick, play2-authの間で討死
Play, Slick, play2-authの間で討死
 
Functional MCU programming #0: Development environment
Functional MCU programming #0: Development environmentFunctional MCU programming #0: Development environment
Functional MCU programming #0: Development environment
 
Safer IoT using functional language
Safer IoT using functional languageSafer IoT using functional language
Safer IoT using functional language
 
Real-time OS system state captured by ATS language
Real-time OS system state captured by ATS languageReal-time OS system state captured by ATS language
Real-time OS system state captured by ATS language
 

Similar to Functional MCU programming

Metasepi team meeting #7: Snatch application on tiny OS
Metasepi team meeting #7: Snatch application on tiny OSMetasepi team meeting #7: Snatch application on tiny OS
Metasepi team meeting #7: Snatch application on tiny OS
Kiwamu Okabe
 
Metasepi team meeting #13: NetBSD driver using Haskell
Metasepi team meeting #13: NetBSD driver using HaskellMetasepi team meeting #13: NetBSD driver using Haskell
Metasepi team meeting #13: NetBSD driver using Haskell
Kiwamu Okabe
 
Metasepi team meeting #8': Haskell apps on Android NDK
Metasepi team meeting #8': Haskell apps on Android NDKMetasepi team meeting #8': Haskell apps on Android NDK
Metasepi team meeting #8': Haskell apps on Android NDK
Kiwamu Okabe
 
Functional IoT: Hardware and Platform
Functional IoT: Hardware and PlatformFunctional IoT: Hardware and Platform
Functional IoT: Hardware and Platform
Kiwamu Okabe
 
Metasepi team meeting #6: "Snatch-driven development"
Metasepi team meeting #6: "Snatch-driven development"Metasepi team meeting #6: "Snatch-driven development"
Metasepi team meeting #6: "Snatch-driven development"
Kiwamu Okabe
 
Debugging of (C)Python applications
Debugging of (C)Python applicationsDebugging of (C)Python applications
Debugging of (C)Python applications
Roman Podoliaka
 
Metasepi team meeting #19: ATS application on Arduino
Metasepi team meeting #19: ATS application on ArduinoMetasepi team meeting #19: ATS application on Arduino
Metasepi team meeting #19: ATS application on Arduino
Kiwamu Okabe
 
Metasepi team meeting #20: Start! ATS programming on MCU
Metasepi team meeting #20: Start! ATS programming on MCUMetasepi team meeting #20: Start! ATS programming on MCU
Metasepi team meeting #20: Start! ATS programming on MCU
Kiwamu Okabe
 
Writing NetBSD Sound Drivers in Haskell
Writing NetBSD Sound Drivers in HaskellWriting NetBSD Sound Drivers in Haskell
Writing NetBSD Sound Drivers in Haskell
Kiwamu Okabe
 
Get your teeth into Plack
Get your teeth into PlackGet your teeth into Plack
Get your teeth into Plack
Workhorse Computing
 
Share the Experience of Using Embedded Development Board
Share the Experience of Using Embedded Development BoardShare the Experience of Using Embedded Development Board
Share the Experience of Using Embedded Development Board
Jian-Hong Pan
 
WebSocket on client & server using websocket-sharp & ASP.NET Core
WebSocket on client & server using websocket-sharp & ASP.NET CoreWebSocket on client & server using websocket-sharp & ASP.NET Core
WebSocket on client & server using websocket-sharp & ASP.NET Core
Chen Yu Pao
 
@arzumy Dev Setup #klxrb
@arzumy Dev Setup #klxrb@arzumy Dev Setup #klxrb
@arzumy Dev Setup #klxrb
Arzumy MD
 
Metasepi team meeting: Ajhc Project Overview
Metasepi team meeting: Ajhc Project OverviewMetasepi team meeting: Ajhc Project Overview
Metasepi team meeting: Ajhc Project Overview
Kiwamu Okabe
 
carrow - Go bindings to Apache Arrow via C++-API
carrow - Go bindings to Apache Arrow via C++-APIcarrow - Go bindings to Apache Arrow via C++-API
carrow - Go bindings to Apache Arrow via C++-API
Yoni Davidson
 
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...
OpenShift Origin
 
OpenMP-OpenACC-Offload-Cauldron2022-1.pdf
OpenMP-OpenACC-Offload-Cauldron2022-1.pdfOpenMP-OpenACC-Offload-Cauldron2022-1.pdf
OpenMP-OpenACC-Offload-Cauldron2022-1.pdf
ssuser866937
 
SaaS Boilerplate.pptx
SaaS Boilerplate.pptxSaaS Boilerplate.pptx
SaaS Boilerplate.pptx
DuyKhi8
 
Debugging Python with gdb
Debugging Python with gdbDebugging Python with gdb
Debugging Python with gdb
Roman Podoliaka
 
Qt native built for raspberry zero
Qt native built for  raspberry zeroQt native built for  raspberry zero
Qt native built for raspberry zero
SoheilSabzevari2
 

Similar to Functional MCU programming (20)

Metasepi team meeting #7: Snatch application on tiny OS
Metasepi team meeting #7: Snatch application on tiny OSMetasepi team meeting #7: Snatch application on tiny OS
Metasepi team meeting #7: Snatch application on tiny OS
 
Metasepi team meeting #13: NetBSD driver using Haskell
Metasepi team meeting #13: NetBSD driver using HaskellMetasepi team meeting #13: NetBSD driver using Haskell
Metasepi team meeting #13: NetBSD driver using Haskell
 
Metasepi team meeting #8': Haskell apps on Android NDK
Metasepi team meeting #8': Haskell apps on Android NDKMetasepi team meeting #8': Haskell apps on Android NDK
Metasepi team meeting #8': Haskell apps on Android NDK
 
Functional IoT: Hardware and Platform
Functional IoT: Hardware and PlatformFunctional IoT: Hardware and Platform
Functional IoT: Hardware and Platform
 
Metasepi team meeting #6: "Snatch-driven development"
Metasepi team meeting #6: "Snatch-driven development"Metasepi team meeting #6: "Snatch-driven development"
Metasepi team meeting #6: "Snatch-driven development"
 
Debugging of (C)Python applications
Debugging of (C)Python applicationsDebugging of (C)Python applications
Debugging of (C)Python applications
 
Metasepi team meeting #19: ATS application on Arduino
Metasepi team meeting #19: ATS application on ArduinoMetasepi team meeting #19: ATS application on Arduino
Metasepi team meeting #19: ATS application on Arduino
 
Metasepi team meeting #20: Start! ATS programming on MCU
Metasepi team meeting #20: Start! ATS programming on MCUMetasepi team meeting #20: Start! ATS programming on MCU
Metasepi team meeting #20: Start! ATS programming on MCU
 
Writing NetBSD Sound Drivers in Haskell
Writing NetBSD Sound Drivers in HaskellWriting NetBSD Sound Drivers in Haskell
Writing NetBSD Sound Drivers in Haskell
 
Get your teeth into Plack
Get your teeth into PlackGet your teeth into Plack
Get your teeth into Plack
 
Share the Experience of Using Embedded Development Board
Share the Experience of Using Embedded Development BoardShare the Experience of Using Embedded Development Board
Share the Experience of Using Embedded Development Board
 
WebSocket on client & server using websocket-sharp & ASP.NET Core
WebSocket on client & server using websocket-sharp & ASP.NET CoreWebSocket on client & server using websocket-sharp & ASP.NET Core
WebSocket on client & server using websocket-sharp & ASP.NET Core
 
@arzumy Dev Setup #klxrb
@arzumy Dev Setup #klxrb@arzumy Dev Setup #klxrb
@arzumy Dev Setup #klxrb
 
Metasepi team meeting: Ajhc Project Overview
Metasepi team meeting: Ajhc Project OverviewMetasepi team meeting: Ajhc Project Overview
Metasepi team meeting: Ajhc Project Overview
 
carrow - Go bindings to Apache Arrow via C++-API
carrow - Go bindings to Apache Arrow via C++-APIcarrow - Go bindings to Apache Arrow via C++-API
carrow - Go bindings to Apache Arrow via C++-API
 
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...
 
OpenMP-OpenACC-Offload-Cauldron2022-1.pdf
OpenMP-OpenACC-Offload-Cauldron2022-1.pdfOpenMP-OpenACC-Offload-Cauldron2022-1.pdf
OpenMP-OpenACC-Offload-Cauldron2022-1.pdf
 
SaaS Boilerplate.pptx
SaaS Boilerplate.pptxSaaS Boilerplate.pptx
SaaS Boilerplate.pptx
 
Debugging Python with gdb
Debugging Python with gdbDebugging Python with gdb
Debugging Python with gdb
 
Qt native built for raspberry zero
Qt native built for  raspberry zeroQt native built for  raspberry zero
Qt native built for raspberry zero
 

Recently uploaded

Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
fredae14
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
LucaBarbaro3
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdfNunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
flufftailshop
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
HarisZaheer8
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Azure API Management to expose backend services securely
Azure API Management to expose backend services securelyAzure API Management to expose backend services securely
Azure API Management to expose backend services securely
Dinusha Kumarasiri
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
saastr
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
Postman
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Tatiana Kojar
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 

Recently uploaded (20)

Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdfNunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Azure API Management to expose backend services securely
Azure API Management to expose backend services securelyAzure API Management to expose backend services securely
Azure API Management to expose backend services securely
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 

Functional MCU programming

  • 1. Functional MCU programming Metasepi Project / Kiwamu Okabe
  • 2. Who am I ? ☆ http://www.masterq.net/ ☆ Twitter: @master_q ☆ Organizer of Metasepi Project ☆ A developer of Ajhc Haskell compiler ☆ A Debian Maintainer ☆ 10 years' experience in developing OS using NetBSD
  • 3. Kick off workshop at Nagoya ! Functional MCU programing workshop ☆ At Nagoya ☆ Meeting minutes http://metasepi.org/posts/2014-01-05-mbed_fp_0.html ☆ Now planning the next workshop...
  • 4. Why functional lang for MCU? ☆ Internet of Things (IoT) ☆ We will live in IoT world ☆ Can't debug IoT device on the field ☆ Should avoid runtime error ☆ We need strong type !
  • 6. Choice of cross compiler
  • 7. Cross compiler: (A)jhc http://ajhc.metasepi.org/ ☆ Language: Haskell ☆ Haskell language is major ! ☆ Need GC heap = Need more memory ☆ Experience running on MCU ARM Cortex-M https://github.com/ajhc/demo-cortex-m3
  • 8. Cross compiler: ATS http://www.ats-lang.org/ ☆ Language: ML ☆ Optional GC = Need low memory ☆ No experience running on MCU ☆ Document translated into Japanese http://jats-ug.metasepi.org/
  • 9. Cross compiler: Rust http://www.rust-lang.org/ ☆ Language: Own syntax like C or JS ☆ Optional GC = Need low memory ☆ Experience running on MCU ARM Cortex-M https://github.com/neykov/armboot ☆ Developing by Mozilla ☆ @pirapira knows the detail of it
  • 10. Choice of MCU board
  • 11. Which MCU? Of course mbed!? Why? ☆ Major ☆ 32bit ☆ Large memory size (> 20kB) ☆ Debugger ☆ Ethernet
  • 12. Which board is good for us... ☆ mbed LPC1768 (¥5,200) RAM 32kB+32kB Ethernet https://mbed.org/platforms/mbed-LPC1768/ ☆ Seeeduino Arch Pro ($43.41) RAM 32kB+32kB Ethernet http://www.seeedstudio.com/depot/arch-pro-p-1677.html ☆ FRDM-KL46Z (¥1,634) RAM 32kB No Ethernet http://www.freescale.com/webapp/sps/site/prod_summary.jsp? code=FRDM-KL46Z
  • 14. gdbserver: pyOCD https://github.com/mbedmicro/pyOCD ☆ Only for MCU using CMSIS-DAP ☆ But now support only mbed LPC1768 ☆ In future, support more board ?
  • 15. gdbserver: OpenOCD http://openocd.sourceforge.net/ ☆ Comming CMSIS-DAP support! ☆ Need HIDAPI library http://www.signal11.us/oss/hidapi/
  • 16. OpenOCD enabling CMSIS-DAP $ $ $ $ $ $ git clone git://github.com/signal11/hidapi.git cd hidapi ./bootstrap ./configure make sudo make install $ git clone https://github.com/master-q/openocd.git $ cd openocd $ git checkout masterq-mbedfest-201401 $ ./bootstrap $ ./configure --enable-cmsis-dap --ship-Olimex ARM-JTAG-EW Programmer yes (auto) CMSIS-DAP Compliant Debugger yes $ make Some time the following FRDM-KL46Z patch is useful. http://permalink.gmane.org/gmane.comp.debugging.openocd.devel/24258
  • 17. On mbed LPC1768 $ sudo ./src/openocd -f tcl/board/mbed-lpc1768.cfg $ arm-none-eabi-gdb (gdb) target remote (gdb) monitor reset (gdb) load Blink.elf localhost:3333 halt Push hard rest button. (gdb) c But too slow... Transfer rate: 50 bytes/sec, 3818 bytes/write. :(
  • 18. On Seeeduino Arch Pro Same as mbed LPC1768.
  • 19. On FRDM-KL46Z Use project at https://github.com/0xc0170/kinetis_klxx_gcc. $ sudo ./src/openocd -f tcl/board/frdm-kl46z.cfg --snip-cortex_m reset_config sysresetreq Info : CMSIS-DAP: FW Version = 1.0 Info : SWCLK/TCK = 0 SWDIO/TMS = 1 TDI = 0 TDO = 0 nTRST = 0 nRESET = 1 Info : DAP_SWJ Sequence (reset: 50+ '1' followed by 0) Info : CMSIS-DAP: Interface ready Info : clock speed 100 kHz Info : IDCODE 0x0bc11477 Info : MKL46Z256VLL4.cpu: hardware has 2 breakpoints, 2 watchpoints Info : accepting 'gdb' connection from 3333 Warn : Cannot communicate... target not halted. Error: auto_probe failed Error: Connect failed. Consider setting up a gdb-attach event for the target to prepare. Error: attempted 'gdb' connection rejected X(
  • 20. Be a hacker such as ねむいさん http://nemuisan.blog.bai.ne.jp/ ☆ OpenOCD hacker ☆ There is his patch at following URL http://nemuisan.blog.bai.ne.jp/?eid=192848#OPENOCD
  • 21. Functional programming fanzine ☆ http://www.paraiso-lang.org/ikmsm/ ☆ About Haskell or OCaml or . . . ☆ About Ajhc in C84 book ☆ About Android app with Haskell in C85 book ☆ Call me if you read it! http://www.paraiso-lang.org/ikmsm/books/c85.html