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 application problem

Other Parts Discussed in Thread: TMS570LS0714

Hi, 

I am working on Tms570ls0714 Uart Bootloader application,But I have some problems about the sys_link.cmd file

The original code of sys_link.cmd  file as follows:

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 */

After the flash partition code is as follows:

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 */

The program is compiled and downloaded to Flash,But The debug window only appears terminate button,resume button has been a gray. The program does not run properly.What is the reason?

  • Are you trying to debug an application code or the bootloader? The bootloader must be programmed into the device with its copy of the vectors at location 0. By default, when you load another program with CCS, it will erase all flash sectors. That can be changed in CCS using the Tools ->On-chip Flash settings:

  • Hi Bob
    I know that the bootloader must be programmed into the device with its copy of the vectors at location 0.
    But I'm try to debug an application code without the bootloader.The application resides at 0x00020000.
    After downloaded the application code to Flash, the debug window only appears terminate button,resume button has been a gray.
  • Hi Sam,

    Sorry, I guess I did not make my point well. The application code cannot load and run without a proper reset vector at location 0. You have three options.

    1. Debug the application code using the original link command file (with vectors at address 0). Then relink with vectors at address 0x20000 when you have a bootloader programmed at location 0.

    2. Add a dummy bootloader to you application code at location 0, that just jumps each vector to your application vectors starting at location 0x20000.

    3. Disable the "Auto Run and Launch" options of CCS.

    I don't like this third option because you will run into problems if you have a reset, an abort or an interrupt while debugging your application code.

  • Hi Bob,

    According to your suggestion I have configured it accordingly . At first I downloaded the bootloader  program with vectors at address 0.Then download the application code to the  address 0x20000. I can view the application data in the  address 0x20000.

    But The following error occurs when the bootloader program jumps to the address 0x20000.

  • I am actually on holiday this week, so I will not be able to respond very often.

    The fact that the PC is in the prefetch abort routine means that it tried to execute a bad instruction. What is the contents of the LR? This should help point to the offending instruction. Some things to think about: 1) did the bootloader enable ECC? If so, does the application code have proper ECC programmed. 2) Was the bootloader in 32-bit ARM mode when it transferred to the application code? (or did it do a bx instruction to address 0x2000 which should put it in ARM mode?) The reset vectors on the TMS570 devices are 32-bit ARM instructions (not Thumb2).