_Swap crash in attempt to add support for STM32F3 board

Mirza Krak


My first post on this list so would like to say that this project
seems very promising and is something that I have been waiting for.

I wanted to get involved so I dusted of a STM32F3 discovery board and
started coding. It helped a lot that there was STM32F1 support all

I have gotten it to compile and also have flash and debug support for
the board which has a STlink v2 interface.

But I am having some problems booting the system. As my topic says the
code gets to the _Swap call and then triggers a hard fault.

Do you guys have any tips on why it crashes here?

Posting a gdb trace below:

_nano_fiber_swap () at
159 _Swap(imask);
(gdb) s
_Swap () at /home/mirzak/git/zephyr-project/arch/arm/core/swap.S:245
245 ldr r1, =_nanokernel
(gdb) s
246 ldr r2, [r1, #__tNANO_current_OFFSET]
(gdb) s
247 str r0, [r2, #__tTCS_basepri_OFFSET]
(gdb) s
249 svc #0
(gdb) s
__svc () at /home/mirzak/git/zephyr-project/arch/arm/core/swap.S:197
197 eors.n r0, r0
(gdb) s
198 msr BASEPRI, r0
(gdb) s
201 ldr r1, =_SCS_ICSR
(gdb) s
202 ldr r2, =_SCS_ICSR_PENDSV
(gdb) s
203 str r2, [r1, #0]
(gdb) s
208 bx lr
(gdb) s
_Swap () at /home/mirzak/git/zephyr-project/arch/arm/core/swap.S:252
252 bx lr
(gdb) s

Program received signal SIGTRAP, Trace/breakpoint trap.
0x0800130a in _SysFatalErrorHandler (reason=reason(a)entry=0,
pEsf=pEsf(a)entry=0x200004f8 <main_task_stack+944>) at
77 if ((curCtx == NANO_CTX_ISR) || _is_thread_essential()) {
(gdb) backtrace
Python Exception <type 'exceptions.ImportError'> No module named gdb.frames:
#0 0x0800130a in _SysFatalErrorHandler (reason=reason(a)entry=0,
pEsf=pEsf(a)entry=0x200004f8 <main_task_stack+944>)
at /home/mirzak/git/zephyr-project/arch/arm/core/sys_fatal_error_handler.c:77
#1 0x080011b8 in _Fault (esf=0x200004f8 <main_task_stack+944>) at
#2 0x080012c2 in __usage_fault () at
#3 <signal handler called>
#4 0x3d45e07c in ?? ()
#5 0xdba824f0 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Best Regards,

Join devel@lists.zephyrproject.org to automatically receive all group messages.