boardemul 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- boardemul-0.1.0/LICENSE +201 -0
- boardemul-0.1.0/NOTICE +19 -0
- boardemul-0.1.0/PKG-INFO +417 -0
- boardemul-0.1.0/README.md +393 -0
- boardemul-0.1.0/boardemul/__init__.py +14 -0
- boardemul-0.1.0/boardemul/__main__.py +19 -0
- boardemul-0.1.0/boardemul/build.py +76 -0
- boardemul-0.1.0/boardemul/cli.py +80 -0
- boardemul-0.1.0/boardemul/lab.py +364 -0
- boardemul-0.1.0/boardemul/launcher.py +124 -0
- boardemul-0.1.0/boardemul/pytest_plugin.py +36 -0
- boardemul-0.1.0/boardemul.egg-info/PKG-INFO +417 -0
- boardemul-0.1.0/boardemul.egg-info/SOURCES.txt +206 -0
- boardemul-0.1.0/boardemul.egg-info/dependency_links.txt +1 -0
- boardemul-0.1.0/boardemul.egg-info/entry_points.txt +5 -0
- boardemul-0.1.0/boardemul.egg-info/top_level.txt +3 -0
- boardemul-0.1.0/emu/aes.py +264 -0
- boardemul-0.1.0/emu/app.py +722 -0
- boardemul-0.1.0/emu/board.py +509 -0
- boardemul-0.1.0/emu/board_tdeck.py +498 -0
- boardemul-0.1.0/emu/bus.py +303 -0
- boardemul-0.1.0/emu/ccmp.py +127 -0
- boardemul-0.1.0/emu/chooser.py +803 -0
- boardemul-0.1.0/emu/device.py +806 -0
- boardemul-0.1.0/emu/devices/air.py +276 -0
- boardemul-0.1.0/emu/devices/backlight.py +132 -0
- boardemul-0.1.0/emu/devices/bhi260ap.py +309 -0
- boardemul-0.1.0/emu/devices/epaper.py +161 -0
- boardemul-0.1.0/emu/devices/es7210.py +77 -0
- boardemul-0.1.0/emu/devices/gps.py +441 -0
- boardemul-0.1.0/emu/devices/i2c_devices.py +469 -0
- boardemul-0.1.0/emu/devices/lcd.py +336 -0
- boardemul-0.1.0/emu/devices/ledc.py +204 -0
- boardemul-0.1.0/emu/devices/lora.py +194 -0
- boardemul-0.1.0/emu/devices/modem.py +74 -0
- boardemul-0.1.0/emu/devices/sdcard.py +320 -0
- boardemul-0.1.0/emu/devices/spi_trace.py +57 -0
- boardemul-0.1.0/emu/devices/sx1262.py +892 -0
- boardemul-0.1.0/emu/devices/tdeck_i2c.py +421 -0
- boardemul-0.1.0/emu/devices/tdeck_trackball.py +80 -0
- boardemul-0.1.0/emu/devices/usb_otg.py +468 -0
- boardemul-0.1.0/emu/devices/wifi_ap.py +1603 -0
- boardemul-0.1.0/emu/dhcp.py +117 -0
- boardemul-0.1.0/emu/dns.py +126 -0
- boardemul-0.1.0/emu/face.py +146 -0
- boardemul-0.1.0/emu/factory.py +77 -0
- boardemul-0.1.0/emu/font.py +170 -0
- boardemul-0.1.0/emu/guest_clock.py +141 -0
- boardemul-0.1.0/emu/home.py +43 -0
- boardemul-0.1.0/emu/i2c_link.py +144 -0
- boardemul-0.1.0/emu/inputs.py +128 -0
- boardemul-0.1.0/emu/local_mirror.py +126 -0
- boardemul-0.1.0/emu/max_face.py +280 -0
- boardemul-0.1.0/emu/peripherals/adc.py +100 -0
- boardemul-0.1.0/emu/peripherals/gpio.py +113 -0
- boardemul-0.1.0/emu/peripherals/i2c.py +35 -0
- boardemul-0.1.0/emu/png.py +109 -0
- boardemul-0.1.0/emu/raster.py +233 -0
- boardemul-0.1.0/emu/run.py +921 -0
- boardemul-0.1.0/emu/sdimage.py +153 -0
- boardemul-0.1.0/emu/serial_input.py +151 -0
- boardemul-0.1.0/emu/serial_link.py +120 -0
- boardemul-0.1.0/emu/skin.py +346 -0
- boardemul-0.1.0/emu/spi_link.py +273 -0
- boardemul-0.1.0/emu/tcp.py +516 -0
- boardemul-0.1.0/emu/tdeck_face.py +269 -0
- boardemul-0.1.0/emu/uplink.py +476 -0
- boardemul-0.1.0/emu/version.py +8 -0
- boardemul-0.1.0/emu/web/index.html +1320 -0
- boardemul-0.1.0/emu/web.py +901 -0
- boardemul-0.1.0/emu/wpa2.py +277 -0
- boardemul-0.1.0/pyproject.toml +51 -0
- boardemul-0.1.0/setup.cfg +4 -0
- boardemul-0.1.0/tests/test_adc.py +73 -0
- boardemul-0.1.0/tests/test_aes.py +107 -0
- boardemul-0.1.0/tests/test_air.py +384 -0
- boardemul-0.1.0/tests/test_app_input.py +278 -0
- boardemul-0.1.0/tests/test_audio_probe.py +79 -0
- boardemul-0.1.0/tests/test_backlight.py +101 -0
- boardemul-0.1.0/tests/test_bhi260ap.py +116 -0
- boardemul-0.1.0/tests/test_ble_central.py +162 -0
- boardemul-0.1.0/tests/test_ble_crypto.py +82 -0
- boardemul-0.1.0/tests/test_bluetooth.py +48 -0
- boardemul-0.1.0/tests/test_bluetooth_air.py +167 -0
- boardemul-0.1.0/tests/test_bluetooth_connect.py +285 -0
- boardemul-0.1.0/tests/test_bluetooth_link_layer.py +153 -0
- boardemul-0.1.0/tests/test_bluetooth_meshtastic.py +134 -0
- boardemul-0.1.0/tests/test_bluetooth_pairing.py +190 -0
- boardemul-0.1.0/tests/test_bluetooth_two_boards.py +130 -0
- boardemul-0.1.0/tests/test_boot.py +110 -0
- boardemul-0.1.0/tests/test_boot_meshtastic.py +125 -0
- boardemul-0.1.0/tests/test_boot_tdeck.py +204 -0
- boardemul-0.1.0/tests/test_bridge_shadow.py +174 -0
- boardemul-0.1.0/tests/test_ccmp.py +107 -0
- boardemul-0.1.0/tests/test_cpenable_probe.py +65 -0
- boardemul-0.1.0/tests/test_device.py +410 -0
- boardemul-0.1.0/tests/test_device_boot.py +182 -0
- boardemul-0.1.0/tests/test_device_window.py +297 -0
- boardemul-0.1.0/tests/test_devices.py +250 -0
- boardemul-0.1.0/tests/test_dhcp.py +86 -0
- boardemul-0.1.0/tests/test_dns.py +109 -0
- boardemul-0.1.0/tests/test_es7210.py +69 -0
- boardemul-0.1.0/tests/test_factory.py +55 -0
- boardemul-0.1.0/tests/test_fetch_firmware.py +184 -0
- boardemul-0.1.0/tests/test_flash.py +134 -0
- boardemul-0.1.0/tests/test_font.py +91 -0
- boardemul-0.1.0/tests/test_forgiven_panic.py +127 -0
- boardemul-0.1.0/tests/test_gps.py +255 -0
- boardemul-0.1.0/tests/test_gps_boot.py +111 -0
- boardemul-0.1.0/tests/test_guest_clock.py +28 -0
- boardemul-0.1.0/tests/test_home.py +35 -0
- boardemul-0.1.0/tests/test_launcher.py +157 -0
- boardemul-0.1.0/tests/test_lcd.py +299 -0
- boardemul-0.1.0/tests/test_ledc.py +117 -0
- boardemul-0.1.0/tests/test_library.py +170 -0
- boardemul-0.1.0/tests/test_library_boot.py +84 -0
- boardemul-0.1.0/tests/test_licensing.py +51 -0
- boardemul-0.1.0/tests/test_local_mirror.py +63 -0
- boardemul-0.1.0/tests/test_lora.py +172 -0
- boardemul-0.1.0/tests/test_matrix_reset_probe.py +82 -0
- boardemul-0.1.0/tests/test_max_face.py +127 -0
- boardemul-0.1.0/tests/test_max_keyboard.py +156 -0
- boardemul-0.1.0/tests/test_max_parts.py +120 -0
- boardemul-0.1.0/tests/test_max_serial_parts.py +151 -0
- boardemul-0.1.0/tests/test_max_touchkey.py +146 -0
- boardemul-0.1.0/tests/test_max_wifi.py +180 -0
- boardemul-0.1.0/tests/test_max_wifi_join.py +159 -0
- boardemul-0.1.0/tests/test_mesh.py +205 -0
- boardemul-0.1.0/tests/test_mesh_api.py +133 -0
- boardemul-0.1.0/tests/test_mesh_timed.py +165 -0
- boardemul-0.1.0/tests/test_meshtastic_api.py +91 -0
- boardemul-0.1.0/tests/test_meshtastic_touch.py +106 -0
- boardemul-0.1.0/tests/test_meshtastic_trackball.py +121 -0
- boardemul-0.1.0/tests/test_meshtastic_wifi_screen.py +223 -0
- boardemul-0.1.0/tests/test_panel.py +115 -0
- boardemul-0.1.0/tests/test_phy_gates.py +97 -0
- boardemul-0.1.0/tests/test_psram_mode.py +74 -0
- boardemul-0.1.0/tests/test_radio_arrival.py +259 -0
- boardemul-0.1.0/tests/test_radio_busy.py +332 -0
- boardemul-0.1.0/tests/test_reboot_flag.py +34 -0
- boardemul-0.1.0/tests/test_reset.py +59 -0
- boardemul-0.1.0/tests/test_restart_probe.py +134 -0
- boardemul-0.1.0/tests/test_rng_seed.py +41 -0
- boardemul-0.1.0/tests/test_run_clock.py +30 -0
- boardemul-0.1.0/tests/test_run_stderr.py +28 -0
- boardemul-0.1.0/tests/test_sample_report.py +52 -0
- boardemul-0.1.0/tests/test_screen_backlight.py +126 -0
- boardemul-0.1.0/tests/test_sdcard.py +319 -0
- boardemul-0.1.0/tests/test_serial_input.py +122 -0
- boardemul-0.1.0/tests/test_serial_probe.py +114 -0
- boardemul-0.1.0/tests/test_shared_air.py +246 -0
- boardemul-0.1.0/tests/test_sleep_probe.py +88 -0
- boardemul-0.1.0/tests/test_soc_quirks.py +41 -0
- boardemul-0.1.0/tests/test_sx1262.py +109 -0
- boardemul-0.1.0/tests/test_tcg_multi.py +76 -0
- boardemul-0.1.0/tests/test_tcp.py +359 -0
- boardemul-0.1.0/tests/test_tdeck_face.py +103 -0
- boardemul-0.1.0/tests/test_tdeck_input.py +351 -0
- boardemul-0.1.0/tests/test_tdeck_keyboard.py +225 -0
- boardemul-0.1.0/tests/test_tdeck_trackball.py +110 -0
- boardemul-0.1.0/tests/test_tdeck_typing.py +154 -0
- boardemul-0.1.0/tests/test_teardown_watchdog.py +53 -0
- boardemul-0.1.0/tests/test_touchkey_boot.py +91 -0
- boardemul-0.1.0/tests/test_uart_overflow_flag.py +25 -0
- boardemul-0.1.0/tests/test_uplink.py +168 -0
- boardemul-0.1.0/tests/test_usb_otg.py +273 -0
- boardemul-0.1.0/tests/test_usb_otg_probe.py +85 -0
- boardemul-0.1.0/tests/test_usb_serial_boot.py +82 -0
- boardemul-0.1.0/tests/test_usb_serial_port.py +37 -0
- boardemul-0.1.0/tests/test_web.py +691 -0
- boardemul-0.1.0/tests/test_web_boot.py +138 -0
- boardemul-0.1.0/tests/test_wifi_ap.py +563 -0
- boardemul-0.1.0/tests/test_wifi_channel.py +62 -0
- boardemul-0.1.0/tests/test_wifi_connect.py +253 -0
- boardemul-0.1.0/tests/test_wifi_power_save.py +176 -0
- boardemul-0.1.0/tests/test_wifi_scan.py +139 -0
- boardemul-0.1.0/tests/test_wifi_uplink.py +126 -0
- boardemul-0.1.0/tests/test_wpa2.py +222 -0
- boardemul-0.1.0/tools/air_between_containers.py +88 -0
- boardemul-0.1.0/tools/analyse_trace.py +115 -0
- boardemul-0.1.0/tools/app_symbols.py +125 -0
- boardemul-0.1.0/tools/bench_bus.py +137 -0
- boardemul-0.1.0/tools/ble_central.py +593 -0
- boardemul-0.1.0/tools/ble_crypto.py +247 -0
- boardemul-0.1.0/tools/bp_count.py +125 -0
- boardemul-0.1.0/tools/device.py +338 -0
- boardemul-0.1.0/tools/disas_rom.py +211 -0
- boardemul-0.1.0/tools/doctor.py +205 -0
- boardemul-0.1.0/tools/dump_final.py +92 -0
- boardemul-0.1.0/tools/dump_mic.py +113 -0
- boardemul-0.1.0/tools/fetch_firmware.py +154 -0
- boardemul-0.1.0/tools/find_ble_advertising.py +103 -0
- boardemul-0.1.0/tools/firmware_manifest.toml +117 -0
- boardemul-0.1.0/tools/hot_before.py +103 -0
- boardemul-0.1.0/tools/image_to_elf.py +150 -0
- boardemul-0.1.0/tools/make_configured_fs.py +195 -0
- boardemul-0.1.0/tools/make_viewer.py +236 -0
- boardemul-0.1.0/tools/mesh_api.py +413 -0
- boardemul-0.1.0/tools/mkflash.py +407 -0
- boardemul-0.1.0/tools/msg4_branch.py +100 -0
- boardemul-0.1.0/tools/ring_state.py +177 -0
- boardemul-0.1.0/tools/rom_overrides.py +73 -0
- boardemul-0.1.0/tools/rom_symbols.py +55 -0
- boardemul-0.1.0/tools/rsp.py +126 -0
- boardemul-0.1.0/tools/sample_report.py +115 -0
- boardemul-0.1.0/tools/tone.py +95 -0
- boardemul-0.1.0/tools/trace_diff.py +124 -0
- boardemul-0.1.0/tools/trace_rx_frame.py +211 -0
boardemul-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "{}"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright {yyyy} {name of copyright owner}
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
boardemul-0.1.0/NOTICE
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
BoardEmul
|
|
2
|
+
Copyright 2026 Prolific Lab
|
|
3
|
+
|
|
4
|
+
This product is licensed in two parts (docs/adr/0179):
|
|
5
|
+
|
|
6
|
+
- Everything outside qemu-patch/ -- the Python emulator, its tools, tests
|
|
7
|
+
and documentation -- is licensed under the Apache License, Version 2.0,
|
|
8
|
+
in LICENSE.
|
|
9
|
+
|
|
10
|
+
- The files in qemu-patch/ are compiled into QEMU and are licensed under
|
|
11
|
+
the GNU General Public License, version 2 or (at your option) any later
|
|
12
|
+
version, in qemu-patch/LICENSE.
|
|
13
|
+
|
|
14
|
+
QEMU itself, fetched and built by tools/build_qemu.sh, is the QEMU
|
|
15
|
+
project's and Espressif's, under their own licences.
|
|
16
|
+
|
|
17
|
+
Firmware for the boards BoardEmul emulates is not part of this product: it
|
|
18
|
+
is fetched from where its vendors publish it (tools/firmware_manifest.toml) and is
|
|
19
|
+
under its vendors' terms.
|
boardemul-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,417 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: boardemul
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Run and test ESP32-S3 firmware without the board
|
|
5
|
+
Author: Prolific Lab
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/prolificlab/boardemul
|
|
8
|
+
Project-URL: Issues, https://github.com/prolificlab/boardemul/issues
|
|
9
|
+
Project-URL: Changelog, https://github.com/prolificlab/boardemul/blob/main/CHANGELOG.md
|
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
|
11
|
+
Classifier: Environment :: Console
|
|
12
|
+
Classifier: Framework :: Pytest
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Topic :: Software Development :: Embedded Systems
|
|
17
|
+
Classifier: Topic :: Software Development :: Testing
|
|
18
|
+
Classifier: Topic :: System :: Emulators
|
|
19
|
+
Requires-Python: >=3.11
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
License-File: LICENSE
|
|
22
|
+
License-File: NOTICE
|
|
23
|
+
Dynamic: license-file
|
|
24
|
+
|
|
25
|
+
# BoardEmul
|
|
26
|
+
|
|
27
|
+
Run and test your ESP32-S3 firmware without the board. BoardEmul emulates
|
|
28
|
+
the chip and the parts wired to it closely enough that real, unmodified
|
|
29
|
+
firmware boots and runs: your own build, or a vendor's. You drive it as a
|
|
30
|
+
person would -- the screen, the keys, the serial ports, the radio -- from a
|
|
31
|
+
page, a script or a CI job.
|
|
32
|
+
|
|
33
|
+
It comes with two boards, the LilyGO T-Deck Max and T-Deck, and is growing
|
|
34
|
+
toward boards its users describe themselves (ADR 0180). The words it uses --
|
|
35
|
+
Build, Device, Board, Part -- are in `GLOSSARY.md`.
|
|
36
|
+
|
|
37
|
+
## Getting started
|
|
38
|
+
|
|
39
|
+
With Python 3.11+ and Docker (ADR 0183):
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
pipx install boardemul
|
|
43
|
+
boardemul
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
The first time it pulls the runtime image, which carries QEMU, fetches the
|
|
47
|
+
vendor firmware `tools/firmware_manifest.toml` pins, and opens the page; your
|
|
48
|
+
devices, firmware and logs are kept in `~/.boardemul`. From a clone,
|
|
49
|
+
`python boardemul.py` does the same and builds the image from the clone's
|
|
50
|
+
own sources (ADR 0159). **`docs/GUIDE.md` is the operator's guide**:
|
|
51
|
+
devices, settings, snapshots and clones, a Meshtastic mesh, the scripting
|
|
52
|
+
API, and the limits.
|
|
53
|
+
|
|
54
|
+
## Testing your firmware
|
|
55
|
+
|
|
56
|
+
Point BoardEmul at your PlatformIO build folder: `firmware.bin`, and its
|
|
57
|
+
filesystem image placed where `partitions.bin` says (ADR 0182).
|
|
58
|
+
|
|
59
|
+
```python
|
|
60
|
+
from boardemul import Lab
|
|
61
|
+
|
|
62
|
+
with Lab() as lab:
|
|
63
|
+
node = lab.device("node", build=".pio/build/t-deck", board="tdeck")
|
|
64
|
+
node.start()
|
|
65
|
+
node.serial("usb").expect(r"ready", timeout=120)
|
|
66
|
+
node.tap(120, 80)
|
|
67
|
+
node.screen.wait(lambda shot: shot.pixel(160, 120) != (0, 0, 0), timeout=60)
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
With pytest, the `boardemul_lab` fixture gives each test session a `Lab`.
|
|
71
|
+
From a shell or CI, `boardemul test` starts one device or several on one
|
|
72
|
+
LoRa air, runs your command, and answers with its exit status:
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
boardemul test --build .pio/build/t-deck --devices 2 -- python -m pytest tests/
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
In a GitHub workflow:
|
|
79
|
+
|
|
80
|
+
```yaml
|
|
81
|
+
- uses: prolificlab/boardemul@v0.1.0
|
|
82
|
+
with:
|
|
83
|
+
build: .pio/build/t-deck
|
|
84
|
+
run: python -m pytest tests/emulated
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Devices count their time in instructions, so a firmware keeps a board's
|
|
88
|
+
timing whatever the host is doing (ADR 0178).
|
|
89
|
+
|
|
90
|
+
Developing the emulator itself uses the development image and builds QEMU
|
|
91
|
+
into `third_party/` (ADR 0147):
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
docker build -t boardemul-build .devcontainer
|
|
95
|
+
docker run --rm -v "%CD%":/work -w /work boardemul-build bash -lc tools/build_qemu.sh
|
|
96
|
+
python tools/fetch_firmware.py
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
`python tools/doctor.py` says whether anything is missing and what fixes it.
|
|
100
|
+
|
|
101
|
+
## State
|
|
102
|
+
|
|
103
|
+
LilyGO's unmodified **factory firmware** boots under QEMU, brings up PSRAM and
|
|
104
|
+
its I2C devices, and draws its launcher to the emulated GDEQ031T10 e-paper
|
|
105
|
+
panel. Frames are written to `logs/frames/` as the run proceeds; `latest.png`
|
|
106
|
+
always holds the current screen.
|
|
107
|
+
|
|
108
|
+
The front door is a browser:
|
|
109
|
+
|
|
110
|
+
```
|
|
111
|
+
python -m emu.web # serves http://127.0.0.1:8420 and opens it
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
The page lists your devices, starts and stops them, shows the panel live
|
|
115
|
+
(long-polled frames), takes touches on the glass and typing on the keyboard
|
|
116
|
+
(the same chord logic the drawn window uses), tails either serial port and
|
|
117
|
+
takes a line typed into it (ADR 0156), plays what the speaker played, and
|
|
118
|
+
can scrub back through the run's frames.
|
|
119
|
+
|
|
120
|
+
On Windows the page and the browser stay on Windows and each run moves into
|
|
121
|
+
the build container, because the board models need Unix sockets and QEMU is
|
|
122
|
+
built there as a Linux program (ADR 0140): Docker Desktop has to be running,
|
|
123
|
+
with the runtime image `python boardemul.py` builds, or the development image
|
|
124
|
+
and QEMU built as above. `BOARDEMUL_IMAGE` names another image; `BOARDEMUL_RUN_IN=native` or
|
|
125
|
+
`container` overrides the choice. The server serves only its own page and a
|
|
126
|
+
run takes per-run settings from it, never a program or a path (ADR 0139).
|
|
127
|
+
|
|
128
|
+
```
|
|
129
|
+
# in the devcontainer
|
|
130
|
+
python3 emu/run.py firmware/T-Deck-MAX_V3.1_20260313.bin --bus --timeout 200
|
|
131
|
+
python3 tools/make_viewer.py # single-file HTML of the captured frames
|
|
132
|
+
|
|
133
|
+
# or the Tk window: pick a device, start it -- and click it
|
|
134
|
+
python emu/app.py --scale 2
|
|
135
|
+
# or watch a run's frames directly, as scripts do
|
|
136
|
+
python emu/app.py --frames logs/frames --scale 2
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Devices
|
|
140
|
+
|
|
141
|
+
A device is a folder that keeps its identity and storage between runs
|
|
142
|
+
(ADR 0133): `tools/device.py create pocket --firmware F.bin` assembles its
|
|
143
|
+
flash, eFuses and card once under `devices/pocket/`; `device.py start pocket`
|
|
144
|
+
or the web UI boots it, and what the guest saves is kept. Configure
|
|
145
|
+
Meshtastic's dialog once and every later boot is a node that already knows
|
|
146
|
+
itself.
|
|
147
|
+
|
|
148
|
+
A device also keeps what every run of it is told about the world around it
|
|
149
|
+
(ADR 0145): an access point to join, a GPS position, and an air with its
|
|
150
|
+
place on it. Set them on the page's Settings sheet, or with
|
|
151
|
+
`device.py settings pocket -- --air mesh --at 50,0 --wifi-ap deck`. Devices
|
|
152
|
+
given the same air name hear each other's LoRa radios, on Windows too, where
|
|
153
|
+
each run is its own container: the runs then meet on a Docker network.
|
|
154
|
+
|
|
155
|
+
A stopped device can be snapshotted and put back, flash, card and settings
|
|
156
|
+
together, and its SD card is yours: download it as a FAT16 image, replace it
|
|
157
|
+
with another, or make a fresh one from files (ADR 0149). The page does all
|
|
158
|
+
three; so does `device.py snapshot|restore|card`. A stopped device can also
|
|
159
|
+
be cloned, flash, card and settings, with a MAC of its own, so one node set
|
|
160
|
+
up through its dialog becomes a mesh of them (ADR 0155).
|
|
161
|
+
|
|
162
|
+
Meshtastic's client API is reachable from this computer, as through a
|
|
163
|
+
cable and over WiFi. On the T-Deck its serial port is TinyUSB's, on the
|
|
164
|
+
chip's USB OTG controller, which is modelled with a host on its cable (ADR
|
|
165
|
+
0166): its log is in the page's console, and `tools/mesh_api.py` reads and
|
|
166
|
+
changes its settings over `--serial-tcp 5555:otg`. Set that way onto the
|
|
167
|
+
run's WPA2 access point and its classic screen, a node joins, takes an
|
|
168
|
+
address, and answers on `localhost:4403` through `--wifi-forward 4403:4403`
|
|
169
|
+
(ADR 0164).
|
|
170
|
+
|
|
171
|
+
**Working on the Max:** the boot chain, flash and eFuses; PSRAM; the e-paper
|
|
172
|
+
panel; touch, the three touch keys and the keyboard; the LoRa radio on chip
|
|
173
|
+
select 3 (ADR 0102); the SD card; I2C0/I2C1 with the board's parts, the fuel
|
|
174
|
+
gauge provisioned as its driver expects (ADR 0103) and the sensor hub booting
|
|
175
|
+
the firmware it is given (ADR 0108); the A7682E modem and the u-blox receiver
|
|
176
|
+
on their serial lines (ADRs 0105, 0117); WiFi, whose scan lists an access
|
|
177
|
+
point given `--wifi-ap` and whose own screen joins it (ADRs 0137, 0152,
|
|
178
|
+
0177); the chip's I2S controllers and
|
|
179
|
+
Bluetooth core, as on the T-Deck (ADR 0148); the USB serial port (ADR 0100).
|
|
180
|
+
The factory firmware's own Test page passes LoRa, Touch, SY6970, BQ27220,
|
|
181
|
+
SD Card, A7682E and ES8311.
|
|
182
|
+
|
|
183
|
+
Touch input works: tapping an icon navigates. Click the panel in the web UI
|
|
184
|
+
or the Tk window -- the keyboard drawn on the shell is the vendor's own
|
|
185
|
+
matrix, so a cap that exists sends a key the firmware has. Events are
|
|
186
|
+
appended as JSON lines to `input.jsonl`, which the emulator tails, so a
|
|
187
|
+
script can drive it just as well as a person. The Max's three touch keys
|
|
188
|
+
under the screen are modelled too, and the vendor firmware answers them by
|
|
189
|
+
going back a screen (ADR 0131).
|
|
190
|
+
|
|
191
|
+
The keyboard reaches the screens that read it: the launcher's icon grid is
|
|
192
|
+
touch-only by the vendor's design, and its sub-screens take keys
|
|
193
|
+
(`tests/test_max_keyboard.py`).
|
|
194
|
+
|
|
195
|
+
**Not working yet on the Max:** the ES8311 codec answers its identity and
|
|
196
|
+
nothing more, so its volume and routing are not modelled, though what the
|
|
197
|
+
firmware sends it over I2S is recorded with `--audio` (ADR 0148); the modem
|
|
198
|
+
answers only the few commands the factory test sends, and has no SIM
|
|
199
|
+
(ADR 0105). The factory interface's password field types its dialer's
|
|
200
|
+
digits, two per key, so a network it joins needs a passphrase of those
|
|
201
|
+
digits: `aaaa` types `22222222` (ADR 0152).
|
|
202
|
+
|
|
203
|
+
### The T-Deck, second board
|
|
204
|
+
|
|
205
|
+
The second board runs LilyGO's own `UnitTest` firmware, unmodified, all the way
|
|
206
|
+
into its LVGL interface -- and the interface answers keys and taps. In one
|
|
207
|
+
110-second run: 740 frames at a steady ten a second, every injected keystroke
|
|
208
|
+
delivered and echoed by the firmware itself (`Key pressed : 0x69`), 66 touch
|
|
209
|
+
reports read. The status bar shows a modelled battery voltage, and the LoRa
|
|
210
|
+
radio answers its bring-up ("Start Radio success!", ADR 0034). Given
|
|
211
|
+
`--wifi-ap NAME` its WiFi scan finds that network, on every scan (ADR 0057);
|
|
212
|
+
without one it finds nothing, correctly.
|
|
213
|
+
|
|
214
|
+
Getting there is five records long, and each one is a wall the firmware stopped
|
|
215
|
+
at and how it was read rather than guessed: the FPU enabled out of reset
|
|
216
|
+
(ADR 0013, now QEMU's own reset value, as on silicon: ADR 0143), both I2S
|
|
217
|
+
directions with one patch carried to QEMU's GDMA (ADR 0016, 0017), four radio bring-up waits answered from disassembled loops
|
|
218
|
+
(ADR 0019), and the SAR ADC that `analogRead()` spins on plus the touch
|
|
219
|
+
interrupt's real polarity (ADR 0020).
|
|
220
|
+
|
|
221
|
+
Its screen is lit as the firmware lights it (ADR 0151): the backlight's pin
|
|
222
|
+
is followed through the GPIO matrix, to an LED controller channel's duty or
|
|
223
|
+
to LilyGO's sixteen-step pulses, and the page and the window dim the panel
|
|
224
|
+
by it. When Meshtastic fades its screen out, the screen goes dark.
|
|
225
|
+
|
|
226
|
+
Its sound is real too (ADR 0146). With `--audio` each stream the speaker
|
|
227
|
+
plays is written to a WAV file in the run's `audio/` directory, which the
|
|
228
|
+
web page plays back; the UnitTest build plays six seconds of a sound of its
|
|
229
|
+
own. With `--mic FILE.wav` the microphone hears that file.
|
|
230
|
+
`tools/tone.py` writes a test tone and measures one.
|
|
231
|
+
|
|
232
|
+
```
|
|
233
|
+
python3 emu/run.py firmware/T-Deck_UnitTest_250620.bin --board tdeck --bus --timeout 3600
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
```
|
|
237
|
+
python emu/app.py --board tdeck --scale 2
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
The window draws the T-Deck from LilyGO's own board drawing, product
|
|
241
|
+
photographs and keyboard sketch (ADR 0126), and it is used the way the device
|
|
242
|
+
is:
|
|
243
|
+
|
|
244
|
+
- **Typing.** Click the caps, or type on the host keyboard. Each character is
|
|
245
|
+
pressed as the chord the T-Deck needs: capitals with its shift, the printed
|
|
246
|
+
second characters with sym. The host's Ctrl is sym and its Alt is alt, so
|
|
247
|
+
Ctrl+Q types `#` and Alt+B toggles the keyboard's backlight, exactly as the
|
|
248
|
+
keyboard's own firmware does (ADR 0127).
|
|
249
|
+
- **Modifiers by mouse.** Clicking alt, sym or a shift latches it for the next
|
|
250
|
+
key.
|
|
251
|
+
- **The trackball.** The mouse wheel rolls it (Shift+wheel for sideways), the
|
|
252
|
+
arrow keys roll it a notch, and pressing the mouse on the ball clicks it for
|
|
253
|
+
as long as you hold it (ADR 0128).
|
|
254
|
+
- **The keyboard backlight.** Light leaks round the caps while it is on
|
|
255
|
+
(ADR 0129).
|
|
256
|
+
|
|
257
|
+
The Max's window is drawn the same way, from LilyGO's own case models
|
|
258
|
+
(ADR 0130): the rounded outline with its corner cut, the grey touch glass
|
|
259
|
+
with three touch keys printed under the screen, and the keyboard the TCA8418
|
|
260
|
+
matrix knows -- five keys in the bottom row, both outer ones up keys, and no
|
|
261
|
+
trackball, which the Max does not have. The three touch keys are modelled too
|
|
262
|
+
(ADR 0131): they report through the CST328 as key events, exactly as the
|
|
263
|
+
vendor's hyn_cst3xx driver parses them, and the vendor firmware answers them
|
|
264
|
+
by taking its interface back a screen.
|
|
265
|
+
|
|
266
|
+
Meshtastic also boots on this board, its PSRAM presented in octal because
|
|
267
|
+
that is the driver its image carries (ADR 0144). Its filesystem image comes
|
|
268
|
+
with it, as the vendor's installer writes it (ADR 0150): fetched, it is
|
|
269
|
+
overlaid at 0xc90000 unless `--overlay` says otherwise (ADR 0021), and
|
|
270
|
+
without it the interface stays black. A fresh first boot mounts storage,
|
|
271
|
+
reads its preferences and, some
|
|
272
|
+
30 seconds of guest time in, reaches the device-ui's setup dialog (ADR 0026).
|
|
273
|
+
The dialog can be filled from the keyboard through the input file: byte 0x09
|
|
274
|
+
moves LVGL's focus from the region to the names and on to OK, letters land in
|
|
275
|
+
the focused field, and 0x0D on OK saves the names and region, after which the
|
|
276
|
+
firmware reboots itself and comes back to its home screen with the LoRa
|
|
277
|
+
frequency set. Two things to know when driving it. The interface blanks its
|
|
278
|
+
panel 30 seconds after LVGL starts unless some input device has reported a
|
|
279
|
+
press, and on this guest that is a few seconds after the dialog appears, so the
|
|
280
|
+
first key has to go in promptly; once blanked, the screen is locked and only
|
|
281
|
+
its own blank-screen button releases it. And touch: Meshtastic's LovyanGFX
|
|
282
|
+
driver reads the touch controller only while its interrupt line is low, and
|
|
283
|
+
never writes the controller's trigger mode, whereas the vendor firmware writes
|
|
284
|
+
mode 0 and treats that same line as pressed when high. The controller model
|
|
285
|
+
follows the mode each firmware wrote (ADR 0029), and asserts the line while
|
|
286
|
+
it holds a report, release included, idling otherwise; a firmware that never
|
|
287
|
+
writes a mode gets the controller's default, low level (ADR 0031). The
|
|
288
|
+
controller also reports in its own
|
|
289
|
+
raster, portrait like the panel behind it, with the board stating the mounting
|
|
290
|
+
(ADR 0030). With both in place the dialog can be filled by touch alone: tapping
|
|
291
|
+
the little keyboard icon beside a field is what binds the keypad to it, typed
|
|
292
|
+
characters land in that field, and OK commits and reboots. Tapping the field
|
|
293
|
+
itself does not bind, which is the interface's own design.
|
|
294
|
+
It runs on the instruction-counted clock, the default (ADRs 0027, 0178):
|
|
295
|
+
the Bluetooth link layer, which the device-ui switches on when its boot logo
|
|
296
|
+
is held, needs the instruction-counted clock to keep its events on time; its
|
|
297
|
+
core's clock, timers and interrupt FIFO are a C device read off the ROM
|
|
298
|
+
(ADR 0025). What it then puts on the air is below.
|
|
299
|
+
|
|
300
|
+
Because neither firmware exercises much of the panel, the window arithmetic,
|
|
301
|
+
orientation and segment handling are checked against synthetic wire traffic
|
|
302
|
+
(`tests/test_lcd.py`), and what a frame even means on a display with no refresh
|
|
303
|
+
command is ADR 0014.
|
|
304
|
+
|
|
305
|
+
Two boards can be put on the same air with `--air DIR` (devices name one
|
|
306
|
+
instead, ADR 0145), and `--at X,Y`,
|
|
307
|
+
`--environment` and `--antenna` say where they stand and what is between them
|
|
308
|
+
(ADRs 0036-0039). A node only transmits once it has a region, which the setup
|
|
309
|
+
dialog gives it: `tools/make_configured_fs.py` does that by driving the dialog
|
|
310
|
+
and keeps the filesystem it produces in `build/`, so the two-node mesh in
|
|
311
|
+
`tests/test_mesh.py` rebuilds from the vendor image and nothing else.
|
|
312
|
+
|
|
313
|
+
A device folder (above) is the other way to keep a configured node: fill
|
|
314
|
+
the dialog once on a device, and every later boot of it already knows
|
|
315
|
+
itself.
|
|
316
|
+
|
|
317
|
+
Bluetooth advertises on an air of its own with `--ble-air DIR`, built the same
|
|
318
|
+
way (ADR 0045). `tools/make_configured_fs.py --bluetooth` captures a filesystem
|
|
319
|
+
with it switched on, and what goes out is what the controller staged: the
|
|
320
|
+
payload is not copied anywhere, so the core resolves the record's offsets
|
|
321
|
+
through the controller's own mappings and sends what they point at
|
|
322
|
+
(ADRs 0044-0045). It advertises, and it can be connected to: a central on that air sends a
|
|
323
|
+
connection request, the firmware's own link layer validates it and starts
|
|
324
|
+
scheduling connection events (ADRs 0046-0047). Meshtastic never scans, so
|
|
325
|
+
two boards cannot find each other over Bluetooth; a central connecting in is
|
|
326
|
+
the peer it was built for. The link carries data both ways: the core sends
|
|
327
|
+
what the controller stages in its transmit descriptors (ADR 0168), so link
|
|
328
|
+
control procedures, L2CAP, ATT and GATT all run, and `tools/ble_central.py`
|
|
329
|
+
is a central that reads and writes a firmware's GATT server. Meshtastic's
|
|
330
|
+
phone API answers over it: the central pairs with the node's PIN by LE
|
|
331
|
+
Secure Connections passkey entry, the controller derives the session key on
|
|
332
|
+
the core's own AES unit, every packet after that is AES-CCM on the air, and
|
|
333
|
+
the central gets the node's whole configuration stream, as an app does
|
|
334
|
+
(ADRs 0169, 0171). The Max carries the same Bluetooth core (ADR 0148).
|
|
335
|
+
|
|
336
|
+
## Tests
|
|
337
|
+
|
|
338
|
+
```
|
|
339
|
+
python3 -m pytest tests/ # some 700 device, image and board tests, ~2 min
|
|
340
|
+
python3 -m pytest tests/ -m slow # some 120 that boot the boards under QEMU
|
|
341
|
+
bash tools/slow_suite.sh 3 # the same, three files at a time
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
The slow tests skip cleanly without a built QEMU or the vendor firmware. See
|
|
345
|
+
ADR 0012. Run several at a time, the ones marked `alone` still run one at a
|
|
346
|
+
time at the end: their firmware keeps deadlines on a clock that follows the
|
|
347
|
+
host's, and a busy host makes them miss (ADR 0167).
|
|
348
|
+
|
|
349
|
+
Where QEMU spends its time, in the build container and without perf:
|
|
350
|
+
`bash tools/profile.sh -- emu/run.py ARGS...` samples each of its threads
|
|
351
|
+
every millisecond and reports per thread, by function (ADR 0176).
|
|
352
|
+
|
|
353
|
+
## Structure
|
|
354
|
+
|
|
355
|
+
docs/BOOT.md the ESP32-S3 boot chain, and what QEMU provides for each stage
|
|
356
|
+
docs/adr/ numbered architecture decision records
|
|
357
|
+
qemu-patch/ the C we own, installed into the QEMU tree at build time
|
|
358
|
+
tools/ QEMU build, firmware fetch, the doctor, flash image
|
|
359
|
+
assembly, frame viewer, device folders, the probes
|
|
360
|
+
tests/ fast device tests, plus golden-frame tests behind -m slow
|
|
361
|
+
emu/ the emulator: launcher, bus bridge host side, device models,
|
|
362
|
+
the drawn faces, the web front door
|
|
363
|
+
firmware/ vendor binaries (not committed; see tools/firmware_manifest.toml)
|
|
364
|
+
devices/ device folders, made by tools/device.py (ADR 0133)
|
|
365
|
+
|
|
366
|
+
## How it fits together
|
|
367
|
+
|
|
368
|
+
QEMU runs the CPU and the parts of the SoC it already models. The boundary
|
|
369
|
+
between C and Python is a bus transaction, not a register access (ADR 0011):
|
|
370
|
+
the SoC's controllers -- GPIO, SPI2, I2C0 and I2C1 -- are C, and what a
|
|
371
|
+
transaction then *means* is Python. The panel sees whole segments and an I2C
|
|
372
|
+
device sees whole exchanges, instead of either side counting FIFO writes. That
|
|
373
|
+
is what took the first board from 232,320 round trips per frame to about 44.
|
|
374
|
+
|
|
375
|
+
Our C is ten files we own plus a header, copied into the QEMU tree by
|
|
376
|
+
`tools/build_qemu.sh` rather than committed to it. Their tree's own
|
|
377
|
+
modification is a handful of build lines in one `meson.build`, plus four
|
|
378
|
+
carried patches to their own logic, listed in the build script: an icount
|
|
379
|
+
sleep that is not deterministic, in QEMU's core, and flash writes that land
|
|
380
|
+
synchronously (both ADR 0115, reported upstream), light sleep in the RTC
|
|
381
|
+
controller's model (ADR 0165), and register accesses that no longer end a
|
|
382
|
+
translation block without icount, in QEMU's core (ADR 0170); the last two
|
|
383
|
+
not yet offered. Nine more were carried
|
|
384
|
+
until Espressif took them into the tag we pin (ADR 0138): a GDMA transmit
|
|
385
|
+
path that never reported which descriptor finished (ADR 0017); an SPI1
|
|
386
|
+
dummy-cycle conversion that shifted every runtime flash read by two bytes
|
|
387
|
+
(ADR 0022); two Bluetooth clock registers the controller checks before it
|
|
388
|
+
will start (ADR 0023); a cross-thread TLB flush that crashed two-thread
|
|
389
|
+
translation (ADR 0066); GDMA reaching PSRAM (ADR 0083); an interrupt-matrix
|
|
390
|
+
level mirror (ADR 0101); a UART chardev hook (ADR 0105); UART RX overflow
|
|
391
|
+
behaviour (ADR 0122); and core reset-and-stall semantics (ADR 0123).
|
|
392
|
+
Each is applied from a declared patch file, and the build stops if any ever
|
|
393
|
+
fails to apply. See ADR 0001, ADR 0011, and the ADR beside each patch.
|
|
394
|
+
|
|
395
|
+
## Dependencies
|
|
396
|
+
|
|
397
|
+
One large external component: the Espressif QEMU fork, pinned by tag and used as
|
|
398
|
+
the CPU and SoC engine only (ADR 0001). Everything else is the Python 3.12
|
|
399
|
+
standard library: `emu/app.py` uses tkinter, the web UI is
|
|
400
|
+
`http.server` plus the browser you already have (ADR 0135).
|
|
401
|
+
|
|
402
|
+
## Reading order
|
|
403
|
+
|
|
404
|
+
Start with `docs/BOOT.md`, then the ADRs in order. ADR 0008 is the one with the
|
|
405
|
+
most transferable lesson; ADR 0011 is the boundary that made the rest possible;
|
|
406
|
+
ADRs 0126, 0130, 0131, 0133, 0134 and 0135 are the run of decisions that built
|
|
407
|
+
the two front doors and the devices between them, and ADRs 0145 and 0149
|
|
408
|
+
made a device something kept like a virtual machine: settings, snapshots,
|
|
409
|
+
its card.
|
|
410
|
+
|
|
411
|
+
## Licence
|
|
412
|
+
|
|
413
|
+
Copyright 2026 Prolific Lab. BoardEmul is under the Apache License 2.0
|
|
414
|
+
(`LICENSE`), except `qemu-patch/`, which is compiled into QEMU and is under
|
|
415
|
+
GPL-2.0-or-later (`qemu-patch/LICENSE`); `NOTICE` says which is which, and
|
|
416
|
+
vendor firmware is never part of it (ADR 0179). Contributions are welcome
|
|
417
|
+
with a sign-off: see `CONTRIBUTING.md`.
|