thebotslam

What does "CPU fault, rebooting" mean, and how do I fix it?

What happens in a fault

  1. The program stops at the bad instruction.
  2. The CPU is down for a second (20 ticks). Its parts keep their last commands meanwhile, so a bot that faults at full throttle drives on blind.
  3. The program starts again from the top, with every variable reset.

A bot that faults again and again loses a second each time and forgets everything it had worked out. If it faults soon after each restart, it can look as if it's doing nothing at all.

Where to see it

if cpu.faults > 0:
    log("rebooted {} times", cpu.faults)

Find the cause

log("slot {} of {}", i, len(targets))

A fault inside a log line doesn't reboot the bot: only that log is dropped, and the log says so.

In assembly, a fault also comes from running past the end of the program, a jump outside it, a load or store outside RAM, or an illegal instruction.