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.

Compiler/TMS570LC4357: Boot loader LC43x

Part Number: TMS570LC4357


Tool/software: TI C/C++ Compiler

my question: my device is tms570LC43x ,and The bootloader is programmed in the 1st flash sector, and the application is programmed at the 1st sector of bank1,if the application occur an inturrupt,how to jump the right entry to run The interrupt response program.

Is there an example project (application)for the tms570LC43x?

my bootloader is the following example,/cfs-file/__key/communityserver-discussions-components-files/312/0245.TMS570LC4357_5F00_UART_5F00_Boot.7z  and the application in the example is only  a binary file ,i run my own application and config the cmd file in the  following way :


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

--retain="*(.intvecs)"

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

MEMORY
{
/* USER CODE BEGIN (2) */
/* USER CODE END */
VECTORS (X) : origin=0x00200100 length=0x00000020
FLASH1 (RX) : origin=0x00200120 length=0x001FFFE0
STACKS (RW) : origin=0x08000000 length=0x00001500
RAM (RW) : origin=0x08001500 length=0x0007EB00

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


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

SECTIONS
{

.intvecs : {} > VECTORS
.text align(8) : {} > FLASH1
.const align(8) : {} > FLASH1
.cinit align(8) : {} > FLASH1
.pinit align(8) : {} > FLASH1
.bss : {} > RAM
.data : {} > RAM
.sysmem : {} > RAM


}

  • Hello,

    You need to modify the sys_intvecs.asm to tell the CPU where is the ISR. For your application:

    ;-------------------------------------------------------------------------------
    ; interrupt vectors
    ; Please change the #0x???? for your specified image location defined in bl_config.h

    b _c_int00
    b #0x200F8 ; 0x200F8=$20100-0x8; 0x20100 is the application start addr
    b #0x200F8 ; Software interrupt
    b #0x200F8 ; Abort (prefetch)
    b #0x200F8 ;, Abort (data)
    reservedEntry
    b reservedEntry
    ldr pc,[pc, #-0x1b0] ; IRQ
    ldr pc,[pc, #-0x1b0] ; FIQ
  • Hello QJ Wang,

    Thank you very much for your reply,I modify the sys_intvecs.asm in my application project   as you suggested,and find a strange phenomenon:when the application run the first time,it loads the right address of ISR from interrupt vector table ,but after reset ,the cpu load the address of ISR from interrupt vector table which defined by the BootLoader program instead of application program;

    I know that  “ldr pc,[pc, #-0x1b0] ; IRQ” means to load the address (0xFFFFFE70) which stored in the RQVECREG to PC  ,so I don' t know the diffrent between your sys_intvecs.asm whit default  sys_intvecs.asm about the ISR address ,and the running resault are the same when i use the default sys_intvecs.asm ;

    I find another question  in your BootLoader:the Fapi_BlockProgram()  flash API don't  work normally , There will be some bit errors when write data to flash .Let's say I write 0x2043BC, and it turns out to be 0X2043EC,and i use Flash_Program_Check() compare the date before and after , andthe check resault is fault also.

     Is there any example of application project which use BootLoader to update ?That would be very helpful!Thank you! 

    Fllowing is my sys_intvecs.asm,my application image is located in 0X200100:


    .sect ".intvecs"
    .arm

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

    .ref _c_int00
    .ref phantomInterrupt
    .def resetEntry

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

      resetEntry

    b _c_int00
    b #0x2000F8 ; 0x2000F8=$200100-0x8; 0x200100 is the application start addr
    b #0x2000F8 ; Software interrupt
    b #0x2000F8 ; Abort (prefetch)
    b #0x2000F8 ;, Abort (data)

    reservedEntry

    b reservedEntry
    ldr pc,[pc, #-0x1b0] ; IRQ
    ldr pc,[pc, #-0x1b0] ; FIQ

  • Hello QJWang,
    I have solved one problem,I find that it‘s not the sys_intvecs.asm that tell the application where is the ISR but the function vimInit() in the _c_int00 that Initialize the interrupt vector table.
    Next I want to solve the problem of flash writing errors,I hope you can give me some advice,Thank you !
  • Hello QJ Wang,

    Fllowing is my application project ,because the application can' t find ISR after reset,so I added the vimInit() in the main() to initialize the interrupt vector table again ,There's one more thing to be said that the BootLoader should disable the interrupt before jump to the application.7824.RTI_LED_TOGGLE.zip

  • Hello,

    I am sorry for late reply. Changing the sys_intvecs.asm tells the CPU to jump to application's interrupt table whenever the exception occurs. For example, if a data abort occurs when executing your application, the code will jump to 0x00000010 (data abort, sys_intvecs.asm of bootloader). If you use the original file, the code will jump to your abort handler define din bootloader. If you change the my example, the code jumps to 0x00000010, then jump to application data abort address of interrupt vector for application, then jump to the data abort handler in your application code.

    The data issue in flash may be caused by the ECC error, it might also be caused by the cache memory.

    I have an UART bootloader example for TMS570LS43x and posted onto E2E. In this example, the application is located in 2nd flash bank, and bootloader is executed in flash rather than SRAM.

    e2e.ti.com/.../2605850