Skip to content

Commit

Permalink
gateware: bootloader: rev2: Added a delay slot for re-timing the `SLO…
Browse files Browse the repository at this point in the history
…T_CHANGED` signal so we hopefully latch it correctly
  • Loading branch information
lethalbit committed Jan 15, 2025
1 parent e07f3b2 commit 8f1c98d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion squishy/gateware/bootloader/rev2.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def elaborate(self, platform: SquishyPlatformType | None) -> Module:
with m.State('IDLE'):
m.d.sync += [ psram.rst_addrs.eq(0), ]
with m.If(slot_changed):
m.next = 'SLOT_CHANGED'
m.next = 'WAIT_SLOT'
with m.Elif(dl_start):
m.d.sync += [
bus_hold.eq(1),
Expand All @@ -194,6 +194,8 @@ def elaborate(self, platform: SquishyPlatformType | None) -> Module:
# reboot anyway.
m.next = 'REQUEST_REBOOT'

with m.State('WAIT_SLOT'):
m.next = 'SLOT_CHANGED'
with m.State('SLOT_CHANGED'):
m.d.sync += [
regs.slot.dest.eq(slot_selection),
Expand Down

0 comments on commit 8f1c98d

Please sign in to comment.