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

More Related Content

PPTX
Raspberry pi
PDF
Introduction to Raspberrypi
PPTX
Raspberry pi
PPTX
Simple Presentation On Raspberry pi
PPT
Raspberry pi 3
PPT
Rasp berry Pi
PPTX
Raspberry pi
PPTX
Introduction to raspberry pi
Raspberry pi
Introduction to Raspberrypi
Raspberry pi
Simple Presentation On Raspberry pi
Raspberry pi 3
Rasp berry Pi
Raspberry pi
Introduction to raspberry pi

What's hot (20)

PPTX
Raspberry pi
PPTX
Raspberry pi complete setup
PPTX
PDF
Single Board Computers & Raspberry Pi Basics
PPTX
Raspberry pi
PPT
Raspberry pi
PPT
Raspberrypi best ppt
PPT
Raspberry-Pi
PPT
Seminar Presentation on raspberry pi
PPTX
Raspberry Pi (Introduction)
PPT
Smart Wireless Surveillance Monitoring using RASPBERRY PI
PPTX
Raspberry Pi presentation for Computer Architecture class
PPT
Raspberry pi : an introduction
ODP
Introduction to Arduino
PPTX
Raspberry pi
PDF
My presentation raspberry pi
PPTX
Raspberry pi
PPTX
Raspberry Pi Session - 22_11_2014
PDF
Arduino vs Raspberry Pi | Which Board to Choose for IoT Projects | IoT Device...
PPTX
Arduino
Raspberry pi
Raspberry pi complete setup
Single Board Computers & Raspberry Pi Basics
Raspberry pi
Raspberry pi
Raspberrypi best ppt
Raspberry-Pi
Seminar Presentation on raspberry pi
Raspberry Pi (Introduction)
Smart Wireless Surveillance Monitoring using RASPBERRY PI
Raspberry Pi presentation for Computer Architecture class
Raspberry pi : an introduction
Introduction to Arduino
Raspberry pi
My presentation raspberry pi
Raspberry pi
Raspberry Pi Session - 22_11_2014
Arduino vs Raspberry Pi | Which Board to Choose for IoT Projects | IoT Device...
Arduino
Ad

Similar to Raspberry Pi Introduction (20)

PPTX
Parallel Rendering of Webpages
PPTX
PDF
PPTX
Rasberry pie--- power point presentation
PPTX
HiPEAC-Keynote.pptx
PPTX
Raspberry Pi
PPTX
Internet of Things, refers to the network of interconnected devices that are ...
PPTX
2_RaspberryPi presentation.pptx
PPTX
Raspberry pi robotics
PPT
INTRODUCTION TO RASPI
PPTX
Raspberry pi basics
PPTX
Raspberry_Pi_4B for robotics, home automation
PPTX
Raspberry Pi Gaming Rig
PPTX
Costruiamo un Rover in 60 minuti
PDF
OpenPOWER Summit 2020 - OpenCAPI Keynote
PPT
Raspberry Pi Technology
PPTX
Up and running with Raspberry Pi
PDF
Introduction to Raspberry PI
PDF
Maker printouts
PPTX
Codasip application class RISC-V processor solutions
Parallel Rendering of Webpages
Rasberry pie--- power point presentation
HiPEAC-Keynote.pptx
Raspberry Pi
Internet of Things, refers to the network of interconnected devices that are ...
2_RaspberryPi presentation.pptx
Raspberry pi robotics
INTRODUCTION TO RASPI
Raspberry pi basics
Raspberry_Pi_4B for robotics, home automation
Raspberry Pi Gaming Rig
Costruiamo un Rover in 60 minuti
OpenPOWER Summit 2020 - OpenCAPI Keynote
Raspberry Pi Technology
Up and running with Raspberry Pi
Introduction to Raspberry PI
Maker printouts
Codasip application class RISC-V processor solutions
Ad

More from Michal Sedlak (9)

PPTX
Nodemcu - introduction
PDF
Multipath
PDF
Linux: Desktop na kazdy den
PDF
Linux: Presmerovanie I/O
PDF
Linux: Procesy
PDF
Linux: Filesystems
PDF
Linux: Zaklady Linuxu
PDF
Linux: LVM
PDF
Twisted
Nodemcu - introduction
Multipath
Linux: Desktop na kazdy den
Linux: Presmerovanie I/O
Linux: Procesy
Linux: Filesystems
Linux: Zaklady Linuxu
Linux: LVM
Twisted

Recently uploaded (20)

PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Advanced IT Governance
PPTX
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
PDF
[발표본] 너의 과제는 클라우드에 있어_KTDS_김동현_20250524.pdf
PPTX
Big Data Technologies - Introduction.pptx
PDF
Electronic commerce courselecture one. Pdf
PDF
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
PDF
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
PPTX
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
PDF
CIFDAQ's Market Wrap: Ethereum Leads, Bitcoin Lags, Institutions Shift
PDF
cuic standard and advanced reporting.pdf
PDF
Advanced Soft Computing BINUS July 2025.pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Event Presentation Google Cloud Next Extended 2025
PDF
GamePlan Trading System Review: Professional Trader's Honest Take
PPTX
Cloud computing and distributed systems.
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
Telecom Fraud Prevention Guide | Hyperlink InfoSystem
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Understanding_Digital_Forensics_Presentation.pptx
MYSQL Presentation for SQL database connectivity
Advanced IT Governance
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
[발표본] 너의 과제는 클라우드에 있어_KTDS_김동현_20250524.pdf
Big Data Technologies - Introduction.pptx
Electronic commerce courselecture one. Pdf
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
CIFDAQ's Market Wrap: Ethereum Leads, Bitcoin Lags, Institutions Shift
cuic standard and advanced reporting.pdf
Advanced Soft Computing BINUS July 2025.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
Event Presentation Google Cloud Next Extended 2025
GamePlan Trading System Review: Professional Trader's Honest Take
Cloud computing and distributed systems.
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Telecom Fraud Prevention Guide | Hyperlink InfoSystem
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows

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