STM32F4 failure on semaphore release in termios.

Karel Gardas karel.gardas at centrum.cz
Sat Aug 31 21:07:32 UTC 2013


On 08/30/13 08:58 AM, Sebastian Huber wrote:
> On 2013-08-28 23:30, Karel Gardas wrote:
>> _Internal_error_Occurred (the_source=RTEMS_FATAL_SOURCE_EXCEPTION,
>> is_internal=false, the_error=536875260)
>
> If you get an exception like this, then you can use in GDB to figure out
> the context (the actual program counter of the exception is not the
> direct value of register_pc):
>
> Breakpoint 6, _Internal_error_Occurred
> (the_source=RTEMS_FATAL_SOURCE_EXCEPTION, is_internal=false,
> the_error=1049524) at
> ../../../../../../rtems/c/src/../../cpukit/score/src/interr.c:35
> 35 _User_extensions_Fatal( the_source, is_internal, the_error );
> (gdb) p/x *(CPU_Exception_frame *)the_error
> $1 = {

Thanks for this nice trick!

(gdb) p/x *(CPU_Exception_frame *)the_error
$2 = {register_r0 = 0x20006acc, register_r1 = 0x1a010004, register_r2 = 
0x0, register_r3 = 0x1a010003, register_r4 = 0x20006ab8, register_r5 = 
0x20001794, register_r6 = 0x20006d80, register_r7 = 0x20003c70, 
register_r8 = 0x20003e7c, register_r9 = 0x20001440, register_r10 = 0x0, 
register_r11 = 0x18fc0, register_r12 = 0x0, register_sp = 0x0, 
register_lr = 0xe57b, register_pc = 0xe584, register_xpsr = 0x21000000, 
vector = 0x3, vfp_context = 0x1}
(gdb) dis 0xe584
warning: bad breakpoint number at or near '0xe584'
(gdb) disas 0xe584
Dump of assembler code for function _Chain_Get_first_unprotected:
    0x0000e56c <+0>:     push	{r7, lr}
    0x0000e56e <+2>:     sub	sp, #24
    0x0000e570 <+4>:     add	r7, sp, #0
    0x0000e572 <+6>:     str	r0, [r7, #4]
    0x0000e574 <+8>:     ldr	r0, [r7, #4]
    0x0000e576 <+10>:    bl	0xe4d8 <_Chain_Head>
    0x0000e57a <+14>:    str	r0, [r7, #20]
    0x0000e57c <+16>:    ldr	r3, [r7, #20]
    0x0000e57e <+18>:    ldr	r3, [r3, #0]
    0x0000e580 <+20>:    str	r3, [r7, #16]
    0x0000e582 <+22>:    ldr	r3, [r7, #16]
    0x0000e584 <+24>:    ldr	r3, [r3, #0]
    0x0000e586 <+26>:    str	r3, [r7, #12]
    0x0000e588 <+28>:    ldr	r3, [r7, #20]
    0x0000e58a <+30>:    ldr	r2, [r7, #12]
    0x0000e58c <+32>:    str	r2, [r3, #0]
    0x0000e58e <+34>:    ldr	r3, [r7, #12]
    0x0000e590 <+36>:    ldr	r2, [r7, #20]
    0x0000e592 <+38>:    str	r2, [r3, #4]
    0x0000e594 <+40>:    ldr	r3, [r7, #16]
    0x0000e596 <+42>:    mov	r0, r3
    0x0000e598 <+44>:    add.w	r7, r7, #24
    0x0000e59c <+48>:    mov	sp, r7
    0x0000e59e <+50>:    pop	{r7, pc}
End of assembler dump.

So it looks like I've debugged well and got up to the culprit. Now the 
question is why this ldr fails...

Thanks,
Karel



More information about the devel mailing list