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.

CCS/PROCESSOR-SDK-AM437X: RTOS project debugging on SK

Part Number: PROCESSOR-SDK-AM437X


Tool/software: Code Composer Studio

I´ve got a brand new Starter Kit for the AM437x. Connected it via the usb cable to my PC. It detected "AM437x SK EVM XDS100v2".

I´ve started CCS, compiled the GPIO_LedBlink_skAM437x_armTestProject and try to debbug it. The program hungs at location 0x80168010 after calling BIOS_start().

If I try to debug the program I wrote the effect is the same. The program hungs at location 0x80168010 after calling BIOS_start().

I´ve tried UART_BasicExample_skAM437x_armTestProject and the EMAC_BasicExample_skAM437x_armBiosExampleProject. They failed fo connnect to the target. CCS says the target is on reset.

What is corrected configuration for debugging a program on the AM437x Starter Kit?

Installed itens:
CCS 7.2
GCC ARM Compiler 4.9.3
processor_sdk_rtos_am437x  4.00.00.04
am437x PDK v1.0.7
bios 6.46.05.55
xdctools 3.32.02.25_core

regards,

Marcio.

  • The RTOS team have been notified. They will respond here.
  • Hi,

    Please check the processors.wiki.ti.com/.../Processor_SDK_Supported_Platforms_and_Versions for the HW setup.

    I don't have SK EVM, I used IDK EVM. But I think the test application for different EVM variations worked the same way. Make sure there is no MMCSD card in the EVM, the GEL file initialize the DDR properly. Load the code, what is 0x80168010 in the map file? The bios_start() calls into gpio_test(). If you put a break point at gpio_test(), will it hit?

    Regards, Eric
  • Hi Eric,

    I think something is missing in the configuration or initialization.

    I´ve tried to run the program several times and managed to run it and see the LED flashing once. Then I´ve powered down the board and never saw it running again.

    When the program ran, the AppGpioCallbackFxn() executed, but the gpio_test() task does not.

    The program starts from main() and hungs when it calls bios_start(). I cannot even step into the bios_start(). It does not run gpio_test().

    int main(void)

    {

    /* Call board init functions */

    Board_initGPIO();

    /* Start BIOS */

    BIOS_start();

    return (0);

    }

    I cannot see the address in the map file.

    I beleive the GEL file is initializing the DDR properly. It is the default. When I initialize the debug section, the Console shows:

    CortexA9: Output: **** AM437x SK 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=0x070000C1

    CortexA9: GEL Output: PHY_STATUS_13=0x070000C4

    CortexA9: GEL Output: PHY_STATUS_14=0x070000C0

    CortexA9: GEL Output: PHY_STATUS_15=0x070000BF

    CortexA9: GEL Output: PHY_STATUS_16=0x00000000

    CortexA9: GEL Output: PHY_STATUS_7 =0x00000045

    CortexA9: GEL Output: PHY_STATUS_8 =0x00000044

    CortexA9: GEL Output: PHY_STATUS_9 =0x00000044

    CortexA9: GEL Output: PHY_STATUS_10=0x00000044

    CortexA9: GEL Output: PHY_STATUS_11=0x00000000

    CortexA9: GEL Output: PHY_STATUS_17=0x033900D4

    CortexA9: GEL Output: PHY_STATUS_18=0x03C300D3

    CortexA9: GEL Output: PHY_STATUS_19=0x004E00D3

    CortexA9: GEL Output: PHY_STATUS_20=0x003F00D3

    CortexA9: GEL Output: PHY_STATUS_21=0x00000000

    CortexA9: GEL Output: PHY_STATUS_22=0x02F90094

    CortexA9: GEL Output: PHY_STATUS_23=0x03830093

    CortexA9: GEL Output: PHY_STATUS_24=0x000E0093

    CortexA9: GEL Output: PHY_STATUS_25=0x03FF0093

    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 SK EVM Initialization is Done ******************


    Thanks for your help.
  • Hi,
    It seems my issue is related to these 2 posts:
    e2e.ti.com/.../1671114
    e2e.ti.com/.../401837.

    I´ve changed the GEL file but I am not sure it worked, because I do not see the added outputs in the console. I´ve also changed from "Mixed ARM/Thumb" to "ARM Only" in the Debug part of the project properties.

    The GPIO_LedBlink_skAM437x_armTestProject now runs, but my project that uses the NDK still hungs.

    regards,
    Marcio.
  • Hi,

    Thanks for the update. Do you mean NIMU_BasicExample_skAM437x_armExampleproject failed? Do you have the console output?

    Regards, Eric
  • Hi Eric,

    I was referring to my own application, which is base on a mix of the LED and NIMU example.

    I tried to debug the NIMU_BasicExample_skAM437x_armExampleproject this morning and it failed too. There is no console output (apart from the GEL).

    It is not deterministic. Sometimes it failed when Task_create() was called, sometimes when BIOS_start() was called. If I stop the debugger and do a step into I can see it is executing the ata Abort Exception handler.

    If modify NIMU_BasicExample_skAM437x_armExampleproject to add a System_printf, I do not see anything. If modify it to flash a LED (via gpio), the LED does not flash.

    regards,

  • Hi Eric,

    I think I found something that could explain the non-deterministic behavior of the code.
    I've started a CCS project from the scratch and added one module at a time, uart, gpio and ndk.
    The program ran until I've added the ndk.
    Sometimes I get the following message on the console "00000.000 ExecStart: Already Open".
    This message is from ExecOpen() at c:\ti\ndk_2_25_01_11\packages\ti\ndk\stack\res\exec.c.
    ExecStatus is a static variable initialized ES_CLOSED at the definition.

    void ExecOpen()
    {
       if( ExecStatus != ES_CLOSED )
       {
         DbgPrintf(DBG_ERROR,"ExecStart: Already Open");
        return;
       }

    ....

    I´ve put a break point in ExecOpen(). The first time this procedure is executed, the variable ExecStatus has garbage. It is not being initialized (wrong link options?) or it is being overwritten.

    2017-10-09 Update:

    The problem seems to be the AM437x.lds (link command) file. When I removed it from the project, it started running. I was using the default from c:\ti\ccsv7\ccs_base\arm\include\. 1565.AM437x.zip


    I am new with ARM cpus. Could you help me?

    Thanks,

  • Hi,

    All the CCS example projects on Processor SDK RTOS are created by the script: processors.wiki.ti.com/.../Rebuilding_The_PDK

    Then you import the CCS project into CCS, build and run. There is no AM437x.lds used in the project. Those projects are RTSC projects with a platform defined with the memory sections and data/code placement. If you follow the way we create project (not add files into CCS from scratch), you should not come into this issue.

    Regards, Eric
  • Hi Eric
    When I said that I´ve started a project from the scratch, I meant that I've created a CCS project using the SYS/BIOS->GNU Target Example->Typical.
    If you open the project properties, the General tab has a place to put the Linker Command File. It is a drop-down list. The AM437x.lds is there. My mistake was to fill this field. I did not realize that is was not needed.
    Thanks,
  • Hi,

    All the Processor SDK RTOS examples are created by the script, they are not bare metal. If you are creating bare metal examples yourself, then it has .ld file as the linker command. Please check processors.wiki.ti.com/.../Processor_SDK_Bare_Metal_Examples

    Regards, Eric