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.

Running LCDK OMAP L138 with SYS\BIOS 6



Hey everyone,

I'm trying to run a simple hello world application on the ARM9 cpu with sys\bios.

1. I know that there should be LCDK-OMAP L138 platform for XDCTools version 3.23.01 and up but I can't find it, I can only find EVM-OMAPL138 and EXP-OMAPL138.

2. While trying to debug the hello world example from sys\bios by choosing one of the two platforms above the application doesn't do anything.

Any toughts?

Thanks,

Joel

  • Yoel,

    I checked and there is no LCDK-specific platform for this board.  I think you should be able to use ti.platforms.evmOMAPL138.  I don’t have an LCDK board with me at the moment to try it, but I’ve done DSP development on that board in the past and didn’t need to use a different/new platform.

    Can you describe more what happens when you run hello world?  Does the program load and run but you don’t get any output?

    Also, do you have a GEL file for initializing the device when connecting with CCS?  I’d expect you should see several console messages as you connect to the ARM device, as PLLs and memory map are initialized, etc.  Are you seeing these?

    Thanks,
    Scott

  • Hey Scott,

    When running the "hello world" example as is, it works, Here is what I get in the console:

    ARM9_0: Output: Target Connected.
    ARM9_0: Output: ---------------------------------------------
    ARM9_0: Output: Memory Map Cleared.
    ARM9_0: Output: ---------------------------------------------
    ARM9_0: Output: Memory Map Setup Complete.
    ARM9_0: Output: ---------------------------------------------
    ARM9_0: Output: PSC Enable Complete.
    ARM9_0: Output: ---------------------------------------------
    ARM9_0: Output: PLL0 init done for Core:300MHz, EMIFA:25MHz
    ARM9_0: Output: DDR initialization is in progress....
    ARM9_0: Output: PLL1 init done for DDR:150MHz
    ARM9_0: Output: Using DDR2 settings
    ARM9_0: Output: DDR2 init for 150 MHz is done
    ARM9_0: Output: ---------------------------------------------
    ARM9_0: Output: DSP Wake Complete.
    ARM9_0: Output: ---------------------------------------------

    The problem appears when I modify the config files with the wizard.

    For example, I tried adding task to the project but and the System_printf() int the task, doesn't  show anything (cio is enabled).
    I've been working with Sys\Bios for 6-7 month now with the concerto so I know my way around but here I can't find where the problem is coming form. 

    Another example:

    While using the "task" example, everything works fine but when I try to create only one task instead of two (commenting the red part), I see nothing in the console. Here is the code:

    Void task1(UArg arg0, UArg arg1);
    Void task2(UArg arg0, UArg arg1);
    Int resource = 0;
    Task_Handle tsk1;
    Task_Handle tsk2;
    Int finishCount = 0;
    /*
    * ======== main ========
    */
    Void main()
     //PSCModuleControl(SOC_PSC_1_REGS, HW_PSC_GPIO, PSC_POWERDOMAIN_ALWAYS_ON,
    // PSC_MDCTL_NEXT_ENABLE);

    Task_Params taskParams;
    /* Create two tasks that share a resource*/
    Task_Params_init(&taskParams);
    taskParams.priority = 1;
    tsk1 = Task_create (task1, &taskParams, NULL);
    Task_Params_init(&taskParams);
    taskParams.priority = 2;
    tsk2 = Task_create (task2, &taskParams, NULL);
    BIOS_start();
    }
    /*
    * ======== task1 ========
    */
    Void task1(UArg arg0, UArg arg1)
    {
    UInt32 time;
    for (;;) {
    System_printf("Running task1 function\n");
    /* do work by waiting for 2 system ticks to pass */
    time = Clock_getTicks();
    while (Clock_getTicks() <= (time + 1)) {
    ;
    }
    Task_sleep(10);
    }
    }
    /*
    * ======== task2 ========
    */
    Void task2(UArg arg0, UArg arg1)
    {
    for (;;) {
    System_printf("Running task2 function\n");
    Task_sleep(10);
    finishCount++;
    if (finishCount == 5) {
    System_printf("Calling BIOS_exit from task2\n");
    BIOS_exit(0);
    }
    }
    }

    This is done with exactly the same configuration.

    The green part is a different problem, this is code from the OMAP StarterWare but when I un-comment it while using SYS\Bios, I get the following exception:

    [ARM9_0] Exception occurred in ThreadType_Main.
    Main handle: 0x0.
    Main stack base: 0xc301367c.
    Main stack size: 0x1000.
    R0 = 0x01e2700c R8 = 0xffffffff
    R1 = 0x00000003 R9 = 0xffffffff
    R2 = 0x00000000 R10 = 0xffffffff
    R3 = 0x00000003 R11 = 0xffffffff
    R4 = 0xff[ARM9_0] ff0700 R12 = 0x00000003
    R5 = 0xc300b524 SP(R13) = 0xc3014618
    R6 = 0x2000005f LR(R14) = 0xc3002ff8
    R7 = 0xffffffff PC(R15) = 0xc3004aec
    PSR = 0x600000df
    ti.sysbios.family.arm.exc.Exception: line 174: E_dataAbort: pc = 0xc3004aec, lr = 0xc3002ff8.
    xdc.ru[ARM9_0] ntime.Error.raise: terminating execution
    
    

    Any toughts?

    Thanks,
    Yoel 

  • Yoel,

    About modifying the hello example… can you describe what you mean by “The problem appears when I modify the config files with the wizard.”  Which wizard?

    For the task example question… if you remove “task2” then the program will not terminate because the call to BIOS_exit() is in that function.  So the output buffered within the SysMin module will not get flushed to the console.  You should still be able to see the output, but you'll need to look at the SysMin buffer via the ROV tool.

    For the PSCModuleControl() call… I’m not familiar with that function.  If you look at the instruction at the PC indicated in the exception report, what is it doing?  I wonder if the PSC module access hasn’t been enabled yet, and if you need to do this with another function call before this one?

    Scott

  • Hey Scott,

    By Wizard I mean, without writing the code but using the "Outline" tab in ccs, because like in the example, the tasks are created at the "main" function.

    When does the data should be flushed to the console? I don't want to exit the program but I still want to see the printf's.

    PSCModuleControl() is a "StarterWare" function that Enabling the PSC for the differnt peripherals, when not using sys\bios this function doesn't throw exception as the first line in main. 
    The actual code is:

    unsigned long address = SOC_PSC_1_REGS + (0xA00 + (HW_PSC_GPIO * 4));               // = 0x01E27000
    unsigned long flags = (0x00000003u & 0x0000001Fu);                                                            // = 0x3
    HWREG(address) = flags;                                                                                                        // Here is where the exception is thrown

    It seems like this memory region hasn't been initialized.
    How come? This doesn't happen without sys\bios, how can I fix it? 

    Thanks,

    Yoel

  • Can you run this in debugger, is the value of address = 0x01E27A0C?

    If so then I would think the BIOS uses the MMU and you don't have permission for this area.

    I found another post about this that might help

    http://e2e.ti.com/support/embedded/bios/f/355/t/193050.aspx

  • Yoel,

    You can flush the SysMin buffer by calling either “System_flush();” or “SysMin_flush();” in your program.

    Or, you may want to switch to the SysStd module that uses C standard I/O for the output.  There is description of the different System options here: http://rtsc.eclipse.org/docs-tip/Using_xdc.runtime_System

    Did configuring the MMU as Aaron suggested resolve the exception?

    Scott

  • Scott and Aaron,

    I didn't use MMU in the sys\bios configuration but Aaron was right, this section wasn't defined so I added another section to the external memory in the "edit platform" form in the tools section and then the exception was gone and the problem was solved.

    About the standard output, when I use system_flush() I can see the text going out to the console.

    Thanks for the help,

    Yoel