Skip to content

Commit

Permalink
[rtt] Zero SRAM when using RTT
Browse files Browse the repository at this point in the history
This prevents OpenOCD from leaking RTT identifier into SRAM which is
used to buffer the firmware during uploading.
  • Loading branch information
salkinium committed Dec 6, 2021
1 parent 7e9a8ba commit bea7f08
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tools/build_script_generator/openocd.cfg.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ proc modm_itm_log { OUTPUT F_CPU {BAUDRATE 2000000} } {

proc modm_program { SOURCE } {
program $SOURCE verify
%% if has_rtt
# Zero SRAM to prevent OpenOCD from leaking RTT identifier into memory
mww 0x{{"%0x" % main_ram.start}} 0 {{main_ram.size // 4}}
%% endif
reset run
shutdown
}
Expand Down

0 comments on commit bea7f08

Please sign in to comment.