ECE472/572 (UCLX) Assignment 2 - version for RaspberryPi

Prepare for the lab

Answer these questions while doing this lab – they will help you understand the procedure and better prepare for the tests.

Activity (30pts.)

This lab assignment task has been reviewed by Mr. Christopher Noe, class of 2018,  Mr. Joseph Groe, class of 2017 and by Ms. Kate Palmer, class of 2015.

This installation assumes that you are running a Linux, or preferably Debian Linux such as Ubuntu booted from a HD or a Virtual Machine. It may be possible to do it while running from a Live CD but the amount of data to be saved temporarily on a RAM disk will be prohibitive with less than 8GB of RAM.

  1. This exercise is based on documentation posted at http://www.raspberrypi.org/documentation/installation/installing-images/linux.md . It puts emphasis on performing steps manually one by one rather than running automated scripts for the sake of learning media partitioning and formatting operations.
  2. cd
  3. script hw2rp.txt
  4. sudo apt-get install wget
  5. ls -l /dev/*
  6. Insert a 4GB or larger SD card (4GB and 8GB cards were tested)
  7. ls -l /dev/sd*
  8. Check for a new disk device name. It will be in the format of /dev/sdx .
  9. sudo mount
  10. df -h
  11. sudo umount /dev/sdx?
    Note: this should unmount /dev/sdx1 and /dev/sdx2, and produce an error message for /dev/sdx as the latter was never mounted.
  12. Do not proceed with this media name if the command above produced an error indicating that the media unmounting failed because the media is in use. You might be trying to format your hard drive instead of the SD card!
  13. Inspect what kind of partition system was already present on your SD card:
    sudo sfdisk -l /dev/sdx
  14. cd
  15. mkdir rpi
  16. cd rpi
  17. pwd
  18. wget http://downloads.raspberrypi.org/raspbian_latest
    Note that as of January 2017 this will result in downloading the image that is also available at
    wget http://director.downloads.raspberrypi.org/raspbian/images/raspbian-2017-01-10/2017-01-11-raspbian-jessie.zip
  19. ls -l
  20. mv raspbian_latest raspbian.zip
  21. Extract the compressed file using unzip to pipe, and read from that pipe by dd run as root that writes data sector by sector to Sd card "hard drive":
    unzip -p raspbian.zip | sudo dd bs=4M of=/dev/sdx
  22. Try this: open another terminal and occasionally type:
    sudo pkill -USR1 -n -x dd
    and then inspect the original terminal window. We are copying almost 4GB of data.
  23. sync
  24. Inspect what kind of partition system was written to your SD card:
    sudo sfdisk -l /dev/sdx
  25. Adjust the UART settings for RaspberryPi version 3B -- we use wired UART and not BlueTooth
    Note: this step can be performed when you prepare the system for the older Raspberry Pi but it does not have any effect on it.
    1. Remove the SD card and insert it again.
      Note: instead of removing and reinserting the SD card you can mount the SD card manually by clicking on its icon that showed up on the desktop.
    2. ls -l /media/youruserid
    3. gedit /media/youruserid/boot/config.txt
    4. Add the following line at the end of the configuration file, save the file and close gedit
      dtoverlay=pi3-miniuart-bt
    5. sync
    6. sudo umount /dev/sdx?
  26. Remove the SD card and insert it into your RaspberryPi. Make sure that the SD card reader LED stopped flashing before ejecting the card. Otherwise, you may have to restart the process from the step where you copy the image file to the SD card using dd.
  27. Connect the RaspberryPi to your 4-pin USB to serial adapter connected as instructed.
  28. Within a minute the board shall come "alive", it's LED shall start pulsing, your computer shall detect four USB devices including USB to serial, and mass storage device
  29. Run a HyperTerminal (from Windows or Linux) On windows you may use an open source software called PUTTY from http://www.putty.org/
    1. connect to the RaspberryPi. The connection parameters are 115000 bits per second, 8-bit, no parity, 1 stop bit
    2. Try to login as one of the follwoing
      • User: root, no password
      • User: pi, password raspberry
    3. set root password using passwd command. Set the password to ee00
      If you have problems with password being to short use sudo and set the password as root instead of as the user.
    4. Enable ssh server to allow for remote login using SSH
      sudo raspi-config
      choose:  advanced options / ssh / enable / yes
    5. check if you are connected to Ethernet
      • verify that the RJ45 connector is active (LED on the connector lights up)
      • check what is your IP address using ifconfig
      • Ignore the 127.0.0.1 address as it is a local address of the board for testing purposes (Local Loopback).
      • If the IP address starts with 10..... that means that the Ethernet port is initialized but DHCP client for IP v.4 was not run.
      • If you are running a home router with network address translation firewall the address should most likely start with 192.168....
    6. if you are connected do attempt to update the board contents. Since you are using the most recent image very little updates should be available.
      Note: some distributions may not have opkg. Try dpkg, apt-getaptitude instead of opkg.
      sudo apt-get update
      sudo apt-get upgrade
    7. More packages that may be useful one day:
      sudo apt-get install binutils bzip2 gettext git libtool make patch sed wget
      sudo apt-get install gcc g++ libgcc-dev task-native-sdk
      sudo apt-get install fakeroot
      sudo apt-get install kernel-module-ftdi-sio
      Comment: It is not our intention to develop software directly on the board. The industry does use cross-compiling technology for embedded system development. However, this board is powerful enough to allow for local compilation of simple programs directly on the board. It is possible to do all further lab work except #5, #6 (system speed and SD card speed and size limit), and #13 (not applicable) directly on this board.
    8. just in case run sync
  30. Connect to the board using SSH:
    ssh 123.456.789.012 -l root
    Note: Adjust user name accordingly. Typing exit will log you out back to the local terminal window.
  31. exit
    This will end the script session. Submit the file hw2bb.txt if requested.

assignment submission

Take a photographs (phone camera is OK) of the board and a HyperTerminal window showing that you connected to it.
Type uname -a in the console to show which version of system is running. make sure that the outcome of uname command is legible in the screen shot or the photograph. ZIP files together if you are submitting multiple files.

Only if requested: Drop the file with the information collected during the exercise as instructed in the corresponding assignment drop box on Sakai. Peoria area students only: label your SD card with your name or use an envelope and hand it to the instructor by the end of the lecture the day the lab is due. Your disk will be returned after grading.

Thank you

web site front local main page local list page general bookmarks software bookmarks go back copyright info