Page 7 of 18

Re: ChibiOS OpenOCD support

Posted: Fri Oct 05, 2012 11:43 am
by Giovanni
Hi,

I would go for chSysInit because it is the API that is necessarily invoked at least one time.

Giovanni

Re: ChibiOS OpenOCD support

Posted: Sat Oct 06, 2012 8:18 am
by mabl
Ok, status report:

During my work on the oocd patches, a lot of bugs have been detected inside the rtos code itself. :? Those code parts have been replaced by new code now and this is already upstream.

The main ChibiOS patch is still under review though. There are automatic style checks which i failed disastrously at first. At least, the build bots don't complain anymore.

Best, MaBl

Re: ChibiOS OpenOCD support

Posted: Sun Oct 07, 2012 11:39 am
by Giovanni
Interesting those automatic checks, we could adopt something similar, how is it done?

Giovanni

Re: ChibiOS OpenOCD support

Posted: Sun Oct 07, 2012 12:05 pm
by mabl
Hi Giovanni,

openocd uses the GIT Review system gerrit and the Build-Bot jenkins. The build bot will invoke the style check during build process.

The check itself is a perl skript: https://github.com/mabl/openocd_chibios ... ckpatch.pl
But I think there are lot's of style checkers on the market.

Generally, I'd very much like to see the repository improved. Especially regarding commit messages, automatic build/testsuit checks and Changelog :ugeek:

Re: ChibiOS OpenOCD support

Posted: Mon Oct 08, 2012 6:56 pm
by feanor
Hi,
i was excited to explore this feature, but unfortunately I'm not able to set it up properly. I've made a git-clone of the mentioned OpenOCD-branch into a Ubuntu-VM, crosscompiled it via mingw32 for windows and copied the binary into the openocd-environment of version 0.6. After this i followed the instructions made in wiki. But there are still no threads in debug-view of eclipse. A verbose debugging shows following line:

&"warning: RMT ERROR : failed to get remote thread list.\n"

What information is needed to help me getting threaded debugging view ;)

Many thanks in advance.

Re: ChibiOS OpenOCD support

Posted: Mon Oct 08, 2012 7:21 pm
by mabl
Hi feanor,

looks like your openocd does not detect ChibiOS. Could you post the whole debug output off eclipse/gdb and oocd? When copying to the 0.6 environment, did you append -rtos auto like described in the guide?

Re: ChibiOS OpenOCD support

Posted: Mon Oct 08, 2012 7:43 pm
by feanor
Hi mabl,

the gdb-output looks like

Code: Select all

776-gdb-set confirm off
776^done
(gdb)
777-gdb-set width 0
777^done
(gdb)
778-gdb-set height 0
778^done
(gdb)
779-interpreter-exec console echo
779^done
780-gdb-show prompt
(gdb)
780^done,value="(gdb) "
(gdb)
781-gdb-set new-console on
781^error,msg="No symbol table is loaded.  Use the \"file\" command."
(gdb)
782-target-select remote localhost:3333
=thread-group-started,id="i1",pid="42000"
=thread-created,id="1",group-id="i1"
*stopped,frame={addr="0x080120f2",func="??",args=[]},thread-id="1",stopped-threads="all"
782^connected
(gdb)
783 info proc
&"info proc\n"
&"Undefined info command: \"proc\".  Try \"help info\".\n"
783^error,msg="Undefined info command: \"proc\".  Try \"help info\"."
784 monitor flash probe 0
(gdb)
&"monitor flash probe 0\n"
@"stm32f4x errata detected - fixing incorrect MCU_IDCODE\n"
@"device id = 0x10006413\n"
@"flash size = 1024kbytes\n"
@"flash 'stm32f2x' found at 0x08000000\n"
784^done
(gdb)
785 monitor flash protect 0 0 127 off
&"monitor flash protect 0 0 127 off\n"
@"ERROR: last sector must be <= 11\n"
@"in procedure 'flash'\n"
785^done
(gdb)
786 info program
&"info program\n"
~"Debugging a target over a serial line.\n"
~"Program stopped at 0x80120f2.\n"
~"It stopped with signal SIGTRAP, Trace/breakpoint trap.\n"
~"Type \"info stack\" or \"info registers\" for more information.\n"
786^done
(gdb)
787 info threads
&"info threads\n"
&"warning: RMT ERROR : failed to get remote thread list.\n"
~"* 1 Remote target  0x080120f2 in ?? ()\n"
787^done
788 monitor reset halt
(gdb)
&"monitor reset halt\n"
monitor reset halt
@"target state: halted\n"
@"target halted due to debug-request, current mode: Thread \n"
@"xPSR: 0x01000000 pc: 0x08002670 msp: 0x20000400\n"
788^done
(gdb)
789-stack-info-depth
789^done,depth="2"
(gdb)
790 monitor stm32f2x mass_erase 0
&"monitor stm32f2x mass_erase 0\n"
monitor stm32f2x mass_erase 0
@"stm32x mass erase complete\n"
790^done
(gdb)
791-stack-list-frames 0 2
791^done,stack=[frame={level="0",addr="0x080120f2",func="??"},frame={level="1",addr="0x08002762",func="??"}]
(gdb)
792 monitor flash write_image ../stm32-mf-chibios/src/build/chibi-mf.elf
monitor flash write_image ../stm32-mf-chibios/src/build/chibi-mf.elf
&"monitor flash write_image ../stm32-mf-chibios/src/build/chibi-mf.elf\n"
@"target state: halted\n"
@"target halted due to breakpoint, current mode: Thread \n"
@"xPSR: 0x61000000 pc: 0x20000042 msp: 0x20000400\n"
@"wrote 84224 bytes from file ../stm32-mf-chibios/src/build/chibi-mf.elf in 1.913086s (42.993 KiB/s)\n"
792^done
(gdb)
793-data-list-changed-registers
793^done,changed-registers=["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25"]
(gdb)
794 monitor flash protect 0 0 127 on
&"monitor flash protect 0 0 127 on\n"
@"ERROR: last sector must be <= 11\n"
@"in procedure 'flash'\n"
794^done
(gdb)
795 info sharedlibrary
&"info sharedlibrary\n"
~"No shared libraries loaded at this time.\n"
795^done
(gdb)
796 disconnect
&"disconnect\n"
disconnect
=thread-group-exited,id="i1"
796^done
797 target remote localhost:3333
(gdb)
&"target remote localhost:3333\n"
target remote localhost:3333
=thread-group-started,id="i1",pid="42000"
=thread-created,id="1",group-id="i1"
~"0x08002670 in ?? ()\n"
0x08002670 in ?? ()
*stopped,frame={addr="0x08002670",func="??",args=[]},thread-id="1",stopped-threads="all"
797^done
(gdb)
798 info threads
&"info threads\n"
&"warning: RMT ERROR : failed to get remote thread list.\n"
~"* 1 Remote target  0x08002670 in ?? ()\n"
798^done
(gdb)
799 monitor soft_reset_halt
&"monitor soft_reset_halt\n"
monitor soft_reset_halt
@"requesting target halt and executing a soft reset\n"
799^done
(gdb)
800 file C:\\Daten\\Projekte\\sw\\stm32-mf-chibios\\src\\build\\chibi-mf.elf
&"file C:\\\\Daten\\\\Projekte\\\\sw\\\\stm32-mf-chibios\\\\src\\\\build\\\\chibi-mf.elf\n"
file C:\\Daten\\Projekte\\sw\\stm32-mf-chibios\\src\\build\\chibi-mf.elf
800^done
(gdb)
801-stack-info-depth
801^done,depth="2"
(gdb)
802-stack-list-frames 0 2
802^done,stack=[frame={level="0",addr="0x08002670",func="ResetHandler",file="../externals/ChibiOS-RT/os/ports/GCC/ARMCMx/crt0.c",fullname="c:\\daten\\projekte\\sw\\stm32-mf-chibios\\externals\\chibios-rt\\os\\ports\\gcc\\armcmx\\crt0.c",line="255"},frame={level="1",addr="0xffffffff",func="??"}]
(gdb)
803-environment-directory
803^done,source-path="$cdir;$cwd"
(gdb)
804-data-list-changed-registers
804^done,changed-registers=["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25"]
(gdb)
805-data-list-register-names
805^done,register-names=["r0","r1","r2","r3","r4","r5","r6","r7","r8","r9","r10","r11","r12","sp","lr","pc","f0","f1","f2","f3","f4","f5","f6","f7","fps","cpsr","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""]
(gdb)
806 info sharedlibrary
&"info sharedlibrary\n"
~"No shared libraries loaded at this time.\n"
806^done
(gdb)
807 tbreak main
&"tbreak main\n"
tbreak main
~"Temporary breakpoint 1 at 0x80120f2: file main.c, line 90.\n"
Temporary breakpoint 1 at 0x80120f2: file main.c, line 90.
=breakpoint-created,bkpt={number="1",type="breakpoint",disp="del",enabled="y",addr="0x080120f2",func="main",file="main.c",fullname="c:\\\\daten\\\\projekte\\\\sw\\\\stm32-mf-chibios\\\\src\\\\main.c",line="90",times="0",original-location="main"}
807^done
808 jump ResetHandler
(gdb)
jump ResetHandler
&"jump ResetHandler\n"
~"Note: automatically using hardware breakpoints for read-only addresses.\n"
Note: automatically using hardware breakpoints for read-only addresses.
808^running
*running,thread-id="all"
(gdb)
=breakpoint-modified,bkpt={number="1",type="breakpoint",disp="del",enabled="y",addr="0x080120f2",func="main",file="main.c",fullname="c:\\\\daten\\\\projekte\\\\sw\\\\stm32-mf-chibios\\\\src\\\\main.c",line="90",times="1",original-location="main"}
~"\nTemporary breakpoint "

Temporary breakpoint ~"1, main () at main.c:90\n"
1, main () at main.c:90
~"90\t  halInit();\n"
90     halInit();
*stopped,frame={addr="0x080120f2",func="main",args=[],file="main.c",fullname="c:\\daten\\projekte\\sw\\stm32-mf-chibios\\src\\main.c",line="90"},thread-id="1",stopped-threads="all"
=breakpoint-deleted,id="1"
(gdb)
809 info threads
&"info threads\n"
&"warning: RMT ERROR : failed to get remote thread list.\n"
~"* 1 Remote target  main () at main.c:90\n"
809^done
(gdb)
810-stack-info-depth
810^done,depth="1"
(gdb)
811-stack-list-frames 0 1
811^done,stack=[frame={level="0",addr="0x080120f2",func="main",file="main.c",fullname="c:\\daten\\projekte\\sw\\stm32-mf-chibios\\src\\main.c",line="90"}]
(gdb)
812-data-list-changed-registers
812^done,changed-registers=["0","1","2","3","4","5","13","14","15"]
(gdb)
813 info sharedlibrary
&"info sharedlibrary\n"
~"No shared libraries loaded at this time.\n"
813^done
(gdb)
814-data-disassemble -s 0x80120f2 -e 0x8012172 -- 1
814^done,asm_insns=[src_and_asm_line={line="90",file="main.c",line_asm_insn=[{address="0x080120f2",func-name="main",offset="2",inst="bl\t0x8009980 <halInit>"}]},src_and_asm_line={line="91",file="main.c",line_asm_insn=[{address="0x080120f6",func-name="main",offset="6",inst="bl\t0x80075f0 <chSysInit>"}]},src_and_asm_line={line="92",file="main.c",line_asm_insn=[]},src_and_asm_line={line="93",file="main.c",line_asm_insn=[{address="0x080120fa",func-name="main",offset="10",inst="movw\tr0, #5244\t; 0x147c"},{address="0x080120fe",func-name="main",offset="14",inst="movt\tr0, #8192\t; 0x2000"},{address="0x08012102",func-name="main",offset="18",inst="movw\tr1, #14348\t; 0x380c"},{address="0x08012106",func-name="main",offset="22",inst="movt\tr1, #8192\t; 0x2000"},{address="0x0801210a",func-name="main",offset="26",inst="bl\t0x8009a80 <extStart>"}]},src_and_asm_line={line="94",file="main.c",line_asm_insn=[]},src_and_asm_line={line="95",file="main.c",line_asm_insn=[{address="0x0801210e",func-name="main",offset="30",inst="bl\t0x8010920 <wf_init>"}]},src_and_asm_line={line="96",file="main.c",line_asm_insn=[{address="0x08012112",func-name="main",offset="34",inst="bl\t0x8010c70 <ha_init>"}]},src_and_asm_line={line="97",file="main.c",line_asm_insn=[{address="0x08012116",func-name="main",offset="38",inst="bl\t0x800f680 <sd_init>"}]},src_and_asm_line={line="98",file="main.c",line_asm_insn=[]},src_and_asm_line={line="99",file="main.c",line_asm_insn=[{address="0x0801211a",func-name="main",offset="42",inst="mov.w\tr0, #4"},{address="0x0801211e",func-name="main",offset="46",inst="bl\t0x8011510 <mod_uart_init>"}]},src_and_asm_line={line="100",file="main.c",line_asm_insn=[{address="0x08012122",func-name="main",offset="50",inst="mov.w\tr0, #2"},{address="0x08012126",func-name="main",offset="54",inst="bl\t0x8011e80 <mod_wavplayer_init>"}]},src_and_asm_line={line="101",file="main.c",line_asm_insn=[{address="0x0801212a",func-name="main",offset="58",inst="mov.w\tr0, #1"},{address="0x0801212e",func-name="main",offset="62",inst="bl\t0x8011220 <mod_rfm_init>"}]},src_and_asm_line={line="102",file="main.c",line_asm_insn=[{address="0x08012132",func-name="main",offset="66",inst="mov.w\tr0, #3"},{address="0x08012136",func-name="main",offset="70",inst="bl\t0x8012060 <mod_bell_init>"}]},src_and_asm_line={line="103",file="main.c",line_asm_insn=[]},src_and_asm_line={line="104",file="main.c",line_asm_insn=[]},src_and_asm_line={line="105",file="main.c",line_asm_insn=[]},src_and_asm_line={line="106",file="main.c",line_asm_insn=[{address="0x0801213a",func-name="main",offset="74",inst="mov.w\tr0, #500\t; 0x1f4"},{address="0x0801213e",func-name="main",offset="78",inst="bl\t0x8008380 <chThdSleep>"}]},src_and_asm_line={line="107",file="main.c",line_asm_insn=[{address="0x08012142",func-name="main",offset="82",inst="mov.w\tr3, #3072\t; 0xc00"},{address="0x08012146",func-name="main",offset="86",inst="movt\tr3, #16386\t; 0x4002"},{address="0x0801214a",func-name="main",offset="90",inst="mov.w\tr2, #3072\t; 0xc00"},{address="0x0801214e",func-name="main",offset="94",inst="movt\tr2, #16386\t; 0x4002"},{address="0x08012152",func-name="main",offset="98",inst="ldr\tr2, [r2, #20]"},{address="0x08012154",func-name="main",offset="100",inst="eor.w\tr2, r2, #32768\t; 0x8000"},{address="0x08012158",func-name="main",offset="104",inst="str\tr2, [r3, #20]"}]},src_and_asm_line={line="108",file="main.c",line_asm_insn=[{address="0x0801215a",func-name="main",offset="106",inst="b.n\t0x801213a <main+74>"}]}]
(gdb)
815-data-disassemble -s 0x801215a -e 0x80121e2 -- 1
815^done,asm_insns=[src_and_asm_line={line="108",file="main.c",line_asm_insn=[{address="0x0801215a",func-name="main",offset="106",inst="b.n\t0x801213a <main+74>"}]}]
(gdb)
816-data-disassemble -s 0x801215a -e 0x80121e2 -- 0
816^done,asm_insns=[{address="0x0801215a",func-name="main",offset="106",inst="b.n\t0x801213a <main+74>"},{address="0x0801215c",inst="nop.w"},{address="0x08012160",inst="cmp\tr2, #34\t; 0x22"},{address="0x08012162",inst="subs\tr4, #58\t; 0x3a"},{address="0x08012164",inst="subs\tr7, #62\t; 0x3e"},{address="0x08012166",inst="ldrb\tr4, [r7, #29]"},{address="0x08012168",inst="movs\tr0, r0"},{address="0x0801216a",inst="movs\tr0, r0"},{address="0x0801216c",inst="cmp\tr4, #43\t; 0x2b"},{address="0x0801216e",inst="subs\tr5, #59\t; 0x3b"},{address="0x08012170",inst="ldrb\tr3, [r3, r5]"},{address="0x08012172",inst="movs\tr0, r0"},{address="0x08012174",inst="mcr2\t13, 7, r4, cr11, cr0, {4}"},{address="0x08012178",inst="add\tr3, r10"},{address="0x0801217a",inst="strh\tr7, [r1, r5]"},{address="0x0801217c",inst="cmp\tr6, #53\t; 0x35"},{address="0x0801217e",inst="movs\tr0, r6"},{address="0x08012180",inst="ldr\tr7, [pc, #312]\t; (0x80122bc)"},{address="0x08012182",inst="ldr\tr6, [pc, #128]\t; (0x8012204)"},{address="0x08012184",inst="ldr\tr5, [pc, #260]\t; (0x801228c)"},{address="0x08012186",inst="movs\tr0, #69\t; 0x45"},{address="0x08012188",inst="movs\tr0, #32"},{address="0x0801218a",inst="mov\tr0, r4"},{address="0x0801218c",inst="strb\tr1, [r0, r1]"},{address="0x0801218e",inst="adds\tr2, #51\t; 0x33"},{address="0x08012190",inst="movs\tr0, #32"},{address="0x08012192",inst="movs\tr0, r4"},{address="0x08012194",inst="ldr\tr7, [pc, #312]\t; (0x80122d0)"},{address="0x08012196",inst="ldr\tr6, [pc, #128]\t; (0x8012218)"},{address="0x08012198",inst="ldr\tr5, [pc, #260]\t; (0x80122a0)"},{address="0x0801219a",inst="movs\tr0, #69\t; 0x45"},{address="0x0801219c",inst="movs\tr0, #32"},{address="0x0801219e",inst="mov\tr0, r4"},{address="0x080121a0",inst="strb\tr1, [r0, r1]"},{address="0x080121a2",inst="movs\tr0, #32"},{address="0x080121a4",inst="movs\tr0, #32"},{address="0x080121a6",inst="movs\tr0, r4"},{address="0x080121a8",inst="movs\tr0, r0"},{address="0x080121aa",inst="movs\tr0, r0"},{address="0x080121ac",inst="movs\tr0, r0"},{address="0x080121ae",inst="movs\tr0, r0"},{address="0x080121b0",inst="str\tr1, [r5, #68]\t; 0x44"},{address="0x080121b2",inst="str\tr4, [r5, #84]\t; 0x54"},{address="0x080121b4",inst="movs\tr0, r0"},{address="0x080121b6",inst="movs\tr0, r0"},{address="0x080121b8",inst="movs\tr0, r0"},{address="0x080121ba",inst="movs\tr0, r0"},{address="0x080121bc",inst="movs\tr0, r0"},{address="0x080121be",inst="movs\tr0, r0"},{address="0x080121c0",inst="ldrsb\tr3, [r2, r1]"},{address="0x080121c2",inst="adds\tr1, #35\t; 0x23"},{address="0x080121c4",inst="movs\tr0, r0"},{address="0x080121c6",inst="movs\tr0, r0"},{address="0x080121c8",inst="ldrsb\tr3, [r2, r1]"},{address="0x080121ca",inst="adds\tr2, #35\t; 0x23"},{address="0x080121cc",inst="movs\tr0, r0"},{address="0x080121ce",inst="movs\tr0, r0"},{address="0x080121d0",inst="ldrsb\tr3, [r2, r1]"},{address="0x080121d2",inst="adds\tr3, #35\t; 0x23"},{address="0x080121d4",inst="movs\tr0, r0"},{address="0x080121d6",inst="movs\tr0, r0"},{address="0x080121d8",inst="ldrsb\tr3, [r2, r1]"},{address="0x080121da",inst="adds\tr4, #35\t; 0x23"},{address="0x080121dc",inst="movs\tr0, r0"},{address="0x080121de",inst="movs\tr0, r0"},{address="0x080121e0",inst="ldrsb\tr3, [r2, r1]"}]
(gdb)


OpenOCD is startet this way:

Code: Select all

openocd -f scripts\board\stm32f4discovery.cfg

and says:

Code: Select all

Open On-Chip Debugger 0.7.0-dev-gcb69d06 (2012-10-07-15:02)
Licensed under GNU GPL v2
For bug reports, read
   http://openocd.sourceforge.net/doc/doxygen/bugs.html
adapter speed: 1000 kHz
srst_only separate srst_nogate srst_open_drain
Info : clock speed 1000 kHz
Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : accepting 'gdb' connection from 3333
Info : stm32f4x errata detected - fixing incorrect MCU_IDCODE
Info : device id = 0x10006413
Info : flash size = 1024kbytes
Warn : acknowledgment received, but no packet pending
undefined debug reason 6 - target needs reset
Info : stm32f4x errata detected - fixing incorrect MCU_IDCODE
Info : device id = 0x10006413
Info : flash size = 1024kbytes
flash 'stm32f2x' found at 0x08000000
ERROR: last sector must be <= 11
in procedure 'flash'
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08002670 msp: 0x20000400
stm32x mass erase complete
target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x20000042 msp: 0x20000400
wrote 84224 bytes from file ../stm32-mf-chibios/src/build/chibi-mf.elf in 1.977539s (41.592 KiB/s)
ERROR: last sector must be <= 11
in procedure 'flash'
Info : dropped 'gdb' connection
Info : accepting 'gdb' connection from 3333
Warn : acknowledgment received, but no packet pending
requesting target halt and executing a soft reset
Info : Padding image section 0 with 8 bytes
target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x20000042 msp: 0x20000400
Info : halted: PC: 0x0801213e
Info : dropped 'gdb' connection
Info : accepting 'gdb' connection from 3333
Warn : acknowledgment received, but no packet pending
Info : stm32f4x errata detected - fixing incorrect MCU_IDCODE
Info : device id = 0x10006413
Info : flash size = 1024kbytes
flash 'stm32f2x' found at 0x08000000
ERROR: last sector must be <= 11
in procedure 'flash'
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08002670 msp: 0x20000400
stm32x mass erase complete
target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x20000042 msp: 0x20000400
wrote 84224 bytes from file ../stm32-mf-chibios/src/build/chibi-mf.elf in 2.018554s (40.747 KiB/s)
Warn : negative acknowledgment, but no packet pending
ERROR: last sector must be <= 11
in procedure 'flash'
Info : dropped 'gdb' connection
Info : accepting 'gdb' connection from 3333
Warn : acknowledgment received, but no packet pending
requesting target halt and executing a soft reset
Error: address + size wrapped(0xfffffffe, 0x00000004)
Info : dropped 'gdb' connection
Info : accepting 'gdb' connection from 3333
Warn : acknowledgment received, but no packet pending
Info : stm32f4x errata detected - fixing incorrect MCU_IDCODE
Info : device id = 0x10006413
Info : flash size = 1024kbytes
flash 'stm32f2x' found at 0x08000000
ERROR: last sector must be <= 11
in procedure 'flash'
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08002670 msp: 0x20000400
stm32x mass erase complete
target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x20000042 msp: 0x20000400
wrote 84224 bytes from file ../stm32-mf-chibios/src/build/chibi-mf.elf in 2.014649s (40.826 KiB/s)
Warn : negative acknowledgment, but no packet pending
ERROR: last sector must be <= 11
in procedure 'flash'
Info : dropped 'gdb' connection
Info : accepting 'gdb' connection from 3333
Warn : acknowledgment received, but no packet pending
requesting target halt and executing a soft reset
Error: address + size wrapped(0xfffffffe, 0x00000004)
Info : dropped 'gdb' connection
Info : accepting 'gdb' connection from 3333
Warn : acknowledgment received, but no packet pending
Info : stm32f4x errata detected - fixing incorrect MCU_IDCODE
Info : device id = 0x10006413
Info : flash size = 1024kbytes
flash 'stm32f2x' found at 0x08000000
ERROR: last sector must be <= 11
in procedure 'flash'
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08002670 msp: 0x20000400
stm32x mass erase complete
target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x20000042 msp: 0x20000400
wrote 84224 bytes from file ../stm32-mf-chibios/src/build/chibi-mf.elf in 2.296875s (35.810 KiB/s)
Warn : negative acknowledgment, but no packet pending
ERROR: last sector must be <= 11
in procedure 'flash'
Info : dropped 'gdb' connection
Info : accepting 'gdb' connection from 3333
Warn : acknowledgment received, but no packet pending
requesting target halt and executing a soft reset
Info : Padding image section 0 with 8 bytes
target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x20000042 msp: 0x20000400
Warn : keep_alive() was not invoked in the 1000ms timelimit. GDB alive packet not sent! (2357). Workaround: increase "set remotetimeout" in GDB
Info : dropped 'gdb' connection
Info : accepting 'gdb' connection from 3333
Warn : acknowledgment received, but no packet pending
Info : stm32f4x errata detected - fixing incorrect MCU_IDCODE
Info : device id = 0x10006413
Info : flash size = 1024kbytes
flash 'stm32f2x' found at 0x08000000
ERROR: last sector must be <= 11
in procedure 'flash'
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08002670 msp: 0x20000400
stm32x mass erase complete
target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x20000042 msp: 0x20000400
wrote 84224 bytes from file ../stm32-mf-chibios/src/build/chibi-mf.elf in 1.873047s (43.912 KiB/s)
ERROR: last sector must be <= 11
in procedure 'flash'
Info : dropped 'gdb' connection
Info : accepting 'gdb' connection from 3333
Warn : acknowledgment received, but no packet pending
requesting target halt and executing a soft reset
Error: address + size wrapped(0xfffffffe, 0x00000004)
Info : dropped 'gdb' connection
Info : accepting 'gdb' connection from 3333
Warn : acknowledgment received, but no packet pending
Info : stm32f4x errata detected - fixing incorrect MCU_IDCODE
Info : device id = 0x10006413
Info : flash size = 1024kbytes
flash 'stm32f2x' found at 0x08000000
ERROR: last sector must be <= 11
in procedure 'flash'
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08002670 msp: 0x20000400
stm32x mass erase complete
target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x20000042 msp: 0x20000400
wrote 84224 bytes from file ../stm32-mf-chibios/src/build/chibi-mf.elf in 1.886719s (43.594 KiB/s)
ERROR: last sector must be <= 11
in procedure 'flash'
Info : dropped 'gdb' connection
Info : accepting 'gdb' connection from 3333
Warn : acknowledgment received, but no packet pending
requesting target halt and executing a soft reset
Error: address + size wrapped(0xfffffffe, 0x00000004)
Info : dropped 'gdb' connection
Info : accepting 'gdb' connection from 3333
Warn : acknowledgment received, but no packet pending
Info : stm32f4x errata detected - fixing incorrect MCU_IDCODE
Info : device id = 0x10006413
Info : flash size = 1024kbytes
flash 'stm32f2x' found at 0x08000000
Error: address + size wrapped(0xfffffffe, 0x00000004)
ERROR: last sector must be <= 11
in procedure 'flash'
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08002670 msp: 0x20000400
stm32x mass erase complete
target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x20000042 msp: 0x20000400
wrote 84224 bytes from file ../stm32-mf-chibios/src/build/chibi-mf.elf in 1.890625s (43.504 KiB/s)
ERROR: last sector must be <= 11
in procedure 'flash'
Info : dropped 'gdb' connection
Info : accepting 'gdb' connection from 3333
Warn : acknowledgment received, but no packet pending
requesting target halt and executing a soft reset
Error: address + size wrapped(0xfffffffe, 0x00000004)
Info : dropped 'gdb' connection
Info : accepting 'gdb' connection from 3333
Warn : acknowledgment received, but no packet pending
Info : stm32f4x errata detected - fixing incorrect MCU_IDCODE
Info : device id = 0x10006413
Info : flash size = 1024kbytes
flash 'stm32f2x' found at 0x08000000
ERROR: last sector must be <= 11
in procedure 'flash'
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08002670 msp: 0x20000400
stm32x mass erase complete
target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x20000042 msp: 0x20000400
wrote 84224 bytes from file ../stm32-mf-chibios/src/build/chibi-mf.elf in 1.855469s (44.328 KiB/s)
ERROR: last sector must be <= 11
in procedure 'flash'
Info : dropped 'gdb' connection
Info : accepting 'gdb' connection from 3333
Warn : acknowledgment received, but no packet pending
requesting target halt and executing a soft reset
Error: address + size wrapped(0xffffffff, 0x00000004)
Warn : WARNING! The target is already running. All changes GDB did to registers will be discarded! Waiting for target to halt.
Info : dropped 'gdb' connection
Info : accepting 'gdb' connection from 3333
Warn : acknowledgment received, but no packet pending
Info : stm32f4x errata detected - fixing incorrect MCU_IDCODE
Info : device id = 0x10006413
Info : flash size = 1024kbytes
flash 'stm32f2x' found at 0x08000000
ERROR: last sector must be <= 11
in procedure 'flash'
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08002670 msp: 0x20000400
stm32x mass erase complete
target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x20000042 msp: 0x20000400
wrote 84224 bytes from file ../stm32-mf-chibios/src/build/chibi-mf.elf in 1.934570s (42.516 KiB/s)
ERROR: last sector must be <= 11
in procedure 'flash'
Info : dropped 'gdb' connection
Info : accepting 'gdb' connection from 3333
Warn : acknowledgment received, but no packet pending
Error: address + size wrapped(0xfffffffe, 0x00000004)
requesting target halt and executing a soft reset
Info : dropped 'gdb' connection
Info : accepting 'gdb' connection from 3333
Warn : acknowledgment received, but no packet pending
Info : stm32f4x errata detected - fixing incorrect MCU_IDCODE
Info : device id = 0x10006413
Info : flash size = 1024kbytes
flash 'stm32f2x' found at 0x08000000
ERROR: last sector must be <= 11
in procedure 'flash'
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08002670 msp: 0x20000400
stm32x mass erase complete
target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x20000042 msp: 0x20000400
wrote 84224 bytes from file ../stm32-mf-chibios/src/build/chibi-mf.elf in 1.913086s (42.993 KiB/s)
ERROR: last sector must be <= 11
in procedure 'flash'
Info : dropped 'gdb' connection
Info : accepting 'gdb' connection from 3333
Warn : acknowledgment received, but no packet pending
requesting target halt and executing a soft reset
Error: address + size wrapped(0xffffffff, 0x00000004)


I changed line 54 of ${OPENOCDROOT}/scripts/target/stm32f4x.cfg to

Code: Select all

target create $_TARGETNAME cortex_m3 -endian $_ENDIAN -chain-position $_TARGETNAME -rtos auto


Thank you for helping me.

Re: ChibiOS OpenOCD support

Posted: Mon Oct 08, 2012 7:51 pm
by mabl
Hi feanor,

the stm32 is an stlink target and it has it's own target in openocd:

Code: Select all

cat ~/bin/oocd/share/openocd/scripts/board/stm32f4discovery.cfg
# This is an STM32F4 discovery board with a single STM32F407VGT6 chip.
# http://www.st.com/internet/evalboard/product/252419.jsp

source [find interface/stlink-v2.cfg]

source [find target/stm32f4x_stlink.cfg]

# use hardware reset, connect under reset
reset_config srst_only srst_nogate


So you will have to modify stm32f4x_stlink.cfg not stm32f4x.cfg.

Best,
MaBl

Re: ChibiOS OpenOCD support

Posted: Mon Oct 08, 2012 8:04 pm
by feanor
Hi mabl,
thanks for the hint. Now openocd tells me

Code: Select all

Auto-detected RTOS: ChibiOS

Info : Successfully loaded memory map of ChibiOS/RT target running version 2.5.1
Error: address + size wrapped(0xffffffff, 0x00000004)
Error: ChibiOS registry integrity check failed, double linked list violation
Info : Only showing current execution because of a broken ChibiOS thread registry.

Re: ChibiOS OpenOCD support

Posted: Mon Oct 08, 2012 8:17 pm
by mabl
Hi feanor,

Basically it is like the error said - oocd thinks your thread registry is borken. But i think this is caused by the error message before.

Code: Select all

Error: address + size wrapped(0xffffffff, 0x00000004)


Are you sure your way of installing oocd is correct? I saw this error also in your log before - and there rtos support did not run.