SlideShare a Scribd company logo
1 of 38
Gophers, Beagles, Hummingboards and Pi 
Building Go applications for SoC ARM boards 
RRyyaannCox 
asciiarmor.com 
ryan.a.cox@gmail.com
ARM
https://stackoverflow.com/questions/14794460/how-does-the-arm-architecture-differ-from-x86
companies. 
10 billion ARM-based chips 
ARM’s customers reported that they had shipped more 
than 10 billion ARM-based chips into everything from 
phones and tablets to smart sensors and servers. This 
takes the cumulative total of ARM-based chips shipped 
to over 50 billion 
400 million ARM-based chips with 
MaliTM graphics 
ARM’s Mali graphics processor brings games and 
user interfaces to life with stunning 3D graphics 
1st ARMv8-based chip shipped 
The ARMv8-A architecture adds 64-bit computing, 
amongst other advances, and is suitable for a wide 
range of devices from mobile phones to servers. 
10Bn 
10Bn 
1st 
10Bn 
121 
400M 
1st 
10Bn 
1st 
121 
1st 
64 
Bit 
400M 
121 
1st 
64 
Bit 
400M 
121 
64 
Bit 
400M 
121 
64 
Bit 
20nm
ARM’s Mali graphics processor brings games and 
user interfaces to life with stunning 3D graphics 
1st ARMv8-based chip shipped 
The ARMv8-A architecture adds 64-bit computing, 
amongst other advances, and is suitable for a wide 
range of devices from mobile phones to servers. 
1st ARM big.LITTLETM technology-based 
chip shipped 
big.LITTLE technology further improves performance in 
energy-ef cient computing devices, and first shipped in 
the Samsung Exynos family of chips 
ARM hired net 441 full-time employees in 2013 
More than 70% of these new employees joined 
our R&D teams 
121 
121 
121 
121 
1st 
1st 
Bit 
20nm 
1st 
64 
Bit 
1st 
1st 
1st 
20nm 
441 
1st 
1st 
441 
64 
Bit 
20nm 
20nm 
20nm 
441 
64 
Bit 
441 
64 
Bit 
20nm
Manufacturer Freescale 
SoC i.MX6 
ARM 
Family Cortex-A 
ARM 
Core A9 
ARM 
https://en.wikipedia.org/wiki/List_of_ARM_microarchitectures 
Architecture ARMv7
Designer Apple 
Manufacturer Samsung 
SoC A5 
ARM 
Family Cortex-A 
ARM 
Architecture ARMv7 
ARM 
Core A9
Single Board Computers
Why? 
• Cost 
• Form Factor 
• Power 
• Access to IO 
• Linux 
• Familiar tool chain 
• Fanless ( quiet ) 
• Prototyping for custom fab 
https://www.kickstarter.com/projects/partyrobotics/bartendro-a-cocktail-dispensing-robot
Arduino Raspberry Pi B+ BBB Rev C Humming 
Board i2ex 
Arch 8bit 32bit 32bit 32bit 
Processor Atmel 
ATmega328 
Broadcom 
BCM2835 ARM11 
TI AM335x 
Cortex A8 
Freescale 
i.MX6 Dual A9 
Cores 1 1 1 2 
RAM 2k 512M 512M 1GB 
ROM 32k microSD 4GB microSD 
Clock 8Mhz 700Mhz 1GHz 1Ghz 
GPIO 14 27 69 8 
USB --- 4 1 2 
Cost $30 $40 $55 $100
http://codeascraft.com/2014/06/24/device-lab-checkout-rfid-style/
Le poulailler connecté 
• Prise de photos infrarouges, détection des oeufs 
• Prise de température / luminosité / capteur mouvement / capteurs d'ouverture 
• Surveillance de la température, de la tension d'alimentation et du courant consommé 
• Alertes via Twitter et SMS (API Free Mobile) 
http://www.digitalspirit.org/blog/index.php/post/2014/09/30/Le-poulailler-connect%C3%A9 
More Projects: http://hackaday.io/projects/tag/raspberry%20pi/page/8
Go Tool Chain
Why Go for ARM SoC? 
• Excellent cross compilation tool chain 
• Native compilation / No VM 
• Diverse and growing libraries usable as-is 
• Support for unsigned ints ( uint8 / uint16 ... )
~/armtest $ GOARCH=386 GOOS=linux go build 
~/armtest $ file armtest 
armtest: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, not stripped 
~/armtest $ GOARCH=amd64 GOOS=darwin go build 
~/armtest $ file armtest 
armtest: Mach-O 64-bit executable x86_64 
brew install go --cross-compile-common or --cross-compile-all 
$ hg clone -u release https://code.google.com/p/go 
$ cd go/src 
$ ./all.bash 
Parallellize builds and more: 
https://github.com/mitchellh/gox
~/armtest $ GOARCH=amd64 GOOS=windows go build 
~/armtest $ file armtest.exe 
armtest.exe: PE32+ executable for MS Windows (console) Mono/.Net assembly 
~/armtest $ GOARCH=arm GOOS=linux GOARM=7 go build 
~/armtest $ file armtest 
armtest: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, not stripped 
https://golang.org/doc/install/source#environment
https://code.google.com/p/go-wiki/wiki/GoArm
BL ,math/rand.Float32(SB) 
BL ,_sfloat(SB) 
MOVF 4(R13),F2 
MOVF F2,"".f1-48(SP) 
PCDATA $1,$0 
BL ,math/rand.Float32(SB) 
BL ,_sfloat(SB) 
MOVF "".f1-48(SP),F4 
MOVF 4(R13),F2 
ADDF F2,F4,F1 
MOVF F1,F3 
MULF F2,F4,F1 
MOVF F1,F2 
BL,math/rand.Float32(SB) 
... MOVF 4(R13),F2 
MOVF F2,"".f1-48(SP) 
PCDATA $1,$0 
BL,math/rand.Float32(SB) 
... MOVF "".f1-48(SP),F4 
MOVF 4(R13),F2 
ADDF F2,F4,F1 
MOVF F1,F3 
MULF F2,F4,F1 
MOVF F1,F2 
$ GOOS=linux GOARCH=arm GOARM=5 go build -gcflags -S 2> arm5.s 
$ GOOS=linux GOARCH=arm GOARM=7 go build -gcflags -S 2> arm7.s
The most important thing to know about Go's assembler is that it is 
not a direct representation of the underlying machine ... the 
compiler emits a kind of incompletely defined instruction set, in 
binary form, which the linker then completes. ... In general, 
machine-specific operations tend to appear as themselves, while 
more general concepts like memory move and subroutine call and 
return are more abstract. The details vary with architecture, and we 
apologize for the imprecision; the situation is not well-defined. 
https://golang.org/doc/asm 
http://plan9.bell-labs.com/sys/doc/asm.html 
http://www.doxsey.net/blog/go-and-assembly/
bl 57dc4 
<math/rand.Float32> 
bl 40744 <_sfloat> 
vldr s8, [sp, #36] ; 0x24 
vldr s4, [sp, #4] 
vadd.f32 s2, s8, s4 
vmov.f32 s6, s2 
vmul.f32 s2, s8, s4 
vmov.f32 s4, s2 
vmov.f32 s10, s6 
bl 531c4 <math/rand.Float32> 
... 
vldr s8, [sp, #36] ; 0x24 
vldr s4, [sp, #4] 
vadd.f32 s2, s8, s4 
vmov.f32 s6, s2 
vmul.f32 s2, s8, s4 
vmov.f32 s4, s2 
vmov.f32 s10, s6 
$ gobjdump -D -s xv5 > 5.s 
$ gobjdump -D -s xv7 > 7.s
Buildflags 
Use to specify 
• integration / unit tests 
• architecture / OS 
• platform ( BBB, Rpi,. .. ) 
// +build bbb 
$ go build -tag bbb 
// +build linux darwin 
// +build 386 
(linux OR darwin) AND 386 
http://golang.org/pkg/go/build/
embd
http://www.thoughtworks.com/insights/blog/introducing-embd-superheroic-embedded-programming-framework 
https://www.youtube.com/watch?v=cAh3pyHJXxQ&list=UUogI7Xgvtd8cDMKkwj0p47g
• GPIO 
• PWM 
• i2c 
• SPI 
• Sensors 
• Platform 
• MIT License 
• Idiomatic 
• Docs / Examples 
• Concurrent
i2c
The original spec allowed for only 100kHz communications, 
and provided only for 7-bit addresses, limiting the number of 
devices on the bus to 112 (there are several reserved 
addresses, which will never be used for valid I2C addresses). 
In 1992, the first public specification was published, adding a 
400kHz fast-mode as well as an expanded 10-bit address 
space. 
Sending 10101010 plus ack 0 
http://support.saleae.com/hc/en-us/articles/200730905-Learn-I2C-Inter-Integrated-Circuit
i2c Driver Creation 
• Get a breakout board 
• Find datasheet 
• Inspect drivers for other platforms ( warning: 
licenses ) 
• Determine subset of features to implement 
• Setup Breadboard 
• Verify functionality via i2cdetect / i2cget / i2cset 
• Code up in Go
architecture 
AApppplliiccaattiioonn 
IInntteerrffaaccee 
Thrift OOSS // KKeerrnneell 
HHaarrddwwaarree 
No syscalls 
No IOCTLs 
No cgo 
embd 
gobot 
custom 
+ kmods 
Standard IPC mechanisms 
Sockets 
GO RPC 
ZeroMQ 
Protocol Buffers 
Custom PCB 
COTS 
Josh Bleecher - https://www.youtube.com/watch?v=a4BQRUpQoe8
ex: litebrite
Link Dump 
https://www.sparkfun.com/ 
http://adafruit.com/ 
http://hackaday.com/ 
https://www.tindie.com/ 
http://www.amazon.com/Practical-Electronics-Inventors-Third-Edition-ebook/ 
dp/B00BAR2YGK 
https://www.youtube.com/watch?v=GJX0BRUagCg
THANK YOU 
RRyyaannCox 
asciiarmor.com 
ryan.a.cox@gmail.com

More Related Content

What's hot

Embedded Recipes 2019 - Pipewire a new foundation for embedded multimedia
Embedded Recipes 2019 - Pipewire a new foundation for embedded multimediaEmbedded Recipes 2019 - Pipewire a new foundation for embedded multimedia
Embedded Recipes 2019 - Pipewire a new foundation for embedded multimediaAnne Nicolas
 
Making Open Source Hardware for Retrogaming on Raspberry Pi
Making Open Source Hardware for Retrogaming on Raspberry PiMaking Open Source Hardware for Retrogaming on Raspberry Pi
Making Open Source Hardware for Retrogaming on Raspberry PiLeon Anavi
 
Single board computer options
Single board computer optionsSingle board computer options
Single board computer optionsALTANAI BISHT
 
Embedded Recipes 2018 - SoC+FPGA update in 2018 - Marek Vasut
Embedded Recipes 2018 - SoC+FPGA update in 2018 - Marek VasutEmbedded Recipes 2018 - SoC+FPGA update in 2018 - Marek Vasut
Embedded Recipes 2018 - SoC+FPGA update in 2018 - Marek VasutAnne Nicolas
 
Electronics & computing - All connectors
Electronics & computing - All connectorsElectronics & computing - All connectors
Electronics & computing - All connectorsdegarden
 
Putting an Apple IIgs BBS on the internet
Putting an Apple IIgs BBS on the internetPutting an Apple IIgs BBS on the internet
Putting an Apple IIgs BBS on the internetAndrew Roughan
 
Docker Use Cases on Raspberry Pi
Docker Use Cases on Raspberry PiDocker Use Cases on Raspberry Pi
Docker Use Cases on Raspberry PiPhilip Zheng
 
Exploring Raspberry Pi
Exploring Raspberry PiExploring Raspberry Pi
Exploring Raspberry PiLentin Joseph
 
Raspberry Pi - HW/SW Application Development
Raspberry Pi - HW/SW Application DevelopmentRaspberry Pi - HW/SW Application Development
Raspberry Pi - HW/SW Application DevelopmentCorley S.r.l.
 
Kernel Recipes 2019 - Driving the industry toward upstream first
Kernel Recipes 2019 - Driving the industry toward upstream firstKernel Recipes 2019 - Driving the industry toward upstream first
Kernel Recipes 2019 - Driving the industry toward upstream firstAnne Nicolas
 
Alessandro Abbruzzetti - Kernal64
Alessandro Abbruzzetti - Kernal64Alessandro Abbruzzetti - Kernal64
Alessandro Abbruzzetti - Kernal64Scala Italy
 
OzKFest 2015 - (Solid) State of the Nation
OzKFest 2015 - (Solid) State of the NationOzKFest 2015 - (Solid) State of the Nation
OzKFest 2015 - (Solid) State of the Nationapple2europlus
 
Broadway microprocessor
Broadway microprocessorBroadway microprocessor
Broadway microprocessorLeo
 
Embedded Recipes 2019 - Testing firmware the devops way
Embedded Recipes 2019 - Testing firmware the devops wayEmbedded Recipes 2019 - Testing firmware the devops way
Embedded Recipes 2019 - Testing firmware the devops wayAnne Nicolas
 
Embedded Recipes 2019 - Linux on Open Source Hardware and Libre Silicon
Embedded Recipes 2019 - Linux on Open Source Hardware and Libre SiliconEmbedded Recipes 2019 - Linux on Open Source Hardware and Libre Silicon
Embedded Recipes 2019 - Linux on Open Source Hardware and Libre SiliconAnne Nicolas
 

What's hot (19)

Embedded Recipes 2019 - Pipewire a new foundation for embedded multimedia
Embedded Recipes 2019 - Pipewire a new foundation for embedded multimediaEmbedded Recipes 2019 - Pipewire a new foundation for embedded multimedia
Embedded Recipes 2019 - Pipewire a new foundation for embedded multimedia
 
FPGA MiSTer (July 2019)
FPGA MiSTer (July 2019)FPGA MiSTer (July 2019)
FPGA MiSTer (July 2019)
 
Making Open Source Hardware for Retrogaming on Raspberry Pi
Making Open Source Hardware for Retrogaming on Raspberry PiMaking Open Source Hardware for Retrogaming on Raspberry Pi
Making Open Source Hardware for Retrogaming on Raspberry Pi
 
Single board computer options
Single board computer optionsSingle board computer options
Single board computer options
 
Beaglebone black
Beaglebone blackBeaglebone black
Beaglebone black
 
Embedded Recipes 2018 - SoC+FPGA update in 2018 - Marek Vasut
Embedded Recipes 2018 - SoC+FPGA update in 2018 - Marek VasutEmbedded Recipes 2018 - SoC+FPGA update in 2018 - Marek Vasut
Embedded Recipes 2018 - SoC+FPGA update in 2018 - Marek Vasut
 
RISC-V 30908 patra
RISC-V 30908 patraRISC-V 30908 patra
RISC-V 30908 patra
 
Electronics & computing - All connectors
Electronics & computing - All connectorsElectronics & computing - All connectors
Electronics & computing - All connectors
 
Putting an Apple IIgs BBS on the internet
Putting an Apple IIgs BBS on the internetPutting an Apple IIgs BBS on the internet
Putting an Apple IIgs BBS on the internet
 
Docker Use Cases on Raspberry Pi
Docker Use Cases on Raspberry PiDocker Use Cases on Raspberry Pi
Docker Use Cases on Raspberry Pi
 
Exploring Raspberry Pi
Exploring Raspberry PiExploring Raspberry Pi
Exploring Raspberry Pi
 
Raspberry Pi - HW/SW Application Development
Raspberry Pi - HW/SW Application DevelopmentRaspberry Pi - HW/SW Application Development
Raspberry Pi - HW/SW Application Development
 
Kernel Recipes 2019 - Driving the industry toward upstream first
Kernel Recipes 2019 - Driving the industry toward upstream firstKernel Recipes 2019 - Driving the industry toward upstream first
Kernel Recipes 2019 - Driving the industry toward upstream first
 
Alessandro Abbruzzetti - Kernal64
Alessandro Abbruzzetti - Kernal64Alessandro Abbruzzetti - Kernal64
Alessandro Abbruzzetti - Kernal64
 
OzKFest 2015 - (Solid) State of the Nation
OzKFest 2015 - (Solid) State of the NationOzKFest 2015 - (Solid) State of the Nation
OzKFest 2015 - (Solid) State of the Nation
 
Pi Is For Python
Pi Is For PythonPi Is For Python
Pi Is For Python
 
Broadway microprocessor
Broadway microprocessorBroadway microprocessor
Broadway microprocessor
 
Embedded Recipes 2019 - Testing firmware the devops way
Embedded Recipes 2019 - Testing firmware the devops wayEmbedded Recipes 2019 - Testing firmware the devops way
Embedded Recipes 2019 - Testing firmware the devops way
 
Embedded Recipes 2019 - Linux on Open Source Hardware and Libre Silicon
Embedded Recipes 2019 - Linux on Open Source Hardware and Libre SiliconEmbedded Recipes 2019 - Linux on Open Source Hardware and Libre Silicon
Embedded Recipes 2019 - Linux on Open Source Hardware and Libre Silicon
 

Similar to Developing Applications for Beagle Bone Black, Raspberry Pi and SoC Single Board ARM Computers with Go

First Steps Developing Embedded Applications using Heterogeneous Multi-core P...
First Steps Developing Embedded Applications using Heterogeneous Multi-core P...First Steps Developing Embedded Applications using Heterogeneous Multi-core P...
First Steps Developing Embedded Applications using Heterogeneous Multi-core P...Toradex
 
0xdroid -- community-developed Android distribution by 0xlab
0xdroid -- community-developed Android distribution by 0xlab0xdroid -- community-developed Android distribution by 0xlab
0xdroid -- community-developed Android distribution by 0xlabNational Cheng Kung University
 
Linxu conj2016 96boards
Linxu conj2016 96boardsLinxu conj2016 96boards
Linxu conj2016 96boardsLF Events
 
0xdroid osdc-2010-100426084937-phpapp02
0xdroid osdc-2010-100426084937-phpapp020xdroid osdc-2010-100426084937-phpapp02
0xdroid osdc-2010-100426084937-phpapp02chon2010
 
Tac Presentation October 72014- Raspberry PI
Tac Presentation October 72014- Raspberry PITac Presentation October 72014- Raspberry PI
Tac Presentation October 72014- Raspberry PICliff Samuels Jr.
 
Exploring the Programming Models for the LUMI Supercomputer
Exploring the Programming Models for the LUMI Supercomputer Exploring the Programming Models for the LUMI Supercomputer
Exploring the Programming Models for the LUMI Supercomputer George Markomanolis
 
Deep learning: Hardware Landscape
Deep learning: Hardware LandscapeDeep learning: Hardware Landscape
Deep learning: Hardware LandscapeGrigory Sapunov
 
Cross-compilation native sous android
Cross-compilation native sous androidCross-compilation native sous android
Cross-compilation native sous androidThierry Gayet
 
Experiences with Oracle SPARC S7-2 Server
Experiences with Oracle SPARC S7-2 ServerExperiences with Oracle SPARC S7-2 Server
Experiences with Oracle SPARC S7-2 ServerJomaSoft
 
Open-source Android 10 on Orange Pi: myth or reality?
Open-source Android 10 on Orange Pi: myth or reality?Open-source Android 10 on Orange Pi: myth or reality?
Open-source Android 10 on Orange Pi: myth or reality?GlobalLogic Ukraine
 
Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)RuggedBoardGroup
 
Abc beagleboard Getting To Know It
Abc beagleboard Getting To Know ItAbc beagleboard Getting To Know It
Abc beagleboard Getting To Know Itrviolachurch
 
IMAGE CAPTURE, PROCESSING AND TRANSFER VIA ETHERNET UNDER CONTROL OF MATLAB G...
IMAGE CAPTURE, PROCESSING AND TRANSFER VIA ETHERNET UNDER CONTROL OF MATLAB G...IMAGE CAPTURE, PROCESSING AND TRANSFER VIA ETHERNET UNDER CONTROL OF MATLAB G...
IMAGE CAPTURE, PROCESSING AND TRANSFER VIA ETHERNET UNDER CONTROL OF MATLAB G...Christopher Diamantopoulos
 
AAME ARM Techcon2013 003v02 Software Development
AAME ARM Techcon2013 003v02  Software DevelopmentAAME ARM Techcon2013 003v02  Software Development
AAME ARM Techcon2013 003v02 Software DevelopmentAnh Dung NGUYEN
 
Flutter Vikings 2022 - Full Stack Dart
Flutter Vikings 2022  - Full Stack DartFlutter Vikings 2022  - Full Stack Dart
Flutter Vikings 2022 - Full Stack DartChris Swan
 
Tesla Hacking to FreedomEV
Tesla Hacking to FreedomEVTesla Hacking to FreedomEV
Tesla Hacking to FreedomEVJasper Nuyens
 
Aftab_Alam_Resume2016
Aftab_Alam_Resume2016Aftab_Alam_Resume2016
Aftab_Alam_Resume2016AFTAB ALAM
 

Similar to Developing Applications for Beagle Bone Black, Raspberry Pi and SoC Single Board ARM Computers with Go (20)

First Steps Developing Embedded Applications using Heterogeneous Multi-core P...
First Steps Developing Embedded Applications using Heterogeneous Multi-core P...First Steps Developing Embedded Applications using Heterogeneous Multi-core P...
First Steps Developing Embedded Applications using Heterogeneous Multi-core P...
 
0xdroid -- community-developed Android distribution by 0xlab
0xdroid -- community-developed Android distribution by 0xlab0xdroid -- community-developed Android distribution by 0xlab
0xdroid -- community-developed Android distribution by 0xlab
 
ARM Processor Tutorial
ARM Processor Tutorial ARM Processor Tutorial
ARM Processor Tutorial
 
Linxu conj2016 96boards
Linxu conj2016 96boardsLinxu conj2016 96boards
Linxu conj2016 96boards
 
Tools for FPGA Development
Tools for FPGA DevelopmentTools for FPGA Development
Tools for FPGA Development
 
0xdroid osdc-2010-100426084937-phpapp02
0xdroid osdc-2010-100426084937-phpapp020xdroid osdc-2010-100426084937-phpapp02
0xdroid osdc-2010-100426084937-phpapp02
 
Tac Presentation October 72014- Raspberry PI
Tac Presentation October 72014- Raspberry PITac Presentation October 72014- Raspberry PI
Tac Presentation October 72014- Raspberry PI
 
Exploring the Programming Models for the LUMI Supercomputer
Exploring the Programming Models for the LUMI Supercomputer Exploring the Programming Models for the LUMI Supercomputer
Exploring the Programming Models for the LUMI Supercomputer
 
Deep learning: Hardware Landscape
Deep learning: Hardware LandscapeDeep learning: Hardware Landscape
Deep learning: Hardware Landscape
 
Cross-compilation native sous android
Cross-compilation native sous androidCross-compilation native sous android
Cross-compilation native sous android
 
Experiences with Oracle SPARC S7-2 Server
Experiences with Oracle SPARC S7-2 ServerExperiences with Oracle SPARC S7-2 Server
Experiences with Oracle SPARC S7-2 Server
 
Open-source Android 10 on Orange Pi: myth or reality?
Open-source Android 10 on Orange Pi: myth or reality?Open-source Android 10 on Orange Pi: myth or reality?
Open-source Android 10 on Orange Pi: myth or reality?
 
Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)
 
Abc beagleboard Getting To Know It
Abc beagleboard Getting To Know ItAbc beagleboard Getting To Know It
Abc beagleboard Getting To Know It
 
IMAGE CAPTURE, PROCESSING AND TRANSFER VIA ETHERNET UNDER CONTROL OF MATLAB G...
IMAGE CAPTURE, PROCESSING AND TRANSFER VIA ETHERNET UNDER CONTROL OF MATLAB G...IMAGE CAPTURE, PROCESSING AND TRANSFER VIA ETHERNET UNDER CONTROL OF MATLAB G...
IMAGE CAPTURE, PROCESSING AND TRANSFER VIA ETHERNET UNDER CONTROL OF MATLAB G...
 
HiPEAC-Keynote.pptx
HiPEAC-Keynote.pptxHiPEAC-Keynote.pptx
HiPEAC-Keynote.pptx
 
AAME ARM Techcon2013 003v02 Software Development
AAME ARM Techcon2013 003v02  Software DevelopmentAAME ARM Techcon2013 003v02  Software Development
AAME ARM Techcon2013 003v02 Software Development
 
Flutter Vikings 2022 - Full Stack Dart
Flutter Vikings 2022  - Full Stack DartFlutter Vikings 2022  - Full Stack Dart
Flutter Vikings 2022 - Full Stack Dart
 
Tesla Hacking to FreedomEV
Tesla Hacking to FreedomEVTesla Hacking to FreedomEV
Tesla Hacking to FreedomEV
 
Aftab_Alam_Resume2016
Aftab_Alam_Resume2016Aftab_Alam_Resume2016
Aftab_Alam_Resume2016
 

More from ryancox

Brian O'Connor HBase Talk - Triangle Hadoop Users Group Dec 2010
Brian O'Connor HBase Talk - Triangle Hadoop Users Group Dec 2010 Brian O'Connor HBase Talk - Triangle Hadoop Users Group Dec 2010
Brian O'Connor HBase Talk - Triangle Hadoop Users Group Dec 2010 ryancox
 
Hadoop New And Note - December 2010 TriHUG
Hadoop New And Note - December 2010 TriHUGHadoop New And Note - December 2010 TriHUG
Hadoop New And Note - December 2010 TriHUGryancox
 
Tri hug 2010 wei
Tri hug 2010   weiTri hug 2010   wei
Tri hug 2010 weiryancox
 
Megadata With Python and Hadoop
Megadata With Python and HadoopMegadata With Python and Hadoop
Megadata With Python and Hadoopryancox
 
July 2010 Triangle Hadoop Users Group - Chad Vawter Slides
July 2010 Triangle Hadoop Users Group - Chad Vawter SlidesJuly 2010 Triangle Hadoop Users Group - Chad Vawter Slides
July 2010 Triangle Hadoop Users Group - Chad Vawter Slidesryancox
 

More from ryancox (6)

Brian O'Connor HBase Talk - Triangle Hadoop Users Group Dec 2010
Brian O'Connor HBase Talk - Triangle Hadoop Users Group Dec 2010 Brian O'Connor HBase Talk - Triangle Hadoop Users Group Dec 2010
Brian O'Connor HBase Talk - Triangle Hadoop Users Group Dec 2010
 
Hadoop New And Note - December 2010 TriHUG
Hadoop New And Note - December 2010 TriHUGHadoop New And Note - December 2010 TriHUG
Hadoop New And Note - December 2010 TriHUG
 
Tri hug 2010 wei
Tri hug 2010   weiTri hug 2010   wei
Tri hug 2010 wei
 
Megadata With Python and Hadoop
Megadata With Python and HadoopMegadata With Python and Hadoop
Megadata With Python and Hadoop
 
July 2010 Triangle Hadoop Users Group - Chad Vawter Slides
July 2010 Triangle Hadoop Users Group - Chad Vawter SlidesJuly 2010 Triangle Hadoop Users Group - Chad Vawter Slides
July 2010 Triangle Hadoop Users Group - Chad Vawter Slides
 
dtrace
dtracedtrace
dtrace
 

Recently uploaded

Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 

Recently uploaded (20)

Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 

Developing Applications for Beagle Bone Black, Raspberry Pi and SoC Single Board ARM Computers with Go

  • 1. Gophers, Beagles, Hummingboards and Pi Building Go applications for SoC ARM boards RRyyaannCox asciiarmor.com ryan.a.cox@gmail.com
  • 2. ARM
  • 3.
  • 5.
  • 6. companies. 10 billion ARM-based chips ARM’s customers reported that they had shipped more than 10 billion ARM-based chips into everything from phones and tablets to smart sensors and servers. This takes the cumulative total of ARM-based chips shipped to over 50 billion 400 million ARM-based chips with MaliTM graphics ARM’s Mali graphics processor brings games and user interfaces to life with stunning 3D graphics 1st ARMv8-based chip shipped The ARMv8-A architecture adds 64-bit computing, amongst other advances, and is suitable for a wide range of devices from mobile phones to servers. 10Bn 10Bn 1st 10Bn 121 400M 1st 10Bn 1st 121 1st 64 Bit 400M 121 1st 64 Bit 400M 121 64 Bit 400M 121 64 Bit 20nm
  • 7. ARM’s Mali graphics processor brings games and user interfaces to life with stunning 3D graphics 1st ARMv8-based chip shipped The ARMv8-A architecture adds 64-bit computing, amongst other advances, and is suitable for a wide range of devices from mobile phones to servers. 1st ARM big.LITTLETM technology-based chip shipped big.LITTLE technology further improves performance in energy-ef cient computing devices, and first shipped in the Samsung Exynos family of chips ARM hired net 441 full-time employees in 2013 More than 70% of these new employees joined our R&D teams 121 121 121 121 1st 1st Bit 20nm 1st 64 Bit 1st 1st 1st 20nm 441 1st 1st 441 64 Bit 20nm 20nm 20nm 441 64 Bit 441 64 Bit 20nm
  • 8. Manufacturer Freescale SoC i.MX6 ARM Family Cortex-A ARM Core A9 ARM https://en.wikipedia.org/wiki/List_of_ARM_microarchitectures Architecture ARMv7
  • 9. Designer Apple Manufacturer Samsung SoC A5 ARM Family Cortex-A ARM Architecture ARMv7 ARM Core A9
  • 11. Why? • Cost • Form Factor • Power • Access to IO • Linux • Familiar tool chain • Fanless ( quiet ) • Prototyping for custom fab https://www.kickstarter.com/projects/partyrobotics/bartendro-a-cocktail-dispensing-robot
  • 12.
  • 13. Arduino Raspberry Pi B+ BBB Rev C Humming Board i2ex Arch 8bit 32bit 32bit 32bit Processor Atmel ATmega328 Broadcom BCM2835 ARM11 TI AM335x Cortex A8 Freescale i.MX6 Dual A9 Cores 1 1 1 2 RAM 2k 512M 512M 1GB ROM 32k microSD 4GB microSD Clock 8Mhz 700Mhz 1GHz 1Ghz GPIO 14 27 69 8 USB --- 4 1 2 Cost $30 $40 $55 $100
  • 14.
  • 16. Le poulailler connecté • Prise de photos infrarouges, détection des oeufs • Prise de température / luminosité / capteur mouvement / capteurs d'ouverture • Surveillance de la température, de la tension d'alimentation et du courant consommé • Alertes via Twitter et SMS (API Free Mobile) http://www.digitalspirit.org/blog/index.php/post/2014/09/30/Le-poulailler-connect%C3%A9 More Projects: http://hackaday.io/projects/tag/raspberry%20pi/page/8
  • 18. Why Go for ARM SoC? • Excellent cross compilation tool chain • Native compilation / No VM • Diverse and growing libraries usable as-is • Support for unsigned ints ( uint8 / uint16 ... )
  • 19. ~/armtest $ GOARCH=386 GOOS=linux go build ~/armtest $ file armtest armtest: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, not stripped ~/armtest $ GOARCH=amd64 GOOS=darwin go build ~/armtest $ file armtest armtest: Mach-O 64-bit executable x86_64 brew install go --cross-compile-common or --cross-compile-all $ hg clone -u release https://code.google.com/p/go $ cd go/src $ ./all.bash Parallellize builds and more: https://github.com/mitchellh/gox
  • 20. ~/armtest $ GOARCH=amd64 GOOS=windows go build ~/armtest $ file armtest.exe armtest.exe: PE32+ executable for MS Windows (console) Mono/.Net assembly ~/armtest $ GOARCH=arm GOOS=linux GOARM=7 go build ~/armtest $ file armtest armtest: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, not stripped https://golang.org/doc/install/source#environment
  • 22.
  • 23. BL ,math/rand.Float32(SB) BL ,_sfloat(SB) MOVF 4(R13),F2 MOVF F2,"".f1-48(SP) PCDATA $1,$0 BL ,math/rand.Float32(SB) BL ,_sfloat(SB) MOVF "".f1-48(SP),F4 MOVF 4(R13),F2 ADDF F2,F4,F1 MOVF F1,F3 MULF F2,F4,F1 MOVF F1,F2 BL,math/rand.Float32(SB) ... MOVF 4(R13),F2 MOVF F2,"".f1-48(SP) PCDATA $1,$0 BL,math/rand.Float32(SB) ... MOVF "".f1-48(SP),F4 MOVF 4(R13),F2 ADDF F2,F4,F1 MOVF F1,F3 MULF F2,F4,F1 MOVF F1,F2 $ GOOS=linux GOARCH=arm GOARM=5 go build -gcflags -S 2> arm5.s $ GOOS=linux GOARCH=arm GOARM=7 go build -gcflags -S 2> arm7.s
  • 24. The most important thing to know about Go's assembler is that it is not a direct representation of the underlying machine ... the compiler emits a kind of incompletely defined instruction set, in binary form, which the linker then completes. ... In general, machine-specific operations tend to appear as themselves, while more general concepts like memory move and subroutine call and return are more abstract. The details vary with architecture, and we apologize for the imprecision; the situation is not well-defined. https://golang.org/doc/asm http://plan9.bell-labs.com/sys/doc/asm.html http://www.doxsey.net/blog/go-and-assembly/
  • 25. bl 57dc4 <math/rand.Float32> bl 40744 <_sfloat> vldr s8, [sp, #36] ; 0x24 vldr s4, [sp, #4] vadd.f32 s2, s8, s4 vmov.f32 s6, s2 vmul.f32 s2, s8, s4 vmov.f32 s4, s2 vmov.f32 s10, s6 bl 531c4 <math/rand.Float32> ... vldr s8, [sp, #36] ; 0x24 vldr s4, [sp, #4] vadd.f32 s2, s8, s4 vmov.f32 s6, s2 vmul.f32 s2, s8, s4 vmov.f32 s4, s2 vmov.f32 s10, s6 $ gobjdump -D -s xv5 > 5.s $ gobjdump -D -s xv7 > 7.s
  • 26. Buildflags Use to specify • integration / unit tests • architecture / OS • platform ( BBB, Rpi,. .. ) // +build bbb $ go build -tag bbb // +build linux darwin // +build 386 (linux OR darwin) AND 386 http://golang.org/pkg/go/build/
  • 27. embd
  • 29. • GPIO • PWM • i2c • SPI • Sensors • Platform • MIT License • Idiomatic • Docs / Examples • Concurrent
  • 30.
  • 31. i2c
  • 32. The original spec allowed for only 100kHz communications, and provided only for 7-bit addresses, limiting the number of devices on the bus to 112 (there are several reserved addresses, which will never be used for valid I2C addresses). In 1992, the first public specification was published, adding a 400kHz fast-mode as well as an expanded 10-bit address space. Sending 10101010 plus ack 0 http://support.saleae.com/hc/en-us/articles/200730905-Learn-I2C-Inter-Integrated-Circuit
  • 33.
  • 34. i2c Driver Creation • Get a breakout board • Find datasheet • Inspect drivers for other platforms ( warning: licenses ) • Determine subset of features to implement • Setup Breadboard • Verify functionality via i2cdetect / i2cget / i2cset • Code up in Go
  • 35. architecture AApppplliiccaattiioonn IInntteerrffaaccee Thrift OOSS // KKeerrnneell HHaarrddwwaarree No syscalls No IOCTLs No cgo embd gobot custom + kmods Standard IPC mechanisms Sockets GO RPC ZeroMQ Protocol Buffers Custom PCB COTS Josh Bleecher - https://www.youtube.com/watch?v=a4BQRUpQoe8
  • 37. Link Dump https://www.sparkfun.com/ http://adafruit.com/ http://hackaday.com/ https://www.tindie.com/ http://www.amazon.com/Practical-Electronics-Inventors-Third-Edition-ebook/ dp/B00BAR2YGK https://www.youtube.com/watch?v=GJX0BRUagCg
  • 38. THANK YOU RRyyaannCox asciiarmor.com ryan.a.cox@gmail.com