SlideShare a Scribd company logo
RaspberryPi
michal6103@gmail.com
Q&A
• Did anyone used microcontrollers or SoCs
• Atmel
• PIC
• Z80, …
• Any experiences with embedded systems or devboards?
• Arduino style…
• Raspberry/Orange/Banana Pi, Humming board, Beaglebone,Odroid
• Who plans to build a media center?
• Who has kids?
Raspberry Pi Foundation
Why Raspberry Pi and the Foundation
• Inspired by ZX Spectrum
• Cheap computer for every child
• Educational reasons – kids do not know how to code
• People happen to be consumers, RPF wants to inspire makers
• Accidental price
• 2006 model build on Atmel ATmega644
• Broadcom employees changed stuff
• Language of choice Python, later Scratch
• Many other languages and tools
Hardware
Geek’s guide
rPi Atmel edition
Models
Raspberry Pi Introduction
Raspberry Pi Model B+
• Announced on 14th July 2014
• Broadcom BCM2835 SoC, with ARM1176JZF-S 700 MHz
processor
• VideoCore IV dual-core 250 MHz GPU
• 512 MB SDRAM - shared by the GPU and CPU
• MicroSD card slot for boot and storage
• 4 x USB 2.0 ports (via on-board 5 port hub)
• RJ45 10/100 MBit/s Ethernet port
• HDMI and Composite video, audio through TRRS jack
• 40 pin GPIO, I2C, SPI, UART interface connector
• CSI (camera) and DSI (display) connectors
• 4 squarely positioned mounting holes
• 600 mA (3.0 W)
Raspberry Pi 2 Model B
• Announced on 2nd Feb 2015
• Broadcom BCM2836 SoC, with quad-core ARM Cortex-A7 900 MHz processor
• Ubuntu Core
• Windows 10 IOT Core
• VideoCore IV dual-core 250 MHz GPU
• 1 GB SDRAM - shared by the GPU and CPU
• MicroSD card slot for boot and storage
• 4 x USB 2.0 ports (via on-board 5 port hub)
• RJ45 10/100 MBit/s Ethernet port
• HDMI and Composite video, audio through TRRS jack
• 40 pin GPIO Interface connector
• CSI (camera) and DSI (display) connectors
• 4 squarely positioned mounting holes
Power – chief culprit
• Micro USB 5V, 1A
• Poly-fuse is problem of the past
• 5.25V is OK for USB
• http://www.modmypi.com/raspberry-pi/accessories/power-supplies/5v-2a-
ultra-hq-usb-power-supply-eu
• USB Power
• max_usb_current=1
• USB output current limit from 600mA to double that, 1200mA
Micro SD Card
• SD, SDHC, SDXC, UHC, all of them except the ones that do not work.
• Boot partition FAT32
• Max. around 20MB/s
• http://elinux.org/RPi_SD_cards
OS
B+ is ARMv6 a.k.a ARM11
• General purpose
• NOOBS - installer
• Raspbian
• Ubuntu Mate, Ubuntu Core (rPi2 only)
• Pidora, Arch and other unofficial
• Mediacenter
• OSMC
• Openelec
• Xbian
• Other obscure OSes
• Windows 10 IOT Core (rPi2 only)
• RISC OS
How to install
• FAT32, just extract it there
• Disk image – just dd it there
• Most distros have Win/Mac/Lin installers
Micro SD - Partitions
• diskpart
• list disk
• select diskn
• list partition
• select partitionn
• delete partition
Notifications and monitoring
• Red square: over-temperature
• Rainbow square: under-voltage
• /sys/class/thermal/thermal_zone0/temp
• /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
• Core temp below 70 degrees
• Voltage above 4.8V, across test pads PP3 (GND) and PP7 (VCC) or PP1( VCC before polyfuse)
• Brown-out detector will at VCC <= 4.65V switch off the power LED
• Watchdog – config.txt
• sudo apt-get install watchdog
• sudo update-rc.d watchdog defaults
• sudo vim /etc/watchdog.conf
Hardware
Hacker’s guide
What is really in BCM2835 SoC?
• ARM1176JZF-S 700 MHz processor – secondary processor
• Dualcore Videocore IV CPU @250MHz with SIMD Parallel Pixel Units
(PPU) which runs scalar (integer and float) and vector (integer only)
programs – primary processor
• Image Sensor Pipeline (ISP) providing lens shading, statistics and
distortion correction
• 12 QPU units which provide 24 GFLOPS compute performance for
coordinate, vertex and pixel shaders
Broadcom VideoCore IV @ 250 MHz
• OpenGL ES 2.0 - OpenGL is a 3D library
• OpenVG - OpenVG is a 2D vector drawing library
• EGL - EGL is an interface between OpenGL ES or OpenVG and the
underlying native platform window system.
• OpenMAX IL - OpenMAX API’s used for audio, video, and still images
processing
• Inside Videcore - https://www.raspberrypi.org/magpi-
issues/MagPi35.pdf page 35
VA API, CUDA and others like OpenCL
• OpenMAX
• QPU Assembly
Broadcom VideoCore IV @ 250 MHz
• MPEG-2 (license)
• VC-1 (license)
• 1080p30 H.264/MPEG-4 AVC high-profile decoder and encoder
• How to encode
https://www.raspberrypi.org/forums/viewtopic.php?t=72435
Dude I just want to build media center…
… more nerdy stuff at the end
Mediacenter
Distros
• No raspi-config here
What can it play
• Bundled acceleration
• H.264 (up to High Profile) up to 1080P
• MPEG-4 up to 1080P. This includes XviD and DivX (but not the older 3.xx DivX).
• Licenses: http://www.raspberrypi.com/license-keys/
• MPEG-2
• VC1
• GPU assisted:
• MJPEG, VP6, VP8 and OGG Theora. Limited to DVD resolutions.
• No acceleration:
• DivX 3, msmpeg, sorenson spark on the ARM. Should work for SD resolutions.
• DTS audio decode works well in recent builds
• TrueHD audio is CPU intensive and may require overclocking
Tuners
• H.264 encode/decode [DVB-S2]
• Licenses:
• MPEG2 decode [DVB-T, DVB-S]
• VC-1
• Tuners:
http://elinux.org/RPi_VerifiedPeripherals#USB_TV_Tuners_and_DVB_
devices
Audio
• Outputs:
• HDMI
• Analog
• I2S {HATs}
• USB soundcards
• MP3 soft decoding stereo
• AC3 , DTS, PCM pass-through
• Multichannel PCM not supported by all receivers – select 2.0 output
IR Remote
• Xbian mappings = Pain
• Kodi
• remote.xml
• Lircmap.xml
• lircd.conf
• USB IR stuff
• LIRC DT overlay – config.txt
• LIRC daemon
• HDMI-CEC
• CEC enabled HDMI cable – pin13
GPIO
GPIO
GPIO Permissions
• MMAP – root access
• SYSFS
• pigpio
• gpio-admin
GPIO performance
Language Library Tested / version Square wave
Shell /proc/mem access 2015-02-14 2.8 kHz
Shell / gpio utility WiringPi gpio utility 2015-02-15 / 2.25 40 Hz
Python RPi.GPIO 2015-02-15 / 0.5.10 70 kHz
Python wiringpi2 bindings 2015-02-15 / latest github 28 kHz
Ruby wiringpi bindings 2015-02-15 / latest gem (1.1.0) 21 kHz
C Native library 2015-02-15 / latest RaspPi 22 MHz
C BCM 2835 2015-02-15 / 1.38 5.4 MHz
C wiringPi 2015-02-15 / 2.25 4.1 – 4.6 MHz
Perl BCM 2835 2015-02-15 / 1.9 48 kHz
http://codeandlife.com/2012/07/03/benchmarking-raspberry-pi-gpio-speed/
Python GPIO
• import RPi.GPIO as GPIO
• Default and will be always supported
• MMAP - Script must be root or write access to /dev/mem
• Kind of abandoned, SPI, PWM missing
• from gpiozero import …
• New and cool
• Focused on beginners
• Examples with wiring diagrams
• import wiringpi2
• Wiringpi wrapper
• Stable, most complete
• import pigpio
• Daemon, no-root for users
• PWM, I2C, SPI, UART, waveforms,
How to access it?
• http://elinux.org/RPi_GPIO_Code_Samples
GPIO - Blink
• Interactive pinout diagram http://pinout.xyz/
• GPIO zero
from gpiozero import LED
from time import sleep
led = LED(17)
while True:
led.on()
sleep(1)
led.off()
sleep(1)
I am hacker, I hack!!!!
Custom GPIO pin setup
• pins_rev1 Rev1 pin setup. There are some difference because of the moved I2C pins
• pins_rev2 Rev2 pin setup. This includes the additional codec pins on P5
• pins_bplus1 Model B+ rev 1.1, including the full 40pin connector
• pins_bplus2 Model B+ rev 1.2, swapping the low-power and lan-run pins
• pins_aplus Model A+, lacking ethernet
• pins_2b1 Pi 2 Model B rev 1.0, controls the SMPS via I2C0
• pins_2b2 Pi 2 Model B rev 1.1, controls the SMPS via software I2C on 42&43
• pins_cm The Compute Module, note the default for this is the default for the chip so can
be a useful source of information about default pullups / downs on the chip.
• https://www.raspberrypi.org/documentation/configuration/pin-configuration.md
Camera
• RAW - Bayer pattern
• Image Sensor Pipeline
• 5Mpx
• fixed-focus
• 1080p30
• 720p60
• VGAp90 – slowmo
Camera
• Standard and NoIR
• 250mA
• HW acceleration
• JPEG
• H.264
• V4L2 API
• raspistill
• raspivid
• Python
• OpenCV
• Timelapse, slowmo
• Motion detection
MMAL - Multi-Media Abstraction Layer
• Accelerated:
• Encoding
• Filters - Blur, Sobel, YUV ….
• Multiplexing
• http://www.jvcref.com/files/PI/documentation/html/
• http://blog.oklahome.net/2014/09/what-ive-learned-about-mmal-
raspberry.html
Camera and Python
• Python:
• https://github.com/waveform80/picamera/tree/release-1.8
• PIL, OpenCV objects
• Stream – network, circular, H.264
• Overlaying
• Examples included: http://picamera.readthedocs.org/en/release-
1.10/
Simple stream from camera
• sudo modprobe bcm2835-v4l2
• cvlc v4l2:///dev/video0 --v4l2-width 1920 --v4l2-height 1080 --v4l2-
chroma h264 --sout '#standard{access=http,mux=ts,dst=0.0.0.0:12345}'
:demux=264
Babymonitor
Display
• https://www.raspberrypi.org/blog/the-eagerly-awaited-raspberry-pi-
display/
• RGB 800×480 display @60fps
• 24-bit colour
• FT5406 10 point capacitive touchscreen
• 70 degree viewing angle
• Metal-backed display with mounting holes for the Pi
Display
Movies are watched and robot is built.
Now what?
• Baking Pi – ASM, bare metal
• https://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/os/
• Low level graphics – C, framebuffer in Linux
• http://raspberrycompote.blogspot.ie/2012/12/low-level-graphics-on-
raspberry-pi-part_9509.html
• Bare metal examples – C, bare metal
• https://github.com/dwelch67/raspberrypi
• Programming AudioVideo on the Raspberry Pi GPU – C, linux
• https://jan.newmarch.name/RPi/index.html
Projects
• Baby monitor
• https://github.com/silvanmelchior/RPi_Cam_Web_Interface
• Vertical plotter WIP
• Video1: https://plus.google.com/u/0/+MichalSedlak/posts/ZjMeC3qguMV
• Video2: https://plus.google.com/photos/photo/116922401464380915458/6059538975170772338
• Plotter: https://github.com/michal6103/droopy
• Renderer: https://github.com/michal6103/droopy-web
• Ambient light WIP Raspberry for server side only, client NodeMCU
• PWM, APA102
• https://github.com/michal6103/striplight
• Hyperion – Opensourced Amblight – waiting for Xbian SPI module
• Video: https://www.youtube.com/watch?v=lnx_futkSQ8
• https://github.com/tvdzwan/hyperion/wiki
• Future:
• Fairy tails audio box, controlled by RFID card for kids
• OpenCV and Box2D voleyball
• Lemon power source
• Speed radar
https://www.raspberrypi.org/magpi-
issues/Projects_Book_v1.pdf
Hardware
Nerd’s guide – You know the licenses and how it works…
Broadcom VideoCore IV @ 250 MHz
• On 28 February 2014, release of full documentation for the VideoCore
IV's 3D subsystem ->
http://www.broadcom.com/docs/support/videocore/VideoCoreIV-
AG100-R.pdf
• Only a minor part of Broadcom’s software released as open source
• All acceleration is done using a firmware for VPU
• The entire SoC itself is managed / initialized by a ThreadX. RTOS that
is loaded into the Videocore's VPU during bootup
Wait what?
Videocore IV GPU
Wait what? Where is ThreadX, RTOS?
• BCM2835 – VPU is primary, CPU is “coprocessor”
• VPU is running ThreadX RTOS, then starts ARM and stuff
Yeah … I got it … What?
• The VideoCore is a custom processor, but is general-purpose enough
to run ThreadX
• The QPU units have been specially tailored to 3D tasks.
• The Videocore runs a RTOS
• RTOS API/ABI translates high-level 3D instructions (e.g. from OpenGL) into
commands for the QPU units
• The bootcode.bin acts as bootloader , start.elf contains the RTOS
• https://www.raspberrypi.org/forums/viewtopic.php?f=72&t=78414
Cool, what does it mean?
• You can write write software for bare hardware
• Any language you like for ARM, in case it is C or assembly
• Assembler and C toolchain for the VideoCore IV
• https://github.com/hermanhermitage/videocoreiv/
• https://github.com/hermanhermitage/videocoreiv/wiki/VideoCore-IV-Programmers-
Manual
• Assembler for QPUs
• https://github.com/hermanhermitage/videocoreiv-qpu
• http://petewarden.com/2014/08/07/how-to-optimize-raspberry-pi-code-using-its-gpu/
Down the rabbit hole
• https://github.com/hermanhermitage
So much flexibility in your solution feels like
How does it boot?
• First stage bootloader in ROM, ran by RISC core on VPU
• Mount FAT32 on SD Card
• VPU loads second-stage bootloader from the SD Card - bootcode.bin
• Second-stage bootloader bootcode.bin
• loaded into the L2 cache as we do not have RAM yet
• inits the RAM and the PLLs
• Parse config.txt for memory split
• third-stage bootloader loaded from SD Card - start.elf {RTOS binary}
• RTOS is launched
• Splits RAM – GPU/ARM {fixup.dat}
• Loads config.txt from SD card
• Loads cmdline.txt
• Loading kernel.img
• Powering on the ARM core {reset 0}
• Hurray Linux
• https://thekandyancode.wordpress.com/2013/09/21/how-the-raspberry-pi-boots-up/
Overclock
• raspi-config
• Multiple settings in config.txt
• Turbo mode does not break warranty
• https://www.raspberrypi.org/blog/introducing-turbo-mode-up-to-50-
more-performance-for-free/
• SD card problems when overclocked – no after Nov 11 2013
Config.txt is new BIOS settings
https://www.raspberrypi.org/documentation/configuration/config-
txt.md
Device trees are the PnP
• Just read this:
https://raw.githubusercontent.com/raspberrypi/firmware/master/boot/overlays/README
• Maybe this: https://www.raspberrypi.org/documentation/configuration/device-tree.md
• Info about devices
• Text file compiled to binary blob
• OS neutral
• Configuration parameters
• Forget about modprobe
• Overlays
• raspi-config for some devices
• Non-dt kernels - ATAGs
Device trees
• config.txt
• dtoverlay=lirc-rpi,gpio_out_pin=17
• spi - Set to "on" to enable the spi interfaces (off)
• random - Set to "on" to enable the hardware random number generator
(off)
• uart0 - Set to "off" to disable uart0 (on)
• watchdog - Set to "on" to enable the hardware watchdog (off)
• Other devices and HATs
• HATs identified by DTB stored in EEPROM
Q&A
Future session
• Baking Pi or one of projects
Thank you for your time
GPS modules
• http://elinux.org/RPi_VerifiedPeripherals#USB_GPS_devices
• SPI, I2C
• Text protocols
Ad

More Related Content

What's hot (20)

Raspberry Pi Presentation
Raspberry Pi PresentationRaspberry Pi Presentation
Raspberry Pi Presentation
Geekizer
 
Raspberry pi complete setup
Raspberry pi complete setupRaspberry pi complete setup
Raspberry pi complete setup
Santosh Kumar Kar
 
Raspberry Pi
 Raspberry Pi  Raspberry Pi
Raspberry Pi
Aditya Khandate
 
Raspberry PI
Raspberry PIRaspberry PI
Raspberry PI
Software Infrastructure
 
Rasberry pi
 Rasberry pi Rasberry pi
Rasberry pi
GANESH GOVIND BHOR
 
Rasp berry Pi
Rasp berry PiRasp berry Pi
Rasp berry Pi
Atieq-ur -Rehman
 
Introduction to Raspberry PI
Introduction to Raspberry PIIntroduction to Raspberry PI
Introduction to Raspberry PI
Chandrashekar Babu
 
Raspberry pi
Raspberry piRaspberry pi
Raspberry pi
Akash Kr Sinha
 
Introduction to Arduino & Raspberry Pi
Introduction to Arduino & Raspberry PiIntroduction to Arduino & Raspberry Pi
Introduction to Arduino & Raspberry Pi
Ahmad Hafeezi
 
Getting Started with Raspberry Pi and Arduino
Getting Started with Raspberry Pi and ArduinoGetting Started with Raspberry Pi and Arduino
Getting Started with Raspberry Pi and Arduino
Chad Mairn
 
Raspberry pi : an introduction
Raspberry pi : an introductionRaspberry pi : an introduction
Raspberry pi : an introduction
LTG Oxford
 
Raspberry-Pi
Raspberry-PiRaspberry-Pi
Raspberry-Pi
Christophe Porchet
 
Seminar Presentation on raspberry pi
Seminar Presentation on raspberry piSeminar Presentation on raspberry pi
Seminar Presentation on raspberry pi
Georgekutty Francis
 
Raspberry pi
Raspberry piRaspberry pi
Raspberry pi
Aradhya Kundu
 
Raspberry pi ppt
Raspberry pi pptRaspberry pi ppt
Raspberry pi ppt
gummaavinash7
 
Raspberry pi ppt
Raspberry pi pptRaspberry pi ppt
Raspberry pi ppt
PavanKumar3601
 
Exploring Raspberry Pi
Exploring Raspberry PiExploring Raspberry Pi
Exploring Raspberry Pi
Lentin Joseph
 
A seminar report on Raspberry Pi
A seminar report on Raspberry PiA seminar report on Raspberry Pi
A seminar report on Raspberry Pi
nipunmaster
 
Transport Layer Numericals
Transport Layer NumericalsTransport Layer Numericals
Transport Layer Numericals
Manisha Keim
 
Raspberry pi
Raspberry pi Raspberry pi
Raspberry pi
Shubham singh
 

Similar to Raspberry Pi Introduction (20)

Parallel Rendering of Webpages
Parallel Rendering of WebpagesParallel Rendering of Webpages
Parallel Rendering of Webpages
Langtech
 
Raspberry pi
Raspberry piRaspberry pi
Raspberry pi
Vasigaran Senthilkumar
 
WOver
WOverWOver
WOver
WO Community
 
Rasberry pie--- power point presentation
Rasberry pie--- power point presentationRasberry pie--- power point presentation
Rasberry pie--- power point presentation
trangasaivarun
 
HiPEAC-Keynote.pptx
HiPEAC-Keynote.pptxHiPEAC-Keynote.pptx
HiPEAC-Keynote.pptx
Behzad Salami
 
Raspberry Pi
Raspberry PiRaspberry Pi
Raspberry Pi
Anirudh Chauhan
 
Internet of Things, refers to the network of interconnected devices that are ...
Internet of Things, refers to the network of interconnected devices that are ...Internet of Things, refers to the network of interconnected devices that are ...
Internet of Things, refers to the network of interconnected devices that are ...
tharunreddy999000
 
2_RaspberryPi presentation.pptx
2_RaspberryPi presentation.pptx2_RaspberryPi presentation.pptx
2_RaspberryPi presentation.pptx
neelamsanjeevkumar
 
Raspberry pi robotics
Raspberry pi roboticsRaspberry pi robotics
Raspberry pi robotics
LloydMoore
 
INTRODUCTION TO RASPI
INTRODUCTION TO RASPIINTRODUCTION TO RASPI
INTRODUCTION TO RASPI
skumartarget
 
Raspberry pi basics
Raspberry pi  basicsRaspberry pi  basics
Raspberry pi basics
BHAWESH RAJPAL
 
Raspberry Pi Gaming Rig
Raspberry Pi Gaming RigRaspberry Pi Gaming Rig
Raspberry Pi Gaming Rig
Duc Le
 
Costruiamo un Rover in 60 minuti
Costruiamo un Rover in 60 minutiCostruiamo un Rover in 60 minuti
Costruiamo un Rover in 60 minuti
Codemotion
 
OpenPOWER Summit 2020 - OpenCAPI Keynote
OpenPOWER Summit 2020 -  OpenCAPI KeynoteOpenPOWER Summit 2020 -  OpenCAPI Keynote
OpenPOWER Summit 2020 - OpenCAPI Keynote
Allan Cantle
 
My presentation raspberry pi
My presentation raspberry piMy presentation raspberry pi
My presentation raspberry pi
HusainBhaldar21
 
Up and running with Raspberry Pi
Up and running with Raspberry PiUp and running with Raspberry Pi
Up and running with Raspberry Pi
Shahed Mehbub
 
Maker printouts
Maker printoutsMaker printouts
Maker printouts
Kellyn Pot'Vin-Gorman
 
Codasip application class RISC-V processor solutions
Codasip application class RISC-V processor solutionsCodasip application class RISC-V processor solutions
Codasip application class RISC-V processor solutions
RISC-V International
 
Abc beagleboard Getting To Know It
Abc beagleboard Getting To Know ItAbc beagleboard Getting To Know It
Abc beagleboard Getting To Know It
rviolachurch
 
QEMU and Raspberry Pi. Instant Embedded Development
QEMU and Raspberry Pi. Instant Embedded DevelopmentQEMU and Raspberry Pi. Instant Embedded Development
QEMU and Raspberry Pi. Instant Embedded Development
GlobalLogic Ukraine
 
Parallel Rendering of Webpages
Parallel Rendering of WebpagesParallel Rendering of Webpages
Parallel Rendering of Webpages
Langtech
 
Rasberry pie--- power point presentation
Rasberry pie--- power point presentationRasberry pie--- power point presentation
Rasberry pie--- power point presentation
trangasaivarun
 
Internet of Things, refers to the network of interconnected devices that are ...
Internet of Things, refers to the network of interconnected devices that are ...Internet of Things, refers to the network of interconnected devices that are ...
Internet of Things, refers to the network of interconnected devices that are ...
tharunreddy999000
 
2_RaspberryPi presentation.pptx
2_RaspberryPi presentation.pptx2_RaspberryPi presentation.pptx
2_RaspberryPi presentation.pptx
neelamsanjeevkumar
 
Raspberry pi robotics
Raspberry pi roboticsRaspberry pi robotics
Raspberry pi robotics
LloydMoore
 
INTRODUCTION TO RASPI
INTRODUCTION TO RASPIINTRODUCTION TO RASPI
INTRODUCTION TO RASPI
skumartarget
 
Raspberry Pi Gaming Rig
Raspberry Pi Gaming RigRaspberry Pi Gaming Rig
Raspberry Pi Gaming Rig
Duc Le
 
Costruiamo un Rover in 60 minuti
Costruiamo un Rover in 60 minutiCostruiamo un Rover in 60 minuti
Costruiamo un Rover in 60 minuti
Codemotion
 
OpenPOWER Summit 2020 - OpenCAPI Keynote
OpenPOWER Summit 2020 -  OpenCAPI KeynoteOpenPOWER Summit 2020 -  OpenCAPI Keynote
OpenPOWER Summit 2020 - OpenCAPI Keynote
Allan Cantle
 
My presentation raspberry pi
My presentation raspberry piMy presentation raspberry pi
My presentation raspberry pi
HusainBhaldar21
 
Up and running with Raspberry Pi
Up and running with Raspberry PiUp and running with Raspberry Pi
Up and running with Raspberry Pi
Shahed Mehbub
 
Codasip application class RISC-V processor solutions
Codasip application class RISC-V processor solutionsCodasip application class RISC-V processor solutions
Codasip application class RISC-V processor solutions
RISC-V International
 
Abc beagleboard Getting To Know It
Abc beagleboard Getting To Know ItAbc beagleboard Getting To Know It
Abc beagleboard Getting To Know It
rviolachurch
 
QEMU and Raspberry Pi. Instant Embedded Development
QEMU and Raspberry Pi. Instant Embedded DevelopmentQEMU and Raspberry Pi. Instant Embedded Development
QEMU and Raspberry Pi. Instant Embedded Development
GlobalLogic Ukraine
 
Ad

More from Michal Sedlak (9)

Nodemcu - introduction
Nodemcu - introductionNodemcu - introduction
Nodemcu - introduction
Michal Sedlak
 
Multipath
MultipathMultipath
Multipath
Michal Sedlak
 
Linux: Desktop na kazdy den
Linux: Desktop na kazdy denLinux: Desktop na kazdy den
Linux: Desktop na kazdy den
Michal Sedlak
 
Linux: Presmerovanie I/O
Linux:  Presmerovanie I/OLinux:  Presmerovanie I/O
Linux: Presmerovanie I/O
Michal Sedlak
 
Linux: Zaklady Linuxu
Linux: Zaklady LinuxuLinux: Zaklady Linuxu
Linux: Zaklady Linuxu
Michal Sedlak
 
Linux: LVM
Linux: LVMLinux: LVM
Linux: LVM
Michal Sedlak
 
Twisted
TwistedTwisted
Twisted
Michal Sedlak
 
Ad

Recently uploaded (20)

Middle East and Africa Cybersecurity Market Trends and Growth Analysis
Middle East and Africa Cybersecurity Market Trends and Growth Analysis Middle East and Africa Cybersecurity Market Trends and Growth Analysis
Middle East and Africa Cybersecurity Market Trends and Growth Analysis
Preeti Jha
 
MULTI-STAKEHOLDER CONSULTATION PROGRAM On Implementation of DNF 2.0 and Way F...
MULTI-STAKEHOLDER CONSULTATION PROGRAM On Implementation of DNF 2.0 and Way F...MULTI-STAKEHOLDER CONSULTATION PROGRAM On Implementation of DNF 2.0 and Way F...
MULTI-STAKEHOLDER CONSULTATION PROGRAM On Implementation of DNF 2.0 and Way F...
ICT Frame Magazine Pvt. Ltd.
 
ICDCC 2025: Securing Agentic AI - Eryk Budi Pratama.pdf
ICDCC 2025: Securing Agentic AI - Eryk Budi Pratama.pdfICDCC 2025: Securing Agentic AI - Eryk Budi Pratama.pdf
ICDCC 2025: Securing Agentic AI - Eryk Budi Pratama.pdf
Eryk Budi Pratama
 
Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...
Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...
Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...
Maarten Verwaest
 
AI x Accessibility UXPA by Stew Smith and Olivier Vroom
AI x Accessibility UXPA by Stew Smith and Olivier VroomAI x Accessibility UXPA by Stew Smith and Olivier Vroom
AI x Accessibility UXPA by Stew Smith and Olivier Vroom
UXPA Boston
 
Agentic Automation - Delhi UiPath Community Meetup
Agentic Automation - Delhi UiPath Community MeetupAgentic Automation - Delhi UiPath Community Meetup
Agentic Automation - Delhi UiPath Community Meetup
Manoj Batra (1600 + Connections)
 
UiPath AgentHack - Build the AI agents of tomorrow_Enablement 1.pptx
UiPath AgentHack - Build the AI agents of tomorrow_Enablement 1.pptxUiPath AgentHack - Build the AI agents of tomorrow_Enablement 1.pptx
UiPath AgentHack - Build the AI agents of tomorrow_Enablement 1.pptx
anabulhac
 
Shoehorning dependency injection into a FP language, what does it take?
Shoehorning dependency injection into a FP language, what does it take?Shoehorning dependency injection into a FP language, what does it take?
Shoehorning dependency injection into a FP language, what does it take?
Eric Torreborre
 
論文紹介:"InfLoRA: Interference-Free Low-Rank Adaptation for Continual Learning" ...
論文紹介:"InfLoRA: Interference-Free Low-Rank Adaptation for Continual Learning" ...論文紹介:"InfLoRA: Interference-Free Low-Rank Adaptation for Continual Learning" ...
論文紹介:"InfLoRA: Interference-Free Low-Rank Adaptation for Continual Learning" ...
Toru Tamaki
 
accessibility Considerations during Design by Rick Blair, Schneider Electric
accessibility Considerations during Design by Rick Blair, Schneider Electricaccessibility Considerations during Design by Rick Blair, Schneider Electric
accessibility Considerations during Design by Rick Blair, Schneider Electric
UXPA Boston
 
Computer Systems Quiz Presentation in Purple Bold Style (4).pdf
Computer Systems Quiz Presentation in Purple Bold Style (4).pdfComputer Systems Quiz Presentation in Purple Bold Style (4).pdf
Computer Systems Quiz Presentation in Purple Bold Style (4).pdf
fizarcse
 
AI-proof your career by Olivier Vroom and David WIlliamson
AI-proof your career by Olivier Vroom and David WIlliamsonAI-proof your career by Olivier Vroom and David WIlliamson
AI-proof your career by Olivier Vroom and David WIlliamson
UXPA Boston
 
Refactoring meta-rauc-community: Cleaner Code, Better Maintenance, More Machines
Refactoring meta-rauc-community: Cleaner Code, Better Maintenance, More MachinesRefactoring meta-rauc-community: Cleaner Code, Better Maintenance, More Machines
Refactoring meta-rauc-community: Cleaner Code, Better Maintenance, More Machines
Leon Anavi
 
How Top Companies Benefit from Outsourcing
How Top Companies Benefit from OutsourcingHow Top Companies Benefit from Outsourcing
How Top Companies Benefit from Outsourcing
Nascenture
 
Multi-Agent AI Systems: Architectures & Communication (MCP and A2A)
Multi-Agent AI Systems: Architectures & Communication (MCP and A2A)Multi-Agent AI Systems: Architectures & Communication (MCP and A2A)
Multi-Agent AI Systems: Architectures & Communication (MCP and A2A)
HusseinMalikMammadli
 
Who's choice? Making decisions with and about Artificial Intelligence, Keele ...
Who's choice? Making decisions with and about Artificial Intelligence, Keele ...Who's choice? Making decisions with and about Artificial Intelligence, Keele ...
Who's choice? Making decisions with and about Artificial Intelligence, Keele ...
Alan Dix
 
Building a research repository that works by Clare Cady
Building a research repository that works by Clare CadyBuilding a research repository that works by Clare Cady
Building a research repository that works by Clare Cady
UXPA Boston
 
Top Hyper-Casual Game Studio Services
Top  Hyper-Casual  Game  Studio ServicesTop  Hyper-Casual  Game  Studio Services
Top Hyper-Casual Game Studio Services
Nova Carter
 
Mastering Testing in the Modern F&B Landscape
Mastering Testing in the Modern F&B LandscapeMastering Testing in the Modern F&B Landscape
Mastering Testing in the Modern F&B Landscape
marketing943205
 
Understanding SEO in the Age of AI.pdf
Understanding SEO in the Age of AI.pdfUnderstanding SEO in the Age of AI.pdf
Understanding SEO in the Age of AI.pdf
Fulcrum Concepts, LLC
 
Middle East and Africa Cybersecurity Market Trends and Growth Analysis
Middle East and Africa Cybersecurity Market Trends and Growth Analysis Middle East and Africa Cybersecurity Market Trends and Growth Analysis
Middle East and Africa Cybersecurity Market Trends and Growth Analysis
Preeti Jha
 
MULTI-STAKEHOLDER CONSULTATION PROGRAM On Implementation of DNF 2.0 and Way F...
MULTI-STAKEHOLDER CONSULTATION PROGRAM On Implementation of DNF 2.0 and Way F...MULTI-STAKEHOLDER CONSULTATION PROGRAM On Implementation of DNF 2.0 and Way F...
MULTI-STAKEHOLDER CONSULTATION PROGRAM On Implementation of DNF 2.0 and Way F...
ICT Frame Magazine Pvt. Ltd.
 
ICDCC 2025: Securing Agentic AI - Eryk Budi Pratama.pdf
ICDCC 2025: Securing Agentic AI - Eryk Budi Pratama.pdfICDCC 2025: Securing Agentic AI - Eryk Budi Pratama.pdf
ICDCC 2025: Securing Agentic AI - Eryk Budi Pratama.pdf
Eryk Budi Pratama
 
Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...
Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...
Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...
Maarten Verwaest
 
AI x Accessibility UXPA by Stew Smith and Olivier Vroom
AI x Accessibility UXPA by Stew Smith and Olivier VroomAI x Accessibility UXPA by Stew Smith and Olivier Vroom
AI x Accessibility UXPA by Stew Smith and Olivier Vroom
UXPA Boston
 
UiPath AgentHack - Build the AI agents of tomorrow_Enablement 1.pptx
UiPath AgentHack - Build the AI agents of tomorrow_Enablement 1.pptxUiPath AgentHack - Build the AI agents of tomorrow_Enablement 1.pptx
UiPath AgentHack - Build the AI agents of tomorrow_Enablement 1.pptx
anabulhac
 
Shoehorning dependency injection into a FP language, what does it take?
Shoehorning dependency injection into a FP language, what does it take?Shoehorning dependency injection into a FP language, what does it take?
Shoehorning dependency injection into a FP language, what does it take?
Eric Torreborre
 
論文紹介:"InfLoRA: Interference-Free Low-Rank Adaptation for Continual Learning" ...
論文紹介:"InfLoRA: Interference-Free Low-Rank Adaptation for Continual Learning" ...論文紹介:"InfLoRA: Interference-Free Low-Rank Adaptation for Continual Learning" ...
論文紹介:"InfLoRA: Interference-Free Low-Rank Adaptation for Continual Learning" ...
Toru Tamaki
 
accessibility Considerations during Design by Rick Blair, Schneider Electric
accessibility Considerations during Design by Rick Blair, Schneider Electricaccessibility Considerations during Design by Rick Blair, Schneider Electric
accessibility Considerations during Design by Rick Blair, Schneider Electric
UXPA Boston
 
Computer Systems Quiz Presentation in Purple Bold Style (4).pdf
Computer Systems Quiz Presentation in Purple Bold Style (4).pdfComputer Systems Quiz Presentation in Purple Bold Style (4).pdf
Computer Systems Quiz Presentation in Purple Bold Style (4).pdf
fizarcse
 
AI-proof your career by Olivier Vroom and David WIlliamson
AI-proof your career by Olivier Vroom and David WIlliamsonAI-proof your career by Olivier Vroom and David WIlliamson
AI-proof your career by Olivier Vroom and David WIlliamson
UXPA Boston
 
Refactoring meta-rauc-community: Cleaner Code, Better Maintenance, More Machines
Refactoring meta-rauc-community: Cleaner Code, Better Maintenance, More MachinesRefactoring meta-rauc-community: Cleaner Code, Better Maintenance, More Machines
Refactoring meta-rauc-community: Cleaner Code, Better Maintenance, More Machines
Leon Anavi
 
How Top Companies Benefit from Outsourcing
How Top Companies Benefit from OutsourcingHow Top Companies Benefit from Outsourcing
How Top Companies Benefit from Outsourcing
Nascenture
 
Multi-Agent AI Systems: Architectures & Communication (MCP and A2A)
Multi-Agent AI Systems: Architectures & Communication (MCP and A2A)Multi-Agent AI Systems: Architectures & Communication (MCP and A2A)
Multi-Agent AI Systems: Architectures & Communication (MCP and A2A)
HusseinMalikMammadli
 
Who's choice? Making decisions with and about Artificial Intelligence, Keele ...
Who's choice? Making decisions with and about Artificial Intelligence, Keele ...Who's choice? Making decisions with and about Artificial Intelligence, Keele ...
Who's choice? Making decisions with and about Artificial Intelligence, Keele ...
Alan Dix
 
Building a research repository that works by Clare Cady
Building a research repository that works by Clare CadyBuilding a research repository that works by Clare Cady
Building a research repository that works by Clare Cady
UXPA Boston
 
Top Hyper-Casual Game Studio Services
Top  Hyper-Casual  Game  Studio ServicesTop  Hyper-Casual  Game  Studio Services
Top Hyper-Casual Game Studio Services
Nova Carter
 
Mastering Testing in the Modern F&B Landscape
Mastering Testing in the Modern F&B LandscapeMastering Testing in the Modern F&B Landscape
Mastering Testing in the Modern F&B Landscape
marketing943205
 
Understanding SEO in the Age of AI.pdf
Understanding SEO in the Age of AI.pdfUnderstanding SEO in the Age of AI.pdf
Understanding SEO in the Age of AI.pdf
Fulcrum Concepts, LLC
 

Raspberry Pi Introduction

  • 2. Q&A • Did anyone used microcontrollers or SoCs • Atmel • PIC • Z80, … • Any experiences with embedded systems or devboards? • Arduino style… • Raspberry/Orange/Banana Pi, Humming board, Beaglebone,Odroid • Who plans to build a media center? • Who has kids?
  • 4. Why Raspberry Pi and the Foundation • Inspired by ZX Spectrum • Cheap computer for every child • Educational reasons – kids do not know how to code • People happen to be consumers, RPF wants to inspire makers • Accidental price • 2006 model build on Atmel ATmega644 • Broadcom employees changed stuff • Language of choice Python, later Scratch • Many other languages and tools
  • 9. Raspberry Pi Model B+ • Announced on 14th July 2014 • Broadcom BCM2835 SoC, with ARM1176JZF-S 700 MHz processor • VideoCore IV dual-core 250 MHz GPU • 512 MB SDRAM - shared by the GPU and CPU • MicroSD card slot for boot and storage • 4 x USB 2.0 ports (via on-board 5 port hub) • RJ45 10/100 MBit/s Ethernet port • HDMI and Composite video, audio through TRRS jack • 40 pin GPIO, I2C, SPI, UART interface connector • CSI (camera) and DSI (display) connectors • 4 squarely positioned mounting holes • 600 mA (3.0 W)
  • 10. Raspberry Pi 2 Model B • Announced on 2nd Feb 2015 • Broadcom BCM2836 SoC, with quad-core ARM Cortex-A7 900 MHz processor • Ubuntu Core • Windows 10 IOT Core • VideoCore IV dual-core 250 MHz GPU • 1 GB SDRAM - shared by the GPU and CPU • MicroSD card slot for boot and storage • 4 x USB 2.0 ports (via on-board 5 port hub) • RJ45 10/100 MBit/s Ethernet port • HDMI and Composite video, audio through TRRS jack • 40 pin GPIO Interface connector • CSI (camera) and DSI (display) connectors • 4 squarely positioned mounting holes
  • 11. Power – chief culprit • Micro USB 5V, 1A • Poly-fuse is problem of the past • 5.25V is OK for USB • http://www.modmypi.com/raspberry-pi/accessories/power-supplies/5v-2a- ultra-hq-usb-power-supply-eu • USB Power • max_usb_current=1 • USB output current limit from 600mA to double that, 1200mA
  • 12. Micro SD Card • SD, SDHC, SDXC, UHC, all of them except the ones that do not work. • Boot partition FAT32 • Max. around 20MB/s • http://elinux.org/RPi_SD_cards
  • 13. OS
  • 14. B+ is ARMv6 a.k.a ARM11 • General purpose • NOOBS - installer • Raspbian • Ubuntu Mate, Ubuntu Core (rPi2 only) • Pidora, Arch and other unofficial • Mediacenter • OSMC • Openelec • Xbian • Other obscure OSes • Windows 10 IOT Core (rPi2 only) • RISC OS
  • 15. How to install • FAT32, just extract it there • Disk image – just dd it there • Most distros have Win/Mac/Lin installers
  • 16. Micro SD - Partitions • diskpart • list disk • select diskn • list partition • select partitionn • delete partition
  • 17. Notifications and monitoring • Red square: over-temperature • Rainbow square: under-voltage • /sys/class/thermal/thermal_zone0/temp • /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq • Core temp below 70 degrees • Voltage above 4.8V, across test pads PP3 (GND) and PP7 (VCC) or PP1( VCC before polyfuse) • Brown-out detector will at VCC <= 4.65V switch off the power LED • Watchdog – config.txt • sudo apt-get install watchdog • sudo update-rc.d watchdog defaults • sudo vim /etc/watchdog.conf
  • 19. What is really in BCM2835 SoC? • ARM1176JZF-S 700 MHz processor – secondary processor • Dualcore Videocore IV CPU @250MHz with SIMD Parallel Pixel Units (PPU) which runs scalar (integer and float) and vector (integer only) programs – primary processor • Image Sensor Pipeline (ISP) providing lens shading, statistics and distortion correction • 12 QPU units which provide 24 GFLOPS compute performance for coordinate, vertex and pixel shaders
  • 20. Broadcom VideoCore IV @ 250 MHz • OpenGL ES 2.0 - OpenGL is a 3D library • OpenVG - OpenVG is a 2D vector drawing library • EGL - EGL is an interface between OpenGL ES or OpenVG and the underlying native platform window system. • OpenMAX IL - OpenMAX API’s used for audio, video, and still images processing • Inside Videcore - https://www.raspberrypi.org/magpi- issues/MagPi35.pdf page 35
  • 21. VA API, CUDA and others like OpenCL • OpenMAX • QPU Assembly
  • 22. Broadcom VideoCore IV @ 250 MHz • MPEG-2 (license) • VC-1 (license) • 1080p30 H.264/MPEG-4 AVC high-profile decoder and encoder • How to encode https://www.raspberrypi.org/forums/viewtopic.php?t=72435
  • 23. Dude I just want to build media center… … more nerdy stuff at the end
  • 26. What can it play • Bundled acceleration • H.264 (up to High Profile) up to 1080P • MPEG-4 up to 1080P. This includes XviD and DivX (but not the older 3.xx DivX). • Licenses: http://www.raspberrypi.com/license-keys/ • MPEG-2 • VC1 • GPU assisted: • MJPEG, VP6, VP8 and OGG Theora. Limited to DVD resolutions. • No acceleration: • DivX 3, msmpeg, sorenson spark on the ARM. Should work for SD resolutions. • DTS audio decode works well in recent builds • TrueHD audio is CPU intensive and may require overclocking
  • 27. Tuners • H.264 encode/decode [DVB-S2] • Licenses: • MPEG2 decode [DVB-T, DVB-S] • VC-1 • Tuners: http://elinux.org/RPi_VerifiedPeripherals#USB_TV_Tuners_and_DVB_ devices
  • 28. Audio • Outputs: • HDMI • Analog • I2S {HATs} • USB soundcards • MP3 soft decoding stereo • AC3 , DTS, PCM pass-through • Multichannel PCM not supported by all receivers – select 2.0 output
  • 29. IR Remote • Xbian mappings = Pain • Kodi • remote.xml • Lircmap.xml • lircd.conf • USB IR stuff • LIRC DT overlay – config.txt • LIRC daemon • HDMI-CEC • CEC enabled HDMI cable – pin13
  • 30. GPIO
  • 31. GPIO
  • 32. GPIO Permissions • MMAP – root access • SYSFS • pigpio • gpio-admin
  • 33. GPIO performance Language Library Tested / version Square wave Shell /proc/mem access 2015-02-14 2.8 kHz Shell / gpio utility WiringPi gpio utility 2015-02-15 / 2.25 40 Hz Python RPi.GPIO 2015-02-15 / 0.5.10 70 kHz Python wiringpi2 bindings 2015-02-15 / latest github 28 kHz Ruby wiringpi bindings 2015-02-15 / latest gem (1.1.0) 21 kHz C Native library 2015-02-15 / latest RaspPi 22 MHz C BCM 2835 2015-02-15 / 1.38 5.4 MHz C wiringPi 2015-02-15 / 2.25 4.1 – 4.6 MHz Perl BCM 2835 2015-02-15 / 1.9 48 kHz http://codeandlife.com/2012/07/03/benchmarking-raspberry-pi-gpio-speed/
  • 34. Python GPIO • import RPi.GPIO as GPIO • Default and will be always supported • MMAP - Script must be root or write access to /dev/mem • Kind of abandoned, SPI, PWM missing • from gpiozero import … • New and cool • Focused on beginners • Examples with wiring diagrams • import wiringpi2 • Wiringpi wrapper • Stable, most complete • import pigpio • Daemon, no-root for users • PWM, I2C, SPI, UART, waveforms,
  • 35. How to access it? • http://elinux.org/RPi_GPIO_Code_Samples
  • 36. GPIO - Blink • Interactive pinout diagram http://pinout.xyz/ • GPIO zero from gpiozero import LED from time import sleep led = LED(17) while True: led.on() sleep(1) led.off() sleep(1)
  • 37. I am hacker, I hack!!!!
  • 38. Custom GPIO pin setup • pins_rev1 Rev1 pin setup. There are some difference because of the moved I2C pins • pins_rev2 Rev2 pin setup. This includes the additional codec pins on P5 • pins_bplus1 Model B+ rev 1.1, including the full 40pin connector • pins_bplus2 Model B+ rev 1.2, swapping the low-power and lan-run pins • pins_aplus Model A+, lacking ethernet • pins_2b1 Pi 2 Model B rev 1.0, controls the SMPS via I2C0 • pins_2b2 Pi 2 Model B rev 1.1, controls the SMPS via software I2C on 42&43 • pins_cm The Compute Module, note the default for this is the default for the chip so can be a useful source of information about default pullups / downs on the chip. • https://www.raspberrypi.org/documentation/configuration/pin-configuration.md
  • 39. Camera • RAW - Bayer pattern • Image Sensor Pipeline • 5Mpx • fixed-focus • 1080p30 • 720p60 • VGAp90 – slowmo
  • 40. Camera • Standard and NoIR • 250mA • HW acceleration • JPEG • H.264 • V4L2 API • raspistill • raspivid • Python • OpenCV • Timelapse, slowmo • Motion detection
  • 41. MMAL - Multi-Media Abstraction Layer • Accelerated: • Encoding • Filters - Blur, Sobel, YUV …. • Multiplexing • http://www.jvcref.com/files/PI/documentation/html/ • http://blog.oklahome.net/2014/09/what-ive-learned-about-mmal- raspberry.html
  • 42. Camera and Python • Python: • https://github.com/waveform80/picamera/tree/release-1.8 • PIL, OpenCV objects • Stream – network, circular, H.264 • Overlaying • Examples included: http://picamera.readthedocs.org/en/release- 1.10/
  • 43. Simple stream from camera • sudo modprobe bcm2835-v4l2 • cvlc v4l2:///dev/video0 --v4l2-width 1920 --v4l2-height 1080 --v4l2- chroma h264 --sout '#standard{access=http,mux=ts,dst=0.0.0.0:12345}' :demux=264
  • 45. Display • https://www.raspberrypi.org/blog/the-eagerly-awaited-raspberry-pi- display/ • RGB 800×480 display @60fps • 24-bit colour • FT5406 10 point capacitive touchscreen • 70 degree viewing angle • Metal-backed display with mounting holes for the Pi
  • 47. Movies are watched and robot is built. Now what? • Baking Pi – ASM, bare metal • https://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/os/ • Low level graphics – C, framebuffer in Linux • http://raspberrycompote.blogspot.ie/2012/12/low-level-graphics-on- raspberry-pi-part_9509.html • Bare metal examples – C, bare metal • https://github.com/dwelch67/raspberrypi • Programming AudioVideo on the Raspberry Pi GPU – C, linux • https://jan.newmarch.name/RPi/index.html
  • 48. Projects • Baby monitor • https://github.com/silvanmelchior/RPi_Cam_Web_Interface • Vertical plotter WIP • Video1: https://plus.google.com/u/0/+MichalSedlak/posts/ZjMeC3qguMV • Video2: https://plus.google.com/photos/photo/116922401464380915458/6059538975170772338 • Plotter: https://github.com/michal6103/droopy • Renderer: https://github.com/michal6103/droopy-web • Ambient light WIP Raspberry for server side only, client NodeMCU • PWM, APA102 • https://github.com/michal6103/striplight • Hyperion – Opensourced Amblight – waiting for Xbian SPI module • Video: https://www.youtube.com/watch?v=lnx_futkSQ8 • https://github.com/tvdzwan/hyperion/wiki • Future: • Fairy tails audio box, controlled by RFID card for kids • OpenCV and Box2D voleyball • Lemon power source • Speed radar
  • 50. Hardware Nerd’s guide – You know the licenses and how it works…
  • 51. Broadcom VideoCore IV @ 250 MHz • On 28 February 2014, release of full documentation for the VideoCore IV's 3D subsystem -> http://www.broadcom.com/docs/support/videocore/VideoCoreIV- AG100-R.pdf • Only a minor part of Broadcom’s software released as open source • All acceleration is done using a firmware for VPU • The entire SoC itself is managed / initialized by a ThreadX. RTOS that is loaded into the Videocore's VPU during bootup
  • 53. Wait what? Where is ThreadX, RTOS? • BCM2835 – VPU is primary, CPU is “coprocessor” • VPU is running ThreadX RTOS, then starts ARM and stuff
  • 54. Yeah … I got it … What? • The VideoCore is a custom processor, but is general-purpose enough to run ThreadX • The QPU units have been specially tailored to 3D tasks. • The Videocore runs a RTOS • RTOS API/ABI translates high-level 3D instructions (e.g. from OpenGL) into commands for the QPU units • The bootcode.bin acts as bootloader , start.elf contains the RTOS • https://www.raspberrypi.org/forums/viewtopic.php?f=72&t=78414
  • 55. Cool, what does it mean? • You can write write software for bare hardware • Any language you like for ARM, in case it is C or assembly • Assembler and C toolchain for the VideoCore IV • https://github.com/hermanhermitage/videocoreiv/ • https://github.com/hermanhermitage/videocoreiv/wiki/VideoCore-IV-Programmers- Manual • Assembler for QPUs • https://github.com/hermanhermitage/videocoreiv-qpu • http://petewarden.com/2014/08/07/how-to-optimize-raspberry-pi-code-using-its-gpu/
  • 56. Down the rabbit hole • https://github.com/hermanhermitage
  • 57. So much flexibility in your solution feels like
  • 58. How does it boot? • First stage bootloader in ROM, ran by RISC core on VPU • Mount FAT32 on SD Card • VPU loads second-stage bootloader from the SD Card - bootcode.bin • Second-stage bootloader bootcode.bin • loaded into the L2 cache as we do not have RAM yet • inits the RAM and the PLLs • Parse config.txt for memory split • third-stage bootloader loaded from SD Card - start.elf {RTOS binary} • RTOS is launched • Splits RAM – GPU/ARM {fixup.dat} • Loads config.txt from SD card • Loads cmdline.txt • Loading kernel.img • Powering on the ARM core {reset 0} • Hurray Linux • https://thekandyancode.wordpress.com/2013/09/21/how-the-raspberry-pi-boots-up/
  • 59. Overclock • raspi-config • Multiple settings in config.txt • Turbo mode does not break warranty • https://www.raspberrypi.org/blog/introducing-turbo-mode-up-to-50- more-performance-for-free/ • SD card problems when overclocked – no after Nov 11 2013
  • 60. Config.txt is new BIOS settings https://www.raspberrypi.org/documentation/configuration/config- txt.md
  • 61. Device trees are the PnP • Just read this: https://raw.githubusercontent.com/raspberrypi/firmware/master/boot/overlays/README • Maybe this: https://www.raspberrypi.org/documentation/configuration/device-tree.md • Info about devices • Text file compiled to binary blob • OS neutral • Configuration parameters • Forget about modprobe • Overlays • raspi-config for some devices • Non-dt kernels - ATAGs
  • 62. Device trees • config.txt • dtoverlay=lirc-rpi,gpio_out_pin=17 • spi - Set to "on" to enable the spi interfaces (off) • random - Set to "on" to enable the hardware random number generator (off) • uart0 - Set to "off" to disable uart0 (on) • watchdog - Set to "on" to enable the hardware watchdog (off) • Other devices and HATs • HATs identified by DTB stored in EEPROM
  • 63. Q&A
  • 64. Future session • Baking Pi or one of projects
  • 65. Thank you for your time