Infineon TLE984 Series Firmware User Manual

Infineon TLE984 Series Firmware User Manual

Microcontroller with lin and power switches for automotive applications
Table of Contents

Advertisement

Quick Links

TLE984x
Microcontroller with LIN and Power Switches for
Automotive Applications
Firmware User Manual (AE-step)
Revision 1.02
2019-04-24
Automotive Power

Advertisement

Table of Contents
loading

Summary of Contents for Infineon TLE984 Series

  • Page 1 TLE984x Microcontroller with LIN and Power Switches for Automotive Applications Firmware User Manual (AE-step) Revision 1.02 2019-04-24 Automotive Power...
  • Page 2 TLE984x Firmware User Manual Revision History Microcontroller with LIN and Power Switches for Automotive Applications Page or Item Subjects (major changes since last revision) Revision 1.02, 2019-04-24 Error code listing updated (Appendix A) User API routines user_nvm_write and user_nvm_write_branch, count range changed to 1- 128 bytes User API user_vbg_temperature_get removed (no possible use-case) Revision 1.01, 2016-04-05...
  • Page 3: Table Of Contents

    TLE984x Firmware User Manual Introduction ..............6 Purpose .
  • Page 4 TLE984x Firmware User Manual 4.4.2 Command 83 – RAM: Execute ............43 4.4.3 Command 84 –...
  • Page 5 TLE984x Firmware User Manual 6.8.20 user_nvm_page_erase ..............92 6.8.21 user_nvm_page_erase_branch .
  • Page 6: Introduction

    TLE984x Firmware User Manual Introduction Introduction This document specifies the BootROM firmware behavior for the TLE984x microcontroller family. The specification is organized into the following major sections: Table 1-1 Document Content Description Topic Description Startup procedure BootROM Startup procedure: An overview on the Startup procedure: the first steps executed by the BootROM after a reset LIN and Fast LIN BSL features Boot Strap Loader...
  • Page 7: Overview

    TLE984x Firmware User Manual Overview Overview This specification includes the description of all firmware features including the operations and tasks defined to support the general startup behaviour and various boot options. Firmware Architecture The BootROM in the TLE984x consists of a firmware image located inside the device’s ROM. It consists of the startup procedure, the bootstrap loader via LIN, the bootstrap loader via Fast- LIN, NVM user routines and NVM integrity handling routines.
  • Page 8: Program Structure

    TLE984x Firmware User Manual Overview Program Structure The different sections of the BootROM provide the following basic functionality. Startup procedure The startup procedure is the main control program in the BootROM. It is the first software-controlled operation in the BootROM that is executed after any reset. The startup procedure performs initialization steps and decode the pin-latched values of the TMS and P0.0 to determine which mode to execute.
  • Page 9: Bootrom Startup Procedure

    TLE984x Firmware User Manual BootROM Startup procedure BootROM Startup procedure This chapter describes the BootROM startup procedure in TLE984x. The startup procedure is the first software-controlled operation in the BootROM that is automatically executed after every reset. There are 2 operation modes in the BootROM : •...
  • Page 10: Boot Modes

    TLE984x Firmware User Manual BootROM Startup procedure A list of supported boot mode pin selections is given in “Boot Modes” on Page Many of the called initialization parts require further configuration parameters which are stored in the NVM CS (Configuration Sector). The initialization process differs slightly between each selected boot mode.
  • Page 11: Nac Definition

    TLE984x Firmware User Manual BootROM Startup procedure The watchdog is always disabled in debug support mode, except when the debug error loop is entered after a boot error. NAC Definition The No Activity Counter (NAC) value defines the time window after reset release within the firmware is able to receive BSL connection messages.
  • Page 12: Post User Mode Entry Recommendations

    TLE984x Firmware User Manual BootROM Startup procedure 3.5.2 Post User Mode Entry Recommendations Upon USER MODE entry, it is highly recommended to to perform the following checks and actions: Prior to any NVM operation, it is recommended to implement a test of SYS_STRTUP_STS.Bit1. If the bit is clear then the data flash mapping is consistent NVM write/erase operation can be performed.
  • Page 13 TLE984x Firmware User Manual BootROM Startup procedure Start Start Timer NVM_CS is CS_NVM_RAM_MBIST Cold_ Reset NVM_CS bit0 = 1 RAM MBIST Warm_Reset? Clear RAM Boot mode selection is done via TMS and P0.0 pins : 1) 0X = USER_BSL_MODE 2) 11 = SWD_DEBUG_MODE Enable debug loop Boot mode SWD Debug mode...
  • Page 14: Reset Types

    TLE984x Firmware User Manual BootROM Startup procedure Init NVM user_mode_entry Apply NVM Protection (debug) Analog module Trim Device configuration prepare (NVM init) debug = OR (NVM Protection) Enabled? OR (Analog module Trimm) Error? Wait for Hot_Reset? debugger Clk to PLL switch Clear interrupts User code addr.
  • Page 15: Startup Procedure Submodules

    TLE984x Firmware User Manual BootROM Startup procedure Cold reset The reset events generated from the following sources, are classified as cold resets : • POR : Power-on reset • Pin reset • Watchdog reset • System fail After a cold reset, all initialization steps, listed in Table 3-1 “Functional Blocks”...
  • Page 16: Watchdog Configuration

    TLE984x Firmware User Manual BootROM Startup procedure • RAM Test (MBIST) and RAM initialization • Analog module trimming • Startup Error Handling • No Activity Counter (NAC) Configuration • Node Address for Diagnostics (NAD) Configuration 3.8.1 Watchdog Configuration After a reset, the watchdog WDT1starts with a long open window. For all the reset types, firmware startup in user mode enables WDT1 before jumping to user code, and the watchdog cannot be disabled while user code is being executed.
  • Page 17: Analog Module Trimming

    TLE984x Firmware User Manual BootROM Startup procedure 3.8.3 Analog Module Trimming During analog module trimming, the trimming values of PMU, voltage regulators, LIN module, temperature sensor, oscillator, PLLand other analog modules are read from the NVM configuration sector and written into the respective SFR registers.
  • Page 18: Lin Node Address For Diagnostics (Nad) Configuration

    TLE984x Firmware User Manual BootROM Startup procedure 3.8.6 LIN Node Address for Diagnostics (NAD) Configuration For LIN, a NAD is stored in the NVM CS (Configuration Sector). It is stored as a value and bit-inverted value in a dedicated NVM CS (Configuration Sector) page. During user mode, this parameter is read from the NVM CS (Configuration Sector) and verified against the stored inverted value.
  • Page 19: Boot Strap Loader (Bsl)

    TLE984x Firmware User Manual Boot Strap Loader (BSL) Boot Strap Loader (BSL) The BSL (Boot Strap Loader) module supports handling of message-based command request and response communication over the serial LIN interface. The received command messages are parsed and executed according to the LIN or FastLIN protocol.
  • Page 20: Bsl Selector

    TLE984x Firmware User Manual Boot Strap Loader (BSL) 4.1.1 BSL Selector The BootROM supports specification of a BSL interface selector in the NVM CS for user-/debug mode. This selector parameter is read and verified by the startup routine and provided as an API call parameter to the software module.
  • Page 21: Bsl Message Parsing & Responses

    TLE984x Firmware User Manual Boot Strap Loader (BSL) Passphrase Frame #1: 0x46 0x4C 0x49 0x4E 0x50 0x41 0x53 ‚F‘ ‚L‘ ‚I‘ ‚N‘ ‚P‘ ‚A‘ ‚S‘ Passphrase Frame #2: 0x53 0x50 0x48 0x52 0x41 0x53 0x45 ‚S‘ ‚P‘ ‚H‘ ‚R‘ ‚A‘ ‚S‘...
  • Page 22 TLE984x Firmware User Manual Boot Strap Loader (BSL) Non Header Block Command processed Polling New Messages (Non Data or EOT Block) || (length > message length) Single Message Multi Command Message Command Multi Message Collect Command Process EOT Block Data Block BSL _MSG_PARSE _STATES Figure 4-3 BSL Command Message State Machine...
  • Page 23 TLE984x Firmware User Manual Boot Strap Loader (BSL) Send Data Msg Multi msg command & No error occurred Data Response Command Processed (Multi Msg Command & Response data left Response data left Error occurred ) || greater than not greater than (Single Msg) EOT msg size EOT msg size...
  • Page 24: Command Execution

    TLE984x Firmware User Manual Boot Strap Loader (BSL) 4.1.6 Command Execution The command data is checked and validated after all the message data is received. This includes that the message parameters are checked for boundaries, any hardware-applied protection (e.g. NVM protection) and if this message is supported for this boot mode.
  • Page 25: Bsl Interframe Timeout Behavior

    TLE984x Firmware User Manual Boot Strap Loader (BSL) Total time: 8 ms The processing time must always be taken into account. 4.1.8 BSL Interframe timeout behavior To keep track of BSL frame transmission violations, interframe timeout is used (described also in Chapter 4.1.2).
  • Page 26 TLE984x Firmware User Manual Boot Strap Loader (BSL) Poll break/sync detection Start frame time measurement Interframe Normal frame Get frame bytes timeout reception: Received bytes Status: Valid frame received within timeout period Interframe No break/sync Poll break/sync detection timeout detected: Status: Timeout =>...
  • Page 27: Bsl Via Lin

    TLE984x Firmware User Manual BSL via LIN The LIN BSL is a LIN-like protocol based on LIN 2.0 (refer to LIN Specification Package documentation, Revision 2.0, 23 September 2003). The LIN protocol layer module handles incoming LIN frames. It forwards the given commands and requests to the BSL protocol layer and is responsible for response message handling.
  • Page 28: Lin Frame Format

    TLE984x Firmware User Manual SFRs LIN Tranceiver GND_LIN BSL_LIN_MODE_LAYERS Figure 4-7 BSL LIN Mode HW/SW Layers 4.2.1 LIN frame format For all supported modes, the command messages (see Command Message Protocol) are transmitted from the host to the BootROM, requesting the commands to be executed. The response request messages (see Response Message Protocol) are transmitted to check the status of the operation and to read out the data requested (e.g.
  • Page 29 TLE984x Firmware User Manual Host BootROM Master Request Header Command Protected Break 7 Data bytes for Checksum Char (At least Command (1 byte) 13 bit low) Slave Response Header Protected Break Char (At least 13 bit low) Response 7 Data bytes for Checksum Command (1 byte)
  • Page 30 TLE984x Firmware User Manual Host BootROM Master Request Header Master Request Block (Command) Delay for processing and executing BSL command is needed. Otherwise no response is possible <<<< Delay >>>> Slave Response communication Slave Response Header is not necessary and can be skipped Slave Response Block LIN_FRAME1_UML...
  • Page 31: Command Message Protocol

    TLE984x Firmware User Manual Figure 4-11 shows the LIN frame communication for BSL commands, where data are read from the device. BootROM provides such data over data blocks and EOT blocks. Host BootROM Master Request Header Master Request Block (Command ) <<<<...
  • Page 32: Response Message Protocol

    TLE984x Firmware User Manual Master Request Block A simple protocol is defined for the communication between the the host and BootROM. The Master Request Header is followed by the Master Request Block. BSL Protocol Block Checksum (1 byte) (7 bytes) (1 byte) LIN_ FRAME_FORMAT Table 4-3...
  • Page 33: Node Address For Diagnostic (Nad)

    TLE984x Firmware User Manual Table 4-5 Slave Response Block Field Description Field Description Node address for diagnostics, specifies the address of the active slave node. BSL Protocol This field determines the type of the BSL message. Data/EOT/Response Depending on the BSL command used, it could be either a data block, an EOT block or Block a response block.
  • Page 34: Lin Message Examples

    TLE984x Firmware User Manual 4.2.2 LIN Message Examples Figure 4-12 Figure 4-13 provide some examples of how to write and read RAM using LIN BSL commands. Host BootROM Master Request Write RAM Data Header & Header Block: 0x55 0x3C NAD Length 0x02 Address CHKS...
  • Page 35 TLE984x Firmware User Manual Host BootROM Master Request Read RAM Data Header & Header Block: 0x55 0x3C NAD Length 0x84 Address CHKS <<< Delay >= BSL command processing time >>> Slave Response Header : 0x55 0x7D Data Block: NAD Length 0x00 Data Bytes CHKS...
  • Page 36: Lin Hal

    TLE984x Firmware User Manual 4.2.3 LIN HAL The LIN HAL handles all SFR register accesses to the LIN hardware modules . These accesses include timing critical register accesses and status polling mechanism. Functionality The following features are provided by the LIN HAL: •...
  • Page 37: Bsl Via Fastlin

    TLE984x Firmware User Manual BSL via FastLIN FastLIN is a LIN enhancement supporting higher baud rates of up to 230.4 kBd. This rate is higher than the standard LIN. FastLIN is especially useful during back-end programming, where faster programming time is desirable.
  • Page 38: Bsl Commands - Protocol (Version 2.0)

    TLE984x Firmware User Manual BSL commands - Protocol (Version 2.0) This section describes the boot strap loader messages that are used by the LIN and FastLIN protocols. The physical layer encapsulation of these messages is described in • BSL via LIN Page 27 •...
  • Page 39 TLE984x Firmware User Manual Padding Bytes For FastLIN: If the customer adds padding bytes, although this is not regular it is still supported by the firmware. Padding bytes up to a data field size of 128 bytes are possible. The firmware will accept the real data and will find the checksum byte after the last padding byte.
  • Page 40: Command 8F H – Bsl: Option Set

    TLE984x Firmware User Manual Table 4-7 NVM Protection Check for BSL Commands NVM protection group (condition to BSL Command block) Group 1 Command 02H – RAM: Write Data/Program NVM HW read or write protection applied Command 05H – NVM: Write Data/Program to any NVM region Command 88H –...
  • Page 41: Command 02

    TLE984x Firmware User Manual 4.4.1 Command 02 – RAM: Write Data/Program Firmware supports downloading of data and code to the device’s internal RAM via command 02 The host initiates the RAM download by sending a header block message. This message contains information about the RAM location (offset address based on RAM start address).
  • Page 42 TLE984x Firmware User Manual 2 – 6 Message Length Data Type BSL20 _MODE_DATA Table 4-9 “Command 02 – RAM: Write Data/Program” Data Block Field Description Field Description Length Number of following bytes in the data block. Always set to 06 Message Type Data block.
  • Page 43: Ram: Execute

    TLE984x Firmware User Manual 4.4.2 Command 83 – RAM: Execute Firmware triggers execution of a RAM user program by the Host via command 83 . This code can be previously downloaded by the BSL Command 02H – RAM: Write Data/Program. The host initiates the RAM code execution by sending the header block message.
  • Page 44 TLE984x Firmware User Manual Returned error codes The message can return the following error codes: - ERR_LOG_CODE_NVM_IS_READ_PROTECTED - ERR_LOG_ERROR (RAM range is invalid) - ERR_LOG_CODE_NVM_RAM_EXEC_PARAMS_INVALID Firmware User Manual (AE-step) Revision 1.02 2019-04-24...
  • Page 45: Ram: Read Data

    TLE984x Firmware User Manual 4.4.3 Command 84 – RAM: Read Data Firmware supports reading of data and code from the device’s internal RAM via command 84 The host initiates the RAM read by sending a header block message. This message contains information about the RAM location (offset address based on RAM start address) and the number of read data bytes.
  • Page 46 TLE984x Firmware User Manual Table 4-13 “Command 84 – RAM: Read Data” Data Block Field Description Field Description Length Number of following bytes in the data block. Always set to 06 Message Type Data block. Always set to 00 Data It contains the read data.
  • Page 47: Nvm: Write Data/Program

    TLE984x Firmware User Manual 4.4.4 Command 05 – NVM: Write Data/Program Firmware supports programming of data and code to the device’s internal NVM via command 05 The host initiates the NVM program by sending a header block message. This message contains information about the NVM location (offset address based on NVM start address).
  • Page 48 TLE984x Firmware User Manual Data Block This block is only used for LIN communication, because the LIN frame length is too short to place the maximum supported data length into the EOT block. 2 – 6 Message Length Data Type BSL20 _MODE_DATA Table 4-16 “Command 05 –...
  • Page 49 TLE984x Firmware User Manual Returned error codes The message can return the following error codes: - ERR_LOG_SUCCESS - ERR_LOG_CODE_NVM_IS_READ_PROTECTED - ERR_LOG_ERROR (NVM range is invalid) - ERR_LOG_CODE_MEM_READWRITE_PARAMS_INVALID - ERR_LOG_CODE_USER_CROSS_PAGE_PRG_NOT_SUPPORTED - ERR_LOG_CODE_USER_PROTECT_NVM_WRITE_PROTECTED - ERR_LOG_CODE_NVM_SEMAPHORE_RESERVED - ERR_LOG_CODE_ACCESS_AB_MODE_ERROR - ERR_LOG_CODE_NVM_MAPRAM_UNKNOWN_TYPE_USAGE - ERR_LOG_CODE_NVM_VER_ERROR - ERR_LOG_CODE_NVM_PROG_MAPRAM_INIT_FAIL - ERR_LOG_CODE_NVM_PROG_VERIFY_MAPRAM_INIT_FAIL Firmware User Manual (AE-step) Revision 1.02...
  • Page 50: Nvm: Execute

    TLE984x Firmware User Manual 4.4.5 Command 86 – NVM: Execute Firmware triggers execution of a NVM user program by the Host via command 86 . This code could be previously downloaded by the BSL Command 05H – NVM: Write Data/Program. The host initiates the NVM code execution by sending the header block message.
  • Page 51: Nvm: Read Data

    TLE984x Firmware User Manual 4.4.6 Command 87 – NVM: Read Data Firmware supports reading of data and code from the device’s internal NVM via command 87 The host initiates the NVM read by sending a header block message. This message contains information about the NVM location (offset address based on NVM start address) and the number of read data bytes.
  • Page 52 TLE984x Firmware User Manual Data Block This block is only used for LIN communication, because the LIN frame length is too short to place the maximum supported data length into the EOT block. 2 – 6 Message Length Data Type BSL20 _MODE_DATA Table 4-20 “Command 87 –...
  • Page 53 TLE984x Firmware User Manual Returned error codes The message can return the following error codes: - ERR_LOG_CODE_NVM_IS_READ_PROTECTED - ERR_LOG_CODE_NVM_ADDR_RANGE_INVALID - ERR_LOG_CODE_MEM_READWRITE_PARAMS_INVALID - ERR_LOG_CODE_NVM_PAGE_NOT_MAPPED - ERR_LOG_CODE_ECC2READ_ERROR Firmware User Manual (AE-step) Revision 1.02 2019-04-24...
  • Page 54: Nvm: Erase

    TLE984x Firmware User Manual 4.4.7 Command 88 – NVM: Erase This command supports the erasure of NVM pages and NVM sectors. The host initiates the NVM erase operation by sending a header block message. This message contains information about the NVM location (offset address based on NVM start address) and selects the erase granularity.
  • Page 55 TLE984x Firmware User Manual - ERR_LOG_CODE_NVM_ERASE_ADDR_INVALID - ERR_LOG_CODE_NVM_SECT_ERASE_ADDR_INVALID - ERR_LOG_CODE_NVM_INIT_MAPRAM_SECTOR Firmware User Manual (AE-step) Revision 1.02 2019-04-24...
  • Page 56: Nvm: Protection Set / Clear

    TLE984x Firmware User Manual 4.4.8 Command 89 – NVM: Protection Set / Clear Firmware supports setting and clearing of NVM protection for different NVM regions via command 89 . These regions are the customer Bootloader NVM sector, code and data NVM sectors (multiple sector regions). NVM region protection includes access protection for read and/or write/erase.
  • Page 57 TLE984x Firmware User Manual Table 4-24 “Command 89 – NVM: Protection Set / Clear” Header Block Options Field Description Field Bits Description Reserved Password Selector Password Selector Password selection to set or reset. Customer Bootloader Password, Code Segment Password, Data Segment Password, Reserved, Operation Set/Clear the password protection...
  • Page 58: Command 0D

    TLE984x Firmware User Manual 4.4.9 Command 0D – NVM: 100TP Write Firmware supports programming of data in the customer-specific 100TP pages via command 0D Any page programming is rejected if the page specific programming limit (100 times) is exceeded. The header block message contains parameter about the 100TP page index, the offset inside that page. The data bytes follow by Data Block messages and the last data bytes are sent by an EOT block message.
  • Page 59 TLE984x Firmware User Manual 2 – 6 Message Length Data Type BSL20 _MODE_DATA Table 4-26 “Command 0D – NVM: 100TP Write” Data Block Field Description Field Description Length Number of following bytes in the data block. Always set to 06 Message Type Data block.
  • Page 60 TLE984x Firmware User Manual - ERR_LOG_CODE_100TP_WRITE_ADDRESS_INVALID - ERR_LOG_CODE_100TP_WRITE_COUNT_EXCEEDED - ERR_LOG_CODE_NVM_SEMAPHORE_RESERVED - ERR_LOG_CODE_ACCESS_AB_MODE_ERROR Firmware User Manual (AE-step) Revision 1.02 2019-04-24...
  • Page 61: Command 8E

    TLE984x Firmware User Manual 4.4.10 Command 8E – NVM: 100TP Read Firmware supports reading of data from the customer-specific 100TP page via command 8E The header block message contains parameter about the 100TP page index, the offset inside that page and the number of read data bytes.
  • Page 62 TLE984x Firmware User Manual Table 4-29 “Command 8E – NVM: 100TP Read” Data Block Field Description Field Description Length Number of following bytes in the data block. Always set to 06 Message Type Data block. Always set to 00 Data It contains the read data.
  • Page 63: H - Bsl: Option Set

    TLE984x Firmware User Manual 4.4.11 Command 8F – BSL: Option Set Firmware supports setting of some BSL option data, including BSL timeout (NAC) and BSL interface selector, via command 8F The header block message contains the selected BSL interface and the NAC value. The given configuration is stored in the device NVM CS and is used for the next startup.
  • Page 64: Bsl: Option Get

    TLE984x Firmware User Manual 4.4.12 Command 90 – BSL: Option Get Firmware supports reading the current configured BSL option data from the NVM CS, including BSL timeout (NAC) and BSL interface selector, via command 90 The header block message contains the information request. The BootROM sends the selected BSL interface and the NAC parameter by an EOT block message.
  • Page 65 TLE984x Firmware User Manual Table 4-33 “Command 90 – BSL: Option Get” EOT Block Description (cont’d) Field Description BSL Interface BSL Interface Selector to be used for the next startup: Selector • 0 - LIN • 1 - FastLIN BSL Timeout (NAC) BSL Timeout before jumping to the User Mode Code execution. The timeout starts counting from device reset release.
  • Page 66: Lin: Nad Set

    TLE984x Firmware User Manual 4.4.13 Command 91 – LIN: NAD Set Firmware supports setting of the LIN NAD via command 91 The header block message contains as a parameter the LIN NAD value. The given NAD address is stored in the device NVM CS and is used for the next startup. The command can only be used if there is no NVM read protection applied to any NVM region and write protection to code segment (linear sectors).
  • Page 67: Lin: Nad Get

    TLE984x Firmware User Manual 4.4.14 Command 92 – LIN: NAD Get Firmware supports reading the currently configured LIN NAD value via command 92 The header block message contains the information request. The BootROM sends the current LIN NAD value by an EOT block message. The command is rejected if NVM HW read protection is applied to any NVM region.
  • Page 68: Command 93 - Fastlin: Set Session Baudrate

    TLE984x Firmware User Manual 4.4.15 Command 93 – FastLIN: Set Session Baudrate Firmware supports changing the FastLIN baudrate for the current FastLIN BSL session via command 93 The header block message contains the new FastLIN baud rate selection for the current FastLIN session. The given parameter is not stored inside the NVM CS, and the FastLIN default baud rate takes effect when the response has been sent back to the host.
  • Page 69: Acknowledge Response Message (81 )

    TLE984x Firmware User Manual 4.4.16 Acknowledge Response Message (81 Firmware supports sending back acknowledge response message (81 ) if the requested BSLcommand does not retrieve any data or the requested data cannot be provided. It is also sent if a problem occurred during processing the requested command data.
  • Page 70: Nvm

    TLE984x Firmware User Manual NVM Overview The NVM module consists of three regions, the Config Sector, the user code region and the user data region. The Config Sector holds device specific information as well the eight 100TP pages. The Config Sector is not directly addressable by the user.
  • Page 71: Nvm Write

    TLE984x Firmware User Manual See also “Command 89H – NVM: Protection Set / Clear” on Page 56 for details on how to set or clear the NVM protection password NVM Write It is strongly recommended to the user that no flash operations which modify the content of the flash, like write and erase, get interrupted at any time.
  • Page 72: Data Flash Initialization

    TLE984x Firmware User Manual written) is triggered. The actions performed by copying a used page inside the data flash sector are the same as for writing a used data flash page. Data Flash Initialization After a reset the volatile memory, MapRAM, has to be recovered in order to be able to perform the address translation for data flash accesses.
  • Page 73: User Routines

    TLE984x Firmware User Manual User Routines User Routines The BootROM exports some library functions to the user mode software. These library functions allow to configure the device boot parameter and access the NVM. List of Supported Features • Read and write the various 100TP pages inside the NVM. •...
  • Page 74: Interrupts

    TLE984x Firmware User Manual User Routines Doing this ensures that the watchdog will not expire and cause reset during NVM operations. Interrupts System interrupts are not used by any BootROM functions during startup or when any user APIs are executed. Customer software must service system interrupts in a normal fashion, which means installing interrupt vectors at the correct locations for the system CPU.
  • Page 75: User Api Routines

    TLE984x Firmware User Manual User API Routines These routines are exported by the BootROM to the customer user mode software. User API Routines support features like accessing memory resources like NVM and 100TP pages. They also support to configure some protection mechanism and BSL parameters. The API functions check the valid parameter range, which is depending on the device.
  • Page 76 TLE984x Firmware User Manual Table 6-2 User API Routines Function Overview (cont’d) Name Description user_nvm_100tp_write This user API function writes data to the configuration NVM, address is relative inside the configuration NVM area (8x one page, 1024 bytes). It stops writing at page boundary. The function shall support partial page programming, preserving the page data not passed as an input.
  • Page 77: User_Nvm_Mapram_Init

    TLE984x Firmware User Manual Table 6-2 User API Routines Function Overview (cont’d) Name Description user_nvm_protect_set This user API function sets a read and/or write protection for any NVM region individually. The API changes the protection state for a region, but does not update the installed password in configuration sector.
  • Page 78: User_Bsl_Config_Get

    TLE984x Firmware User Manual Return Values Data Type Description int32_t Zero in case the function has been called successfully, otherwise a negative error code. The returned code can be one of the following: ERR_LOG_SUCCESS, ERR_LOG_ERROR, ERR_LOG_CODE_NVM_SEMAPHORE_RESERVED, ERR_LOG_CODE_NVM_INIT_MAPRAM_SECTOR 6.8.2 user_bsl_config_get Description This user API function reads the user BSL interface selection value.
  • Page 79: User_Ecc_Events_Get

    TLE984x Firmware User Manual Return Values Data Type Description int32_t ERR_LOG_SUCCESS in case of success, otherwise a negative error code. Returned error code can be one of the following: ERR_LOG_SUCCESS, ERR_LOG_CODE_USERAPI_CONFIG_SECTOR_WRITE_PROTECTED, ERR_LOG_CODE_USERAPI_CONFIG_SET_PARAMS_INVALID, ERR_LOG_CODE_NVM_SEMAPHORE_RESERVED, ERR_LOG_CODE_ACCESS_AB_MODE_ERROR Remarks It is not allowed to be called by NVM callback routines. 6.8.4 user_ecc_events_get Description...
  • Page 80: User_Ecc_Check

    TLE984x Firmware User Manual Return Values Data Type Description int32_t ERR_LOG_SUCCESS in case no single or double ECC event have occurred, A negative error code for single, double or single and double ECC errors A negative error code if the NVM semaphore is not free. Returned error code can be one of the following: ERR_LOG_SUCCESS, ERR_LOG_CODE_USERAPI_POINTER_RAM_RANGE_INVALID, ERR_LOG_CODE_NVM_SEMAPHORE_RESERVED,...
  • Page 81: User_Mbist_Set

    TLE984x Firmware User Manual Remarks This routine does not provide the ECC error address. Please use the user_ecc_events_get routines to retrieve the addresses. It is not allowed to be called by NVM callback routines or any interrupt or multi-threaded environment in a re- entrant context.
  • Page 82: User_Nac_Set

    TLE984x Firmware User Manual Prototype uint8_t user_nac_get (void) Parameters void Return Values Data Type Description uint8_t NAC value that is found in the configuration memory. It returns "wait forever" (0xFF) in case no NAC value is currently configured in the configuration memory. 6.8.8 user_nac_set Description...
  • Page 83: User_Nad_Get

    TLE984x Firmware User Manual It is not allowed to be called by NVM callback routines or any interrupt or multi-threaded environment in a re- entrant context. 6.8.9 user_nad_get Description This user API function reads out the LIN NAD value that is currently configured in the non volatile device configuration memory.
  • Page 84: User_Nvm_100Tp_Read

    TLE984x Firmware User Manual Return Values Data Type Description int32_t ERR_LOG_SUCCESS in case of successful write operation, otherwise a negative error code. Returned error code can be one of the following: ERR_LOG_SUCCESS, ERR_LOG_CODE_USERAPI_CONFIG_SECTOR_WRITE_PROTECTED, ERR_LOG_CODE_NVM_SEMAPHORE_RESERVED, ERR_LOG_CODE_ACCESS_AB_MODE_ERROR, ERR_LOG_CODE_NAD_VALUE_INVALID Remarks It is not allowed to be called by NVM callback routines or any interrupt or multi-threaded environment in a re- entrant context.
  • Page 85: User_Nvm_100Tp_Write

    TLE984x Firmware User Manual Data Type Name Description void * data Data pointer where to store the read data. Pointer plus valid count must be within valid RAM range or an error code is returned uint32_t count Amount of data bytes to read. If count is zero, there is no operation and an error code is returned.
  • Page 86: User_Nvm_Config_Get

    TLE984x Firmware User Manual Parameters Data Type Name Description uint32_t page_num Page number where to write to. Valid range: 0 to 7 uint32_t offset Byte offset inside the selected page address, where to start writing. Maximum is 126 bytes. const void * data Data pointer where to read the data to write.
  • Page 87: User_Nvm_Password_Clear

    TLE984x Firmware User Manual uint8_t * data_nvm_size Parameters Data Type Name Description uint8_t * cbsl_nvm_size Pointer where to store the retrieved NVM cbsl size. Valid RAM range is 0x18000000 + device RAM size. uint8_t * code_nvm_size Pointer where to store the retrieved NVM code size. Valid RAM range is 0x18000000 + device RAM size.
  • Page 88: User_Nvm_Password_Set

    TLE984x Firmware User Manual Parameters Data Type Name Description uint32_t password Current active password for the segment . A valid password parameter consists of a 30-bit password (bits 0...29), bits 30 and 31 are ignored. NVM_PASSWORD_SEG segment Segment where password should be cleared MENT_t Return Values Data Type...
  • Page 89: User_Nvm_Protect_Get

    TLE984x Firmware User Manual uint32_t password NVM_PASSWORD_SEGMENT_t segment Parameters Data Type Name Description uint32_t password Protection password to apply on the given segment NVM_PASSWORD_SEG segment Segment which should be password protected MENT_t Return Values Data Type Description int32_t ERR_LOG_SUCCESS in case the password could be successfully applied, otherwise a negative error code.
  • Page 90: User_Nvm_Protect_Set

    TLE984x Firmware User Manual Return Values Data Type Description uint32_t Current protection status of the NVM segment selected: Protection disabled: 0x00000000 read protection enabled: 0x80000000 Write protection enabled: 0x40000000 Read and write protection enabled: 0xC0000000 Segment not recognized: 0xFFFFFFFF 6.8.17 user_nvm_protect_set Description This user API function sets a read and/or write protection for any NVM region individually.
  • Page 91: User_Nvm_Protect_Clear

    TLE984x Firmware User Manual Return Values Data Type Description int32_t ERR_LOG_SUCCESS in case the password could be successfully applied, otherwise a negative error code. Returned error code can be one of the following: ERR_LOG_SUCCESS, ERR_LOG_CODE_USER_NVM_PROTECT_SEGMENT_INVALID, ERR_LOG_CODE_NVM_SEMAPHORE_RESERVED, ERR_LOG_CODE_CS_PAGE_CHECKSUM, ERR_LOG_CODE_CS_PAGE_ECC2READ, ERR_LOG_CODE_USER_PROTECT_NVM_AND_PWD_ERASED, ERR_LOG_CODE_NVM_PROTECT_REMOVE_PASSWORD_FAILED, Remarks It is not allowed to be called by NVM callback routines or any interrupt or multi-threaded environment in a re- entrant context.
  • Page 92: User_Nvm_Ready_Poll

    TLE984x Firmware User Manual Return Values Data Type Description int32_t ERR_LOG_SUCCESS in case the password could be successfully applied, otherwise a negative error code. Returned error code can be one of the following: ERR_LOG_SUCCESS, ERR_LOG_CODE_USER_NVM_PROTECT_SEGMENT_INVALID, ERR_LOG_CODE_NVM_SEMAPHORE_RESERVED, ERR_LOG_CODE_CS_PAGE_CHECKSUM, ERR_LOG_CODE_CS_PAGE_ECC2READ, ERR_LOG_CODE_USER_PROTECT_NVM_AND_PWD_ERASED, ERR_LOG_CODE_NVM_PROTECT_REMOVE_PASSWORD_FAILED, Remarks It is not allowed to be called by NVM callback routines or any interrupt or multi-threaded environment in a re- entrant context.
  • Page 93: User_Nvm_Page_Erase_Branch

    TLE984x Firmware User Manual Prototype int32_t user_nvm_page_erase ( uint32_t address Parameters Data Type Name Description uint32_t address Address of the NVM page to erase. Non-aligned address is accepted. Range is 0x11000000 + device NVM size. Return Values Data Type Description int32_t ERR_LOG_SUCCESS in case of successful erase operation, otherwise a negative error code.
  • Page 94: User_Nvm_Sector_Erase

    TLE984x Firmware User Manual Parameters Data Type Name Description uint32_t address Address of the NVM page to erase. Non-aligned address is accepted. Range is 0x11000000 + device NVM size. user_callback_t branch_address Function callback address where to jump while waiting for the NVM module to finish the erase operation.
  • Page 95: User_Nvm_Write

    TLE984x Firmware User Manual Return Values Data Type Description int32_t ERR_LOG_SUCCESS in case of successful erase operation, otherwise a negative error code. Returned error code can be one of the following: ERR_LOG_SUCCESS, ERR_LOG_CODE_NVM_ADDR_RANGE_INVALID, ERR_LOG_CODE_USER_PROTECT_NVM_WRITE_PROTECTED, ERR_LOG_CODE_NVM_SEMAPHORE_RESERVED, ERR_LOG_CODE_NVM_INIT_MAPRAM_SECTOR Remarks It is not allowed to be called by NVM callback routines or any interrupt or multi-threaded environment in a re- entrant context.
  • Page 96: User_Nvm_Write_Branch

    TLE984x Firmware User Manual Parameters Data Type Name Description uint32_t address NVM address where to program the data. Range is 0x11000000 + device NVM size. const void * data Pointer to the data where to read the programming data. Pointer must be within valid RAM range (0x18000000 + device RAM size) or an error code is returned.
  • Page 97 TLE984x Firmware User Manual The page programming stops at page boundary. The firmware preserves the non-programmed page data. This function rejects with an error in case the accessed NVM page is write protected. Prototype int32_t user_nvm_write_branch ( uint32_t address const void * data uint8_t count uint8_t options user_callback_t branch_address...
  • Page 98: User_Ram_Mbist

    TLE984x Firmware User Manual Return Values Data Type Description int32_t ERR_LOG_SUCCESS in case of successful write operation, otherwise a negative error code. Returned error code can be one of the following: ERR_LOG_SUCCESS, ERR_LOG_CODE_PARAM_INVALID, ERR_LOG_CODE_USER_API_BRANCH_ADDRESS_INVALID, ERR_LOG_CODE_USERAPI_POINTER_RAM_RANGE_INVALID, ERR_LOG_CODE_USER_CROSS_PAGE_PRG_NOT_SUPPORTED, ERR_LOG_CODE_USER_PROTECT_NVM_WRITE_PROTECTED, ERR_LOG_CODE_NVM_SEMAPHORE_RESERVED, ERR_LOG_CODE_ACCESS_AB_MODE_ERROR, ERR_LOG_CODE_NVM_MAPRAM_UNKNOWN_TYPE_USAGE, ERR_LOG_CODE_NVM_VER_ERROR, ERR_LOG_CODE_NVM_PROG_MAPRAM_INIT_FAIL, ERR_LOG_CODE_NVM_PROG_VERIFY_MAPRAM_INIT_FAIL,...
  • Page 99: User_Nvm_Clk_Factor_Set

    TLE984x Firmware User Manual Return Values Data Type Description int32_t ERR_LOG_SUCCESS in case of successful MBIST execution, otherwise a negative error code. Returned error code can be one of the following: ERR_LOG_SUCCESS, ERR_LOG_CODE_MBIST_RAM_RANGE_INVALID, ERR_LOG_CODE_MBIST_FAILED, ERR_LOG_CODE_MBIST_TIMEOUT Remarks Customer needs to make attention to not destroy the BootROM stack pointer. 6.8.26 user_nvm_clk_factor_set Description...
  • Page 100: Enumerator Reference

    TLE984x Firmware User Manual 6.10.1 Enumerator Reference This chapter contains the Enumerator reference. Table 6-3 Enumerator Overview Name Description BSL_INTERFACE_SELECT_t User API BSL interface selection. NVM_PASSWORD_SEGMENT_t NVM protection API password segment 6.10.1.1 BSL_INTERFACE_SELECT_t Description User API BSL interface selection. Prototype typedef enum BSL_IF_LIN = 0, BSL_IF_FAST_LIN = 1,...
  • Page 101: Constant Reference

    TLE984x Firmware User Manual Parameters Name Value Description NVM_PASSWORD_SEGMENT_BOOT NVM password for customer segment, used for customer bootloader NVM_PASSWORD_SEGMENT_CODE NVM password for customer code segment, which is not used by the customer bootloader. NVM_PASSWORD_SEGMENT_DATA NVM password for customer data segment. 6.10.2 Constant Reference This chapter contains the Constant reference.
  • Page 102: Terminology

    TLE984x Firmware User Manual Terminology 100-Time The BootROM offers eight 100-time programmable pages to the user mode software. The Programming size of a 100TP page is 128 bytes. The last two bytes of each 100TP page store the (100TP) programming counter, followed by the page checksum byte. Application Programming Interface BootROM Device-internal ROM code that the CPU executes directly after reset release...
  • Page 103 TLE984x Firmware User Manual Header block Part of the BSL command message. The host initiates a command by sending the header block. Some commands require further data transmission, during which the header block is followed by one or multiple data blocks and a terminating EOT block. Host The host communicates with the BootROM device over the LIN interface.
  • Page 104 TLE984x Firmware User Manual Special Function Register (CPU memory-mapped device hardware registers) Serial Wire Debug Tearing Safe The mapping mechanism of the NVM module is intended to be used like a log-structured Programming file system: When a page is programmed in the cell array, the old values are not physically overwritten, but a different physical page (the spare page) in the same sector is programmed in fact.
  • Page 105: Appendix A – Error Codes

    TLE984x Firmware User Manual Appendix A – Error Codes This chapter provides a list of all available error codes. Table 6-5 List of Possible Errors during Startup User Error Name Error Errors Description Code ERR_LOG_SUCCESS No Error ERR_LOG_ERROR Standard Error ERR_LOG_CODE_MEM_READWRITE_PARAMS_INVALID -7 Invalid BSL parameters to RAM/NVM/NVM_CS read/write...
  • Page 106 TLE984x Firmware User Manual Table 6-5 List of Possible Errors during Startup User Error Name Error Errors Description Code ERR_LOG_CODE_NVM_PAGE_NOT_MAPPED NVM page is not mapped ERR_LOG_CODE_NVM_INIT_MAPRAM_SECTOR Mapped page has double mapping or ECC2 error when trying to init mapRAM ERR_LOG_CODE_ACCESS_AB_MODE_ERROR Error when setting the assembly buffer mode ERR_LOG_CODE_NVM_PROTECT_REMOVE_PASSWOR...
  • Page 107 TLE984x Firmware User Manual Table 6-5 List of Possible Errors during Startup User Error Name Error Errors Description Code ERR_LOG_CODE_USER_PROTECT_NVM_WRITE_PROT user_nvm_write/branch operation ECTED not allowed when NVM is write protected ERR_LOG_CODE_MBIST_RAM_RANGE_INVALID user_ram_mbist() RAM range for MBIST is invalid ERR_LOG_CODE_USER_PROTECT_NO_PASSWORD_E user_nvm_password_clear() no XISTS password installed when trying to clear password...
  • Page 108: Appendix B – Stack Usage Of User Api Functions

    TLE984x Firmware User Manual Appendix B – Stack Usage of User API Functions The following table lists the maximum used stack for each user API function. Table 6-6 Maximum used stack for user API functions User API function Maximum stack usage (bytes) user_bsl_config_get user_bsl_config_set user_ecc_check...
  • Page 109: Appendix C – Bootrom User Api Functions

    TLE984x Firmware User Manual Appendix C – BootROM User API Functions This appendix provides a table that lists all exported BootROM functions and their addresses that can be called by user code. Table 6-7 User API Functions adresses User API Function BootROM Thumb Address user_bsl_config_get 00000101...
  • Page 110: Appendix D – Analog Module Trimming (100Tp Pages)

    TLE984x Firmware User Manual Appendix D – Analog Module Trimming (100TP Pages) The TLE984x contains 8 x 100TP (100 Time Programmable) pages and each page has a size of 128 bytes but only the first 126 Bytes are usable. The last two Bytes of each 100TP page store the programming counter followed by the page checksum Byte.
  • Page 111 TLE984x Firmware User Manual Table 6-8 100TP page 0 and page 1 : Analog Module Trimming registers 0x4C ADC1_FILT_UP_CTRL 0x50 ADC1_FILTCOEFF0_11 0x54 ADC1_CAL_CH10_11 0x58 ADC1_CAL_CH8_9 0x5C ADC1_CAL_CH6_7 0x60 ADC1_CAL_CH4_5 0x64 ADC1_CAL_CH2_3 0x68 ADC1_CAL_CH0_1 0x6C ADC1_SQ10_11 0x70 ADC1_SQ8_9 0x74 ADC1_SQ6_7 0x78 ADC1_SQ4_5 Example Table 6-9...
  • Page 112 TLE984x Firmware User Manual Table 6-10 Alternative predefined values to trim in case 100TP page 0 and page 1 CRC is incorrect 100 TP Page 0 Data Offset SFR registers Alternative Back up values 0x00 ADC1_DUIN_SEL 0x00000000 0x04 ADC1_MMODE0_11 0x00000000 0x08 ADC1_DCHCNT1_4_UPPER 0x00000000...
  • Page 113: Appendix E – Device Settings In Nvm Cs

    TLE984x Firmware User Manual Appendix E – Device settings in NVM CS The BootROM uses pre-configured settings written to NVM CS, which all are used to perform various tasks inside the device. This section show the settings used for different modules. Table 6-11 BSL module configuration NVM CS entry Value...
  • Page 114: Appendix F – Execution Time Of Bootrom User Api Functions

    TLE984x Firmware User Manual Appendix F – Execution time of BootROM User API Functions This appendix provides a table that lists the execution Time of BootROM User API functions. Table 6-13 User API execution time User API function Execution time [ms] Worst case operation Normal operation 25MHz...
  • Page 115: Appendix G – Change Of Register Reset Values

    TLE984x Firmware User Manual Appendix G – Change of register reset values Before the BootROM is executing user code, the startup boot sequence has been executed. This means configuring the device with user parameters, setting up NVM to be ready for the user and other important system settings.
  • Page 116 Trademarks of Infineon Technologies AG AURIX™, C166™, CanPAK™, CIPOS™, CoolGaN™, CoolMOS™, CoolSET™, CoolSiC™, CORECONTROL™, CROSSAVE™, DAVE™, DI-POL™, DrBLADE™, EasyPIM™, EconoBRIDGE™, EconoDUAL™, EconoPACK™, EconoPIM™, EiceDRIVER™, eupec™, FCOS™, HITFET™, HybridPACK™, Infineon™, ISOFACE™, IsoPACK™, i- Wafer™, MIPAQ™, ModSTACK™, my-d™, NovalithIC™, OmniTune™, OPTIGA™, OptiMOS™, ORIGA™, POWERCODE™, PRIMARION™, PrimePACK™, PrimeSTACK™, PROFET™, PRO-SIL™, RASIC™, REAL3™, ReverSave™, SatRIC™, SIEGET™, SIPMOS™, SmartLEWIS™, SOLID FLASH™, SPOC™, TEMPFET™,...

Table of Contents