Test openOCD-Chibios
Using Eclipse

1 Load test code in target
   Dev_1 (Code with shell, LED blinker, FatFs, and two hardware interrupts)
2 Power cycle JTAG and target 
   OK
3 Run openOCD (Version Open On-Chip Debugger 0.7.0-dev-g4e00135 (2012-10-10-11:00). 
   Using start script
   source [find ...../openocd/scripts/interface/olimex-arm-usb-ocd.cfg]
   source [find ....../oocd/share/openocd/scripts/target/stm32f1x.cfg]
   init
   halt
   cortex_m3 maskisr auto
   poll
   reset run

4 Run GDB (Eclipse, record config)
GDB (DSF) Hardware Debugging Launcher
On Startup tab
   Selected 
      Reset
      Load symbols
      Use project binary: ch.elf
   file /home/chris/software/ChibiOS_5_1/Dev_1/build/ch.elf 
On Debugger tab
   GDB is ..../arm-none-eabi-gdb
   Protocol version "mi"
   
5 Record Debug window

Dev_1_OCD [Program]	
	/home/chris/bin/oocd/bin/openocd	
Dev_1 [GDB Hardware Debugging]	
	ch.elf	
		Thread [1] (Suspended : User Request)	
			_idle_thread() at chsys.c:61 0x8000ed8	
			_port_thread_start() at chcore_v7m.c:255 0x8000d1c	
	gdb	

Didn't start up properly.
Close GDB and openOCD and restart (without hardware power cycle)
Same result
Close GDB and openOCD hardware reset and restart (without hardware power cycle)

Dev_1_OCD [Program]	
	/home/chris/bin/oocd/bin/openocd	
Dev_1 [GDB Hardware Debugging]	
	ch.elf	
		Thread [4] 536877936 (shell :  : WTQUEUE) (Suspended : Container)	
			chSchGoSleepS() at chschd.c:122 0x8001360	
			chSchGoSleepTimeoutS() at chschd.c:195 0x8001454	
			qwait() at chqueues.c:69 0x8003350	
			chIQReadTimeout() at chqueues.c:232 0x8003556	
			read() at serial.c:63 0x8004bee	
			shellGetLine() at shell.c:261 0x8012536	
			shell_thread() at shell.c:155 0x801230a	
			_port_thread_start() at chcore_v7m.c:255 0x8000d1c	
		Thread [3] 536877624 (blinker :  : SLEEPING) (Suspended : Container)	
			chSchGoSleepS() at chschd.c:122 0x8001360	
			chSchGoSleepTimeoutS() at chschd.c:190 0x800143a	
			chThdSleep() at chthreads.c:290 0x80018a8	
			Thread1() at main.c:351 0x8014c16	
			_port_thread_start() at chcore_v7m.c:255 0x8000d1c	
		Thread [2] 536873472 (idle :  : CURRENT) (Suspended : Container)	
			_idle_thread() at chsys.c:61 0x8000ed8	
			_port_thread_start() at chcore_v7m.c:255 0x8000d1c	
		Thread [1] 536873664 (main :  : WTOREVT) (Suspended : User Request)	
			_idle_thread() at chsys.c:61 0x8000ed8	
			chSchGoSleepTimeoutS() at chschd.c:190 0x800143a	
			chEvtWaitOneTimeout() at chevents.c:451 0x8002c10	
			main() at main.c:657 0x8014f84	
	gdb	

6 Resume then pause
7 Record debug window
Dev_1_OCD [Program]	
	/home/chris/bin/oocd/bin/openocd	
Dev_1 [GDB Hardware Debugging]	
	ch.elf	
		Thread [4] 536877936 (shell :  : WTQUEUE) (Suspended : Signal : SIGINT:Interrupt)	
			chSchGoSleepS() at chschd.c:122 0x8001360	
			chSchGoSleepTimeoutS() at chschd.c:195 0x8001454	
			qwait() at chqueues.c:69 0x8003350	
			chIQReadTimeout() at chqueues.c:232 0x8003556	
			read() at serial.c:63 0x8004bee	
			shellGetLine() at shell.c:261 0x8012536	
			shell_thread() at shell.c:155 0x801230a	
			_port_thread_start() at chcore_v7m.c:255 0x8000d1c	
		Thread [3] 536877624 (blinker :  : SLEEPING) (Suspended : Container)	
			chSchGoSleepS() at chschd.c:122 0x8001360	
			chSchGoSleepTimeoutS() at chschd.c:190 0x800143a	
			chThdSleep() at chthreads.c:290 0x80018a8	
			Thread1() at main.c:351 0x8014c16	
			_port_thread_start() at chcore_v7m.c:255 0x8000d1c	
		Thread [2] 536873472 (idle :  : CURRENT) (Suspended : Container)	
			_idle_thread() at chsys.c:61 0x8000ed8	
			_port_thread_start() at chcore_v7m.c:255 0x8000d1c	
		Thread [1] 536873664 (main :  : WTOREVT) (Suspended : Container)	
			chSchGoSleepS() at chschd.c:122 0x8001360	
			chSchGoSleepTimeoutS() at chschd.c:190 0x800143a	
			chEvtWaitOneTimeout() at chevents.c:451 0x8002c10	
			main() at main.c:657 0x8014f84	
	gdb	

8 Set breakpoint at LED flasher.
9 Run till break
   Stopped in chSchGoSleepS
10 Record debug window
Dev_1_OCD [Program]	
	/home/chris/bin/oocd/bin/openocd	
Dev_1 [GDB Hardware Debugging]	
	ch.elf	
		Thread [5] 536873752 (No Name :  : Unknown state) (Suspended : Container)	
			Thread1() at main.c:321 0x8014b7a	
			_port_thread_start() at chcore_v7m.c:255 0x8000d1c	
		Thread [4] 536877936 (shell :  : WTQUEUE) (Suspended : Signal : SIGTRAP:Trace/breakpoint trap)	
			chSchGoSleepS() at chschd.c:122 0x8001360	
			chSchGoSleepTimeoutS() at chschd.c:195 0x8001454	
			qwait() at chqueues.c:69 0x8003350	
			chIQReadTimeout() at chqueues.c:232 0x8003556	
			read() at serial.c:63 0x8004bee	
			shellGetLine() at shell.c:261 0x8012536	
			shell_thread() at shell.c:155 0x801230a	
			_port_thread_start() at chcore_v7m.c:255 0x8000d1c	
		Thread [3] 536877624 (blinker :  : CURRENT) (Suspended : Container)	
			chSchGoSleepS() at chschd.c:122 0x8001360	
			chSchGoSleepTimeoutS() at chschd.c:190 0x800143a	
			chThdSleep() at chthreads.c:290 0x80018a8	
			Thread1() at main.c:351 0x8014c16	
			_port_thread_start() at chcore_v7m.c:255 0x8000d1c	
		Thread [1] 536873664 (main :  : WTOREVT) (Suspended : Container)	
			chSchGoSleepS() at chschd.c:122 0x8001360	
			chSchGoSleepTimeoutS() at chschd.c:190 0x800143a	
			chEvtWaitOneTimeout() at chevents.c:451 0x8002c10	
			main() at main.c:657 0x8014f84	
	gdb	

11 Run till break
   Stopped at toggle led (Correct place)
12 Record debug window
Dev_1_OCD [Program]	
	/home/chris/bin/oocd/bin/openocd	
Dev_1 [GDB Hardware Debugging]	
	ch.elf	
		Thread [6] 536873472 (idle :  : READY) (Suspended : Container)	
			chSchDoRescheduleBehind() at chschd.c:309 0x8001558	
			chSchDoReschedule() at chschd.c:363 0x8001606	
			_port_switch_from_isr() at chcore_v7m.c:203 0x8000ce4	
		Thread [5] 536873752 (\300\n :  : Unknown state) (Suspended : Breakpoint)	
			Thread1() at main.c:321 0x8014b7a	
			_port_thread_start() at chcore_v7m.c:255 0x8000d1c	
		Thread [4] 536877936 (shell :  : WTQUEUE) (Suspended : Container)	
			chSchGoSleepS() at chschd.c:122 0x8001360	
			chSchGoSleepTimeoutS() at chschd.c:195 0x8001454	
			qwait() at chqueues.c:69 0x8003350	
			chIQReadTimeout() at chqueues.c:232 0x8003556	
			read() at serial.c:63 0x8004bee	
			shellGetLine() at shell.c:261 0x8012536	
			shell_thread() at shell.c:155 0x801230a	
			_port_thread_start() at chcore_v7m.c:255 0x8000d1c	
		Thread [3] 536877624 (blinker :  : CURRENT) (Suspended : Container)	
			chSchGoSleepS() at chschd.c:122 0x8001360	
			chSchGoSleepTimeoutS() at chschd.c:190 0x800143a	
			chThdSleep() at chthreads.c:290 0x80018a8	
			Thread1() at main.c:351 0x8014c16	
			_port_thread_start() at chcore_v7m.c:255 0x8000d1c	
	gdb	

11b Run till break
   Stopped at toggle led (Correct place)
12b Record debug window
Dev_1_OCD [Program]	
	/home/chris/bin/oocd/bin/openocd	
Dev_1 [GDB Hardware Debugging]	
	ch.elf	
		Thread [7] 536873664 (main :  : WTOREVT) (Suspended : Container)	
			chSchGoSleepS() at chschd.c:122 0x8001360	
			chSchGoSleepTimeoutS() at chschd.c:190 0x800143a	
			chEvtWaitOneTimeout() at chevents.c:451 0x8002c10	
			main() at main.c:657 0x8014f84	
		Thread [5] 536873752 (No Name :  : Unknown state) (Suspended : Breakpoint)	
			Thread1() at main.c:321 0x8014b7a	
			_port_thread_start() at chcore_v7m.c:255 0x8000d1c	
		Thread [4] 536877936 (shell :  : WTQUEUE) (Suspended : Container)	
			chSchGoSleepS() at chschd.c:122 0x8001360	
			chSchGoSleepTimeoutS() at chschd.c:195 0x8001454	
			qwait() at chqueues.c:69 0x8003350	
			chIQReadTimeout() at chqueues.c:232 0x8003556	
			read() at serial.c:63 0x8004bee	
			shellGetLine() at shell.c:261 0x8012536	
			shell_thread() at shell.c:155 0x801230a	
			_port_thread_start() at chcore_v7m.c:255 0x8000d1c	
		Thread [3] 536877624 (blinker :  : CURRENT) (Suspended : Container)	
			chSchGoSleepS() at chschd.c:122 0x8001360	
			chSchGoSleepTimeoutS() at chschd.c:190 0x800143a	
			chThdSleep() at chthreads.c:290 0x80018a8	
			Thread1() at main.c:351 0x8014c16	
			_port_thread_start() at chcore_v7m.c:255 0x8000d1c	
	gdb	

13 Remove breakpoint
14 Resume Pause
   Stopped in chSchGoSleepS
15 Record debug window
Dev_1_OCD [Program]	
	/home/chris/bin/oocd/bin/openocd	
Dev_1 [GDB Hardware Debugging]	
	ch.elf	
		Thread [8] 536873472 (idle :  : CURRENT) (Suspended : Container)	
			_idle_thread() at chsys.c:61 0x8000ed8	
			_port_thread_start() at chcore_v7m.c:255 0x8000d1c	
		Thread [7] 536873664 (main :  : WTOREVT) (Suspended : Signal : SIGINT:Interrupt)	
			chSchGoSleepS() at chschd.c:122 0x8001360	
			chSchGoSleepTimeoutS() at chschd.c:190 0x800143a	
			chEvtWaitOneTimeout() at chevents.c:451 0x8002c10	
			main() at main.c:657 0x8014f84	
		Thread [4] 536877936 (shell :  : WTQUEUE) (Suspended : Container)	
			chSchGoSleepS() at chschd.c:122 0x8001360	
			chSchGoSleepTimeoutS() at chschd.c:195 0x8001454	
			qwait() at chqueues.c:69 0x8003350	
			chIQReadTimeout() at chqueues.c:232 0x8003556	
			read() at serial.c:63 0x8004bee	
			shellGetLine() at shell.c:261 0x8012536	
			shell_thread() at shell.c:155 0x801230a	
			_port_thread_start() at chcore_v7m.c:255 0x8000d1c	
		Thread [3] 536877624 (blinker :  : SLEEPING) (Suspended : Container)	
			chSchGoSleepS() at chschd.c:122 0x8001360	
			chSchGoSleepTimeoutS() at chschd.c:190 0x800143a	
			chThdSleep() at chthreads.c:290 0x80018a8	
			Thread1() at main.c:351 0x8014c16	
			_port_thread_start() at chcore_v7m.c:255 0x8000d1c	
	gdb	

16 Resume Pause
   Stopped in idle_thread 
17 Record debug window
Dev_1_OCD [Program]	
	/home/chris/bin/oocd/bin/openocd	
Dev_1 [GDB Hardware Debugging]	
	ch.elf	
		Thread [8] 536873472 (idle :  : CURRENT) (Suspended : Signal : SIGINT:Interrupt)	
			_idle_thread() at chsys.c:61 0x8000ed8	
			_port_thread_start() at chcore_v7m.c:255 0x8000d1c	
		Thread [7] 536873664 (main :  : WTOREVT) (Suspended : Container)	
			chSchGoSleepS() at chschd.c:122 0x8001360	
			chSchGoSleepTimeoutS() at chschd.c:190 0x800143a	
			chEvtWaitOneTimeout() at chevents.c:451 0x8002c10	
			main() at main.c:657 0x8014f84	
		Thread [4] 536877936 (shell :  : WTQUEUE) (Suspended : Container)	
			chSchGoSleepS() at chschd.c:122 0x8001360	
			chSchGoSleepTimeoutS() at chschd.c:195 0x8001454	
			qwait() at chqueues.c:69 0x8003350	
			chIQReadTimeout() at chqueues.c:232 0x8003556	
			read() at serial.c:63 0x8004bee	
			shellGetLine() at shell.c:261 0x8012536	
			shell_thread() at shell.c:155 0x801230a	
			_port_thread_start() at chcore_v7m.c:255 0x8000d1c	
		Thread [3] 536877624 (blinker :  : SLEEPING) (Suspended : Container)	
			chSchGoSleepS() at chschd.c:122 0x8001360	
			chSchGoSleepTimeoutS() at chschd.c:190 0x800143a	
			chThdSleep() at chthreads.c:290 0x80018a8	
			Thread1() at main.c:351 0x8014c16	
			_port_thread_start() at chcore_v7m.c:255 0x8000d1c	
	gdb	

Note keeps stopping in idle_thread with multiple Resume Pause cycles. 
This quite different to previous behaviour.


On starting from power cycle of targer and JTAG
Start openOCD
Start GDB (DSF). This only shows one thread.
Terminate GDB
Start GDB (DSF)
Runs OK stops at idle thread.


