ECE 320 · Week 9
Modern Computer: Embedded Systems
Which of the two buses comes up first, and why.
Week 9 of 10 · Das Frite
ECE 320 · Week 9 · In class
Which of the two buses comes up first, and why.
- Bring up the bus you named in the week-7 proposal.
- Leave a design note for the bus that does not work yet.
- A recovery runbook is not this week's work.
ECE 320 · Week 9 · In class
The homework is a paragraph that names which bus comes up first, and why.
- That paragraph is not the design note.
- Power-cycle once on the second pass and show that the working bus still answers.
ECE 320 · Week 9 · Lecture
Bring up one bus at a time
- Two half-working buses give you no clue which layer is wrong. One working bus is a base to build on.
- Pick an order with a reason: fewer unknowns, a part you have already captured, or the bus the other depends on.
- "Works" means a value you can check against something outside your code: a datasheet register, a known voltage, the clock.
ECE 320 · Week 9 · Lecture
Check the layers from the bottom
| Layer | Question | How to check |
|---|---|---|
| Wiring | Power, ground, right pins? | station sheet, multimeter |
| Device tree | Bus enabled? | /proc/device-tree, overlay |
| Device file | Does it exist, can you open it? | ls -l /dev, permissions |
| Signals | Do bytes move? | logic analyser |
| Your code | Right bytes, right decode? | the mock test from week 8 |
ECE 320 · Week 9 · Lecture
Ask the bus before your code does
i2cdetect -l # the I2C buses Linux has
i2cdetect -y 1 # who answers on bus 1
i2cget -y 1 0x48 0x00 # one register from 0x48
spi-config -d /dev/spidev0.0 -q # mode, bits, speed
head -c 4 /dev/zero | spi-pipe -d /dev/spidev0.0 -b 4 | xxd
- The bus number, address and register are examples; yours come from the device tree and the datasheet.
- A part that answers here but not in your program puts the fault in your code, not the wiring.
ECE 320 · Week 9 · Lecture
A design note for the bus that does not work yet
- What it should do, in one sentence, and which part is on it.
- What you tried, and what each attempt showed, with the file name of any capture.
- The next single thing you will check, and what result would change your plan.
A note someone else can pick up beats a note that says "SPI broken".
ECE 320 · Week 9 · Lecture
Survive a power cycle
- A bus that works only after hand steps in a shell is not working yet.
- After a power cycle, list what had to be done again: re-enable an overlay, change a permission, start a program by hand?
- Each manual step either moves into the image's configuration or becomes a line in your README.
ECE 320 · Week 9 · Lab
Lab
- Build the project from the week-7 proposal until one of the two buses works.
- Update the design note for the bus that does not work yet. Do not write a recovery runbook. Second pass: power-cycle once and show the working bus still answers.
- Assemble the lab hand-in: A checkpoint note showing one project bus working and the design note for the second bus.
ECE 320 · Week 9 · Lab
Hand in
A checkpoint note showing one project bus working and the design note for the second bus.
ECE 320 · Week 9 · Homework
Homework
- Write which of your two buses you will bring up first, and why, in a paragraph that is not the design note.
ECE 320 · Week 9 · Homework
Turn in
A paragraph naming which bus comes up first, and why, outside the design note.
ECE 320 · Week 9 · Read
Read
On the lab site: Module 12, A whole system, is the reading. This week grades the checkpoint of one bus and the note for the second. Stop before a recovery runbook.
ECE 320 · Week 9 · Next
Week 10
The demo order: two buses, a service, and one question about your own capture or overlay.