Lab: Co-simulation End-to-End I/O
Course 2 · Module 4 Type: Hands-on (bring-up + input path + output path + latency) Suggested time: ~2.5–3 hours
Read first: Lesson · Checklist · ← Table of Contents · ← M03 · M05 →
Useful references during the lab
Section titled “Useful references during the lab”| Document | Use when |
|---|---|
| M02 lab | Studio / Simulator / COM |
| M03 lab | An event script / a Virtual Device |
| Hackathon | A HEX · web-app/ evidence |
| Course 1 M04 | Task timing |
Lab Goals
Section titled “Lab Goals”- Run firmware alongside the Twin/host reliably
- Prove input: trigger it → the firmware perceives it
- Prove output: the firmware commands it → the host/Twin reflects it
- Note rough latency at at least 1 point
- Fill in cosim-checklist.md
Prerequisites
Section titled “Prerequisites”- M02’s first session passed
- M03 has a device model + an event script (or a timeline)
- Choose a path: Simulator and/or Board + HEX
- A
lab-notes/folder for evidence
Lab A — Bring-up co-sim (required)
Section titled “Lab A — Bring-up co-sim (required)”- Open Bitstream Studio
- Choose Simulator or Bitstream (only one)
- Link until there’s a stream/heartbeat
- Wait ≥ 30 seconds without it dropping
- Take a screenshot of the Link status + the graph/values
Pass when: both the host and the firmware source (sim or board) show a clear sign of life
Lab B — Input path (required)
Section titled “Lab B — Input path (required)”- Use the script/timeline from M03, or trigger it with a scene/UI/button
- Have the firmware show it read the value (a UART log, a mode change, or a value echoed on the host that is clearly from the read logic)
- Record: what was triggered → what the firmware reported
Pass when: someone on the team can explain the Twin/stimulus → firmware arrow, with evidence
Lab C — Output path (required)
Section titled “Lab C — Output path (required)”- Have the firmware change at least one output (an LED, a flag, a publish, a log marker)
- Confirm that Bitstream Studio (or the
web-app/) reflects the result - Compare it against the WHEN/THEN behaviour from M03
Pass when: there is paired evidence (the firmware side + the host side)
Lab D — Latency note (recommended)
Section titled “Lab D — Latency note (recommended)”- Choose one measurement point (such as stimulus → the first log line)
- Do 3 rounds and note the approximate value
- Guess 1 likely cause of delay (the task period / the scene rate / the UI)
- Fill it into the checklist
Pass when: there is a value range and a hypothesis for the delay source — it doesn’t need to be the prettiest number
Lab E — Optional extras
Section titled “Lab E — Optional extras”- Compare Path A (Simulator) with Path B (Board) on the same script
- If there is a GLB from M03 — load it into the scene and note what the image helps demonstrate (it does not replace sensor truth)
Lab E1 — Hackathon web-app ex05 (recommended)
Section titled “Lab E1 — Hackathon web-app ex05 (recommended)”Read the walkthrough in README §4 first
- Serve the Hackathon
web-app/folder and openex05_bmi270_orientation.html - Confirm the badge is
connected, with aroute: - In the sensor settings, turn on BMI270 Euler and/or Quaternion in the publish mask
- Tilt the board, or switch to the Motion scene — the horizon + ° must move
- Take a screenshot alongside the BMI270 panel in Studio; note the
source:andmask 0x…
Pass when: you can explain that ex05 proves the outer output path, and that if it stays stuck at waiting for orientation, the mask is incomplete (not just “the web page is broken”)
Deliverables checklist
Section titled “Deliverables checklist”- Labs A–C passed
- cosim-checklist.md filled in completely
- Input + output evidence (screenshot/clip/log)
- (Recommended) Lab D latency
- (Recommended) Lab E / E1 (
ex05)
Troubleshooting
Section titled “Troubleshooting”| Symptom | Approach |
|---|---|
| The Link doesn’t come up | Shutdown the backends · check the port · M02 |
| There’s a graph, but it’s silent after triggering | Check the scene/cfg · the M03 script · the firmware log |
| The log is correct, but the UI doesn’t move | The wrong panel is open · the consumer didn’t connect |
| Latency values are very scattered | Use a log timestamp · don’t time it by eye alone |
| Switching Simulator/Bitstream causes confusion | Clear the data · Link fresh, one mode at a time |
| ex05 is stuck at waiting for orientation | Turn on Euler/Quaternion in the BMI270 mask — not just accel/gyro |
| ex05 is disconnected | Serve the correct web-app/ folder · Studio/the bridge is open |
Lesson · Checklist · Table of Contents · M05 →
Cite this lesson
If you teach from this lesson or reuse it in slides or documents, credit it with the text below. If you changed it, add (adapted) after the title.
"Lab: Co-simulation End-to-End I/O" from TESA Open Knowledge by the Thai Embedded Systems Association (TESA), https://github.com/tesaiot/tesa-qualification-program, licensed under CC BY-NC 4.0
Thai attribution: "แล็บ: I/O ครบวงจรแบบ co-simulation" จาก TESA Open Knowledge โดยสมาคมสมองกลฝังตัวไทย (Thai Embedded Systems Association: TESA) https://github.com/tesaiot/tesa-qualification-program สัญญาอนุญาต CC BY-NC 4.0
Lesson link: https://tesaiot.github.io/tesa-qualification-program/en/courses/digital-twin/m04-cosimulation/l02-lab/
This lesson adapts the source below; keep its credit too.
https://github.com/drsanti/TESAIoT-Courses/blob/287c21814ba8c75f693136616dcd270349a15966/C2/M04/lab.md · Original content by Asst. Prof. Dr. Santi Nuratch (ผศ.ดร.สันติ นุราช), KMUTT. Course 2 (C2/) of drsanti/TESAIoT-Courses. TESA funded the work and holds the rights; published here under CC BY-NC 4.0. The upstream repository carries no licence file. Text kept faithful; structure, front matter, quizzes and notes added by TESA Open Knowledge.
TESA Open Knowledge · © 2026 สมาคมสมองกลฝังตัวไทย (TESA) · CC BY-NC 4.0
Content is licensed CC BY-NC 4.0. Reuse it non-commercially and credit the Thai Embedded Systems Association (TESA) every time. · How to cite TESA