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.

TMS570LS3137: TMS570LS3137 CAN Bootloader In addition to 3.0 MB on chip flash ,the external 32 MB FLASH can be SPI interface chip or EMIF interface connected externally to TMS570LS3137 .

Part Number: TMS570LS3137
Other Parts Discussed in Thread: HALCOGEN

TMS570LS3137 CAN Bootloader

Micro Board that can hold more than 6MB application , is there any source of CAN Boot loader for TMS570LS3137 that have EMIF FLASH driver integrated , SPI flash driver integrated .

In addition to 3.0 MB on chip flash ,the external 32 MB FLASH can be SPI interface chip or EMIF interface connected externally to TMS570LS3137 .

  • Hello,

    The EMIF driver for external flash (for example NOR flash,) is not integrated into the existing bootloaders, but you can add them quickly. I have a PC example code (VC++) for CAN bootloader, but the code is designed to use NI CAN-USB adaptor. Which adaptor do you use?

  • 2) We are using PEAK PCAN-USB IPEH-002021 (www.peak-system.com/PCAN-USB.199.0.html ) .

    3) I have downloaded Hercules_MCU_Bootloader.zip from http://processors.wiki.ti.com/index.php/TMS570_Hercules_MCU_Bootloader .


    4) Can you help me integrating the TMS570LS3137  "CRC verification" and EMIF driver for external flash we are using S29GL256S 32MB_NOR Flash is not integrated into the existing boot loaders .

    5) On the TMS570LS3137 Flash locations CRC Check module resides from 0x00000000 to 0x00010000 hex  and Boot loader resides from 0x00010000 to 0x00020000 hex . I have to relocate the complete Application firmware to address 0x00020000 to acheive this in the Application link.cmd file I have changed IVT address and flash start address from 0x00000000 to 0x00020000 . But after compilation and linking the .out file still has bytes at locations starting from 0x00000000 to 0x00000130 all other implementations are moved to 0x00020000 .
    Why there are still these IVT or some .obj placed at 0x00000000 to 0x00000130 , How to solve this . Does CCS include intrinsic object files placed at these locations ? where should I find solution .

    6) Our project consists of slave Micro-controller that needs an application update over SPI interface . To achieve this I am using SafetyMCU_Bootloader\TMS570LS31x\boot_can source files that will function as CAN Boot loader to update firmware of TMS570LS3137 , to update the firmware of Slave Micro-Controller over SPI in the TMS570LS3137 Boot loader I have enabled SPI_ENABLE_UPDATE and CAN_ENABLE_UPDATE .
    This way now My code consists of CAN driver to update TMS570LS3137 Application and SPI driver . but In comments I have read One of CAN_ENABLE_UPDATE, SPI_ENABLE_UPDATE should be enabled . Can I enable SPI_ENABLE_UPDATE and CAN_ENABLE_UPDATE what all needs to be taken care to have both CAN , SPI enabled in the downloaded Hercules_MCU_Bootloader.zip from http://processors.wiki.ti.com/index.php/TMS570_Hercules_MCU_Bootloader  .

    7) Can you also please verify the thread https://e2e.ti.com/support/microcontrollers/hercules/f/312/p/526417/1914373
    The thread mentions PLL is not properly initialized in the boot_can of TMS570LS3137 and it causes system hang up when self reset from Application . Can you please let me know what needs to be fixed the Boot_CAN .

    The problem appears when I try to reset the MCU from the application code (writing to SYSECR register bits 15 and 14) or even when I try to reset the
    MCU pulling low the RST pin: it gets stuck in the mapClocks() for the bootloader function systemInit(), all being called by _c_int00(). More
    specifically, in this line:

    8) Can you help me with latest fixed CAN Boot loader for TMS570LS3137 as I see following fix is missed in the Boot Loader I have https://e2e.ti.com/support/microcontrollers/hercules/f/312/t/680543?RM48L950-erasing-flash-sector-0-results-in-a-hang-in-Fapi-BlockErase-

    9) Do you have Boot loader files sys_startup.c , sys_core.asm , sys_intvecs.asm code that switches between 3 interrupt vector tables . One Interrupt vector table is the CRC check Module ( CRC Check module resides from 0x00000000 to 0x00010000 hex ) it verifies CRC of the Application firmware ( 0x00020000 to End ) and also CRC of Boot loader (  Boot loader resides from 0x00000000 to 0x00020000 hex ) else generates an Diagnostic. CRC check module would then handle control to the Boot loader , the Boot loader than loops in wait state if the Application needs to be updated else executes the Application.

  • Hello Chandre,

    2) We are using PEAK PCAN-USB IPEH-002021 (www.peak-system.com/PCAN-USB.199.0.html ) .
    QJW> This is the PC example code (VC++) for CAN bootloader. As I mentioned in my last post, this example uses NI USB-CAN.

    3) Please refer to this post for CRC calculation.
    e2e.ti.com/.../2805284
    4). I posted example code for accessing NOR flash:
    e2e.ti.com/.../2704297
    5). The interrupt table is at 0x00000000, and can not be changed. So the first few words (from 0x00 to 0x1c) are for interrupt table:

    b _c_int00 ;0x00
    undefEntry
    b undefEntry ;0x04;
    svcEntry
    b svcEntry ;0x08, Software interrupt
    prefetchEntry
    b prefetchEntry ;0x0C, Abort (prefetch)
    b _dabort ;0x10, Abort (data)
    reservedEntry
    b reservedEntry ;0x14
    ldr pc,[pc, #-0x1b0] ;0x18
    ldr pc,[pc, #-0x1b0] ;0x1C

    6) you can use either SPI bootloader or CAN bootloader to download the application code to flash, but not both. But you can modify the bootloader to use CAN and SPI to download 2 separate applications.

    7) will update the bootloader code using the latest HALCOGen driver
    8) I will take a look and update the CMD file if needed.
    9) No I don't have this kind of files.
  • Thanks for the Information Provided and I consider line items 2,3,4,5 as resolved .

    Following are yet to be resolved .
    7) will update the boot loader code using the latest HALCOGen driver

    Latest Boot Loader code using Latest HALCOGen Driver

    8) I will take a look and update the CMD file if needed.

    Fix for "erasing flash sector 0 results in a hang in Fapi_BlockErase"

    10) Can the Complete application download to SRAM at once and than write to Flash at once (NO to Brick the board and to avoid failure on Abort condition).

    One New Question is Is there any Constraint for FLASH API that the Crystal Frequency  should run at 160MHZ ?

    Can you provide the Boot loader ( with latest HALCOGen ) and with 180MHz Crystal Frequency as in the current example it is mentioned as 160 MHz Crystal Frequency

    //*****************************************************************************

    //
    // The frequency (MHz) of the crystal used to clock the micro-controller.
    //
    // This defines the crystal frequency used by the micro-controller running the
    // boot loader.

    //*****************************************************************************
    #define CRYSTAL_FREQ 16 //MHz

    #define SYS_CLK_FREQ 160 //MHz

  • 7) will update the boot loader code using the latest HALCOGen driver

    Latest Boot Loader code using Latest HALCOGen Driver

    8) I will take a look and update the CMD file if needed.

    Fix for "erasing flash sector 0 results in a hang in Fapi_BlockErase"

    10) Can the Complete application download to SRAM at once and than write to Flash at once (NO to Brick the board and to avoid failure on Abort condition).

    One New Question is Is there any Constraint for FLASH API that the Crystal Frequency should run at 160MHZ ?

    Can you provide the Boot loader ( with latest HALCOGen ) and with 180MHz Crystal Frequency as in the current example it is mentioned as 160 MHz Crystal Frequency

    //*****************************************************************************

    //
    // The frequency (MHz) of the crystal used to clock the micro-controller.
    //
    // This defines the crystal frequency used by the micro-controller running the
    // boot loader.

    //*****************************************************************************
    #define CRYSTAL_FREQ 16 //MHz

    #define SYS_CLK_FREQ 160 //MHz

    Chandrashekhar Kalvacherla
  • Hello,

    You can use any crystal frequency between 5MHz to 20MHz. The system clock is up to 180MHz. If you use 180MHz as the MCU system clock, you need to use 180MHz when initialize the flash banks:

    Fapi_initializeFlashBanks((uint32_t)180)
  • 7) will update the boot loader code using the latest HALCOGen driver
    8) I will take a look and update the CMD file if needed.

    QJW> As I stated before, I will update the bootloader using the HW drivers from the latest HALCoGen. But will not complete until 2Q2019.


    Fix for "erasing flash sector 0 results in a hang in Fapi_BlockErase"
    QJW> Very careful to erase the sector 0 of bank 0 since it contains the interrupt vector table. Before issuing erasing command, please disable all the interrupt in your application.

    10) Can the Complete application download to SRAM at once and than write to Flash at once (NO to Brick the board and to avoid failure on Abort condition).
    QJW> Yes, you can download the whole application to SRAM, them program them to flash. But we don't think kind of example.