TI E2E™ 设计支持论坛将于 5 月 30 日至 6 月 1 日进行维护。如果您在此期间需要技术支持,请联系 TI 的客户支持中心寻求帮助。

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.

TMS570ls0714 Bootloader CMD分区问题

Other Parts Discussed in Thread: TMS570LS0714

对TMS570ls0714的APP程序默认的CMD文件代码如下:

MEMORY
{
VECTORS (X) : origin= 0x00000000  length=0x00000020
FLASH0 (RX)   : origin= 0x00000020  length=0x00BFFE0
STACKS (RW) : origin= 0x08000000  length=0x00001500
RAM (RW)        : origin= 0x08001500  length=0x0002eb00

/* USER CODE BEGIN (2) */

/* USER CODE END */
}

/* USER CODE BEGIN (3) */
/* USER CODE END */


/*----------------------------------------------------------------------------*/
/* Section Configuration */

SECTIONS
{
.intvecs : {} > VECTORS
.text : {} > FLASH0 
.const : {} > FLASH0 
.cinit : {} > FLASH0
.pinit : {} > FLASH0 
.bss : {} > RAM
.data : {} > RAM
.sysmem : {} > RAM

FEE_TEXT_SECTION : {} > FLASH0 
FEE_CONST_SECTION : {} > FLASH0
FEE_DATA_SECTION : {} > RAM

/* USER CODE BEGIN (4) */
/* USER CODE END */

进行Bootloader分区代码如下:

MEMORY
{
VECTORS (X) : origin= 0x00020000  length=0x00000020
FLASH1 (RX)   : origin= 0x00020020  length=0x0009FFE0
STACKS (RW) : origin= 0x08000000  length=0x00001500
RAM (RW)        : origin= 0x08001500  length=0x0002eb00

/* USER CODE BEGIN (2) */

/* USER CODE END */
}

/* USER CODE BEGIN (3) */
/* USER CODE END */


/*----------------------------------------------------------------------------*/
/* Section Configuration */

SECTIONS
{
.intvecs : {} > VECTORS
.text : {} > FLASH1
.const : {} > FLASH1
.cinit : {} > FLASH1
.pinit : {} > FLASH1
.bss : {} > RAM
.data : {} > RAM
.sysmem : {} > RAM

FEE_TEXT_SECTION : {} > FLASH1
FEE_CONST_SECTION : {} > FLASH1
FEE_DATA_SECTION : {} > RAM

/* USER CODE BEGIN (4) */
/* USER CODE END */

只对APP程序编译后,将APP程序下载至Flash出现terminate按钮,resume一直为灰色,程序无法运行。分区未超限,请问这是什么原因?

  • APP程序除了设置cmd分区外,还需要进行其他设置吗?

  • 怎么就没人呢?

  • Hi xing sun,

    你要实现什么功能?

    如果是实现Bootloader的话,bootloader程序的起始地址应为0x00000000,应用程序的起始地址应与bootloader工程里bl_config.h中APP_START_ADDRESS的地址保持一致。例如bootloader程序里bl_config.h中定义#define APP_START_ADDRESS       0x00020000, APP程序的CMD文件VECTORS起始地址即为0x00020000,则VECTORS (X) : origin= 0x00020000  length=0x00000020

    如果你只是调试运行APP应用程序,其起始地址应为0x00000000,即APP程序的CMD文件应为:VECTORS (X) : origin= 0x00000000  length=0x00000020

  • 你好,我现在想用Hercules TMS570LS31x的UART Bootloader下载应用程序到TMS570LS3137HDK中,根据bl_config.h中定义#define APP_START_ADDRESS       0x00020000,我把应用程序CMD文件VECTORS起始地址改为0x00020000,生成应用程序bin文件成功下载到板子中,但是应用程序好像不能正常运行,因为看不到程序运行的现象,而且一运行程序nerror引脚上的红色LED灯D1亮起,目测感觉是是存储空间分配的问题,我把bootloader 的CMD,应用程序原来的CMD和应用程序修改后的CMD贴上来,您能帮我看下吗?非常感谢!

    UART bootloader CMD:

    --retain="*(.intvecs)"


    MEMORY
    {
        VECTORS    (X)   : origin=0x00000000 length=0x00000020
        FLASH_API  (RX)  : origin=0x00000020 length=0x000014E0
        FLASH0     (RX)  : origin=0x00001500 length=0x002FEB00   //LS31x and RM48 Flash size is 0x300000
        SRAM       (RW)  : origin=0x08002000 length=0x0002D000
        STACK      (RW)  : origin=0x08000000 length=0x00002000
    }
    SECTIONS
    {
       .intvecs : {} > VECTORS
       flashAPI :
       {
         Fapi_UserDefinedFunctions.obj (.text)
         bl_flash.obj (.text)
         --library=..\lib\F021_API_CortexR4_BE.lib (.text)
       } load = FLASH_API, run = SRAM, LOAD_START(api_load), RUN_START(api_run), SIZE(api_size)

       .text  > FLASH0
       .const > FLASH0
       .cinit > FLASH0
       .pinit > FLASH0
       .data  > SRAM
       .bss   > SRAM
    }

    应用程序原来的CMD:

    /*----------------------------------------------------------------------------*/
    /* sys_link.cmd                                                               */
    /*                                                                            */
    /*
    * Copyright (C) 2009-2016 Texas Instruments Incorporated - www.ti.com
    *
    *
    *  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.
    *
    */

    /*                                                                            */
    /*----------------------------------------------------------------------------*/
    /* USER CODE BEGIN (0) */
    /* USER CODE END */


    /*----------------------------------------------------------------------------*/
    /* Linker Settings                                                            */

    --retain="*(.intvecs)"

    /* USER CODE BEGIN (1) */
    /* USER CODE END */

    /*----------------------------------------------------------------------------*/
    /* Memory Map                                                                 */

    MEMORY
    {
        VECTORS (X)  : origin=0x00000000 length=0x00000020
        FLASH0  (RX) : origin=0x00000020 length=0x0017FFE0
        FLASH1  (RX) : origin=0x00180000 length=0x00180000
        STACKS  (RW) : origin=0x08000000 length=0x00001500
        RAM     (RW) : origin=0x08001500 length=0x0003EB00

    /* USER CODE BEGIN (2) */
    /* USER CODE END */
    }

    /* USER CODE BEGIN (3) */
    /* USER CODE END */


    /*----------------------------------------------------------------------------*/
    /* Section Configuration                                                      */

    SECTIONS
    {
        .intvecs : {} > VECTORS
        .text    : {} > FLASH0 | FLASH1               //这里FLASH0 | FLASH1是什么意思?
        .const   : {} > FLASH0 | FLASH1
        .cinit   : {} > FLASH0 | FLASH1
        .pinit   : {} > FLASH0 | FLASH1
        .bss     : {} > RAM
        .data    : {} > RAM
     .sysmem  : {} > RAM
     

    /* USER CODE BEGIN (4) */
    /* USER CODE END */
    }

    /* USER CODE BEGIN (5) */
    /* USER CODE END */


    /*----------------------------------------------------------------------------*/
    /* Misc                                                                       */

    /* USER CODE BEGIN (6) */
    /* USER CODE END */
    /*----------------------------------------------------------------------------*/

     

    应用程序用bootloader下载时修改后的CMD:

    /*----------------------------------------------------------------------------*/
    /* sys_link.cmd                                                               */
    /*                                                                            */
    /*
    * Copyright (C) 2009-2016 Texas Instruments Incorporated - www.ti.com
    *
    *
    *  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.
    *
    */

    /*                                                                            */
    /*----------------------------------------------------------------------------*/
    /* USER CODE BEGIN (0) */
    /* USER CODE END */


    /*----------------------------------------------------------------------------*/
    /* Linker Settings                                                            */

    --retain="*(.intvecs)"

    /* USER CODE BEGIN (1) */
    /* USER CODE END */

    /*----------------------------------------------------------------------------*/
    /* Memory Map                                                                 */

    MEMORY
    {
        VECTORS (X)  : origin=0x00020000 length=0x00000020
        //FLASH0  (RX) : origin=0x00000020 length=0x0017FFE0
        FLASH1  (RX) : origin=0x00020020 length=0x0017FFE0
        STACKS  (RW) : origin=0x08000000 length=0x00001500
        RAM     (RW) : origin=0x08001500 length=0x0003EB00

    /* USER CODE BEGIN (2) */
    /* USER CODE END */
    }

    /* USER CODE BEGIN (3) */
    /* USER CODE END */


    /*----------------------------------------------------------------------------*/
    /* Section Configuration                                                      */

    SECTIONS
    {
        .intvecs : {} > VECTORS
        .text    : {} > FLASH1
        .const   : {} > FLASH1
        .cinit   : {} > FLASH1
        .pinit   : {} > FLASH1
        .bss     : {} > RAM
        .data    : {} > RAM
     .sysmem  : {} > RAM
     

    /* USER CODE BEGIN (4) */
    /* USER CODE END */
    }

    /* USER CODE BEGIN (5) */
    /* USER CODE END */


    /*----------------------------------------------------------------------------*/
    /* Misc                                                                       */

    /* USER CODE BEGIN (6) */
    /* USER CODE END */
    /*----------------------------------------------------------------------------*/

  • Hi Hongke,

    1. 先建立Uart_Bootloader工程,然后根据bl_config.h中定义#define APP_START_ADDRESS       0x00020000来设定应用程序CMD文件VECTORS起始地址,这一步是正确的;

    2. 对于Hercules TMS570LS31x,你需要看一下对应datasheet里的Flash Memory的章节,TMS570LS31x的Flash中的BANK0,BANK1分别对应于CMD文件中的FLASH0,FLASH1。其中FLASH1的起始地址应为0x0018 0000,明显,你上面的定义的FLASH1的地址空间是有误的。

    3. 你也可以在你的应用程序项目中生成的.map文件里查询你的memory的使用情况,核实一下你的memory配置是否正确。