build: the libavr pin advances past the audit sweep, and two gates start meaning something
The pin crosses libavr's phase-6 close and the guideline sweep behind it. All 37 chips green, 43 tests each, the README size table matching every built image, and all 13602 flash images byte-identical to the previous pin. The bump broke one gate and exposed another as ornamental. `check_unit.cmake` matched the autobaud loader's measured unit by the symbol `unit_E`; libavr's rule-46 sweep renamed the member to `m_unit`, which the mangling spells `6m_unitE`. On the RAM-home chips the check went red and said so. On the GPIOR chips it went green - the branch that asserts the unit is *not* in RAM passes on an empty match, and an empty match is what a stale regex returns for every image. Both branches mean something again. `tools/check.sh` ran the 37-chip loop under `set -e`, so the first red chip ended the gate and the 36 behind it were never built - a stale size canary on attiny13 would have been an alibi for every loader after it. It accumulates now and fails at the end naming every red preset, which is the shape libavr's own check.sh carries and the reason it carries it. The port's own sweep, verified by byte identity: the four TSB tiers' 16-byte info block is `std::to_array` rather than an extent written beside the sixteen elements the compiler can count, the three-member serial and loader configs break one member per line, the turn-around loops are braced, and the test fixture's config pair is a deduced `std::array` (rules 36, 40, 34). Two comments stop narrating how the code came to be and one stops citing a repro at a path it left two phases ago (rules 12, 13). pureboot's identity stamp stays the raw array rule 36 bans, and now says why: its reads must fold to immediates because the bytes are in program memory and a formed address is dereferenced as data space. As a `std::array` the read loop stopped unrolling and emitted exactly that - measured at +8 B and a wrong answer on the wire. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -11,26 +11,26 @@ if(NOT _res EQUAL 0)
|
||||
message(FATAL_ERROR "${OBJDUMP} -t ${ELF} failed")
|
||||
endif()
|
||||
|
||||
# The symbol line: "00800100 l O .noinit 00000002 <mangled>unit_E".
|
||||
string(REGEX MATCH "\n0*([0-9a-f]+)[^\n]+[ \t][^ \t\n]*unit_E\n" _line "${_syms}")
|
||||
# The symbol line: "00800100 l O .noinit 00000002 <mangled>6m_unitE".
|
||||
string(REGEX MATCH "\n0*([0-9a-f]+)[^\n]+[ \t][^ \t\n]*6m_unitE\n" _line "${_syms}")
|
||||
|
||||
if(GPIOR)
|
||||
if(_line)
|
||||
message(FATAL_ERROR "unit_ RAM symbol present although the unit's home is GPIOR ${GPIOR} - "
|
||||
message(FATAL_ERROR "m_unit RAM symbol present although the unit's home is GPIOR ${GPIOR} - "
|
||||
"the host peeks the pair, and a RAM copy would be dead weight")
|
||||
endif()
|
||||
message(STATUS "no unit_ RAM object - the unit lives in the GPIOR pair at ${GPIOR}")
|
||||
message(STATUS "no m_unit RAM object - the unit lives in the GPIOR pair at ${GPIOR}")
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(NOT _line)
|
||||
message(FATAL_ERROR "no unit_ symbol in ${ELF} - is this the autobaud loader?")
|
||||
message(FATAL_ERROR "no m_unit symbol in ${ELF} - is this the autobaud loader?")
|
||||
endif()
|
||||
|
||||
# AVR data-space symbols carry the 0x800000 VMA offset.
|
||||
math(EXPR _want "0x800000 + ${RAM_START}" OUTPUT_FORMAT HEXADECIMAL)
|
||||
math(EXPR _have "0x${CMAKE_MATCH_1}" OUTPUT_FORMAT HEXADECIMAL)
|
||||
if(NOT _have STREQUAL _want)
|
||||
message(FATAL_ERROR "unit_ sits at ${_have}, ram_start is ${_want} - the host peeks ram_start")
|
||||
message(FATAL_ERROR "m_unit sits at ${_have}, ram_start is ${_want} - the host peeks ram_start")
|
||||
endif()
|
||||
message(STATUS "unit_ at ${_have} == ram_start")
|
||||
message(STATUS "m_unit at ${_have} == ram_start")
|
||||
|
||||
@@ -95,7 +95,7 @@ int main(int argc, char *argv[])
|
||||
if (cfg) {
|
||||
std::uint32_t app_end = boot_base - 128; // config page sits directly below the boot code
|
||||
for (int i = 0; cfg[i] && cfg[i + 1]; i += 2) {
|
||||
const std::array<char, 3> pair = {cfg[i], cfg[i + 1], 0};
|
||||
const std::array pair{cfg[i], cfg[i + 1], '\0'};
|
||||
avr->flash[app_end + i / 2] = static_cast<std::uint8_t>(std::strtoul(pair.data(), nullptr, 16));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,12 +94,11 @@ def main():
|
||||
fail(f"{label}: EEPROM read-back mismatch")
|
||||
|
||||
if hand_over:
|
||||
# Regression: a calibration pulse with no knock behind it must
|
||||
# not wedge the loader. The knock's edge wait used to be
|
||||
# unbudgeted, so one stray low pulse - EMI, or a host that opens
|
||||
# the port and never knocks - held the loader forever and the
|
||||
# application never ran. The whole activation is bounded now, so
|
||||
# the window closes and the app boots; the banner is the proof.
|
||||
# A calibration pulse with no knock behind it must not wedge
|
||||
# the loader: the whole activation is bounded, including the
|
||||
# knock's edge wait, so one stray low pulse - EMI, or a host
|
||||
# that opens the port and never knocks - closes the window and
|
||||
# boots the application. The banner is the proof.
|
||||
# (The pause lets the loader reach its measurement loop, so the
|
||||
# pulse is genuinely seen and the test cannot pass vacuously.)
|
||||
device.reset()
|
||||
|
||||
@@ -64,11 +64,9 @@ def main():
|
||||
fail("EEPROM round-trip through the staged copy")
|
||||
|
||||
# The resident slot, written from the copy standing beside it - the
|
||||
# whole point of relocating. pureboot 9 dropped the running-slot guard
|
||||
# that used to sit behind this, so the probe that used to accompany it
|
||||
# (aim a write at the copy's *own* slot and watch it be refused) is
|
||||
# gone with it: there is nothing to refuse now, and a copy that erases
|
||||
# the page it is executing from does not come back to report it.
|
||||
# whole point of relocating. There is no running-slot guard to probe
|
||||
# against: nothing here refuses an address, and a copy that erases the
|
||||
# page it is executing from does not come back to report it.
|
||||
# pbselfwrite.py gates that direction on a device it is allowed to
|
||||
# destroy.
|
||||
marker = bytes((i * 3) & 0xFF for i in range(page))
|
||||
|
||||
Reference in New Issue
Block a user