Repository navigation
process-node 0.3.1: RL78 boot ROM emulator (Protocol A) for testing RL78 programming - #12
Merged
Merged
Conversation
…0 strap on PA9 PA9 (the console TX, the bench's LA3) held low through reset starts an emulated R5F100LE boot ROM instead of the node: RL78 Protocol A on one wire, open-drain single-wire half duplex, 115200 to 1 Mbit/s. Every command of R01AN0815 Rev. 1.10 (reset, baud rate set, signature, erase, blank check, program, verify, checksum, security set/get/release) with the guide's frames, checksums and status codes; flash in RAM, written only when blank. The emulator's 68 KB is kept out of .bss and filled word-wise (GCC turned the loop into byte-wise memset): zeroing it at startup and filling it byte by byte took longer than a programmer holds TOOL0 after reset. The strap is sampled with the internal pull-up, so an undriven LA3 never starts it. Host-tested in tests/test_rl78emu.c. Refs embeddedci-com/benchpod-firmware#135 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tests/rl78_programmer.py, a minimal Protocol A programmer over the pod's one-wire UART and pod-timed entry; tests/test_rl78.py (marker rl78) runs it: signature, program/verify/checksum, data flash, parameter errors, 250k/500k/1M baud, security, and a normal boot afterwards. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An RL78 boot ROM emulator in process-node, so RL78 programming over the BenchPod (embeddedci-com/benchpod-firmware#135) can be tested on the bench without an RL78.
What it does
When PA9 (the console TX, which is the bench's LA3) is held low through reset, the node starts an emulated R5F100LE (RL78/G13) boot ROM instead of booting normally. It speaks RL78 Protocol A on that one wire, following Renesas R01AN0815 Rev. 1.10:
A normal boot is unchanged: the strap is sampled with the internal pull-up on, so an undriven LA3 never starts the emulator.
One limit vs a real part: the emulator needs TOOL0 held low for about 6 ms after the reset release, the time it takes to set up its flash. A real RL78 needs only 723 µs + tHD. The README says this.
Tests
tests/test_rl78emu.c(inmake test-host) checks every command flow byte for byte, including the bad-checksum, bad-footer, parameter and security cases.tests/rl78_programmer.pyis a minimal Protocol A programmer over the pod's one-wire UART (open_uart(half_duplex=True, entry=UartEntry(...))).tests/test_rl78.py(markerrl78) runs it against the emulator:Hardware results
On benchpod-30a9f1, with pod firmware from embeddedci-com/benchpod-firmware#161 (gateware v57) and the SDK from embeddedci-com/embeddedci-python#104:
test_rl78.py --soak 3: 30/30 passed.test_lifecycle.py,test_rl78.pyandtest_power.pyin one run: 21 passed. The node's console is paused for the RL78 module and the node boots normally afterwards.On pods without
uart_hdthe RL78 tests skip.Two bugs found on hardware
Both made the first frames after entry go missing:
.bssat startup mademain()start after the programmer had already released TOOL0. Fix: the buffer is in.noinit.memset, about 30 ms. Fix:no-tree-loop-distribute-patternson that loop.Merge after embeddedci-com/benchpod-firmware#161 and embeddedci-com/embeddedci-python#104.
🤖 Generated with Claude Code