Skip to content

Commit

Permalink
added watchdog disable code
Browse files Browse the repository at this point in the history
  • Loading branch information
Erich Styger committed Oct 28, 2017
1 parent 1ddd419 commit 5fc3b07
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="ilg.gnuarmeclipse.debug.gdbjtag.jlink.launchConfigurationType">
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.PERIPHERALS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;peripherals&gt;&#13;&#10;&lt;peripheral name=&quot;ADC0&quot;/&gt;&#13;&#10;&lt;peripheral name=&quot;NVIC&quot;/&gt;&#13;&#10;&lt;/peripherals&gt;&#13;&#10;"/>
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.doConnectToRunning" value="false"/>
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.doConnectToRunning" value="true"/>
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.doContinue" value="false"/>
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.doDebugInRam" value="false"/>
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.doFirstReset" value="true"/>
Expand Down Expand Up @@ -31,7 +31,7 @@
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.gdbServerExecutable" value="${jlink_path}/${jlink_gdbserver}"/>
<intAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.gdbServerGdbPortNumber" value="2331"/>
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.gdbServerLog" value=""/>
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.gdbServerOther" value="-s -rtos GDBServer/RTOSPlugin_FreeRTOS"/>
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.gdbServerOther" value=""/>
<intAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.gdbServerSwoPortNumber" value="2332"/>
<intAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.gdbServerTelnetPortNumber" value="2333"/>
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.interfaceSpeed" value="auto"/>
Expand Down
20 changes: 13 additions & 7 deletions Examples/KDS/tinyK20/tinyK20_Demo/Sources/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,12 @@ uint8_t data[] = {0x28, 0x87, 0x99, 0x37, 0x09, 0x00, 0x00};

static void delay(void) {
__asm (
"mov r1, 0x1 \n"
"mov r0, #0xf00 \n" /* build address 0xfe5 */
"add r0, #0xe5 \n"
"blx r0 \n" /* jump to code disabling the watchdog at 0xfe5 */
"mov r1, #0x2 \n"
"Loop1: \n"
"mov r0, 0x20 \n"
"mov r0, #0x20 \n"
"Loop2: \n"
"subs r0, #1 \n"
"nop \n"
Expand All @@ -97,7 +100,7 @@ static void delay(void) {
/* jump to startup code */
"mov r0, #0x600 \n" /* _startup is at 0x625 */
"add r0, #0x25 \n" /* 0x25 because of thumb bit */
"blx r0 \n" /* jump! */
"bx r0 \n" /* jump! */
#else
"bx lr \n"
#endif
Expand All @@ -106,7 +109,10 @@ static void delay(void) {
}

static const uint8_t delay_code[] = {
0x4F,0xF0,0x01,0x01, /* mov.w r1, #1 */
0x4F,0xF4,0x70,0x60, /* mov.w r0, #0xf00 */
0x00,0xf1,0xe5,0x00, /* add.w r0, #0xe5 */
0x80,0x47, /* blx r0 */
0x4F,0xF0,0x02,0x01, /* mov.w r1, #2 */
0x4f,0xf4,0x20,0x00, /* mov.w r0, #0x20 */
0x01,0x38, /* subs 50, #1 */
0x00,0xBF, /* nop */
Expand All @@ -117,8 +123,8 @@ static const uint8_t delay_code[] = {
#if 1
/* jump to startup code */
0x4f,0xf4,0xc0,0x60, /* move.w 50, #0x600 */
0x00,0xf1,0x25, /* add.w r0, #0x25 */
0x00,0x80,0x47, /* blx r0 */
0x00,0xf1,0x25,0x00, /* add.w r0, #0x25 */
0x00,0x47, /* bx r0 */
#else
0x70,0x47 /* bx lr */
#endif
Expand All @@ -138,7 +144,7 @@ int main(void)
/*** End of Processor Expert internal initialization. ***/

/* Write your code here */
#if 0
#if 1
f = (void(*)(void))(&delay_code[0]);
f();
delay();
Expand Down
Binary file not shown.

0 comments on commit 5fc3b07

Please sign in to comment.