Assignments
- Learning objectives for assignments (may be very useful when studying for quizzes).
- Suggested: C style guide.
Components in 2024 Student Hardware Package
Expand for details
- 1x BeagleBone Green
- 1x Zen cape: custom built I/O cape; may be Green (V1) or Red (V1.1)
- 1x 1/2 sized breadboard
- ~3x LEDs: such as blue, yellow, red, red (big), green (big), blue (big)
- 1x tri-colour
- ~3x Buttons, or these buttons.
- Resistors:
1,000 Ohm (1k), or 10,000 Ohms (10k),
and 470 Ohms (0.47k) - 1x Photocell light sensor or this photoresistor
- Jumper wires: female-to-male, and male-to-male (may be of slightly different lengths)
- 1x 8-LED NeoPixel stick
- 1x Stacking header to make it easier to connect wires to P8 and P9 headers
- 1x micro USB cable (plus one short one included with the BBG)
- 1x Mounting plate (or similar)
- 1x Anti-static bag, large enough to put in assembled BBG + Zen + mounting plate. Zen cape is likely already in this bag.
- Plastic box to put everything in.
- Some kits may also include:
- TMP36 analog temperature sensor (not needed)
Assignment Demo Process
You will demo your assignments to the TAs for marking. This helps ensure no marks are lost due to problems with the TAs running code on their system, and ensures that your solution (which has been fully tested on your system with your hardware) works well!Expand for details
- If assignment was done as a pair, it's best to have both people there (but not required).
- Each student get 1 free no-show to a marking appointment; after that a 5% penalty for each subsequent unexcused no-show.
Email the TAs and instructor if you are unable to make a sign-up appointment.
Process
- A few days after each assignment is due, the instructor will share a link for how to sign-up for demo slots.
- Most demos will be in Surrey, but some in Burnaby may be possible.
- If you will need to compile your project on the TA's laptop (don't have one yourself), you will need to indicate that when signing up: At most one student per time-slot (per TA) can need the TA's laptop.
- When you arrive for your demo, check in with the TA who may have a sign-in sheet to ensure students are marked in the correct order.
- TAs will mark students in the order of their time-slots, not first-come-first-serve.
- If a student misses their time slot (and the TA was ready for them), then they will have to wait until the TA has a free moment (after students who have marking appointments).
- If you have your own laptop (or are borrowing a friend's), then have your VM and web-browser up and running, and your BeagleBone booted.
- If you do not have your own laptop capable of running the software, then the TA will have a computer that can be used. Their computer will be setup in the way described in the guides. On their computer, they may want you to do the work of extracting/building/..., or they may do it themselves with you there.
- Either way, should expect to bring your BeagleBone and Zen cape to the marking.
- During the demo you will likely need to do the following while the TA is watching:
- Download your code from CourSys
- Compile without any errors (warnings OK, but you should really resolve those!)
- Run your code on your BBG
- You and the TA will exercise your program, showing how it handles both simple and edge use cases (trying to find bugs!). Likely using tools as required by the assignment such as
valgrind
, a web browser, ornetcat
. The TA will likely play around with your solution, possibly getting your help to do things as needed. - Show the TA your code inside of your IDE (or, perhaps they will load it on their computer). They may ask you to explain or discuss some aspect of your code to ensure that you wrote it with at most a reasonable amount of help from others/online/AI.
- The TA will likely take notes as they go, and give you feedback as well. They may comment on the functionality of your solution, or on things they notice in your code (good and bad).
- The TA will likely look at any other files submitted for the assignment (output captures, etc) while you are building your assignment.
- If there are any misunderstandings about requirements, or how to get things running, you and the TA can discuss the issue.
- There may be a mark penalty if any changes to the code are needed in order to get it working. The TA will assign any deductions based on what they feel is reasonable. If there are any disagreements, you and the TA should work on finishing marking and capturing your solution's behaviour; then you can talk to the instructor to work out any issues.
- During the demo, expect to get feedback on your work and how to improve. Treat this feedback as constructive criticism. It will be given to you respecting you and your abilities, and shared as an educator providing feedback on your work.
- Marking is not expected to be a debate: students are welcome to comment on how to demonstrate the full functionality of their solution; however, it is the TA's decision about what is and is not worth marks, or what triggers a deduction. If a discussion between the student and TA cannot easily be resolved, the student is encouraged to discuss it with the instructor.
Assignment 1 - Getting Started
Click to expand...
- Assignment description
- Assignment marking guide
- How-To Guides
- Starter CMake project for assignments
- Case Assembly Guide: How to put together the BeagleBone, Zen, and mounting plate.
- Quick-Start Guide: How to setup the build environment and download code to the BeagleBone.
- Networking Guide: How to get an Ethernet connection between the BeagleBone and the host PC.
- NFS Guide: How to setup the NFS server and connect to it from the target.
- LED Guide: How to control the LEDs via the terminal and C.
- GPIO Guide: How to read and control digital logic pins (joystick!) via the terminal and C.
- RFS Customization Guide: Guide to setting the message of the day, and running code on log in.
- Data sheets and schematic on Zen cape.
- Due Jan 25th by 11:59pm.
Submit via CourSys - In-class quiz Monday Jan 29th; see learning objectives and in-class notes.
- In-person marking starting Jan 29th; signup sheet to be published near due date.
Assignment 2 - Linux Light-Dip Sensor
Click to expand...
- Assignment description
- Provided files including
- Sample output (Serial and UDP)
- Hardware test app (download ZIP file, extract, and run it on the BBG)
- Python program to show data via UDP
noworky.c
periodTimer.h/.c
- Suggested module architecture
- Assignment marking guide
- How-To Guides
- A2D (Analog) Guide: Covers enabling the ADC virtual cape, reading a voltage, and using C code
- Sample C program: potDriver.c
- [UPDATE] Expanded guide to show how to wire photoresistor.
- Light Sensor (photoresistor) video by Dr. Brian.
- For printed guide, see light sensor guide (created by students; just first 2 pages); use a 10kOhm resistor (or similar).
- Guide on using I2C to drive 2-digit 14-seg display
- Sample C program: segDisplay.c & i2c_commands.sh
- Linux PWM Guide: How to drive the buzzer and PWM-tri-colour LEDs on the Zen cape via Linux
- [UPDATE] Expanded guide to show how to an LED to under PWM control.
- Debugging Guide: Covers GDB Server, Cross-GDB, Eclipse, and stripping a binary.
- Student suggested links for threads, sockets, C/C++, strings, and pipes (may be out of date).
- A2D (Analog) Guide: Covers enabling the ADC virtual cape, reading a voltage, and using C code
- Due Feb 25th by 11:59pm. (Note: Quiz 2 on Monday Feb 26th)
Submit via CourSys
Assignment 3 - BeatBox
Click to expand...
- Assignment description.
- Guides and Provided Files:
- Zen Cape Audio Guide covering the Zen cape, USB Audio, and PCM audio output via ALSA in C
- ALSA Code Samples:
wave-player.c
&Makefile
: Sample C application for PCM audio output via ALSA.audio_cmake.zip
: The wave-player app built using CMake instead of a Makefile.audioMixer_template.c/.h
: Template of an audio mixer code for mixing real-time PCM sounds into one output stream.
- Drum sounds suitable for creating a drum beat. From Freesound.org, by "menegass", used under Creative Commons license
- Student created guide for using ALSA with Rust
- ALSA Code Samples:
- Accelerometer: No guide is provided for using the specific parts on the Zen capes.
- See I2C guide above for general commands and understanding.
- See accelerometer data sheet for knowing what registers to read/write:
Zen Cape Green: MMA8452Q datasheet by Freescale Semiconductor, I2C bus I2C_1 at address 0x1C.
Zen Cape Red: LIS331DLH datasheet by ST Micro, I2C bus I2C_1 at address 0x18.
- Provided files including:
index.html
andstyle.css
: partially complete client side webpage.Makefile
periodTimer.h/.c
- Zen Cape Audio Guide covering the Zen cape, USB Audio, and PCM audio output via ALSA in C
- Assignment marking guide.
- Due Mar 13th by 11:59pm.
Assignment 4 - PRU + Linux
- Assignment description.
- Assignment marking guide.
- Video showing game and LEDs
- [NOTE: Mar 26] Corrected Joystick pins for inside PRU.
- How-To Guides and Docs
- PRU Guide
- Sample code for PRU (
14SegFun.c
) - Sample PRU code from lectures (14-Seg, Button, memory, ...)
- Sample code for PRU (
- [NEW] Notes on CMake with PRU: how to adapt our CMake build system to copy the PRU folder.
- PRU controlling NeoPixel sample code (see comments for directions to get it working)
- PWM Buzzer guide
- PRU Guide
- Reference Documents
- Zen cape schematics
- BBG pin info for:
P8 Header
P9 Header
- Due April 3rd by 11:59pm
Submit via CourSys
Kernel Driver Exercise
- Exercise description (with marking guide and sample output).
- Provided Files
- User-space test app for reading files with a specific buffer size.
- Guides
- Driver Creation Guide
- Here is a previous guide which covers compiling and downloading a new kernel to the board. However, as of Feb 2023 the version of UBoot running on the board seems not to function with downloading the kernel (generates "data abort" errors). So, we are switching to building drivers for the currently installed kernel on the board, using the above (shorter!) guide.
- Driver Creation Guide
- Due April 10th by 11:59pm.
- Standard late policy applies.
- Submit via CourSys
Project
See the project information page.
Policies
- Assignment Late Policy
Assignments may be turned in up to 3 days late with 0% penalty. Later than this is 100% penalty (60 minute grace period). Contact the instructor if there are extenuating circumstances. - Extensions and Deferrals
Email Dr. Brian with your request. You may need to complete and email SFU Academic Concession Self-Declaration Form. Doctor's notes are usually not required. Extensions only considered for circumstances beyond the student's control; plan to submit assignments on time. - Academic Honesty
- The MOSS tool will be used to check the originality of all electronic submissions.
- SFU's Academic Honesty policy is crucial to earning credit in this course. Violations of the policy will be taken seriously and reported to the department and university.
- Explanation of penalties applied for academic dishonesty.
- AI Policy
- Students may use AI tools (such as GitHub's Copilot, or ChatGPT) to support their programming.
- You must do the high-level design yourself and be able to write all submitted code on your own (even if you used help from the AI).
- You should use the AI to code no more than a few lines at a time: do not have it write all lines of code.
- You must add a comment to any functions that you used the AI's help to write more than 5 line of code.
- Code written exclusively by, or with the help of an AI system is still governed by the academic honesty policies of the course and university. If a significant number of lines of code, or detailed/critical code is found not to be the student's work, then that work will get a zero. If the copied code was not cited correctly (from either a human or AI source) then it will be considered a case of academic dishonesty and the entire assignment may get a grade of 0 and a report on file with the university.