From 660e0f25f258a4c8089347ae5e0f6f15e3b5beb4 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Thu, 16 May 2024 22:10:25 +0200 Subject: [PATCH] Check VTOR set is successful. Catches M0 without VTOR. --- teleprobe/src/run.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/teleprobe/src/run.rs b/teleprobe/src/run.rs index b0f690e..df54eab 100644 --- a/teleprobe/src/run.rs +++ b/teleprobe/src/run.rs @@ -197,6 +197,13 @@ impl Runner { // Write VTOR // NOTE this DOES NOT play nice with the softdevice. core.write_word_32(0xE000ED08, vector_table.location)?; + let got_vtor = core.read_word_32(0xE000ED08)?; + if got_vtor != vector_table.location { + panic!( + "failed to set VTOR! got {:08x} want {:08x}", + got_vtor, vector_table.location + ) + } // Hacks to get the softdevice to think we're doing a cold boot here. //core.write_32(0x2000_005c, &[0]).unwrap();