Created
June 3, 2017 06:47
-
-
Save janjongboom/0ad27f2c98e9cd2c146ad937c1e9a0f2 to your computer and use it in GitHub Desktop.
Memory breakpoint testing mbed OS 5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "mbed.h" | |
DigitalOut led1(LED1); | |
// main() runs in its own thread in the OS | |
int main() { | |
Serial pc(USBTX, USBRX); | |
pc.baud(115200); | |
char test[200]; | |
for (size_t ix = 0; ix < sizeof(test); ix++) { | |
test[ix] = rand() % 255; | |
} | |
wait(osWaitForever); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to use:
Break on line 12.
Inspect address of
test
in the watch window via (&test
).Add a memory watch using the Debug console via:
(where
0x20001950
is the address oftest
offset by 68 (but less than 200 :-)) bytes)Hit the 'Play' button.
The trap should fire. Inspect the value of
ix
.