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.

evmOMAPL138板子使用startware的bootloader问题

我选择用SPI flash来进行boot,可是编译工程的时候提示undefined symbol BlPlatformSPIImageCopy

整个startware包里面找过了都没有这个这个函数的定义。我该怎么做才能解决这个问题?

  • 是编译的哪个工程?

  • StarterWare目录下的bootloader

  • 工程路径:

    C:\ti\OMAPL138_StarterWare_1_10_03_03\build\armv5\cgt_ccs\omapl138\evmOMAPL138\bootloader

    编译结果:我咋没看到编译信息里提到你说的函数:

    **** Clean-only build of configuration Debug for project bootloader_armv5_omapl138_evmOMAPL138 ****

    "C:\\ti\\ccsv6\\utils\\bin\\gmake" -k clean
    DEL /F "boot.out"
    Could Not Find C:\ti\OMAPL138_StarterWare_1_10_03_03\build\armv5\cgt_ccs\omapl138\evmOMAPL138\bootloader\Debug\boot.out
    DEL /F "bl_copy_rprc.pp" "bl_main.pp" "bl_platform.pp" "bl_spi.pp"
    Could Not Find C:\ti\OMAPL138_StarterWare_1_10_03_03\build\armv5\cgt_ccs\omapl138\evmOMAPL138\bootloader\Debug\bl_copy_rprc.pp
    DEL /F "bl_copy_rprc.obj" "bl_main.obj" "bl_platform.obj" "bl_spi.obj"
    Could Not Find C:\ti\OMAPL138_StarterWare_1_10_03_03\build\armv5\cgt_ccs\omapl138\evmOMAPL138\bootloader\Debug\bl_copy_rprc.obj
    'Finished clean'
    ' '

    **** Build Finished ****

    **** Build of configuration Debug for project bootloader_armv5_omapl138_evmOMAPL138 ****

    "C:\\ti\\ccsv6\\utils\\bin\\gmake" -k all
    'Building file: C:/ti/OMAPL138_StarterWare_1_10_03_03/bootloader/src/bl_copy_rprc.c'
    'Invoking: TMS470 Compiler'
    "C:/ti/ccsv6/tools/compiler/ti-cgt-arm_15.12.1.LTS/bin/armcl" -mv5e -g --define=omapl138 --define=evmOMAPL138 --define=SPI --define=RPRC_IMAGE --include_path="C:/ti/ccsv6/tools/compiler/ti-cgt-arm_15.12.1.LTS/include" --include_path="../../../../../../../include" --include_path="../../../../../../../bootloader/include" --include_path="../../../../../../../bootloader/include/evmOMAPL138" --include_path="../../../../../../../include/hw" --include_path="../../../../../../../include/armv5" --include_path="../../../../../../../include/armv5/omapl138" --include_path="../../../../../../../grlib/include" --include_path="../../../../../../../usblib/include" --include_path="../../../../../../../ipclite/include" --include_path="../../../../../../../nandlib/include" --diag_warning=225 -me --abi=eabi --code_state=32 --preproc_with_compile --preproc_dependency="bl_copy_rprc.pp" "C:/ti/OMAPL138_StarterWare_1_10_03_03/bootloader/src/bl_copy_rprc.c"
    'Finished building: C:/ti/OMAPL138_StarterWare_1_10_03_03/bootloader/src/bl_copy_rprc.c'
    ' '
    'Building file: C:/ti/OMAPL138_StarterWare_1_10_03_03/bootloader/src/bl_main.c'
    'Invoking: TMS470 Compiler'
    "C:/ti/ccsv6/tools/compiler/ti-cgt-arm_15.12.1.LTS/bin/armcl" -mv5e -g --define=omapl138 --define=evmOMAPL138 --define=SPI --define=RPRC_IMAGE --include_path="C:/ti/ccsv6/tools/compiler/ti-cgt-arm_15.12.1.LTS/include" --include_path="../../../../../../../include" --include_path="../../../../../../../bootloader/include" --include_path="../../../../../../../bootloader/include/evmOMAPL138" --include_path="../../../../../../../include/hw" --include_path="../../../../../../../include/armv5" --include_path="../../../../../../../include/armv5/omapl138" --include_path="../../../../../../../grlib/include" --include_path="../../../../../../../usblib/include" --include_path="../../../../../../../ipclite/include" --include_path="../../../../../../../nandlib/include" --diag_warning=225 -me --abi=eabi --code_state=32 --preproc_with_compile --preproc_dependency="bl_main.pp" "C:/ti/OMAPL138_StarterWare_1_10_03_03/bootloader/src/bl_main.c"
    'Finished building: C:/ti/OMAPL138_StarterWare_1_10_03_03/bootloader/src/bl_main.c'
    ' '
    'Building file: C:/ti/OMAPL138_StarterWare_1_10_03_03/bootloader/src/evmOMAPL138/bl_platform.c'
    'Invoking: TMS470 Compiler'
    "C:/ti/ccsv6/tools/compiler/ti-cgt-arm_15.12.1.LTS/bin/armcl" -mv5e -g --define=omapl138 --define=evmOMAPL138 --define=SPI --define=RPRC_IMAGE --include_path="C:/ti/ccsv6/tools/compiler/ti-cgt-arm_15.12.1.LTS/include" --include_path="../../../../../../../include" --include_path="../../../../../../../bootloader/include" --include_path="../../../../../../../bootloader/include/evmOMAPL138" --include_path="../../../../../../../include/hw" --include_path="../../../../../../../include/armv5" --include_path="../../../../../../../include/armv5/omapl138" --include_path="../../../../../../../grlib/include" --include_path="../../../../../../../usblib/include" --include_path="../../../../../../../ipclite/include" --include_path="../../../../../../../nandlib/include" --diag_warning=225 -me --abi=eabi --code_state=32 --preproc_with_compile --preproc_dependency="bl_platform.pp" "C:/ti/OMAPL138_StarterWare_1_10_03_03/bootloader/src/evmOMAPL138/bl_platform.c"
    'Finished building: C:/ti/OMAPL138_StarterWare_1_10_03_03/bootloader/src/evmOMAPL138/bl_platform.c'
    ' '
    'Building file: C:/ti/OMAPL138_StarterWare_1_10_03_03/bootloader/src/bl_spi.c'
    'Invoking: TMS470 Compiler'
    "C:/ti/ccsv6/tools/compiler/ti-cgt-arm_15.12.1.LTS/bin/armcl" -mv5e -g --define=omapl138 --define=evmOMAPL138 --define=SPI --define=RPRC_IMAGE --include_path="C:/ti/ccsv6/tools/compiler/ti-cgt-arm_15.12.1.LTS/include" --include_path="../../../../../../../include" --include_path="../../../../../../../bootloader/include" --include_path="../../../../../../../bootloader/include/evmOMAPL138" --include_path="../../../../../../../include/hw" --include_path="../../../../../../../include/armv5" --include_path="../../../../../../../include/armv5/omapl138" --include_path="../../../../../../../grlib/include" --include_path="../../../../../../../usblib/include" --include_path="../../../../../../../ipclite/include" --include_path="../../../../../../../nandlib/include" --diag_warning=225 -me --abi=eabi --code_state=32 --preproc_with_compile --preproc_dependency="bl_spi.pp" "C:/ti/OMAPL138_StarterWare_1_10_03_03/bootloader/src/bl_spi.c"
    'Finished building: C:/ti/OMAPL138_StarterWare_1_10_03_03/bootloader/src/bl_spi.c'
    ' '
    'Building target: boot.out'
    'Invoking: TMS470 Linker'
    "C:/ti/ccsv6/tools/compiler/ti-cgt-arm_15.12.1.LTS/bin/armcl" -mv5e -g --define=omapl138 --define=evmOMAPL138 --define=SPI --define=RPRC_IMAGE --diag_warning=225 -me --abi=eabi --code_state=32 -z -m"bootloader_armv5_omapl138_evmOMAPL138.map" --warn_sections -i"C:/ti/ccsv6/tools/compiler/ti-cgt-arm_15.12.1.LTS/lib" -i"C:/ti/ccsv6/tools/compiler/ti-cgt-arm_15.12.1.LTS/include" -i"../../../../../../../binary/armv5/cgt_ccs/omapl138/drivers/Debug" -i"../../../../../../../binary/armv5/cgt_ccs/omapl138/evmOMAPL138/platform/Debug" -i"../../../../../../../binary/armv5/cgt_ccs/omapl138/system_config/Debug" -i"../../../../../../../binary/armv5/cgt_ccs/omapl138/ipclib/Debug" -i"../../../../../../../binary/armv5/cgt_ccs/omapl138/usblib/Debug" -i"../../../../../../../binary/armv5/cgt_ccs/utils/Debug" -i"../../../../../../../binary/armv5/cgt_ccs/grlib/Debug" -i"../../../../../../../binary/armv5/cgt_ccs/nandlib/Debug" --reread_libs --xml_link_info="boot_linkInfo.xml" --rom_model -o "boot.out" "./bl_copy_rprc.obj" "./bl_main.obj" "./bl_platform.obj" "./bl_spi.obj" "../boot.cmd" -l"libc.a" -ldrivers.lib -lutils.lib -lplatform.lib -lsystem_config.lib
    <Linking>
    warning: entry-point symbol other than "_c_int00" specified: "Entry"
    'Finished building target: boot.out'
    ' '
    A subdirectory or file ..\..\..\..\..\..\..\binary\armv5\cgt_ccs\omapl138\evmOMAPL138\bootloader\Debug already exists.
    boot.out
    1 file(s) copied.
    ' '

    **** Build Finished ****

    spi flash copy的函数如下。你的starterware是不是用的别人改过的啊

    #if defined(SPI)
    static unsigned int SPIBootCopy(void)
    {
    BL_SPI_Header spiBootHeader;
    rprcFileHeader rprcHeader;
    rprcSectionHeader section;
    int offset = IMAGE_OFFSET;
    int sectionCount;

    /* Spi Initialization */
    BL_PLATFORM_SPISetup();
    BL_SPI_Configure();

    // check magic number and read image size from SPI header
    SPI_readBytes(&spiBootHeader, &offset, sizeof(spiBootHeader));
    if ((spiBootHeader.magicNum != MAGIC_NUM_SF) &&
    (spiBootHeader.magicNum != MAGIC_NUM_GF))
    {
    UARTPuts("Invalid magic number in boot image\r\n", -1);
    BootAbort();
    }

    // read application image header
    SPI_readBytes(&rprcHeader, &offset, sizeof(rprcFileHeader));

    // check magic number
    if (rprcHeader.magic != RPRC_MAGIC_NUMBER)
    {
    UARTPuts("Invalid magic number in boot image\r\n", -1);
    BootAbort();
    }
    else if ( 4 < rprcHeader.text_len)
    {
    UARTPuts("WARNING: RPRC Boot image header has larger text section than expected.\r\n", -1);
    }
    else if ( 4 > rprcHeader.text_len)
    {
    UARTPuts("ERROR: RPRC Boot image header is malformed.\r\n", -1);
    BootAbort();
    }

    /* Get loadable section count */
    SPI_readBytes(&sectionCount, &offset, 4);

    /* Skip over any remaining text header */
    offset += (rprcHeader.text_len - 4);

    /* Read entrypoint(s) and copy sections to memory */
    while (sectionCount> 0)
    {
    /* Read new section header */
    SPI_readBytes(&section, &offset, sizeof(rprcSectionHeader));

    if (section.type == RPRC_RESOURCE)
    {
    /* check that resource has BOOTADDR type (ignore other resources) */
    SPI_readBytes(&section.type, &offset, sizeof(int));
    if (section.type == RPRC_BOOTADDR)
    {
    if (entryPoint == 0)
    entryPoint = section.addr;
    else if (DspEntryPoint == 0)
    DspEntryPoint = section.addr;
    else
    UARTPuts("Ignoring extra entrypoint in boot image\r\n", -1);
    }

    /* Skip the rest of the resource section */
    offset += section.size - sizeof(int);
    }
    else
    {
    /* Copy section to memory */
    SPI_readBytes((void *)section.addr, &offset, section.size);
    --sectionCount;
    }
    }

    return E_PASS;
    }

  • 能不能给我看下你的工程Properties里面的build->C6000 Compiler->Predefined Symbols里面都预定义了什么??

    我这边装的starterware里的工程都不能正常打开

  • 终于可以编译通过了。3Q

    还有一个问题,我的板子是logicPD的evmOMAPL138,然后我想通过sfh工具烧写程序。将S7的5:8设为了0101,然后已经链接上串口,给板子重新上电还是没收到BOOTME

  • 自己连上仿真器通过寄存器看是不是UART boot模式,主机UART baud rate设的对不对,无非就是这些东西。

  • 您好:请问

    1.这个startware bootloader 工程就是烧写在arm rom中的bootrom 的源代码吗?如果不是拿这个工程的作用是什么?

    2.该工程中的RPRC IMAGE 的magic num是0x43525052,这个跟AIS 的magic num 不一样,就是说该工程不能加载AIS 镜像?

    3.看到网上资料说 bootloader包括了 RBL、UBL和u-boot ,请问这些boot函数都是通用的吗?不在乎加载的操作系统镜像是什么?请问哪里可以看这些boot函数源代码? 

  • #1. 这个不是烧写在ROM中的源代码,这是一个二级boot的例子。类似于UBL之类的。它的作用仅仅是一个例子。不是必需的,也可以说不是必要的。我就几乎没看过这个工程。我也很少见别人用这个工程。它应该是结合tools目录下的ti_image和flash_writer来使用的。用ti_image打包你的应用程序成这个bootloader可识别的格式,并用flash_writer写到相应的偏移地址,这样这个bootlaoder才能从这个地址去读image,并解析它。

    #2. 这个magic number应该是跟ti_image相关了。

    #3. bootloader是个概念,只要是功能上是为了boot,都叫bootloader,RBL只芯片ROM里的bootloader,UBL指user bootloader,可以称之为second bootloader,之所以有UBL存在的必要,因为ROM本身不会去初始化PLL, DDR等,如果代码过大需要放到DDR上,则需要启动运行一个程序来初始化它,再搬移真正的应用代码到相应的位置运行,这个程序除了初始化,和搬代码,一般也不需要其它功能,所以俗称之为second bootloader.

    当然在L138上,RBL支持AIS,可以在AIS里传配置给RBL里的初始化函数,UBL也是可以不要的了。

    UBOOT则功能上更宽一些了,其主要目的是用来启动Linux,也有其它操作系统也借用UBOOT来启动,其目的不在于启动芯片这个层面了,UBOOT里支持各种接口如UART, 网口,USB等,其本身几经比普通的应用程序都要复杂而强大了。