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.

TMS570LS1227: cmd file for Bootloader and Application Code

Part Number: TMS570LS1227


Device is TMS570LS1227

Need to know the contents of cmd file in Bootloader code and Application Code. How the partition should be done for Vectors and rest of the sections.

My Application code location has to be at 0x40000 location

  • If you place the bootloader at the very beginning of the flash (0x00000000), the VECTORS is:

        VECTORS    (X)   : origin=0x00000000 length=0x00000020

        FLASH0 (RX) : origin=0x00000020 length=0x00140000-0x20


    If the Application is at 0x40000 (not the application program status used in my bootloader example)

           VECTORS    (X)   : origin=0x00040000 length=0x00000020

           FLASH0     (RX)  : origin=0x00040020 length=0x140000-0x40020

  • In Application cmd file if the above address are used, the application doest not run.

    the lauchpad turns fulltime ON and program is not debuggable. 

    are there any other changes required elsewhere like  interrupt vector file (sys_intvecs.asm). Should it be same in both the cases?

  • The bootloader is a simple project and should be bug-free, so I'd like to change the exception table at 0x00000000.

    This means that the exception table in bootloader sys_intvecs.asm is changed to:

    b _c_int00
    b 0x20000-0x08   ;;undefEntry
    b  0x20000-0x08  ;;svcEntry
    b 0x20000-0x8     ;;prefetchEntry
    b 0x20000-0x8     ;;prefetchEntry
    b 0x20000-0x8     ;;_dabort
    b phantomInterrupt
    ldr pc,[pc,#-0x1b0]
    ldr pc,[pc,#-0x1b0]

    The exception for example data abort will be handled in application instead of bootloader.

  • If your Application status is programmed to 0x40000, and Application image is programmed to 0x400x0, the CMD file needs to be changed to:

           VECTORS    (X)   : origin=0x000400x0 length=0x00000020

           FLASH0     (RX)  : origin=0x000400y0 length=0x140000-0x400y0

  • If I write this in sys_intvecs.asm of bootloader 

    it gives me illegal operand error 

  • MEMORY
    {
    VECTORS (X) : origin=0x00020000 length=0x00000020
    FLASH0 (RX) : origin=0x00020020 length=0x0011ffe0
    STACKS (RW) : origin=0x08000000 length=0x00001500
    RAM (RW) : origin=0x08001500 length=0x0002EB00

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

    Is this fine for my Application if it is to be at 0x00020000 location

  • MEMORY
    {
    VECTORS (X) : origin=0x00020000 length=0x00000020
    FLASH0 (RX) : origin=0x00020020 length=0x0011ffE0
    STACKS (RW) : origin=0x08000000 length=0x00001500
    RAM (RW) : origin=0x08001500 length=0x0002EB00

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

    the lauchpad turns fulltime ON and program is not debuggable for this address as you said.

  • please post your bootloader source code

  • any secured channel for sharing it ?

  • Hi Lokesh,

    Just read your Bootloader sys_intvecs.asm

    .sect ".intvecs"
    .arm

    ;-------------------------------------------------------------------------------
    ; import reference for interrupt routines

    .ref _c_int00
    .ref _dabort
    .ref phantomInterrupt
    .def resetEntry

    ;-------------------------------------------------------------------------------
    ; interrupt vectors

    resetEntry
        b _c_int00
    undefEntry
        b undefEntry
    svcEntry
        b svcEntry
    prefetchEntry
        b prefetchEntry
        b _dabort
        b phantomInterrupt
        ldr pc,[pc,#-0x1b0]
        ldr pc,[pc,#-0x1b0]

    The bootloader is a small piece of code, and should be tested comprehensively, and bug free. So I'd like to put all the exception handlers to Application:

    so I change the exception vector to:

    b _c_int00
    b 0x20000-0x08   ;;undefEntry
    b  0x20000-0x08  ;;svcEntry
    b 0x20000-0x8     ;;prefetchEntry
    b 0x20000-0x8     ;;prefetchEntry
    b 0x20000-0x8     ;;_dabort
    b phantomInterrupt
    ldr pc,[pc,#-0x1b0]
    ldr pc,[pc,#-0x1b0]