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.

bootloader on DM8148 for SYS/BIOS application.

Other Parts Discussed in Thread: CCSTUDIO, SYSBIOS

Hello Ti,

I am developing a simple bootloader for ARM on DM8148 evm board.

I am following the steps mentioned in below link.

processors.wiki.ti.com/.../DM814x_AM387x_PSP_U-Boot

but when I am trying to boot, Its showing "Starting kernel ... " on terminal.

So my questions,
How do I know my code is working or not?

is uart out will work without gel file intialisation?

or printf() function can show output on terminal?

  • I moved your question to the device forum.
  • Hi Dinesh,

    The most up to date wiki regarding DM814x u-boot is:
    processors.wiki.ti.com/.../TI81XX_PSP_UBOOT_User_Guide

    Can you provide full console output when trying to boot your board?

    Regards,
    Pavel
  • Hi Pavel,

    I am following step to create SD Card boot standalone.

    Step -1 Converted the CCS 4.2.4 built example  program to print on UART into bin file using CCS post build steps as follows


    "C:\ti\ccsv4\ccsv4\utils\tiobj2bin\tiobj2bin.bat" "boot_uart0_test.out" "boot_uart0_test.bin" "C:\ti\ccsv4\ccsv4\tools\compiler\tms470\bin\ofd470.exe" "C:\ti\ccsv4\ccsv4\tools\compiler\tms470\bin\hex470.exe" "C:\ti\ccsv4\ccsv4\utils\tiobj2bin\mkhex4bin.exe"

    2. converted the bin into ub image using following command  sudo mkimage -A arm -T kernel -C none -a 0x80009000 -e 0x40304984 –d /home/root1/APS/dinesh/boot_uart0_test/Debug/boot_uart0_test.bin  /home/root1/APS/dinesh/boot_uart0_test/Debug/boot_uart0_test.ub

    3. Created uImage by copying cp /home/root1/APS/dinesh/boot_uart0_test/Debug/boot_uart0_test.ub /home/root1/APS/dinesh/boot_uart0_test/Debug/uImage

    4. Copied above image to sd card boot partition manually.

    Then tried to boot from sd card by setting boot mode switches 11101. We get following output
     

    The Environment variables are as follows.

    Thanking you !!

    Dinesh

  • Dinesh Dharmik said:
    I am following step to create SD Card boot standalone.

    From where you get these steps? I do not see such steps in the official u-boot/kernel documents:

    From the console log you have sent, it seems to me that u-boot is working/loading fine, the flow hang when should switch to the linux kernel. Are you

    using DM814x TI EVM or custom board? If custom board, how much is the size of the DDR3 RAM on this custom board?

    Dinesh Dharmik said:
    converted the bin into ub image using following command

    Dinesh Dharmik said:
    boot_uart0_test.ub

    This ub image does not look to be valid linux kernel image. That is way your flow hang when switch to it.

    Regards,
    Pavel

  • Hi Pavel,

    Please check below forum link.
    e2e.ti.com/.../1455202

    And procedure to generate .ub image mention in section of "How do I boot SYS/BIOS using U-Boot ? ".

    of link.
    processors.wiki.ti.com/.../BIOS_with_GCC_(CortexA)

    Regards
    Dinesh
  • Dinesh,

    "Once you have a uboot image, you can go through the steps on this wiki to create a BIOS binary image that uboot can load and boot"

    A BIOS binary image is NOT linux kernel image (uImage).

    Regards,
    Pavel
  • Hi Pavel,


    I am using DM8148 Mistral custom board and DDR3 is 2GB. Using the steps processors.wiki.ti.com/.../BIOS_with_GCC_(CortexA).

    We created standalone application image with following command -

    sudo mkimage -A arm -T standalone -C none -a 0x80000000 -e 0x80006b2c -d /home/test/test_print_boot.bin   /home/test_print_boot_std.ub
    The application prints hello world using System_printf() as well as using printf(); The application also sends character "a" in a while loop

    We copied this image to bootable partition of  card.

    On inserting the sd card & switching on Board we enter uboot stage 2 Then we execute following command

    1. mmc rescan 0

    2. fatls mmc 0 ( to check the presence of file)

    3. fatload mmc 0 0x80000000 test_print_boot_std.ub

    4. go 0x80000000

    But no printf statements or character "a" in code, are visible on terminal. The same application works fine when I run it using CCS on Windows machine connected to same board.  Am I missing any step here?

    Regards

    Dinesh

  • Dinesh Dharmik said:
    sudo mkimage

    Are you inside folder u-boot/tools/ when run that command?

    Dinesh Dharmik said:
    -T standalone

    Can you try with -T kernel (as the wiki page states)?

    Dinesh Dharmik said:
    -a 0x80000000

    Can you try with -a 0x81000000, as at address 0x80000000 you have the u-boot loaded, thus you might overwrite the u-boot.

    Dinesh Dharmik said:
    -e 0x80006b2c

    From the wiki:

    // The kernel_entry_point_addr is the address of the first function that runs when the SYS/BIOS kernel gets control. The name of this function is _c_int00 
    and it's address can be obtained from the map file.

    Are you aligned with that?

    Dinesh Dharmik said:
    -d /home/test/test_print_boot.bin


    How do you create this test_print_boot.bin file? Provide info about that.

    Regards,
    Pavel

  • Hi Pavel,

    1.Are you inside folder u-boot/tools/ when run that command?

    Yes,

    2. Can you try with -T kernel (as the wiki page states)?

    tried for both kernel and standalone but same result, no print out on terminal.

    3. Can you try with -a 0x81000000, as at address 0x80000000 you have the u-boot loaded, thus you might overwrite the u-boot.

    Tried with address 0x81000000

    fatload mmc 0  0x81000000 uImage

    but get same output

    4.

    in above example. 0x80006b10 is starting address of  _c_int00.

    PFA, map file and out file

    test_led_boot.zip

    5. We built the .out file using code composer studio 4.2.4 then converted it to uImage ( The .out file switches on LEDS on board. This was verified by using CCS ( GEL file was replace by c code) & same board.)
    ../TI/CodeSourcery/bin$ ./arm-none-linux-gnueabi-objcopy -I elf32-little -O binary /home/test_led_boot/test_led_boot.out  /home/test_led_boot/test_led_boot.bin 

    sudo mkimage -A arm -T kernel  -C none -a 0x80000000 -e 0x80006b10 -d /home/test_led_boot/test_led_boot.bin     /home/test_led_boot/test_led_boot.ub

    cp /home/test_led_boot/test_led_boot.ub   /home/test_led_boot/uImage

    The image was copied on sd card & board was booted from SD card following is output.


     

  • Dinesh Dharmik said:
    We built the .out file using code composer studio 4.2.4 then converted it to uImage

    The wiki page you refer to explains how to run application which is created outside the CCS environment, application created in command line mode with makefile.
    Can you try that?

    Dinesh Dharmik said:
    ./TI/CodeSourcery/bin$ ./arm-none-linux-gnueabi-objcopy -I elf32-little -O binary /home/test_led_boot/test_led_boot.out  /home/test_led_boot/test_led_bo

    The input file format should be elf32-little format (like mySysBiosApp.xa8fg). I suspect test_led_boot.out is not elf32-little format, can you check this?

    Dinesh Dharmik said:
    sudo mkimage -A arm -T kernel  -C none -a 0x80000000 -e 0x80006b10 -d /home/test_led_boot/test_led_boot.bin     /home/test_led_boot/test_led_boot.ub

    You are still using -a 0x80000000, can you comment on that point?? Did you really try with 0x81000000??

    Dinesh Dharmik said:
    cp /home/test_led_boot/test_led_boot.ub   /home/test_led_boot/uImage

    I do not see such command in the wiki, to rename test_led_boot.ub with uImage, can you comment on that point? What makes you think you have to rename this
    out file to linux kernel image??

    Regards,
    Pavel

  • Hi Pavel,

    For elf32-little format.
    I configured Project -> properties -> CCS build -> Device Endianness = little and Output format = eabi(ELF).
    ( is this setting right ? )

    I tried with load address -a 0x81000000 (not mentioned in command but you can check in screen shot ).
    but no output.

    for uImage and boot partition.
    we are using ./mksd-ti814x.sh /dev/sdb MLO u-boot.bin test_led_boot.ub led_boot.tar.gz

    How to decide load address ?

    Regards
    Dinesh
  • Dinesh Dharmik said:
    For elf32-little format.
    I configured Project -> properties -> CCS build -> Device Endianness = little and Output format = eabi(ELF).
    ( is this setting right ? )

    You are still using CCStudio to create your executable, while the wiki page you pointed explains how to run application which is created outside the CCS environment, application created in command line mode with makefile. Can you try this on your side?

    You can also use "file" command to determine file type. For example, in A15GccExample folder (available to download from the wiki page), we have file reentrancyTest.out. When I check it with "file" command, I see it is elf32-little:

    A15GccExample$ file reentrancyTest.out
    reentrancyTest.out: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, not stripped

    Dinesh Dharmik said:
    for uImage and boot partition.
    we are using ./mksd-ti814x.sh /dev/sdb MLO u-boot.bin test_led_boot.ub led_boot.tar.gz

    How to decide load address ?

    You can use the one pointed in the wiki:

    loadaddr 0x81000000


    Regards,
    Pavel

  • Also wiki page state that sysbios.ub should be loaded at 0x81000000, not rename sysbios.ub to uImage, then to load.

    BR
    Pavel
  • Hi,

    We followed given link.

    But, we are getting below error,

    /home/rahul/Desktop/dinesh_boot/ti-ezsdk_dm814x-evm_5_05_02_00/component-sources/xdctools_3_23_03_53/xs --xdcpath="/home/rahul/Desktop/dinesh_boot/ti-ezsdk_dm814x-evm_5_05_02_00/component-sources/bios_6_33_05_46/packages" xdc.tools.configuro -b config.bld -c /home/rahul/TI/CodeSourcery -t ti.targets.arm.elf.A8F -p ti.platforms.evmDM8148 -r release /home/rahul/Desktop/dinesh_boot/A15GccExample/sysbios.cfg
    configuring sysbios.xea8f from package/cfg/sysbios_pea8f.cfg ...
    js: "/home/rahul/Desktop/dinesh_boot/ti-ezsdk_dm814x-evm_5_05_02_00/component-sources/xdctools_3_23_03_53/packages/xdc/cfg/Main.xs", line 156: Error: xdc.cfg.INCOMPATIBLE_TARGET_VERSION: current target 'ti.targets.arm.elf.A8F' [] is not compatible with targets used to build the following packages; package ti.targets.arm.rtsarm [in /home/rahul/Desktop/dinesh_boot/ti-ezsdk_dm814x-evm_5_05_02_00/component-sources/xdctools_3_23_03_53/packages/ti/targets/arm/rtsarm/] was built using 'ti.targets.arm.elf.A8F' [1,0,4.9,0]

    Adding the following line to your program configuration script:
        environment['xdc.cfg.check.fatal'] = 'false';
    converts this incompatibility error into a warning. Please, check the documentation for the package xdc.cfg for more information.
    gmake: *** [package/cfg/sysbios_pea8f.xdl] Error 1
    js: "/home/rahul/Desktop/dinesh_boot/ti-ezsdk_dm814x-evm_5_05_02_00/component-sources/xdctools_3_23_03_53/packages/xdc/tools/Cmdr.xs", line 51: Error: xdc.tools.configuro: configuration failed due to earlier errors (status = 2); 'linker.cmd' deleted.

    Please help,


    Regards

    Dinesh

    neon -mfloat-abi

  • Hi Pavel,

    In make file,

    REENTLIBPATH = $(XDCTOOLS)/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/lib/fpu

    We can not find /libs folder.

    Regards

    Dinesh

  • Hi Pavel

    we are able to run make file successfully. & make file creates reentrancyTest.out file but it doesnt create /reentrancyTest.xa8fg to execute the

    $ ~/gcc-arm-none-eabi-4_7-2013q3/bin/arm-none-eabi-objcopy -I elf32-little -O binary release/mySysBiosApp.xa15fg sysbios.b

    Also when do file reentrancyTest.out we get

    reentrancyTest.out: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, not stripped.

    We followed the steps to convert this to .ub. But this ub application doesnt gave out any printf message we had added in code.

    Can

    /*
     * Copyright (c) 2013, Texas Instruments Incorporated
     * All rights reserved.
     *
     * Redistribution and use in source and binary forms, with or without
     * modification, are permitted provided that the following conditions
     * are met:
     *
     * *  Redistributions of source code must retain the above copyright
     *    notice, this list of conditions and the following disclaimer.
     *
     * *  Redistributions in binary form must reproduce the above copyright
     *    notice, this list of conditions and the following disclaimer in the
     *    documentation and/or other materials provided with the distribution.
     *
     * *  Neither the name of Texas Instruments Incorporated nor the names of
     *    its contributors may be used to endorse or promote products derived
     *    from this software without specific prior written permission.
     *
     * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
     * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
     * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
     * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
     * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
     * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
     * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     */
    /*
     *  ======== StringTokenTest1.c ========
     *  This test case is used to test re-entrancy of libc's strtok function.
     */
    
    #include <string.h>
    
    #include <xdc/std.h>
    #include <xdc/runtime/System.h>
    #include <ti/sysbios/BIOS.h>
    #include <ti/sysbios/knl/Task.h>
    #include <ti/sysbios/hal/Hwi.h>
    #include <stdio.h>
    
    #if defined(gnu_targets_arm_M3)  \
      | defined(gnu_targets_arm_M4)  \
      | defined(gnu_targets_arm_M4F)
    #define INTR   20
    #else
    #define INTR   10 
    #endif
    
    Task_Handle tsk0, tsk1;
    #if 0
    Void myIsr(UArg arg)
    {
        /*
         *  Increase tsk1's priority to force it to preempt tsk0.
         */
        Task_setPri(tsk1, 15);
    }
    
    Void tsk0_func(UArg arg0, UArg arg1)
    {
       char origStr[] = "TEST@STRING@ONE";
       char *newStr;
    
       newStr = strtok(origStr, "@");
       if (strcmp(newStr, "TEST") != 0) {
           System_printf("Error: strtok re-entrancy compromised\n");
           BIOS_exit(1);
       }
       System_printf("Parsed String : %s\n", newStr);
       Hwi_post(INTR);
       newStr = strtok(NULL, "@");
       if (strcmp(newStr, "STRING") != 0) {
           System_printf("Error: strtok re-entrancy compromised\n");
           BIOS_exit(1);
       }
       System_printf("Parsed String : %s\n", newStr);
    }
    
    Void tsk1_func(UArg arg0, UArg arg1)
    {
       char origStr[] = "INVALID1@INVALID2@INVALID3";
       volatile char *newStr;
       volatile char *dummyStr;
    
       newStr = strtok(origStr, "@");
       /* Do this to make sure the call to strtok does not get optimized out */
       dummyStr = newStr;
       newStr = dummyStr;
    }
    
    /*
     *  ======== main ========
     */
    Int main(Int argc, Char* argv[])
    {
        Task_Params params;
        Hwi_Params  hwiParams;
    	
    	printf("Entering main_func().\n");	
        System_printf("Entering main_func().\n");
        Task_Params_init(&params);
        Hwi_Params_init(&hwiParams);
    
        params.priority = 10;
        tsk0 = Task_create(tsk0_func, &params, NULL);
    
        params.priority = 5;
        tsk1 = Task_create(tsk1_func, &params, NULL);
    
        Hwi_create(INTR, myIsr, &hwiParams, NULL);
    
        BIOS_start();
    
        return (0);
    }
    #else
    /*
     *  ======== idle_func ========
     */
    Void idle_func()
    {
        System_printf("Entering idle_func().\n");
        BIOS_exit(0);
    }
    
    
    
    
    int main (void)
    {
    	printf("Entering main_func().\n");
    	System_printf("sys Entering main_func().\n");
    	return 0;
    }
    #endif
    

     you tell us if we are missing anything?


  • Which cross compiler toolchain you are using?

    Note: If you do not have a UART driver in your app and want to get the System_printf() messages, you can use SysMin as the System provider and set SysMin.flushAtExit to false. Once the app completes, you can connect to the board via CCS, load the program symbols and look at ROV SysMin view to read the print messages.

    This could be because semi-hosting does not work when the debugger is connected. Can you comment out the below line in your *.cfg file:
    var SemiHost = xdc.useModule('ti.sysbios.rts.gnu.SemiHostSupport');
     
    You can let the core run for a bit, halt it and look at SysMin buffer in ROV. It shows all the prints. Later, you can plug in your own UART driver so prints go to UART.
     
    ==============================================================================
    The only way to print to terminal without CCS/JTAG that I can think of is if you write a small UART driver function and plug it in as the default putch function that BIOS uses. Here are the changes you would need to make:
     
    Add the following to the *.cfg file:
    var SysCallback = xdc.useModule('xdc.runtime.SysCallback'); // Already present
    SysCallback.putchFxn = "&uartPrintf_putch";                 // Our callback
     
    Next, implement “Void uartPrintf_putch(Char ch)” in C. This function is basically a UART write.



    Regards,
    Pavel

  • I have found also some pages explaining regarding u-boot applications:

    www.denx.de/.../UBootStandalone
    varadgautam.wordpress.com/.../

    Regards,
    Pavel