Guest
#2725689
Hi all, I am observing a strange behaviour here. I am debugging a LM3S6753 with CodeSourcery Tools and Eclipse. I just updated to latest CodeSourcery with GDB 4.6.3, by the way. I have a FreeRTOS project and stripped it down to something rather simple with a malloc call. I am stopping at this code 184 if( ( xWantedSize > 0 ) && ( xWantedSize < configTOTAL_HEAP_SIZE ) ) 000038a8: pvPortMalloc+120 ldr r3, [r7, #4] 000038aa: pvPortMalloc+122 cmp r3, #0 000038ac: pvPortMalloc+124 beq.n 0x3964 <pvPortMalloc+308> 000038ae: pvPortMalloc+126 ldr r2, [r7, #4] 000038b0: pvPortMalloc+128 movw r3, #11999 ; 0x2edf 000038b4: pvPortMalloc+132 cmp r2, r3 000038b6: pvPortMalloc+134 bhi.n 0x3964 <pvPortMalloc+308> 188 pxPreviousBlock = &xStart; and switch to Instruction stepping mode The register contents are General Registers General Purpose and FPU Register Group r0 0x40 r1 0x4 r2 0x40 r3 0x0 r4 0x18d3672f r5 0x1 r6 0xa4b r7 0x200035ec r8 0x1c003812 r9 0xc9002302 r10 0xa6941002 r11 0xd129840c r12 0x36e10541 sp 0x200035ec lr 0x3cf3 pc 0x3d95 f0 0x0 f1 0x0 f2 0x0 f3 0x0 f4 0x0 f5 0x0 f6 0x0 f7 0x0 fps 0x0 cpsr 0x61000020 I can execute the first ldr r3... command, I see r3 updated with the correct value, but when I execute the next step command (cmp r3 ...), the processor gives me a hard fault and gets caught in the FaultISR handler. I can't see any reason, why a cmp r3, #0 command would cause this. When I stop the processor now, the register contents are General Registers General Purpose and FPU Register Group r0 0x0 r1 0x4 r2 0x40f0 r3 0x0 r4 0x18d3672f r5 0x1 r6 0xa4b r7 0x20001b08 r8 0x1c003812 r9 0xc9002302 r10 0xa6941002 r11 0xd129840c r12 0x36e10541 sp 0x2000360c lr 0xfffffff9 pc 0x3f41 f0 0x0 f1 0x0 f2 0x0 f3 0x0 f4 0x0 f5 0x0 f6 0x0 f7 0x0 fps 0x0 cpsr 0x21000023 I attach the openocd log for this session. The error seems to be here Debug: 1692 50691 cortex_m3.c:404 cortex_m3_examine_exception_reason(): HardFault SHCSR 0x0, SR 0x40000000, CFSR 0x1, AR 0xffffffff Debug: 1693 50691 cortex_m3.c:515 cortex_m3_debug_entry(): entered debug state in core mode: Handler at PC 0x3f40, target->state: halted Any ideas what might go wrong here? Best regards, Rainer