Understood.
Could someone who has RTOS support working (or has had in working in the past) please provide the
versions of gcc, gdb and openocd that worked for them.
Also, the openocd configuration during build (what args were passed to configure before make?)
The openocd build configuration in my case was:
Code: Select all
./configure --enable-stlink --enable-arm-jtag-ew --enable-ft2232_libftdi
Next, the exact commands used to bring up the debugging session.
In my (non-working) case:
The file ./openocd.cfg:
Code: Select all
source ../stm32l-discovery/stm32l-discovery.cfg
$_TARGETNAME configure -rtos auto
gdb starts with the command:
Code: Select all
/cortex/bin/gdb -x start.gdb binaryElfFile
where the start.gdb script is:
Code: Select all
target extended-remote :3333
set remote hardware-breakpoint-limit 6
set remote hardware-watchpoint-limit 4
load
monitor reset halt
tbreak chSysInit
continue
finish
The combined output from openocd and gdb is:
Code: Select all
brent@zardoz:~/git/charger/firmware/zev$ openocd &
[2] 19597
Open On-Chip Debugger 0.8.0-dev-00257-ga3c0f05 (2013-11-04-17:42)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.sourceforge.net/doc/doxygen/bugs.html
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
Info : This adapter doesn't support configurable speed
Info : STLINK v2 JTAG v14 API v2 SWIM v0 VID 0x0483 PID 0x3748
Info : Target voltage: 2.893909
brent@zardoz:~/git/charger/firmware/zev$ Info : stm32lx.cpu: hardware has 6 breakpoints, 4 watchpoints
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08000aa0 msp: 0x20000400
STM32L: Enabling HSI
receiving debug messages from current target enabled
background polling: on
TAP: stm32lx.cpu (enabled)
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08000aa0 msp: 0x20000400
/cortex/bin/gdb -x ../stm32l-discovery/start.gdb build/zev.elf
GNU gdb (GDB) 7.6.50.20131105-cvs
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-pc-linux-gnu --target=arm-none-eabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from build/zev.elf...done.
Info : accepting 'gdb' connection from 3333
Info : STM32L flash size is 128kb, base address is 0x8000000
Warn : acknowledgment received, but no packet pending
ResetHandler () at /home/brent/chibios/os/ports/GCC/ARMCMx/crt0.c:274
274 asm volatile ("cpsid i");
Info : Auto-detected RTOS: ChibiOS
Error: Memory signature identifier does not contain magic bytes.
Error: Reading the memory signature of ChibiOS/RT failed
Loading section startup, size 0xf4 lma 0x8000000
Loading section .text, size 0x5674 lma 0x8000100
Loading section .data, size 0x10 lma 0x8005778
Info : Padding image section 0 with 12 bytes
Info : Padding image section 1 with 4 bytes
target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x20000012 msp: 0x20000400
target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x20000012 msp: 0x20000400
Warn : keep_alive() was not invoked in the 1000ms timelimit. GDB alive packet not sent! (1097). Workaround: increase "set remotetimeout" in GDB
Start address 0x8000aa0, load size 22392
Transfer rate: 12 KB/sec, 5598 bytes/write.
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08000aa0 msp: 0x20000400
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08000aa0 msp: 0x20000400
Temporary breakpoint 1 at 0x8000eb6: file /home/brent/chibios/os/kernel/src/chsys.c, line 90.
Note: automatically using hardware breakpoints for read-only addresses.
Info : Successfully loaded memory map of ChibiOS/RT target running version 2.6.1
Error: ChibiOS registry integrity check failed, NULL pointer
Info : Only showing current execution because of a broken ChibiOS thread registry.
Temporary breakpoint 1, chSysInit () at /home/brent/chibios/os/kernel/src/chsys.c:90
90 port_init();
main () at main.c:51
51 debugPrintInit(debugOutput);
(gdb) info thread
[New Thread 536872976]
Id Target Id Frame
2 Thread 536872976 (No Name : : READY) Remote 'g' packet reply is too long: 00000000000000000000000000000000910e00080000000055555555555555555555555555555555555555555555555500000000d008002000000000510d00080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
(gdb)
In if I run the above without enabling the "$_TARGETNAME configure -rtos auto" command in my openocd.cfg,
everything works fine. If I delay running "$_TARGETNAME configure -rtos auto" until after chSysInit() has
finished, I get no extra threading info (but the system remains usable)
This might well be a regression in openocd or gdb. I'm just hoping we can help find it.
Thanks!