SlideShare a Scribd company logo
Raspberry Pi tutorials
www.ittraining.com.tw
Outline
Introduction to Raspberry Pi
About Linux BSP
Misc (backup OS image, vcgencmd, …)
Raspberry Pi Education Kit
INTRODUCTION TO RASPBERRY PI
Raspberry Pi (Model B+)
Hardware Spec.
SoC:BroadcomBCM2835(CPU,GPU DSP,SDRAM, USB)
CPU:ARM1176JZF-S核心(ARM11系列)700MHz
GPU: Broadcom VideoCore IV, OpenGL ES 2.0, 1080p 30 h.264/MPEG-4
AVC
RAM: 256MByte (Rev A), 512 MByte (Rev B)
OS:Raspbian Linux, GNU/Linux(Debian, Fedora, Arch Linux ARM),
Android,…
Video Codec
Video Codec for MPEG2 and VC-1 need License
You will need to provide your device's internal 16-digit serial
number as part of your order. Your serial number is not the
number printed on your board.
http://www.raspberrypi.com
RaspPi pinout (Model B+)
you can learn Linux driver
http:// blog.ittraining.com.tw
Rasp Pi Software Architecture
SoC BCM2835 Address Map
Peripherals are mapped into the kernel virtual address space starting at address 0xF2000000.
#define BCM2835_PERI_BASE 0x20000000
#define BCM2835_GPIO_BASE (BCM2835_PERI_BASE + 0x200000)
Linux BSP
Bootloader with Device Tree support
Kernel with Device Tree support
Drivers for SoC and board components
SoC machine specific layer
Root file system for software developers
GNU cross compiler for ARM architecture
xxx Build Environment
Pi’s SD Card Layout
3 Embedded Linux components
Boot code
Linux Kernel
Root File system
Boot code
kernel
Root FileSystem
mmcblock0p1
/boot
mmcblock0p2
/
You can access “boot code partition “ in windows , because it is FAT32
lsblk & fdisk -l
/boot
Bootcode
• bootcode.bin (Binary)
• start.elf (Binary)
• fixup.dat (Binary)
• config.txt (read before arm)
Linux kernel boot command
• cmdline.txt
dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200
console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
RaspPi Startup: GPU --> CPU
First stage bootloader --> boot from SD card, and
automatically mount SDcard FAT32 Partition
Second stage bootloader (bootcode.bin) – Read
GPU Firmware (start.elf) on SD card and write to
GPU, and then boot GPU
GPU firmware (start.elf) - Once loaded, this
allows the GPU to start up the ARM.
• An additional file, fixup.dat, is used to configure the
SDRAM partition between the GPU and the ARM. At
this point, the CPU is release from reset and
execution is transferred over.
Linux code - Kernel.img (note: boot parameters:
/boot/cmdline.txt)
/proc/cmdline
Linux Kernel boot parameters
dma.dmachans=0x7f35
bcm2708_fb.fbwidth=1920
bcm2708_fb.fbheight=1080
bcm2708.boardrev=0xe
bcm2708.serial=0x67da1f2e
smsc95xx.macaddr=B8:27:EB:DA:1F:2E
sdhci-bcm2708.emmc_clock_freq=250000000
vc_mem.mem_base=0x1ec00000
vc_mem.mem_size=0x20000000
dwc_otg.lpm_enable=0
console=ttyAMA0,115200
kgdboc=ttyAMA0,115200
console=tty1 root=/dev/mmcblk0p2
rootfstype=ext4
elevator=deadline
rootwait
More about RPI BCM2708 Parameters
http://elinux.org/RPI_BCM2708_Parameters#cite_note-15
Linux booting flow
1. Boot up with Broadcom Bootcode
2. Initialize the system and peripherals.
3. Launch linux kernel
4. Mount initird (initial ramdisk), if any
5. Mount the real root filesystem
6. Execute init and launch shell
Embedded Linux Course
Execute init
Mount rootfs
Start kernel
Boot code
ARM Linux
GPU
Root File system
There are two components to a running Linux system: the
kernel and the root file system
Root file system : mounted as the root directory (/)
To work properly, the root filesystem should include a
minimum set of files to support the system
1) runtime shared libraries from the toolchain : /lib/*.so
2) system configuration files : /etc/*
3) /dev
4) …
Applications
Shared Library
Linux Kernel
Root filesystem
2-17
Embedded Linux Course
Root File System Layout
Embedded Linux Course
/
├── bin
├── boot
├── dev
├── etc
├── home
├── lib
├──init
├──firmware
├── modules/<kernel_ver>
├── modprobe.d
├── lost+found
├── media
├── mnt
├── opt
├── proc
├── root
├── run
├── sbin
├── selinux
├── srv
├── sys
├── tmp
├── usr
└── var
Filesystem Hierarchy Standard (FHS)
2-19
Embedded Linux Course
Directory Description
bin Essential command binaries
boot Static files of the boot loader
dev Device files
etc Host-specific system configuration
lib Essential shared libraries and kernel modules
media Mount point for removeable media
mnt Mount point for mounting a filesystem temporarily
opt Add-on application software packages
sbin Essential system binaries
tmp Temporary files
usr Secondary hierarchy
var Variable data
Root File System Layout
Mount
Edit /etc/fstab
Check “mount” status,, run mount command
Cat /proc/filesystems (support by your kernel)
MISC
/boot/config.txt  like PC BIOS setting
Module Blacklist
/etc/modprobe.d/raspi-blacklist.conf
Raspbian configuration files that prevents
them from being loaded automatically (the
normal setting)
Load I2C Driver Module
The I2C ports need to be enabled in Raspbian before
they can be used.
$sudo nano /etc/modules
$sudo nano /etc/modprobe.d/raspi-blacklist.conf
remove a '#' character to this line
​To install the I2C utilities:
$sudo apt-get install i2c-tools
$sudo reboot
i2c-bcm2708
i2c-dev
# blacklist i2c-bcm2708
Access EEPROM Using I2c-tools
i2cdetect -y 1
EEPROM read/write using i2cset/i2cget
open source I2c-tools
http://www.lm-sensors.org/wiki/I2CTools
Screen Shot
Run a script on start up
sudo nano /etc/rc.local
Make sure not to miss the & character at the end, otherwise the script will not
run in the background and will make the booting process get stuck in a loop!
Backing up your Operating System image
BACKUP
sudo dd bs=4M if=/dev/sdb of=raspbian.img
Restore you system from SD card
sudo dd bs=4M if=raspbian.img of=/dev/sdb
Communicate with VC ( Broadcom Video Core)
vcgencmd :Command exported from GPU
Firmware
See http://elinux.org/RPI_vcgencmd_usage
root@raspberrypi:/home# vcgencmd commands
commands="vcos, ap_output_control, ap_output_post_processing, vchi_test_init,
vchi_test_exit, pm_set_policy, pm_get_status, pm_show_stats, pm_start_logging,
pm_stop_logging, version, commands, set_vll_dir, led_control, set_backlight, set_logging,
get_lcd_info, set_bus_arbiter_mode, cache_flush, otp_dump, codec_enabled,
get_camera, get_mem, measure_clock, measure_volts, measure_temp, get_config,
hdmi_ntsc_freqs, hdmi_status_show, pwm_speedup, force_audio, render_bar, disk_notify,
inuse_notify, sus_suspend, sus_status, sus_is_enabled, sus_stop_test_thread,
egl_platform_switch, mem_validate, mem_oom, mem_reloc_stats, file, vctest_memmap,
vctest_start, vctest_stop, vctest_set, vctest_get"
vcgencmd Examples
Raspberry Pi Education Kit
Read more : http://blog.ittraining.com.tw/2015/03/raspberry-pi_16.html
References
http:// blog.ittraining.comt.tw
http://www.youtube.com/user/itc9988

More Related Content

What's hot (20)

PPT
Universal Reconfigurable Processing Platform For Space Rev Voice4
dseagrave
 
PPTX
SNAPDRAGON SoC Family and ARM Architecture
Abdullaziz Tagawy
 
PPTX
Embedded TCP/IP stack for FreeRTOS
艾鍗科技
 
PDF
Embedded Recipes 2018 - SoC+FPGA update in 2018 - Marek Vasut
Anne Nicolas
 
PDF
Project ACRN GPIO mediator introduction
Project ACRN
 
PDF
TinyML - 4 speech recognition
艾鍗科技
 
PDF
Let's Play STM32
Jay Chen
 
PDF
MYC-C7Z015 CPU Module
Linda Zhang
 
PDF
I/O仮想化最前線〜ネットワークI/Oを中心に〜
Ryousei Takano
 
PPT
Synopsys User Group Presentation
emlawgr
 
PDF
Control-M 800 - Infrastructure Example
Ohio University
 
PDF
Project ACRN USB mediator introduction
Project ACRN
 
PPTX
Snapdragon SoC and ARMv7 Architecture
Santosh Verma
 
PPT
Hp pro liant dl3xx g7
Eddy Jennekens
 
PPT
CCNA CHAPTER 5 BY jetarvind kumar madhukar
ALLCAD Services Pvt Limited
 
PDF
Project ACRN: SR-IOV implementation
Geoffroy Van Cutsem
 
PDF
BKK16-TR08 How to generate power models for EAS and IPA
Linaro
 
PDF
Linux+sensor+device-tree+shell=IoT !
Dobrica Pavlinušić
 
PDF
SFO15-502: Using generic cpuidle framework for ARM/ARM64 in your driver
Linaro
 
PPTX
I2C-Bus Design and Verification Specs
Mostafa Khamis
 
Universal Reconfigurable Processing Platform For Space Rev Voice4
dseagrave
 
SNAPDRAGON SoC Family and ARM Architecture
Abdullaziz Tagawy
 
Embedded TCP/IP stack for FreeRTOS
艾鍗科技
 
Embedded Recipes 2018 - SoC+FPGA update in 2018 - Marek Vasut
Anne Nicolas
 
Project ACRN GPIO mediator introduction
Project ACRN
 
TinyML - 4 speech recognition
艾鍗科技
 
Let's Play STM32
Jay Chen
 
MYC-C7Z015 CPU Module
Linda Zhang
 
I/O仮想化最前線〜ネットワークI/Oを中心に〜
Ryousei Takano
 
Synopsys User Group Presentation
emlawgr
 
Control-M 800 - Infrastructure Example
Ohio University
 
Project ACRN USB mediator introduction
Project ACRN
 
Snapdragon SoC and ARMv7 Architecture
Santosh Verma
 
Hp pro liant dl3xx g7
Eddy Jennekens
 
CCNA CHAPTER 5 BY jetarvind kumar madhukar
ALLCAD Services Pvt Limited
 
Project ACRN: SR-IOV implementation
Geoffroy Van Cutsem
 
BKK16-TR08 How to generate power models for EAS and IPA
Linaro
 
Linux+sensor+device-tree+shell=IoT !
Dobrica Pavlinušić
 
SFO15-502: Using generic cpuidle framework for ARM/ARM64 in your driver
Linaro
 
I2C-Bus Design and Verification Specs
Mostafa Khamis
 

Viewers also liked (9)

PPTX
The Raspberry Pi JavaFX Carputer
Simon Ritter
 
PPTX
哥寫的不是程式,是軟體 - 從嵌入式系統看軟體工程全貌
Tun-Yu Chang
 
PDF
Based on raspberry pi with the application of Stepper
冠宇 陳
 
PDF
淺談RESTful API認證 Token機制使用經驗分享
Tun-Yu Chang
 
PPTX
Raspberry Pi 3 + UART/Bluetooth issues
yeokm1
 
PDF
Sophia conf 2013 - Le monde du Raspberry
Nicolas Hennion
 
PDF
Project humix overview - For Raspberry pi community meetup
Jeffrey Liu
 
PDF
Exploring Raspberry Pi
Lentin Joseph
 
PPTX
台灣樹莓派 2016/12/26 #17 站在Nas的中心呼喊物聯網 QNAP QIoT
Anderson Cheng
 
The Raspberry Pi JavaFX Carputer
Simon Ritter
 
哥寫的不是程式,是軟體 - 從嵌入式系統看軟體工程全貌
Tun-Yu Chang
 
Based on raspberry pi with the application of Stepper
冠宇 陳
 
淺談RESTful API認證 Token機制使用經驗分享
Tun-Yu Chang
 
Raspberry Pi 3 + UART/Bluetooth issues
yeokm1
 
Sophia conf 2013 - Le monde du Raspberry
Nicolas Hennion
 
Project humix overview - For Raspberry pi community meetup
Jeffrey Liu
 
Exploring Raspberry Pi
Lentin Joseph
 
台灣樹莓派 2016/12/26 #17 站在Nas的中心呼喊物聯網 QNAP QIoT
Anderson Cheng
 
Ad

Similar to Raspberry Pi tutorial (20)

PPTX
U-Boot Porting on New Hardware
RuggedBoardGroup
 
PPT
101 1.1 hardware settings
Acácio Oliveira
 
PPT
Basic Linux kernel
Morteza Nourelahi Alamdari
 
ODP
[Defcon] Hardware backdooring is practical
Moabi.com
 
PPT
Qemu - Raspberry | while42 Singapore #2
While42
 
PPTX
Starting Raspberry Pi
LloydMoore
 
ODP
Hardware backdooring is practical : slides
Moabi.com
 
PPT
U Boot or Universal Bootloader
Satpal Parmar
 
PDF
BeagleBone Black Booting Process
SysPlay eLearning Academy for You
 
PDF
Hardware Discovery Commands
Kevin OBrien
 
PDF
Vortex86 Sx Linux How To
Rogelio Canedo
 
PDF
NetBSD on Google Compute Engine (en)
Ryo ONODERA
 
PDF
Beagleboard xm-setup
Premjith Achemveettil
 
PDF
Kernel Recipes 2015 - Kernel dump analysis
Anne Nicolas
 
PDF
Howto Pxeboot
Rogério Sampaio
 
PDF
[Hackito2012] Hardware backdooring is practical
Moabi.com
 
PDF
Building
Satpal Parmar
 
PDF
x86_64 Hardware Deep dive
Naoto MATSUMOTO
 
PDF
BeagleBone Black Bootloaders
SysPlay eLearning Academy for You
 
ODP
Advanced Diagnostics 2
Aero Plane
 
U-Boot Porting on New Hardware
RuggedBoardGroup
 
101 1.1 hardware settings
Acácio Oliveira
 
Basic Linux kernel
Morteza Nourelahi Alamdari
 
[Defcon] Hardware backdooring is practical
Moabi.com
 
Qemu - Raspberry | while42 Singapore #2
While42
 
Starting Raspberry Pi
LloydMoore
 
Hardware backdooring is practical : slides
Moabi.com
 
U Boot or Universal Bootloader
Satpal Parmar
 
BeagleBone Black Booting Process
SysPlay eLearning Academy for You
 
Hardware Discovery Commands
Kevin OBrien
 
Vortex86 Sx Linux How To
Rogelio Canedo
 
NetBSD on Google Compute Engine (en)
Ryo ONODERA
 
Beagleboard xm-setup
Premjith Achemveettil
 
Kernel Recipes 2015 - Kernel dump analysis
Anne Nicolas
 
Howto Pxeboot
Rogério Sampaio
 
[Hackito2012] Hardware backdooring is practical
Moabi.com
 
Building
Satpal Parmar
 
x86_64 Hardware Deep dive
Naoto MATSUMOTO
 
BeagleBone Black Bootloaders
SysPlay eLearning Academy for You
 
Advanced Diagnostics 2
Aero Plane
 
Ad

More from 艾鍗科技 (20)

PPTX
AI 技術浪潮, 什麼是機器學習? 什麼是深度學習, 什麼是生成式AI, AI 能力認證
艾鍗科技
 
PPTX
Appendix 1 Goolge colab
艾鍗科技
 
PPTX
Project-IOT於餐館系統的應用
艾鍗科技
 
PPTX
02 IoT implementation
艾鍗科技
 
PPTX
Tiny ML for spark Fun Edge
艾鍗科技
 
PDF
Openvino ncs2
艾鍗科技
 
PDF
Step motor
艾鍗科技
 
PDF
2. 機器學習簡介
艾鍗科技
 
PDF
5.MLP(Multi-Layer Perceptron)
艾鍗科技
 
PDF
3. data features
艾鍗科技
 
PPTX
心率血氧檢測與運動促進
艾鍗科技
 
PPTX
利用音樂&情境燈幫助放鬆
艾鍗科技
 
PPTX
IoT感測器驅動程式 在樹莓派上實作
艾鍗科技
 
PPTX
無線聲控遙控車
艾鍗科技
 
PPT
最佳光源的研究和實作
艾鍗科技
 
PPTX
無線監控網路攝影機與控制自走車
艾鍗科技
 
PPTX
Reinforcement Learning
艾鍗科技
 
PPTX
Linux Device Tree
艾鍗科技
 
PPTX
人臉辨識考勤系統
艾鍗科技
 
PPTX
智慧家庭Smart Home
艾鍗科技
 
AI 技術浪潮, 什麼是機器學習? 什麼是深度學習, 什麼是生成式AI, AI 能力認證
艾鍗科技
 
Appendix 1 Goolge colab
艾鍗科技
 
Project-IOT於餐館系統的應用
艾鍗科技
 
02 IoT implementation
艾鍗科技
 
Tiny ML for spark Fun Edge
艾鍗科技
 
Openvino ncs2
艾鍗科技
 
Step motor
艾鍗科技
 
2. 機器學習簡介
艾鍗科技
 
5.MLP(Multi-Layer Perceptron)
艾鍗科技
 
3. data features
艾鍗科技
 
心率血氧檢測與運動促進
艾鍗科技
 
利用音樂&情境燈幫助放鬆
艾鍗科技
 
IoT感測器驅動程式 在樹莓派上實作
艾鍗科技
 
無線聲控遙控車
艾鍗科技
 
最佳光源的研究和實作
艾鍗科技
 
無線監控網路攝影機與控制自走車
艾鍗科技
 
Reinforcement Learning
艾鍗科技
 
Linux Device Tree
艾鍗科技
 
人臉辨識考勤系統
艾鍗科技
 
智慧家庭Smart Home
艾鍗科技
 

Recently uploaded (20)

PDF
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
PPTX
STAFF DEVELOPMENT AND WELFARE: MANAGEMENT
PRADEEP ABOTHU
 
PDF
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
PPTX
PATIENT ASSIGNMENTS AND NURSING CARE RESPONSIBILITIES.pptx
PRADEEP ABOTHU
 
PDF
Isharyanti-2025-Cross Language Communication in Indonesian Language
Neny Isharyanti
 
PPTX
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
PPTX
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
PPTX
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
PPTX
How to Set Up Tags in Odoo 18 - Odoo Slides
Celine George
 
PDF
community health nursing question paper 2.pdf
Prince kumar
 
PPTX
SPINA BIFIDA: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
PPTX
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
PPTX
2025 Winter SWAYAM NPTEL & A Student.pptx
Utsav Yagnik
 
PPTX
How to Set Maximum Difference Odoo 18 POS
Celine George
 
PPTX
How to Handle Salesperson Commision in Odoo 18 Sales
Celine George
 
PDF
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
PPTX
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
PDF
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
PDF
The Different Types of Non-Experimental Research
Thelma Villaflores
 
PDF
ARAL-Orientation_Morning-Session_Day-11.pdf
JoelVilloso1
 
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
STAFF DEVELOPMENT AND WELFARE: MANAGEMENT
PRADEEP ABOTHU
 
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
PATIENT ASSIGNMENTS AND NURSING CARE RESPONSIBILITIES.pptx
PRADEEP ABOTHU
 
Isharyanti-2025-Cross Language Communication in Indonesian Language
Neny Isharyanti
 
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
How to Set Up Tags in Odoo 18 - Odoo Slides
Celine George
 
community health nursing question paper 2.pdf
Prince kumar
 
SPINA BIFIDA: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
2025 Winter SWAYAM NPTEL & A Student.pptx
Utsav Yagnik
 
How to Set Maximum Difference Odoo 18 POS
Celine George
 
How to Handle Salesperson Commision in Odoo 18 Sales
Celine George
 
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
The Different Types of Non-Experimental Research
Thelma Villaflores
 
ARAL-Orientation_Morning-Session_Day-11.pdf
JoelVilloso1
 

Raspberry Pi tutorial

  • 2. Outline Introduction to Raspberry Pi About Linux BSP Misc (backup OS image, vcgencmd, …) Raspberry Pi Education Kit
  • 5. Hardware Spec. SoC:BroadcomBCM2835(CPU,GPU DSP,SDRAM, USB) CPU:ARM1176JZF-S核心(ARM11系列)700MHz GPU: Broadcom VideoCore IV, OpenGL ES 2.0, 1080p 30 h.264/MPEG-4 AVC RAM: 256MByte (Rev A), 512 MByte (Rev B) OS:Raspbian Linux, GNU/Linux(Debian, Fedora, Arch Linux ARM), Android,…
  • 6. Video Codec Video Codec for MPEG2 and VC-1 need License You will need to provide your device's internal 16-digit serial number as part of your order. Your serial number is not the number printed on your board. http://www.raspberrypi.com
  • 7. RaspPi pinout (Model B+) you can learn Linux driver http:// blog.ittraining.com.tw
  • 8. Rasp Pi Software Architecture
  • 9. SoC BCM2835 Address Map Peripherals are mapped into the kernel virtual address space starting at address 0xF2000000. #define BCM2835_PERI_BASE 0x20000000 #define BCM2835_GPIO_BASE (BCM2835_PERI_BASE + 0x200000)
  • 10. Linux BSP Bootloader with Device Tree support Kernel with Device Tree support Drivers for SoC and board components SoC machine specific layer Root file system for software developers GNU cross compiler for ARM architecture xxx Build Environment
  • 11. Pi’s SD Card Layout 3 Embedded Linux components Boot code Linux Kernel Root File system Boot code kernel Root FileSystem mmcblock0p1 /boot mmcblock0p2 / You can access “boot code partition “ in windows , because it is FAT32
  • 13. /boot Bootcode • bootcode.bin (Binary) • start.elf (Binary) • fixup.dat (Binary) • config.txt (read before arm) Linux kernel boot command • cmdline.txt dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
  • 14. RaspPi Startup: GPU --> CPU First stage bootloader --> boot from SD card, and automatically mount SDcard FAT32 Partition Second stage bootloader (bootcode.bin) – Read GPU Firmware (start.elf) on SD card and write to GPU, and then boot GPU GPU firmware (start.elf) - Once loaded, this allows the GPU to start up the ARM. • An additional file, fixup.dat, is used to configure the SDRAM partition between the GPU and the ARM. At this point, the CPU is release from reset and execution is transferred over. Linux code - Kernel.img (note: boot parameters: /boot/cmdline.txt)
  • 15. /proc/cmdline Linux Kernel boot parameters dma.dmachans=0x7f35 bcm2708_fb.fbwidth=1920 bcm2708_fb.fbheight=1080 bcm2708.boardrev=0xe bcm2708.serial=0x67da1f2e smsc95xx.macaddr=B8:27:EB:DA:1F:2E sdhci-bcm2708.emmc_clock_freq=250000000 vc_mem.mem_base=0x1ec00000 vc_mem.mem_size=0x20000000 dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait More about RPI BCM2708 Parameters http://elinux.org/RPI_BCM2708_Parameters#cite_note-15
  • 16. Linux booting flow 1. Boot up with Broadcom Bootcode 2. Initialize the system and peripherals. 3. Launch linux kernel 4. Mount initird (initial ramdisk), if any 5. Mount the real root filesystem 6. Execute init and launch shell Embedded Linux Course Execute init Mount rootfs Start kernel Boot code ARM Linux GPU
  • 17. Root File system There are two components to a running Linux system: the kernel and the root file system Root file system : mounted as the root directory (/) To work properly, the root filesystem should include a minimum set of files to support the system 1) runtime shared libraries from the toolchain : /lib/*.so 2) system configuration files : /etc/* 3) /dev 4) … Applications Shared Library Linux Kernel Root filesystem 2-17 Embedded Linux Course
  • 18. Root File System Layout Embedded Linux Course / ├── bin ├── boot ├── dev ├── etc ├── home ├── lib ├──init ├──firmware ├── modules/<kernel_ver> ├── modprobe.d ├── lost+found ├── media ├── mnt ├── opt ├── proc ├── root ├── run ├── sbin ├── selinux ├── srv ├── sys ├── tmp ├── usr └── var
  • 19. Filesystem Hierarchy Standard (FHS) 2-19 Embedded Linux Course Directory Description bin Essential command binaries boot Static files of the boot loader dev Device files etc Host-specific system configuration lib Essential shared libraries and kernel modules media Mount point for removeable media mnt Mount point for mounting a filesystem temporarily opt Add-on application software packages sbin Essential system binaries tmp Temporary files usr Secondary hierarchy var Variable data Root File System Layout
  • 20. Mount Edit /etc/fstab Check “mount” status,, run mount command
  • 22. MISC
  • 23. /boot/config.txt  like PC BIOS setting
  • 24. Module Blacklist /etc/modprobe.d/raspi-blacklist.conf Raspbian configuration files that prevents them from being loaded automatically (the normal setting)
  • 25. Load I2C Driver Module The I2C ports need to be enabled in Raspbian before they can be used. $sudo nano /etc/modules $sudo nano /etc/modprobe.d/raspi-blacklist.conf remove a '#' character to this line ​To install the I2C utilities: $sudo apt-get install i2c-tools $sudo reboot i2c-bcm2708 i2c-dev # blacklist i2c-bcm2708
  • 26. Access EEPROM Using I2c-tools i2cdetect -y 1 EEPROM read/write using i2cset/i2cget open source I2c-tools http://www.lm-sensors.org/wiki/I2CTools
  • 28. Run a script on start up sudo nano /etc/rc.local Make sure not to miss the & character at the end, otherwise the script will not run in the background and will make the booting process get stuck in a loop!
  • 29. Backing up your Operating System image BACKUP sudo dd bs=4M if=/dev/sdb of=raspbian.img Restore you system from SD card sudo dd bs=4M if=raspbian.img of=/dev/sdb
  • 30. Communicate with VC ( Broadcom Video Core) vcgencmd :Command exported from GPU Firmware See http://elinux.org/RPI_vcgencmd_usage root@raspberrypi:/home# vcgencmd commands commands="vcos, ap_output_control, ap_output_post_processing, vchi_test_init, vchi_test_exit, pm_set_policy, pm_get_status, pm_show_stats, pm_start_logging, pm_stop_logging, version, commands, set_vll_dir, led_control, set_backlight, set_logging, get_lcd_info, set_bus_arbiter_mode, cache_flush, otp_dump, codec_enabled, get_camera, get_mem, measure_clock, measure_volts, measure_temp, get_config, hdmi_ntsc_freqs, hdmi_status_show, pwm_speedup, force_audio, render_bar, disk_notify, inuse_notify, sus_suspend, sus_status, sus_is_enabled, sus_stop_test_thread, egl_platform_switch, mem_validate, mem_oom, mem_reloc_stats, file, vctest_memmap, vctest_start, vctest_stop, vctest_set, vctest_get"
  • 32. Raspberry Pi Education Kit Read more : http://blog.ittraining.com.tw/2015/03/raspberry-pi_16.html