Skip to content

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 →

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

  • 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

  • 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

  1. Open Bitstream Studio
  2. Choose Simulator or Bitstream (only one)
  3. Link until there’s a stream/heartbeat
  4. Wait ≥ 30 seconds without it dropping
  5. 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


  1. Use the script/timeline from M03, or trigger it with a scene/UI/button
  2. 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)
  3. Record: what was triggered → what the firmware reported

Pass when: someone on the team can explain the Twin/stimulus → firmware arrow, with evidence


  1. Have the firmware change at least one output (an LED, a flag, a publish, a log marker)
  2. Confirm that Bitstream Studio (or the web-app/) reflects the result
  3. Compare it against the WHEN/THEN behaviour from M03

Pass when: there is paired evidence (the firmware side + the host side)


  1. Choose one measurement point (such as stimulus → the first log line)
  2. Do 3 rounds and note the approximate value
  3. Guess 1 likely cause of delay (the task period / the scene rate / the UI)
  4. 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


  • 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)
Section titled “Lab E1 — Hackathon web-app ex05 (recommended)”

Read the walkthrough in README §4 first

  1. Serve the Hackathon web-app/ folder and open ex05_bmi270_orientation.html
  2. Confirm the badge is connected, with a route:
  3. In the sensor settings, turn on BMI270 Euler and/or Quaternion in the publish mask
  4. Tilt the board, or switch to the Motion scene — the horizon + ° must move
  5. Take a screenshot alongside the BMI270 panel in Studio; note the source: and mask 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”)


  • 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)

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.

Full guide: how to cite TESA

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