Skip to content

Commit

Permalink
FW: Force the CPU to hang on errors
Browse files Browse the repository at this point in the history
  • Loading branch information
dehanj committed Mar 14, 2024
1 parent fcccee8 commit 6ce40d1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion hw/application_fpga/firmware.bin.sha512
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3769540390ee3d990ea3f9e4cc9a0d1af5bcaebb82218185a78c39c6bf01d9cdc305ba253a1fb9f3f9fcc63d97c8e5f34bbb1f7bec56a8f246f1d2239867b623 firmware.bin
aad49235ab60b732a45bbedf5774c543df1b40d52b226ffc41bc6c3e2dbbb3963e810f0a52ccf7ba4689b414f1cb941076b896a47d2377fb61c1976bdbcebe17 firmware.bin
5 changes: 4 additions & 1 deletion hw/application_fpga/fw/tk1/assert.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ void assert_fail(const char *assertion, const char *file, unsigned int line,
htif_puts(function);
htif_lf();

forever_redflash();
// Force illegal instruction to halt CPU
asm volatile("unimp");

// Not reached
__builtin_unreachable();
}
2 changes: 1 addition & 1 deletion hw/application_fpga/fw/tk1/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ int main()
htif_puts("firmware state 0x");
htif_puthex(state);
htif_lf();
forever_redflash();
assert(1 == 2);
break; // Not reached
}
}
Expand Down

0 comments on commit 6ce40d1

Please sign in to comment.