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.

Missing "startup_ARMCA9.S" for AM437x

I am following the tutorial for building a simple "Hello World" example on the AM437x and the document shows that the sample project includes startup_ARMCA9.S, but when I follow the steps, I get startup_ARMCA8.S in my project instead.

I searched the TI folder, and found startup_ARMCA8.S, and startup_ARMCA15.S, but not the one for the Cortex A9.

Can I get the correct startup code somehow?

Thanks!

Doug

  • Doug,

    Since the AM437x devices were used primarily with embedded Linux, a specific startup file for the Cortex A9 was never commissioned. Only recently the baremetal development was fully backed by the release of the RTOS Processor SDK.

    All that said, either the A8 or the A15 startup files should work just fine with your A9 processor. The initialization these files perform is very basic and there are no functional differences between them (obviously this may change if there is a need).

    In any case, I filed the enhancement number SDSCM00052436. You can check its status in the link SDOWP in my signature below.

    I apologize for the inconvenience,
    Rafael
  • desouza,

    Thank you for the quick response. If I understand you correctly, the RTOS Processor SDK will include the support for the AM437x which we will be needing for our project. Hopefully, your workaround will solve my immediate issue, but there still seems to be something going awry for me.


    I have taken the startup source file for the Cortex A8 and placed it into my project for use with the Cortex A9. At this point I can successfully compile and link the simple Hello.c application which I am attempting to debug. However, when I attempt to debug the program following the instructions in the Getting Started guide, I am running into more difficulties. I am suspicious that the issues I am having may be due to the fact that I am using the Cortex A9 and have had to employ workarounds to get the project to build. I will post my debugging process and perhaps you can see where the problem lies.


    1) A compile and link my "hello" program.


    2) I click Run>Debug to launch the debugger. The debug perspective opens and a new source tab opens with the text:

    No source available for "0x35628"


    The "Debug" tab also opens and presents me with a list of all of the cores on my device, with a connection for each to the XDS100v2 Debugger. All of the cores show "Disconnected" status.


    3) I right click on the Cortex A9 debug probe and click "Connect Target". After some activity the Cortex A9 Debug Probe changes state to "(Suspended) No Symbols Defined for 00035628" and the console tab then displays a long series of diagnostics:


    CortexA9: Output: **** AM437x IDK EVM Initialization is in progress ..........

    CortexA9: Output: **** Device Type: GP

    CortexA9: GEL Output: System input clock is 24MHz

    CortexA9: GEL Output: **** AM43xx OPP100 with CLKIN=24MHz is in progress .........

    CortexA9: GEL Output: **** Going to Bypass...

    CortexA9: GEL Output: **** Bypassed, changing values...

    CortexA9: Output: **** Locking PLL

    CortexA9: GEL Output: **** MPU PLL locked

    CortexA9: GEL Output: **** Core Bypassed

    CortexA9: GEL Output: **** Now locking Core...

    CortexA9: GEL Output: **** Core locked

    CortexA9: GEL Output: **** Calculated PER SD Divisor=4

    CortexA9: GEL Output: **** PER DPLL Bypassed

    CortexA9: GEL Output: **** PER DPLL Locked

    CortexA9: GEL Output: **** Calculated EXTDEV SD Divisor=4

    CortexA9: GEL Output: **** EXTDEV DPLL Bypassed

    CortexA9: GEL Output: **** EXTDEV DPLL Locked

    CortexA9: GEL Output: **** DISP PLL Config is in progress ..........

    CortexA9: GEL Output: **** DISP PLL Locked

    CortexA9: GEL Output: **** DDR DPLL Bypassed

    CortexA9: GEL Output: **** DDR DPLL Locked

    CortexA9: GEL Output: **** Setting DDR3 = 400MHz

    CortexA9: GEL Output: **** AM43xx OPP100 configuration is done .........

    CortexA9: GEL Output: Starting DDR3 configuration...

    CortexA9: Output: EMIF PRCM is in progress .......

    CortexA9: Output: EMIF PRCM Done

    CortexA9: GEL Output: EMIF CLK enabled...

    CortexA9: GEL Output: Waiting for VTP Ready .......

    CortexA9: GEL Output: VTP is Ready!

    CortexA9: GEL Output: VTP controller enabled

    CortexA9: GEL Output: Checking if DLL is ready...

    CortexA9: GEL Output: DLL is ready

    CortexA9: GEL Output: Configuring DDR IOs and Control Module registers...

    CortexA9: GEL Output: Configuration of Control Module registers complete

    CortexA9: GEL Output: Setting up DDR3 H/W leveling configuration...

    CortexA9: GEL Output: Starting EMIF controller configuration...

    CortexA9: GEL Output:


    DDR3 Hardware leveling complete... Outputing all the leveling results !!!


    CortexA9: GEL Output: PHY_STATUS_12=0x0700003F

    CortexA9: GEL Output: PHY_STATUS_13=0x07000039

    CortexA9: GEL Output: PHY_STATUS_14=0x0700004D

    CortexA9: GEL Output: PHY_STATUS_15=0x0700004D

    CortexA9: GEL Output: PHY_STATUS_16=0x00000000

    CortexA9: GEL Output: PHY_STATUS_7 =0x00000047

    CortexA9: GEL Output: PHY_STATUS_8 =0x00000048

    CortexA9: GEL Output: PHY_STATUS_9 =0x00000046

    CortexA9: GEL Output: PHY_STATUS_10=0x00000045

    CortexA9: GEL Output: PHY_STATUS_11=0x00000000

    CortexA9: GEL Output: PHY_STATUS_17=0x03D4004D

    CortexA9: GEL Output: PHY_STATUS_18=0x02050057

    CortexA9: GEL Output: PHY_STATUS_19=0x01E90062

    CortexA9: GEL Output: PHY_STATUS_20=0x01C60062

    CortexA9: GEL Output: PHY_STATUS_21=0x00000000

    CortexA9: GEL Output: PHY_STATUS_22=0x0394000D

    CortexA9: GEL Output: PHY_STATUS_23=0x01C50017

    CortexA9: GEL Output: PHY_STATUS_24=0x01A90022

    CortexA9: GEL Output: PHY_STATUS_25=0x01860022

    CortexA9: GEL Output: PHY_STATUS_26=0x00000000

    CortexA9: GEL Output:


    DDR3 configuration is complete!!!


    CortexA9: GEL Output: Turning on EDMA...

    CortexA9: GEL Output: EDMA is turned on...

    CortexA9: Output: **** AM437x IDK EVM Initialization is Done ******************


    The "Disassembly" tab seems to show the core halted at some address:

    00035618:   2020F85C            eorhs      pc, r0, r12, asr r8
    0003561c:   120CF8C2            andne      pc, r12, #0xc20000
    00035620:   4020F85C            eormi      pc, r0, r12, asr r8
    00035624:   2230F8D4            eorshs     pc, r0, #0xd40000
    00035628:   D0FB2A00            rscsle     r2, r11, r0, lsl #20  <--- Halted Here
    0003562c:   D5040415            strle      r0, [r4, #-0x415]
    00035630:   F8C82001           .word       0xf8c82001
    00035634:   E8BDE000            pop        {sp, lr, pc}
    00035638:   07D283F0           .word       0x07d283f0
    0003563c:   2201D0F2            andhs      sp, r1, #0xf2
    00035640:   2230F8C4            eorshs     pc, r0, #0xc40000

    At this point, I click Run>Load>Load Program and load my Hello.out program. At this point, the debugger just sits there doing nothing.

    The "Suspend", "Terminate" and "Sytem Reset" buttons are the only active controls on the menu for debugging.

    If I press "Suspend" the processor halts and I get the following disassembly:

    __do_global_dtors_aux:
    80000000:   E92D4010            push       {r4, lr}
    80000004:   E59F4028            ldr        r4, [pc, #0x28]
    80000008:   E5D43000            ldrb       r3, [r4]
    8000000c:   E3530000            cmp        r3, #0
    80000010:   1A000005            bne        #0x8000002c
    80000014:   E59F301C            ldr        r3, [pc, #0x1c]
    80000018:   E3530000            cmp        r3, #0
    8000001c:   159F0018            ldrne      r0, [pc, #0x18]
    80000020:   1320F000            nopne     
    80000024:   E3A03001            mov        r3, #1
    80000028:   E5C43000            strb       r3, [r4]
    8000002c:   E8BD4010            pop        {r4, lr}        <---------Halted Here
    80000030:   E12FFF1E            bx         lr
    80000034:   800044F4            strdhi     r4, r5, [r0], -r4
    80000038:   00000000            andeq      r0, r0, r0
    8000003c:   80003B84            andhi      r3, r0, r4, lsl #23
              frame_dummy:
    80000040:   E92D4008            push       {r3, lr}
              NMI_Handler:
    80000044:   3034                adds       r0, #0x34
              HardFault_Handler:
    80000046:   E59F                b          #0x7ffffb88
              SVC_Handler:
    80000048:   0000                movs       r0, r0
              PendSV_Handler:
    8000004a:   E353                b          #0x800006f4
              SysTick_Handler:
    8000004c:   0030                movs       r0, r6
              Default_Handler:

    So, it looks like the program and symbols have loaded, but the processor seems to be stuck in an exception of som sort.

    Like I stated before, I'm not sure if there are missing steps in the guide, or something is broken because of the multiple workarounds I have had to use to get this simple project running. I hope someone there can give me some ise how to get past this issue.
    Thanks!

    Doug

  • Okay,

    It looks like I fixed this issue.

    I disabled the feature that executes to main() automatically when the program is loaded and then I single stepped the startup code and found where it stopped making sense. It was in one of the library functions, and so I started looking for that and then realized where things were messed up.

    It turned out to be as I suspected. The portion of the instructions that explains how to work around the lack of support for the AM437x by setting up a project for the AM335x causes the linker file for the AM335x to be included in the project. Inside that .lds file is a reference to *startup_ARMCA8.o (.text), which must be changed to *startup_ARMCA9.o (.text) in order for the software to function properly.

    At this point I can see "[CortexA9] Hello World!" on my console output tab!

    Thanks for the help with my problem. I hope this is the last workaround issue I have to overcome.

    Doug
  • Doug,

    Sorry for the lack of updates, but I am glad everything is working now.

    The problem you got (the invalid .o file) was hit by me when I was migrating everything from the A8 to the A15 core.

    One additional detail you may want to be careful is the match between the libraries specified in the linker options and the specs passed to the compiler ("nano", "nosys", "rdimon") - this caused trouble when I was creating projects between these host support options.

    Apart from this, the GCC for Cortex A cores traditionally requires a LOT of stack. I have absolutely no idea why this is required, but I could never get to the bottom of this.

    In any case, thank you for reporting your findings.

    Regards,
    Rafael