ECE472/572 (UCLX) Assignment 10

Prepare for the lab - direct questions

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

Prepare for the lab - indirect questions

Activity 1 (20pts.)

Write a short program that accesses /dev/rtcx or its equivalent and prints the current time of the hardware clock. Use the following loose program outline. Please note that we will read the clock state not by reading from the device file (like we did in case of joystick) but instead by executing ioctl with parameter RTC_RD_TIME and the pointer to a variable of type rtc_time.

You may have to modify the file name of the clock device. You will have to modify the way the date and time is printed. Can you run your program as a regular user, or do you need to be a root?

  1. Run udevadm info -a -p /sys/class/rtc/rtc0 and observe its output
  2. Edit/create the content of the file /etc/udev/rules.d/10-local.rules and add the following line:
    SUBSYSTEM=="rtc" KERNEL=="rtc0" SYMLINK="clock" MODE="0666" GROUP="uclinux"
  3. Run sudo udevadm control --reload-rules
  4. Run sudo udevadm trigger
  5. Run ls -l /dev/rt* /dev/cl*
  6. Capture the view of the output of the ls command above

tar-gz or tar-bz and submit the source code, compiled binary, and the two PNG images of the screen captures of the running program and of the ls command.

Activity 2(20pts.)

The activity for BB and RPI was tested by Madison Straubhaar, class of 2017.

Do one of the labs below. Use shell commands, shell scripts, or short programs in C. Do not use Pythin scripts that utilize GPIO library of any kind.

Activity for BeagleBone

Inspect the GPIO access description provided on ARMhf Web site () and set up two GPIO pins, one as an input pin and one as an output pin. Do not use pins that are alrteady assigned - check the documentation of your board. Provide a typescript or a screen capture of running uanme -a followed  ls -alF /sys/class/gpio as well as the contents of each of the activated pin directory.

In case you cannot find the location of GPIO drivers for your board - redo Lab 6 correctly and put it on your SD card. Pay attention to the correct settings of make linux-menuconfig.

Activity for RaspberryPi

Inspect the GPIO access description provided on ARMhf Web site () and set up two GPIO pins, one as an input pin and one as an output pin. Do not use pins that are alrteady assigned - check the documentation of your board. Provide a typescript or a screen capture of running uanme -a followed  ls -alF /sys/class/gpio as well as the contents of each of the activated pin directory.

In case you cannot find the location of GPIO drivers for your board - redo Lab 6 correctly and put it on your SD card. Pay attention to the correct settings of make linux-menuconfig.

Activity for NGW100 (posted for historical reasons only)

Port your RTC activity program to AVR32 NGW board or BeagleBone board and run under ucLinux. The device name and location may be different in embedded Linux. Furthermore, some features may not be implemented on that board. Modify the program and remove some features if necessary. tar-gz or tar-bz and submit the source code, compiled binary, and a PNG image of the screen capture of the running program on the uC Linux board.

In case you cannot find the rtc driver on your board document that fact by running uanme -a followed by ls -aF /folder.../ listing contents of the corresponding folders, write a brief comment about that in a text editor, and capture your screen showing ssh or putty console response to your command and your text editor window with the note next to your console. Submit that image.

Submission

Drop the file with the information collected during the exercise as instructed in the corresponding assignment drop box on Sakai.

Thank you.

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