This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Beaglebone processor abort prior to reaching main()

Other Parts Discussed in Thread: AM3359

Hi,

 We had a running project that we added IP code from the lwip version in AM335X_StarterWare_02_00_00_07. We finally got the project to build and link correctly (see other threads.) Currently the beaglebone will load the code and attempt reach main() but before it can hits the processor abort vectors. Walking through the code prior to main we can see that it makes it through init.asm beginning past Clear_Bss_Section and loop and then jumps to __TI_auto_init:

          Clear_Bss_Section:
80000068:   E59F002C LDR             R0, _bss_start
8000006c:   E59F102C LDR             R1, _bss_end
80000070:   E2411004 SUB             R1, R1, #4
80000074:   E3A02000 MOV             R2, #0
          Loop:
80000078:   E4802004 STR             R2, [R0], #4
8000007c:   E1500001 CMP             R0, R1
80000080:   DAFFFFFC BLE             Loop
80000084:   EB0253AA BL              __TI_auto_init

When we try to step on the first line of __TI_auto_init, the processor jumps to the abort vector.

          __TI_auto_init:
80094f34:   E92D40F0 STMFD           R13!, {R4, R5, R6, R7, R14}    <-- Can't step past this line
80094f38:   E59F00B0 LDR             R0, c_binit
80094f3c:   E3700001 CMN             R0, #1
80094f40:   1B000056 BLNE            copy_in
80094f44:   E59F50B0 LDR             R5, c_cinit_start
80094f48:   E59F70B0 LDR             R7, c_cinit_end
80094f4c:   E59F60B0 LDR             R6, handler_start

This is where we end up:

4030fc10:   E59FF014 LDR             PC, 0x4030FC2C
4030fc14:   E24FF008 SUB             PC, PC, #8
4030fc18:   E59FF010 LDR             PC, 0x4030FC30
4030fc1c:   E59FF010 LDR             PC, 0x4030FC34
4030fc20:   80000000 ANDHI           R0, R0, R0
4030fc24:   800A2EB0 STRHIH          R2, [R10], -R0
4030fc28:   800A2DE8 ANDHI           R2, R10, R8, ROR #27
4030fc2c:   800A2EB0 STRHIH          R2, [R10], -R0
4030fc30:   800A2E10 ANDHI           R2, R10, R0, LSL R14
4030fc34:   800A2EAC ANDHI           R2, R10, R12, LSR #29
4030fc38:   00000000 ANDEQ           R0, R0, R0
4030fc3c:   00000000 ANDEQ           R0, R0, R0
4030fc40:   00000000 ANDEQ           R0, R0, R0

The Abort registers:

Abort_Registers    
   SPSR_ABT    0x2000019F    Stores the status of interrupt enables and critical processor status signals in abort mode [Core]    
    R13_ABT    0x880007E0    General Purpose Register 13 in Abort mode [Core]    
    R14_ABT    0x80094F3C    General Purpose Register 14 in Abort mode [Core]    

Can someone tell us where in the 3359 technical manual we could look to figure out why the processor is aborting? Because this error is happening prior to main() we assume that the error has something to do with having added the lwip stack to the project.

Thanks,

     John C.

  • As added reference to the project the following files have been copied into the project:

    c:\ti\AM335X_StarterWare_02_00_00_07\system_config\armv7a\cache.c

    c:\ti\AM335X_StarterWare_02_00_00_07\system_config\armv7a\am335x\clock.c

    c:\ti\AM335X_StarterWare_02_00_00_07\system_config\armv7a\cgt\cp15.asm

    c:\ti\AM335X_StarterWare_02_00_00_07\platfrom\beaglebone\cpsw.c

    c:\ti\AM335X_StarterWare_02_00_00_07\system_config\armv7a\cgt\cpu.c

    c:\ti\AM335X_StarterWare_02_00_00_07\utils\delay.c

    c:\ti\AM335X_StarterWare_02_00_00_07\utils\delay.h

    c:\ti\AM335X_StarterWare_02_00_00_07\platfrom\beaglebone\dmtimer.c

    c:\ti\AM335X_StarterWare_02_00_00_07\platfrom\beaglebone\edma.c (edma_driver.c)

    c:\ti\AM335X_StarterWare_02_00_00_07\platfrom\beaglebone\edma.c (edma_platform.c)

    c:\ti\AM335X_StarterWare_02_00_00_07\system_config\armv7a\am335x\cgt\exceptionhandler.asm

    c:\ti\AM335X_StarterWare_02_00_00_07\drivers\gpio_v2.c

    c:\ti\AM335X_StarterWare_02_00_00_07\drivers\gpio.c

    c:\ti\AM335X_StarterWare_02_00_00_07\drivers\gpmc.c

    c:\ti\AM335X_StarterWare_02_00_00_07\system_config\armv7a\cgt\init.asm

    c:\ti\AM335X_StarterWare_02_00_00_07\system_config\armv7a\am335x\interrupt.c

    c:\ti\AM335X_StarterWare_02_00_00_07\third_party\lwip-1.4.0\ports\cpsw\lwiplib.c

    c:\ti\AM335X_StarterWare_02_00_00_07\third_party\lwip-1.4.0\ports\cpsw\lwiplib.h

    c:\ti\AM335X_StarterWare_02_00_00_07\system_config\armv7a\mmu.c

    c:\ti\AM335X_StarterWare_02_00_00_07\system_config\armv7a\am335x\startup.c

    c:\ti\AM335X_StarterWare_02_00_00_07\platfrom\beaglebone\sysdelay.c

    c:\ti\AM335X_StarterWare_02_00_00_07\platfrom\beaglebone\sysperf.c

    c:\ti\AM335X_StarterWare_02_00_00_07\drivers\uart_irda_cir.c

    c:\ti\AM335X_StarterWare_02_00_00_07\platfrom\beaglebone\uart.c

    c:\ti\AM335X_StarterWare_02_00_00_07\platfrom\beaglebone\uartConsole.c

    c:\ti\AM335X_StarterWare_02_00_00_07\utils\uartStdio.c

    Predefined Symbols:

    am335x
    am3359
    beaglebone

    Compiler includes:

    "${CG_TOOL_ROOT}/include"
    "C:\ti\AM335X_StarterWare_02_00_00_07\examples\beaglebone\enet_echo"
    "C:\ti\AM335X_StarterWare_02_00_00_07\drivers"
    "C:\ti\AM335X_StarterWare_02_00_00_07\examples\beaglebone\enet_lwip"
    "C:\ti\AM335X_StarterWare_02_00_00_07\include"
    "C:\ti\AM335X_StarterWare_02_00_00_07\include\hw"
    "C:\ti\AM335X_StarterWare_02_00_00_07\include\armv7a"
    "C:\ti\AM335X_StarterWare_02_00_00_07\include\armv7a\am335x"
    "C:\ti\AM335X_StarterWare_02_00_00_07\third_party\lwip-1.4.0"
    "C:\ti\AM335X_StarterWare_02_00_00_07\third_party\lwip-1.4.0\src\include"
    "C:\ti\AM335X_StarterWare_02_00_00_07\third_party\lwip-1.4.0\ports\cpsw"
    "C:\ti\AM335X_StarterWare_02_00_00_07\third_party\lwip-1.4.0\ports\cpsw\include"
    "C:\ti\AM335X_StarterWare_02_00_00_07\third_party\lwip-1.4.0\src\include\ipv4"
    "C:\ti\AM335X_StarterWare_02_00_00_07\third_party\lwip-1.4.0\src\include\lwip"
    "C:\ti\AM335X_StarterWare_02_00_00_07\third_party\lwip-1.4.0\apps\httpserver_raw"

    Linker command file: AM3359.cmd

    Linker includes:

    "libc.a"
    "C:\ti\AM335X_StarterWare_02_00_00_07\binary\armv7a\cgt_ccs\utils\utils.lib"
    "C:\ti\AM335X_StarterWare_02_00_00_07\binary\armv7a\cgt_ccs\am335x\system_config\system.lib"
    "C:\ti\AM335X_StarterWare_02_00_00_07\binary\armv7a\cgt_ccs\am335x\drivers\drivers.lib"
    "C:\ti\AM335X_StarterWare_02_00_00_07\binary\armv7a\cgt_ccs\am335x\beaglebone\platform\platform.lib"

    Any help please?

    Thanks,

         John C.

  • This error is occurring because when the processor is attempting to do the STMFD instruction, R13 has a value of 0x880002C8.

    80094f34:   E92D40F0 STMFD           R13!, {R4, R5, R6, R7, R14}

    This value is out of memory range and is caused by the stack size being set to 0x800 in the Project build parameters. Because the stack actually works from high to low address, the linker has put the starting stack address 0x800 above the high address of the memory settings. So be careful when you are setting the stack size in the project settings as that is not really the stack size.