Monthly Archives: February 2018

USB Stick Debug

[  424.424019] usb 4-2.3: new full-speed USB device number 6 using uhci_hcd
[  424.529658] usb 4-2.3: not running at top speed; connect to a high speed hub
[  424.563659] usb 4-2.3: New USB device found, idVendor=090c, idProduct=1000
[  424.563663] usb 4-2.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  424.563666] usb 4-2.3: Product: USB Flash Drive
[  424.563668] usb 4-2.3: Manufacturer: USB 2.0
[  424.563671] usb 4-2.3: SerialNumber: AA00000000006062
[  424.656450] usb-storage 4-2.3:1.0: USB Mass Storage device detected
[  424.656526] scsi host8: usb-storage 4-2.3:1.0
[  424.656603] usbcore: registered new interface driver usb-storage
[  424.676605] usbcore: registered new interface driver uas
[  425.811695] scsi 8:0:0:0: Direct-Access     USB 2.0  USB Flash Drive  1100 PQ: 0 ANSI: 4
[  425.812320] sd 8:0:0:0: Attached scsi generic sg3 type 0
[  425.816685] sd 8:0:0:0: [sdc] 7987200 512-byte logical blocks: (4.09 GB/3.81 GiB)
[  425.819683] sd 8:0:0:0: [sdc] Write Protect is off
[  425.819688] sd 8:0:0:0: [sdc] Mode Sense: 43 00 00 00
[  425.822677] sd 8:0:0:0: [sdc] No Caching mode page found
[  425.822682] sd 8:0:0:0: [sdc] Assuming drive cache: write through
[  425.846689]  sdc: sdc1
[  425.863678] sd 8:0:0:0: [sdc] Attached SCSI removable disk
[  435.540775] sd 8:0:0:0: [sdc] tag#0 FAILED Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
[  435.540782] sd 8:0:0:0: [sdc] tag#0 CDB: Read(10) 28 00 00 00 10 70 00 00 c6 00
[  435.540786] blk_update_request: I/O error, dev sdc, sector 4208
[  435.542751] usb 4-2.3: USB disconnect, device number 6
[  435.548036] scsi 8:0:0:0: rejecting I/O to offline device
[  435.548042] scsi 8:0:0:0: [sdc] killing request
[  435.548045] scsi 8:0:0:0: rejecting I/O to offline device
[  435.548047] scsi 8:0:0:0: [sdc] killing request
[  435.548155] scsi 8:0:0:0: [sdc] FAILED Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK
[  435.548158] scsi 8:0:0:0: [sdc] CDB: Read(10) 28 00 00 00 10 71 00 00 c5 00
[  435.548162] blk_update_request: I/O error, dev sdc, sector 4209
[  435.548225] scsi 8:0:0:0: [sdc] FAILED Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK
[  435.548227] scsi 8:0:0:0: [sdc] CDB: Read(10) 28 00 00 00 10 70 00 00 01 00
[  435.548228] blk_update_request: I/O error, dev sdc, sector 4208
[  435.550362] FAT-fs (sdc1): FAT read failed (blocknr 2160)
[  435.553364] FAT-fs (sdc1): FAT read failed (blocknr 822)
[  435.572113] FAT-fs (sdc1): unable to read boot sector to mark fs as dirty
[  503.592050] usb usb4-port2: disabled by hub (EMI?), re-enabling...
[  105.996015] usb 4-2.4: new low-speed USB device number 10 using uhci_hcd
[  106.080012] usb 4-2.4: device descriptor read/64, error -71
[  106.268013] usb 4-2.4: device descriptor read/64, error -71
[  106.444013] usb 4-2.4: new low-speed USB device number 11 using uhci_hcd
[  106.528013] usb 4-2.4: device descriptor read/64, error -71
[  106.716014] usb 4-2.4: device descriptor read/64, error -71
[  106.892014] usb 4-2.4: new low-speed USB device number 12 using uhci_hcd
[  107.300012] usb 4-2.4: device not accepting address 12, error -71
[  107.372015] usb 4-2.4: new low-speed USB device number 13 using uhci_hcd
[  107.780031] usb 4-2.4: device not accepting address 13, error -71
[  107.781130] usb 4-2-port4: unable to enumerate USB device

96Boards (Linaro Hardware)

Summary of most frequently asked questions at ELC, April 25, 2016

What is Linaro? Linaro is a collaborative engineering organization focused on improving the ARM ecosystem. Our members fund the engineering activities, such as Linux kernel development, toolchain optimization, and validation. The main goal being that we can build the foundational pieces of software together, so that every System on Chip (SoC) vendor can leverage which reduces fragmentation and time to market.

Why is Linaro building hardware? Linaro is purely a software company. Linaro is not building hardware, our members are.

What is 96Boards? 96Boards is an initiative inside of Linaro, which defines various hardware specifications for members/non-members to build a board from. Currently, there are two specifications, CE, and EE. The CE specification targets the embedded, IoT, and mobile markets, whereas the EE specification is targeted towards enterprise use cases. To find out more, click here to go to the 96boards website.

How are 96Boards different than the Raspberry Pi? 96Boards hardware specification defines various standardized form factors, unlike the raspberry pi. The raspberry pi uses only broadcom SoC’s and the form factor changes from board to board. With 96Boards, you get choice, the choice of various different SoC’s at different price points.

Raspberry Pi is cheaper, how can the 96Boards compete?
Raspberry Pi is indeed cheaper, and you get what you pay for. Linaro being a software company focused on ARM, can provide a much more mature software stack than the community based raspberry pi. For example, a 64bit kernel is supported on all of the 96Boards hardware which is currently available, this is not the case with raspberry pi.

Boards

Huawei HiKey960, Release date around 01.05.2017
github.com/96boards-hikey
HiKey960 Development Board User Manual
DragonBoard 410c, Release date around 01.07.2015

Expansion Boards

PoE + Ethernet Mezzanine
DUAL MIPI Adapter Mezzanine – AiStarVision
PoE + Ethernet Mezzanine

Pinout

MIPI Adapter Mezzanine – AiStarVision
PoE + Ethernet Mezzanine

Raspberry Pi 3, Camera

Camera Hardware, CPU -> VCHI -> GPU, shared RAM, MMAL

Camera Module Usage

  • raspistill, capturing still photographs with the camera module
  • raspivid, capturing video with the camera module

API / Programmierschnittstelle

Wikipedia

Video4Linux (V4L) => V4L2 für Version 2
Video for Windows (VfW) (alt) => Windows 3.1 (1992)
Windows Driver Model (WDM) (alt)
Windows Driver Frameworks (WDF, formerly Windows Driver Foundation) (ab Windows 2000 bis Windows 10)
DirectShow (war Teil von DirectX, ist nun Bestandteil der Windows-Plattform)

linuxtv.org (official)

Development: Video4Linux APIs => Video4Linux2 V4L2

Tutorials

How to use V4L2 Cameras on the Raspberry Pi 3 with an Upstream Kernel
Definition of “downstream” and “upstream”

  • Staging
  • Mainline
  • Upstream
  • Downstream
    • Raspberry PI Upstreaming
      staging: Import the BCM2835 MMAL-based V4L2 camera driver.
      Help learning MMAL/contributing to userland utils
      What is MMAL?

      Programs

      github.com/raspberrypi/userland/tree/master/host_applications/linux/apps/raspicam

      USB-Webcam

      Linux media interface
      Linux video capture interface
      
      $ sudo apt-get install fswebcam
      [...]
      The following NEW packages will be installed:
        fontconfig-config fonts-dejavu-core fswebcam libfontconfig1 libgd3 libjbig0 libtiff5 libwebp6 libxpm4
      [...]
      
      $ fswebcam [<options>] <filename>
      $ fswebcam
      -r 640x480       # Auflösung festlegen
      -d /dev/video0   # Welches Device wird benutzt
      -v               # Verbose -> Ausführliche Ausgabe
      /tmp/test.jpg    # Ausgabe-Datei 
      
      
      $ sudo apt-get install motion
      [...]
      The following NEW packages will be installed:
        ffmpeg libaacs0 libass5 libasyncns0 libavc1394-0 libavcodec57 libavdevice57 libavfilter6 libavformat57 libavresample3
        libavutil55 libbdplus0 libbluray1 libbs2b0 libcaca0 libcairo2 libcdio-cdda1 libcdio-paranoia1 libcdio13
        libchromaprint1 libdc1394-22 libdrm-amdgpu1 libdrm-freedreno1 libdrm-nouveau2 libdrm-radeon1 libebur128-1 libegl1-mesa
        libfftw3-double3 libflac8 libflite1 libfribidi0 libgbm1 libgl1-mesa-dri libgl1-mesa-glx libglapi-mesa libgme0
        libgraphite2-3 libgsm1 libharfbuzz0b libice6 libiec61883-0 libjack-jackd2-0 libllvm3.9 libmariadbclient18 libmp3lame0
        libmpg123-0 libogg0 libopenal-data libopenal1 libopencv-core2.4v5 libopencv-imgproc2.4v5 libopenjp2-7 libopenmpt0
        libopus0 libpgm-5.2-0 libpixman-1-0 libpostproc54 libpq5 libpulse0 libraw1394-11 librubberband2 libsdl2-2.0-0 libsensors4
        libshine3 libsm6 libsnappy1v5 libsndfile1 libsndio6.1 libsodium18 libsoxr0 libspeex1 libssh-gcrypt-4
        libswresample2 libswscale4 libtheora0 libtwolame0 libtxc-dxtn-s2tc libva-drm1 libva-x11-1 libva1 libvdpau-va-gl1 libvdpau1
        libvorbis0a libvorbisenc2 libvorbisfile3 libvpx4 libwavpack1 libwayland-client0 libwayland-cursor0
        libwayland-egl1-mesa libwayland-server0 libwebpmux2 libx11-xcb1 libx264-148 libx265-95 libxcb-dri2-0 libxcb-dri3-0 libxcb-glx0
        libxcb-present0 libxcb-render0 libxcb-shape0 libxcb-shm0 libxcb-sync1 libxcb-xfixes0 libxcursor1
        libxdamage1 libxfixes3 libxi6 libxinerama1 libxkbcommon0 libxrandr2 libxrender1 libxshmfence1 libxss1 libxtst6 libxv1 libxvidcore4
        libxxf86vm1 libzmq5 libzvbi-common libzvbi0 mesa-va-drivers mesa-vdpau-drivers motion mysql-common va-driver-all vdpau-driver-all
        x11-common
      [...]
      Setting up motion (4.0-1) ...
      Adding group `motion' (GID 113) ...
      Done.
      Warning: The home dir /var/lib/motion you specified already exists.
      Adding system user `motion' (UID 109) ...
      Adding new user `motion' (UID 109) with group `motion' ...
      The home directory `/var/lib/motion' already exists.  Not copying from `/etc/skel'.
      adduser: Warning: The home directory `/var/lib/motion' does not belong to the user you are currently creating.
      Adding user `motion' to group `video' ...
      Adding user motion to group video
      Done.
      
      $ sudo vi /etc/default/motion
      start_motion_daemon=no => yes
      
      $ sudo mkdir /srv/motion
      $ sudo chown motion:motion /srv/motion
      

Raspberry Pi 3, Boot options in /boot/config.txt

documentation > configuration > config-txt

  • Memory
  • Licence Keys/Codecs
  • Video/Display
  • Audio
  • Camera
  • Boot
  • Ports and Device Tree
  • Overclocking
  • Conditional Filters
  • Miscellaneous

=

  • Videocore GPU (VC4)
 $ ls -la /boot
total 21059
drwxr-xr-x  3 root root    2560 Jan  1  1970 .
drwxr-xr-x 21 root root    4096 Nov 29 02:37 ..
-rwxr-xr-x  1 root root   15830 Oct 30 10:36 bcm2708-rpi-0-w.dtb
-rwxr-xr-x  1 root root   15367 Oct 30 10:36 bcm2708-rpi-b.dtb
-rwxr-xr-x  1 root root   15626 Oct 30 10:36 bcm2708-rpi-b-plus.dtb
-rwxr-xr-x  1 root root   15086 Oct 30 10:36 bcm2708-rpi-cm.dtb
-rwxr-xr-x  1 root root   16693 Oct 30 10:36 bcm2709-rpi-2-b.dtb
-rwxr-xr-x  1 root root   17794 Oct 30 10:36 bcm2710-rpi-3-b.dtb
-rwxr-xr-x  1 root root   16550 Oct 30 10:36 bcm2710-rpi-cm3.dtb
-rwxr-xr-x  1 root root   50248 Aug 11 17:03 bootcode.bin
-rwxr-xr-x  1 root root     142 Jan  1  1980 cmdline.txt
-rwxr-xr-x  1 root root    1627 Feb  1 17:00 config.txt
-rwxr-xr-x  1 root root   18693 Aug 21  2015 COPYING.linux
-rwxr-xr-x  1 root root    2578 Oct 30 10:36 fixup_cd.dat
-rwxr-xr-x  1 root root    6551 Oct 30 10:36 fixup.dat
-rwxr-xr-x  1 root root    9694 Oct 30 10:36 fixup_db.dat
-rwxr-xr-x  1 root root    9694 Oct 30 10:36 fixup_x.dat
-rwxr-xr-x  1 root root     145 Nov 29 02:37 issue.txt
-rwxr-xr-x  1 root root 4579632 Oct 30 10:36 kernel7.img
-rwxr-xr-x  1 root root 4379152 Oct 30 10:36 kernel.img
-rwxr-xr-x  1 root root    1494 Nov 18  2015 LICENCE.broadcom
-rwxr-xr-x  1 root root   18974 Nov 29 02:37 LICENSE.oracle
drwxr-xr-x  2 root root   10240 Nov 29 01:21 overlays
-rwxr-xr-x  1 root root  667460 Oct 30 10:36 start_cd.elf
-rwxr-xr-x  1 root root 4956676 Oct 30 10:36 start_db.elf
-rwxr-xr-x  1 root root 2820196 Oct 30 10:36 start.elf
-rwxr-xr-x  1 root root 3904228 Oct 30 10:36 start_x.elf

Boot options in config.txt

enable_uart=1

The Raspberry Pi UARTs

start_x=1

start_x=1 should be specified when using the camera module.

gpu_mem=128

GPU memory in megabytes. This sets the memory split between the CPU and GPU; the CPU gets the remaining memory. Minimum value is 16; maximum value is 192, 448, or 944, depending on whether you are using a 256M, 512MB, or 1024MB Pi.
Memory options in config.txt

force_turbo=1

disable dynamic clocking (and force overclocking) with force_turbo=1
Overclocking options in config.txt


					

Raspberry Pi 3, raspi-config

Configuration tool for the Raspberry Pi

github.com/RPi-Distro/raspi-config (new)
github.com/asb/raspi-config (old)

Manual

raspi-config, raspberrypi.org
RPi raspi-config, elinux.org

$ which raspi-config
/usr/bin/raspi-config

$ file /usr/bin/raspi-config
/usr/bin/raspi-config: POSIX shell script, ASCII text executable

$ sudo cat /proc/device-tree/model
Raspberry Pi 3 Model B Rev 1.2

$ whiptail \
  --title "abc" \
  --backtitle "xyz" \
  --menu "Setup Options" 20 30 10 \
  --cancel-button Finish \
  --ok-button Select \
  "1 abc" "A B C" \
  "2 xyz" "X Y Z" 

INTERACTIVE=True
ASK_TO_REBOOT=0
BLACKLIST=/etc/modprobe.d/raspi-blacklist.conf
CONFIG=/boot/config.txt

#
# Interactive use loop
#
if [ "$INTERACTIVE" = True ]; then
  [ -e $CONFIG ] || touch $CONFIG
  calc_wt_size
  while true; do
      FUN=$(whiptail --title "Raspberry Pi Software Configuration Tool (raspi-config)" --backtitle "$(cat /proc/device-tree/model)" --menu "Setup Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT --cancel-button Finish --ok-button Select \
        "1 Change User Password" "Change password for the current user" \
        "2 Network Options" "Configure network settings" \
        "3 Boot Options" "Configure options for start-up" \
        "4 Localisation Options" "Set up language and regional settings to match your location" \
        "5 Interfacing Options" "Configure connections to peripherals" \
        "6 Overclock" "Configure overclocking for your Pi" \
        "7 Advanced Options" "Configure advanced settings" \
        "8 Update" "Update this tool to the latest version" \
        "9 About raspi-config" "Information about this configuration tool" \
        3>&1 1>&2 2>&3)
    RET=$?
    if [ $RET -eq 1 ]; then
      do_finish
    elif [ $RET -eq 0 ]; then
        case "$FUN" in
          1\ *) do_change_pass ;;
          2\ *) do_network_menu ;;
          3\ *) do_boot_menu ;;
          4\ *) do_internationalisation_menu ;;
          5\ *) do_interface_menu ;;
          6\ *) do_overclock ;;
          7\ *) do_advanced_menu ;;
          8\ *) do_update ;;
          9\ *) do_about ;;
          *) whiptail --msgbox "Programmer error: unrecognized option" 20 60 1 ;;
        esac || whiptail --msgbox "There was an error running option $FUN" 20 60 1
    else
      exit 1
    fi
  done
fi

do_interface_menu() {
  [...]
    "P1 Camera" "Enable/Disable connection to the Raspberry Pi Camera" \
    "P2 SSH" "Enable/Disable remote command line access to your Pi using SSH" \
    "P3 VNC" "Enable/Disable graphical remote access to your Pi using RealVNC" \
    "P4 SPI" "Enable/Disable automatic loading of SPI kernel module" \
    "P5 I2C" "Enable/Disable automatic loading of I2C kernel module" \
    "P6 Serial" "Enable/Disable shell and kernel messages on the serial connection" \
    "P7 1-Wire" "Enable/Disable one-wire interface" \
    "P8 Remote GPIO" "Enable/Disable remote access to GPIO pins" \
  [...]
  elif [ $RET -eq 0 ]; then
    case "$FUN" in
      P1\ *) do_camera ;;
      P2\ *) do_ssh ;;
      P3\ *) do_vnc ;;
      P4\ *) do_spi ;;
      P5\ *) do_i2c ;;
      P6\ *) do_serial ;;
      P7\ *) do_onewire ;;
      P8\ *) do_rgpio ;;
    [...]
  fi
}