Skip to content

Commit bea7f08

Browse files
committed
[rtt] Zero SRAM when using RTT
This prevents OpenOCD from leaking RTT identifier into SRAM which is used to buffer the firmware during uploading.
1 parent 7e9a8ba commit bea7f08

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tools/build_script_generator/openocd.cfg.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ proc modm_itm_log { OUTPUT F_CPU {BAUDRATE 2000000} } {
1919

2020
proc modm_program { SOURCE } {
2121
program $SOURCE verify
22+
%% if has_rtt
23+
# Zero SRAM to prevent OpenOCD from leaking RTT identifier into memory
24+
mww 0x{{"%0x" % main_ram.start}} 0 {{main_ram.size // 4}}
25+
%% endif
2226
reset run
2327
shutdown
2428
}

0 commit comments

Comments
 (0)