BGND is a no-op, not real background-debug-mode entry #4
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
BGND(opcode00) is decoded but executes as abreak-style no-op(
M68HC12.cs:361-363), so it does nothing at all:On real silicon,
BGNDis the entry point into Background Debug Mode(BDM): the CPU stops executing and waits for serial debug commands on the
BKGDpin (or, in emulation, for a debugger to resume it). It is the hardwarebreakpoint/embedded-debug feature of the 68HC12 family.
Impact
BGNDas a software breakpoint (common in firmware debugbuilds and monitor/ROM code) keep running instead of halting.
BKGD/BDM debug channel is absent, so no BDM protocol support exists.Current behavior
BGNDfalls through the same case asNOP: PC advances, nothing else.ExecuteInstructionshas no halt reason for a BGND stop; the Renode monitorcannot distinguish "hit BGND" from normal execution.
Affected files
src/Infrastructure/src/Emulator/Peripherals/Peripherals/CPU/M68HC12/M68HC12.csExecutionResulthandling inExecuteInstructions(
M68HC12.cs:49-70)Desired behavior
BGNDhalts execution and surfaces as a distinct stop reason so that:BGNDat a given PC.ICpuSupportingGdbplumbing) canresume execution from the
BGNDinstruction.breakpoint-style stops (look at the MSP430X or ARM interpreter CPUs for the
established pattern).
Acceptance criteria
BGNDstops the machine and is distinguishable from a normalstop and from
WAI/STOP.BGND.NOPkeeps its existing behavior.Suggested approach
bgndHalted(or reuse aBreakpoint/DebugRequestedhalt flag)state checked in the
ExecuteInstructionsloop, similar towaitingForInterrupt(M68HC12.cs:61-63).pause/halt-reason reporting somachshows thestop reason.
BKGD) is a much largereffort; a minimal first step is halt-on-BGND + resume, with BDM protocol as
a documented follow-up.