Repository navigation
Commit a3ae148
committed
ports/litex: run_hw.py — drive serialboot from BIOS console, no race window.
Old flow tried to ack the BIOS's serialboot magic during the 5-s
auto-boot window. Two failure modes in the wild:
- The magic was matched as `b\"sL5DdSMmkekro\\n\"` but the BIOS
uses CRLF, so on most consoles (with CRLF line endings) the
match never fired and we hung until the 30-s timeout.
- Even when the match worked it required openFPGALoader + Python
startup + scheduler latency to all fit inside 5 s. Slow
filesystem / first-boot caches blew the budget.
New flow (per the user's suggestion):
1. Load the bitstream.
2. Wait up to 60 s for the BIOS to exhaust serialboot →
networkboot → flashboot → sdcardboot and drop into its
`litex>` console (matched on the bare \"litex\" substring,
since the prompt is wrapped in ANSI colour codes).
3. Send `serialboot\\n` ourselves. The BIOS re-enters serialboot
and prints the magic — no time pressure.
4. Match the magic on the bare \"sL5DdSMmkekro\" substring (works
regardless of \\n vs \\r\\n trailing bytes).
5. ACK + SFL upload as before.
Verified on real Arty: load bitstream → BIOS auto-boot fails over
~5 s → console prompt appears → we send serialboot → magic →
upload → MicroPython REPL → test_hw_arty.py prints all five
sections + DHCP + DNS + HTTP GET OK → [run_hw] OK: 1/1.1 parent 2dcb5dc commit a3ae148
1 file changed
Lines changed: 20 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
35 | | - | |
| 33 | + | |
| 34 | + | |
36 | 35 | | |
37 | 36 | | |
38 | 37 | | |
| |||
227 | 226 | | |
228 | 227 | | |
229 | 228 | | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
234 | 247 | | |
235 | 248 | | |
236 | 249 | | |
| |||
0 commit comments