Giovanni wrote:Mabl,
Could you try the following change?
Code: Select all
void _port_thread_start(void) {
register tfunc_t thread asm("r1");
register void *param asm("r0");
chSysUnlock();
asm volatile ("mov r0, r5 \n\t"
"mov r1, r4" : : : "r0", "r1");
chThdExit(thread(param));
}
Hi Giovanni,
I changed this code, but it did not help:
(gdb) bt
#0 _idle_thread (p=0x0) at Externals/ChibiOS/os/kernel/src/chsys.c:61
#1 0x08000eba in _port_thread_start () at Externals/ChibiOS/os/ports/GCC/ARMCMx/chcore_v7m.c:259
#2 0x0800180a in chSchGoSleepS (newstate=32 ' ') at Externals/ChibiOS/os/kernel/src/chschd.c:121
#3 0x20002aa0 in vtlist ()
#4 0x20002aa0 in vtlist ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
You should see the same error with your non-rtos openocd.
Freddie Chopin wrote:Giovanni wrote:BTW, is there a version of OCD compiled for windows including the threading code?
Not yet (; I usually provide dev binaries every two-months, and 0.6.1 was published just two weeks ago.
If you think that ChibiOS/RT support in OpenOCD is stable enough I could do a binary earlier.
It should be quite stable. I think there are still bug in the openocd rtos code itself - especially things like stepping in threads and stuff. I'm also not sure if this patch is currently needed for stlink:
http://openocd.zylin.com/#/c/923/