Professional Documents
Culture Documents
Infineon TLE984x Firmware UserManual v01 04 en
Infineon TLE984x Firmware UserManual v01 04 en
Table of contents
About this document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Table of contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.1 Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2 Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.3 Abbreviations and special terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.1 Firmware architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.2 Program structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.3 RAM structure for user . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3 BootROM startup procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.1 Startup program structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.2 Boot modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.3 Debug Support mode entry (with SWD port) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.4 NAC definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.5 User and BSL mode entry (UM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.5.1 Unlock BSL communications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.5.2 Post user mode entry recommendations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.6 Flowcharts for user BSL / debug modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.7 Reset types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.8 Startup procedure submodules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.8.1 Watchdog configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.8.2 RAM test (MBIST) and RAM initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.8.3 Analog module trimming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.8.4 Startup error handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.8.5 No Activity Counter (NAC) configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.8.6 LIN Node Address for Diagnostics (NAD) configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4 Boot Strap Loader (BSL) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
4.1 BSL overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.1.1 BSL selector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.1.2 BSL interframe timeout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.1.3 NVM / RAM range access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.1.4 LIN / FastLIN passphrase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.1.5 BSL message parsing and responses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
4.1.6 Command execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
4.1.7 Timing constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
4.1.8 BSL interframe timeout behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
4.2 BSL via LIN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
4.2.1 LIN frame format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
4.2.1.1 Command message protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
4.2.1.2 Response message protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
4.2.1.3 Node Address for Diagnostic (NAD) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
4.2.1.4 Checksum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
4.2.2 LIN message examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
4.2.3 LIN HAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Firmware User Manual 2 Revision 1.04
2024-01-15
MOTIX™ TLE984xQX
Microcontroller with LIN and power switches for automotive applications
6.8.17 user_nvm_protect_set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
6.8.18 user_nvm_protect_clear . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
6.8.19 user_nvm_ready_poll . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
6.8.20 user_nvm_page_erase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
6.8.21 user_nvm_page_erase_branch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
6.8.22 user_nvm_sector_erase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
6.8.23 user_nvm_write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
6.8.24 user_nvm_write_branch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
6.8.25 user_ram_mbist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
6.8.26 user_nvm_clk_factor_set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
6.9 NVM protection API types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
6.9.1 user_callback_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
6.10 Data types and structure reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
6.10.1 Enumerator reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
6.10.1.1 BSL_INTERFACE_SELECT_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
6.10.1.2 NVM_PASSWORD_SEGMENT_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
6.10.2 Constant reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
Appendix A – error codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Appendix B – stack usage of user API functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
Appendix C – BootROM user API functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
Appendix D – analog module trimming (100TP pages) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Appendix E – device settings in NVM CS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
Appendix F – execution time of BootROM user API functions . . . . . . . . . . . . . . . . . . . . . . . . . . 118
Appendix G – change of register reset values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
1 Introduction
This document specifies the BootROM firmware behavior for the TLE984xQX microcontroller family.
The specification is organized into the following major sections:
1.1 Purpose
The document describes the functionality of the BootROM firmware.
1.2 Scope
The BootROM firmware for the TLE984xQX family will provide the following features:
• Startup procedure for stable operation of TLE984xQX chip
• Debugger connection for proper code debug
• BSL mode for users to download and run code from NVM and RAM
• NVM operation handling, e.g. program and erase
2 Overview
This specification includes the description of all firmware features including the operations and tasks defined
to support the general startup behavior and various boot options.
BootROM
ARM CORTEX-M0 NVM FLASH SRAM
(ROM)
Systembus
Serial Communication
Timer GPT12 Chip Environment Interfaces
Watchdog WDT1 (PMU/SCU/PLL) (Fast-LIN (with UART
protocol) / LIN)
Figure 1 Block diagram of the BootROM and its interaction with other TLE984xQX components
The startup procedure is the first software-controlled operation in the BootROM that is automatically
executed after every reset. Certain startup submodules are skipped depending on the type of reset (more
details are provided in “Reset types” on Page 14) and the error which might occur (more details are provided
in “Startup error handling” on Page 16).
The startup procedure includes the NVM initialization, PLL configuration, enabling of NVM protection,
branching to the different modes and other startup procedure steps.
There are two (2) operation modes in the BootROM:
• User/BSL mode
• Debug Support mode
The deciding factor will be on the latch values of TMS and P0.0 upon a reset. During reset, these signals are
latched at the rising edge of RESET pin. Details are provided in “Boot modes” on Page 9.
Libraries
(used by all
SWD Debug
modules)
Mode
Analog Module
MBIST Clock / PLL
Trimming
Timer
NVM /
CS
Watchdog
The initialization process differs slightly between each selected boot mode. Each boot mode has a different
set of initialization steps to be performed. For instance, some initialization steps might be skipped for one
mode but carried out for another mode.
The functional blocks are listed in Table 2.
The reset source should get read from the PMU Reset Status Register (PMU_RESET_STS). Clearing
PMU_RESET_STS is strongly recommended in the user startup code, as uncleared bits can cause a wrong reset
source interpretation in the BootROM firmware after the next reset (e.g. handling a warm reset as a cold reset)
The system startup status register SCU.SYS_STRTUP_STS should get checked for any startup fails.
The bit INIT_FAIL which is a logical or of all module status bits should get checked at least.
See the TLE984xQX user manual for a detailed register description.
Start
Cold_ Reset No
OR
NVM_CS bit0 = 1
Yes
RAM MBIST
Warm_Reset?
Yes
No
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
User BSL mode SWD Debug mode
select
Disable Watchdog
No No
RAM test OK? RAM test OK?
Yes Yes
user_mode_entry user_mode_entry
(debug = Disabled) (debug = Enabled)
Enable Watchdog
Clear Timer
Loop forever
Device configuration
prepare
BSL
Clk to PLL
switch
Clear interrupts
Clear RAM
User mode error
handling
Attention: The reset source is read from the PMU Reset Status Register (PMU_RESET_STS). Clearing
PMU_RESET_STS is strongly recommended in the user startup code, as uncleared bits can
cause a wrong reset source interpretation in the BootROM firmware after the next reset (e.g.
handling a warm reset as a cold reset).
See also “Post user mode entry recommendations” on Page 11.
Note: The standard RAM interface is disabled during MBIST test execution.
Note: MON inputs must not be floating in order to prevent an unintended wakeup.
BSL Libraries
(used by all
BSL Protocol modules)
All command messages are encapsulated in an interface-specific frame format. This format includes specified
parameters, such as a checksum calculation and overall message size. Also specified on this level is whether
the interface is used as a peer-to-peer connection or as a commander-responder-bus communication, which
includes device node addressing. This interface-specific frame handling is implemented in the interface-
specific protocol layer (e.g. LIN protocol).
The BSL protocol layer performs the command execution based on the parsed BSL commands. This results in
programming of the NVM, NVM CS (Configuration Sector), downloading to RAM or execution of NVM/RAM
code. It also includes the aspect that some commands are blocked based on applied hardware protection or
boot mode selection.
0 1 2 3 4 5 6
0 1 2 3 4 5 6
For LIN communication, the passphrase frames are encapsulated by sync break, sync char, protected ID, NAD
and checksum byte fields. A passphrase frame is rejected in case of incorrect received NAD or checksum bytes.
For FastLIN communication, the frames are extended by the checksum byte. Details about the encapsulation
are given in Section 4.2.
The BootROM ignores and rejects all received LIN and FastLIN frames if the communication is still locked. This
rejection includes frames with valid NAD and checksum fields. It does not reply to any received passphrase
frames.
The NAC timeout stops when the communication is unlocked after receiving the second valid passphrase
frame. For more details about NAC timeout, refer to Section 3.4.
Non Header
Block
Command
Polling New Messages processed
Single
Message
Multi
Command
Message
Command
Multi Message Collect Command Process
EOT Block
Data Block
. BSL _MSG_PARSE _STATES
The state machine starts to wait for the header block. This could be either a command which consists of a
single header block (the message type MSB bit is set) or a command that consists of multiple messages (the
message type MSB bit is zero).
For multi-message commands, all message data is collected by receiving data block messages. The last
message data is always received by an EOT block message.
The EOT block message reception initiates command parsing and execution.
The command processing includes message validation, where the message parameters are checked for
boundaries, any hardware applied protection and if this message is supported for this boot mode.
The state machine aborts the multi-message collection if the overall data bytes of all collected messages have
exceeded the maximum message data buffer length of 137 bytes (7 bytes in the header block message +
130 EOT data bytes).
For single message commands, all command-related information is already available in the header block
message. The command parsing and execution start right after receiving the message.
After command execution and after a response has been sent, the state machine returns to the header block
polling state in order to wait for the next command.
Any received message which does not fit the current state or state transmission leads to an exit from the
current state and restarting of the whole state machine.
Response data left Response data left (Multi Msg Command &
greater than not greater than Error occurred) ||
EOT msg size EOT msg size (Single Msg)
Send Response
Send EOT Msg
Msg
Some BSL messages request read-out of data from the device. These messages expect multi-message
responses. The responses are sent out using data block and EOT block messages, where the data block
messages are only used for the data that does not fit in the EOT block message. The EOT block message is the
last message for such responses.
Other BSL messages download data or initiate code execution. They do not request reading out of any data.
These messages only reply with a status response message.
A BSL command execution replies with a status response message in the event that the command execution
fails.
Attention: The BootROM responds to each incoming command. This is either the requested data or the
response block (e.g. success or error code). Only the code execution command does not reply
with a response message.
Table 4 BSL byte and frame timing limits and highest transfer rate
Delay type LIN (min.) FastLIN (min.)
Between bytes 4.1 µs 3.7 µs
Between end of CMD to start of DATA or EOT frame 20 µs 20 µs
Interframe timeout 280 ms 280 ms
Host waiting time for message processing before asking for response 100 µs *) n/a
Host waiting time after response is received until a new frame can be sent 20 µs 20 µs
*) There are certain BSL commands that need longer processing time. These involve NVM write/erase
operations. The host waiting time is longer before a command response can be requested or before a result is
sent back. Changing a value in an already programmed NVM page, which happen if a setting is changed,
requires the following NVM steps:
• Read the full page into the HW buffer
• Update the HW buffer with new data
• Program the page from the HW buffer
• Erase the old page
Total time: 8 ms
The processing time must always be taken into account.
Notes
1. When a LIN frame is received, its PID and NAD numbers are checked. If one of them does not match, the current
frame is discarded and frame reception process is restarted with detection of break/sync sequence.
2. Valid host synchronization: For FLIN/LIN the full passphrase has been received before NAC expires.
Received bytes
Status: Valid frame received
within timeout period
BSL
Protocol
LIN
Timer
Protocol
LIN
HAL
. LIN_PROTOCOL_LAYER
Figure 11 shows the interaction between hardware and software layers for the BSL LIN mode.
SW
SFRs HW
Tx Rx
LIN Tranceiver
LIN GND_LIN
BSL_LIN_MODE_LAYERS
Host BootROM
SYN
SYN Protected
Break 7 Data bytes for Checksum
Char ID NAD
(At least Command (1 byte)
55H 3CH
13 bit low)
SYN
SYN Protected
Break
Char ID
(At least
55H 7DH
13 bit low)
Response
. B12PHASEDETAILS
The Commander Request Header is transmitted from the host to the BootROM, followed by the command,
which is the header block. The Responder Response Header is transmitted to check the status of the
operation. To save protocol overhead, the BootROM supports multiple data block transfers, sending a
Responder Response Header is only allowed after the EOT block has been sent. Sending a Responder
Response Header between data blocks will result in a communication error. As the commands are sent one
after another without waiting for any status indication, a certain delay is required (as shown in Figure 13) to
ensure sufficient time is provided for the BootROM to execute the desired operations.
Figure 13 shows the LIN frame communication for BSL commands, where no data blocks and EOT blocks are
involved.
Host BootROM
Figure 14 shows the LIN frame communication for BSL commands, where data are downloaded over data
blocks and EOT blocks.
Host BootROM
…
… The last data are always sent
… with a EOT block frame .
This EOT triggers the BootROM
...
command processing
Commander Request Header and execution
Figure 15 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
…
… Multiple Responder Response Header are sent by the Host,
where BootROM replies with Data Blocks.
…
These Data Blocks contain the required data.
...
Responder Response Header
. LIN_ FRAME_FORMAT
. LIN_RESPONSE _FORMAT
Note: The LIN block with the standard LIN broadcast NAD (7FH) is ignored.
The firmware treats a received BSL message with NAD value of FFH as 'broadcast' message. BSL responds to
this no matter which NAD value is stored inside the NVM CS. A device with an invalid NAD value in NVM CS only
responds to a BSL 'broadcast' message.
4.2.1.4 Checksum
The checksum contains the inverted eight-bit sum with a carry over all data bytes. Data bytes are defined as
all bytes in the LIN frame excluding the protected ID byte.
Checksum calculation over the data bytes only is referred to as a classic checksum. An eight-bit sum with carry
is equivalent to the sum of all values, subtracted by 255 every time the sum is greater than or equal to 256.
Enhanced checksums are normally used for LIN 2.x devices, but frame identifiers (PID) 3CH always uses the
classic checksum.
The checksum is the last field of Command and Response LIN frames.
Host
BootROM
Commander Request Write RAM Data
Header &
Header Block: SYN 0x55 0x3C NAD Length *) 0x02 Address *) Res Num*) CHKS
EOT Block: SYN 0x55 0x3C NAD Length *) 0x80 Data Bytes*) CHKS
Host
BootROM
Commander Request Read RAM Data
Header &
Header Block: SYN 0x55 0x3C NAD Length *) 0x84 Address *) Res Num*) CHKS
. LIN_FRAME_RAM_READ_EXAMPLES
SW
SFRs HW
Tx Rx
LIN Tranceiver
LIN GND_LIN
BSL_FAST_LIN_MODE_LAYER
S
Dummy bytes
Depending on the BSL frame data fill level, some frame data bytes are not used. Those bytes are filled with
dummy bytes, which are set to zero. The BootROM ignores dummy bytes, independent of their values.
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.
RAM access limitation
Access to the BootROM RAM is limited for the BSL commands Command 84H – RAM: Read Data and
Command 02H – RAM: Write Data/Program. In all boot modes, the full RAM range can be read but global
variables/data and stack area cannot be written to. Trying to write to these areas will result in an error.
RAM and NVM address range checks
All commands reading or writing the NVM or RAM check the address range and return an error if it is exceeded.
The number of bytes to be read or written must be greater than zero.
Blocking of BSL commands due to NVM protection
With any command, the BSL applies checks to determine if the command can get executed. BSL commands
accessing the NVM also check the applied read or write NVM HW protection scheme against the NVM access
request. Details are given specifically with each BSL command description. An error is returned upon any
access violation. Table 10 states which NVM protection group is checked before a given BSL command is
executed.
Definitions of NVM protection groups:
• Group 1 = NVM HW read or write protection applied to any NVM region. Reason for this: BSL download is
blocked in case any protection is set. This is done to avoid BSL download of code into any region (even
100TP pages)
• Group 2 = NVM HW read protection applied to any NVM region. Reason for this: BSL download is blocked in
case any protection is set. This is done to avoid BSL download of code into any region (even 100TP pages)
• Group 3 = NVM HW read protection applied to any NVM region and no write protection to NVM code region.
Reason for this: When in user mode, instead, the concept is that for CS accessible page (e.g. 100TP pages)
the FW should apply the same protection set for the user code region. This means that the 100TP write via
User API should be blocked only in case the write protection of the code region (checked by looking at the
NVM_PROT_STS bits) is set
• Group 4 = NVM HW read and write protection for all regions are ignored. Reason for this: For a command
that can change protection, must be allowed access independently of protection
0 1 2 3 4 5 6
Address Address
Message Address
Length Byte #0 Byte #2 Reserved Number
Type Byte #1
(MSB) (LSB)
Table 11 “Command 02H – RAM: Write Data/Program” Header Block Field Description
Field Description
Length Number of following bytes in the header block. Always set to 06H
Message Type RAM write command. Always set to 02H
Address Byte #0 (MSB) 24-bit RAM address offset where to store the download data.
Address Byte #1 The offset starts counting from the RAM start address 1800.0000H
Address Byte #2 (LSB)
Number 8-bit number of data bytes to write with the whole message. The BootROM expects to
receive these bytes in data blocks and an EOT block.
Maximum supported length: 128 bytes.
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.
0 1 2–6
Message
Length Data
Type
. BSL20 _MODE_DATA
Table 12 “Command 02H – RAM: Write Data/Program” Data Block Field Description
Field Description
Length Number of following bytes in the data block. Always set to 06H
Message Type Data block. Always set to 00H
Data It contains the downloaded data (no dummy data to fill up the packet).
EOT Block
0 1 2...129
Message
Length Data
Type
. BSL20_MODE_EOT
Table 13 “Command 02H – RAM: Write Data/Program” EOT Block Field Description
Field Description
Length Number of following bytes in the EOT block. The value depends on the size of the “Data”
field:
• LIN – always 2 to 6 bytes
• FastLIN – 2 ... 129 bytes
Message Type EOT block. Always set to 80H
Data The maximum size of the field depends on the BSL interface that is used:
• LIN – 5 bytes
• FastLIN – 128 bytes
Contains the downloaded data.
The EOT block message is the last message for a download and contains the last
downloaded bytes. The data download process does not use data block messages if the
overall data size is equal to or smaller than the “Data” field.
It is not allowed for the RAM code to make a return call. ARM LR register has been set to zero when jumping to
RAM. If BSL should be re-entered a system reset must be performed.
This command does not support any Responder Response Header. It performs the RAM code execution right
after receiving the header block.
Command is rejected if there is any NVM HW read protection applied to any NVM region. Details about the NVM
access protection are given in Command 89H – NVM: Protection Set / Clear.
Header Block
0 1 2 3 4
Address Address
Message Address
Length Byte #0 Byte #2
Type Byte #1
(MSB) (LSB)
0 1 2 3 4 5 6
Address Address
Message Address
Length Byte #0 Byte #2 Reserved Number
Type Byte #1
(MSB) (LSB)
Table 15 “Command 84H – RAM: Read Data” Header Block Field Description
Field Description
Length Number of following bytes in the header block. Always set to 06H
Message Type RAM read data command. Always set to 84H
Address Byte #0(MSB) 24-bit RAM address offset where to read the data.
Address Byte #1 The offset starts counting from the RAM start address 1800.0000H
Address Byte #2(LSB)
Number 8-bit number of data bytes to read. The BootROM will send these bytes in Data Blocks
and an EOT block.
Maximum supported length: 128 bytes
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.
0 1 2–6
Message
Length Data
Type
. BSL20 _MODE_DATA
Table 16 “Command 84H – RAM: Read Data” Data Block Field Description
Field Description
Length Number of following bytes in the data block. Always set to 06H
Message Type Data block. Always set to 00H
Data It contains the read data.
EOT Block
0 1 2...129
Message
Length Data
Type
. BSL20_MODE_EOT
Table 17 “Command 84H – RAM: Read” Data EOT Block Field Description
Field Description
Length Number of following bytes in the EOT block. The value depends on the size of the Data field:
• LIN – always 2 to 6 bytes
• FastLIN – 2 ... 128 bytes
Message Type EOT block. Always set to 80H
Data The maximum size of the field depends on the used BSL interface:
• LIN – 5 bytes
• FastLIN – 128 bytes
Contains the read data.
The EOT block message is the last message for a read byte. The data read process does not
use Data Block messages if the overall data size is equal to or smaller than the “Data” field
0 1 2 3 4 5 6
Address Address
Message Address
Length Byte #0 Byte #2 Reserved Number
Type Byte #1
(MSB) (LSB)
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.
0 1 2–6
Message
Length Data
Type
. BSL20 _MODE_DATA
Table 19 “Command 05H – NVM: Write Data/Program” Data Block Field Description
Field Description
Length Number of following bytes in the data block. Always set to 06H
Message Type Data block. Always set to 00H
Data It contains the downloaded data (no dummy data to fill up the packet)
EOT Block
0 1 2...129
Message
Length Data
Type
. BSL20_MODE_EOT
Table 20 “Command 05H – NVM: Write Data/Program” EOT Block Field Description
Field Description
Length Number of following bytes in the EOT block. The value depends on the size of the Data
field:
• LIN – always 2 to 6 bytes
• FastLIN – 2 ... 129 bytes
Message Type EOT block. Always set to 80H
Data The maximum size of the field depends on the used BSL interface:
• LIN – 5 bytes
• FastLIN – 128 bytes
Contains the downloaded data.
The EOT block message is the last message for a download and contains the last
downloaded bytes. The data download process does not use Data Block messages if the
overall data size is equal to or smaller than the "Data" field
0 1 2 3 4
Address Address
Message Address
Length Byte #0 Byte #2
Type Byte #1
(MSB) (LSB)
0 1 2 3 4 5 6
Address Address
Message Address
Length Byte #0 Byte #2 Reserved Number
Type Byte #1
(MSB) (LSB)
Table 22 “Command 87H – NVM: Read Data” Header Block Field Description
Field Description
Length Number of following bytes in the header block. Always set to 06H
Message Type NVM read data command. Always set to 87H
Address Byte #0(MSB) 24-bit NVM address offset where to read the data.
Address Byte #1 The offset starts counting from the NVM start address 1100.0000H
Address Byte #2(LSB)
Number 8-bit number of data bytes to read. The BootROM will send these bytes in Data Blocks
and an EOT block.
Maximum supported length: 128 bytes
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.
0 1 2–6
Message
Length Data
Type
. BSL20 _MODE_DATA
Table 23 “Command 87H – NVM: Read Data” Data Block Field Description
Field Description
Length Number of following bytes in the data block. Always set to 06H
Message Type Data block. Always set to 00H
Data It contains the read data
EOT block
0 1 2...129
Message
Length Data
Type
. BSL20_MODE_EOT
Table 24 “Command 87H – NVM: Read Data” EOT Block Field Description
Field Description
Length Number of following bytes in the EOT block. The value depends on the size of the Data
field:
• LIN – always 2 to 6 bytes
• FastLIN – 2 ... 128 bytes
Message Type EOT block. Always set to 80H
Data The maximum size of the field depends on the used BSL interface:
• LIN – 5 bytes
• FastLIN – 128 bytes
Contains the read data.
The EOT block message is the last message for read bytes. The data read process does
not use Data Block messages if the overall data size is equal to or smaller than the “Data”
field
0 1 2 3 4 5
Address Address
Message Address Erase
Length Byte #0 Byte #2
Type Byte #1 Type
(MSB) (LSB)
0 1 2 3 4 5 6
Password Password
Message Password Password
Length Byte #0 Byte #3 Options
Type Byte #1 Byte #2
(MSB) (LSB)
Table 26 “Command 89H – NVM: Protection Set / Clear” Header Block Field Description
Field Description
Length Number of following bytes in the header block. Always set to 06H
Message Type NVM protection set/clear command. Always set to 89H
Password Byte #0(MSB) 32-bit password parameter. (see also “NVM password format” on Page 68)
Password Byte #1
Password Byte #2
Password Byte #3(LSB)
Options The options field is described in Table 27
Table 27 “Command 89H – NVM: Protection Set / Clear” Header Block Options Field Description
Field Bits Description
Res 7:3 Reserved
Password Selector 2:1 Password Selector
Password selection to set or reset.
00B Customer Bootloader Password
01B Code Segment Password
10B Data Segment Password
11B Reserved
Operation 0 Set/Clear the password protection
0B Clear, The password protection is cleared if the provided password
matches the installed password for the region
1B Set, Password protection is installed for the region if the selected
password protection is currently not installed
0 1 2 3 4 5 6
Message CS
Length Reserved Offset Reserved Number
Type Index
. BSL20_MODE0B_HEADER
Table 28 “Command 0DH – NVM: 100TP Write” Header Block Field Description
Field Description
Length Number of following bytes in the header block. Always set to 06H
Message Type NVM 100TP write command. Always set to 0DH
CS Index 100TP Selector.
Supported range: 0 ... 7
Offset Byte offset within page, valid range 0 ... 125
Number 8-bit number of data bytes to write with the whole message. The BootROM expects to
receive these bytes in Data Blocks and an EOT block.
Maximum supported length: 126 bytes
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.
0 1 2–6
Message
Length Data
Type
. BSL20 _MODE_DATA
Table 29 “Command 0DH – NVM: 100TP Write” Data Block Field Description
Field Description
Length Number of following bytes in the data block. Always set to 06H
Message Type Data block. Always set to 00H
Data It contains the downloaded data (no dummy data to fill up the packet).
EOT Block
0 1 2...127
Message
Length Data
Type
Table 30 “Command 0DH – NVM: 100TP Write” EOT Block Field Description
Field Description
Length Number of following bytes in the EOT block. The value depends on the size of the Data
field:
• LIN – always 2 to 6 bytes
• FastLIN – 2 ... 127 bytes
Message Type EOT block. Always set to 80H
Data The maximum size of the field depends on the used BSL interface:
• LIN – 5 bytes
• FastLIN – 126 bytes
Contains the read data.
The EOT block message is the last message for read bytes. The data read process does
not use Data Block messages if the overall data size is equal to or smaller than the “Data”
field.
• 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
0 1 2 3 4 5 6
Message CS
Length Reserved Offset Reserved Number
Type Index
. BSL20 _MODE0C_HEADER
Table 31 “Command 8EH – NVM: 100TP Read” Header Block Field Description
Field Description
Length Number of following bytes in the header block. Always set to 06H
Message Type NVM 100TP read command. Always set to 8EH
CS Index 100TP Selector.
Supported range: 0 ... 7
Offset Byte offset within page, valid range 0 ... 126
Number Number of data bytes to read. The BootROM will send these bytes in Data Blocks and an
EOT block.
Maximum supported length: 127 bytes
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.
0 1 2–6
Message
Length Data
Type
. BSL20 _MODE_DATA
Table 32 “Command 8EH – NVM: 100TP Read” Data Block Field Description
Field Description
Length Number of following bytes in the data block. Always set to 06H
Message Type Data block. Always set to 00H
Data It contains the read data
EOT Block
0 1 2...129
Message
Length Data
Type
. BSL20_MODE_EOT
Table 33 “Command 8EH – NVM: 100TP Read” EOT Block Field Description
Field Description
Length Number of following bytes in the EOT block. The value depends on the size of the Data
field:
• LIN – always 2 to 6 bytes
• FastLIN – 2 ... 128 bytes
Message Type EOT block. Always set to 80H
Data The maximum size of the field depends on the used BSL interface:
• LIN – 5 bytes
• FastLIN – 128 bytes.
Contains the read data.
The EOT block message is the last message for read bytes. The data read process does
not use Data Block messages if the overall data size is equal to or smaller than the "Data"
field
0 1 2 3
BSL BSL
Message
Length Interface Timeout
Type
Selector (NAC)
Table 34 “Command 8FH – BSL: Option Set” Header Block Field Description
Field Description
Length Number of following bytes in the header block. Always set to 03H
Message Type BSL option set. Always set to 8FH
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.
A maximum of 140 ms is supported.
The BSL timeout parameter counts the amount of 5 ms (01H = 5 ms, 02H = 10 ms and so
on). The value FFH waits forever.
A value = 00H disables the BSL mode and the BootROM directly jumps to user mode
0 1
Message
Length
Type
Table 35 “Command 90H – BSL: Option Get” Header Block Field Description
Field Description
Length Number of following bytes in the header block. Always set to 01H
Message Type BSL option set. Always set to 90H
EOT block
0 1 2 3
BSL BSL
Message
Length Interface Timeout
Type
Selector (NAC)
0 1 2
Message LIN
Length
Type NAD
Table 37 “Command 91H – LIN: NAD Set” Header Block Field Description
Field Description
Length Number of following bytes in the header block. Always set to 02H
Message Type BSL option set. Always set to 91H
LIN NAD New NAD value to be stored in the NVM CS
0 1
Message
Length
Type
Table 38 “Command 92H – LIN: NAD Get” Header Block Field Description
Field Description
Length Number of following bytes in the header block. Always set to 01H
Message Type BSL option set. Always set to 92H
EOT Block
0 1 2
Message
Length NAD value
Type
Table 39 “Command 92H – LIN: NAD Get” EOT Block Field Description
Field Description
Length Number of following bytes in the EOT block. Always set to 02H
Message Type EOT block. Always set to 80H
NAD value The configured LIN NAD value
Note: When sending this command, the response to the command will use the old baudrate. The new
baudrate will be set only after the response has been transmitted.
0 1 2
Fast-LIN
Message
Length Baudrate
Type
Selector
Table 40 “Command 93H – FastLIN: Set Session Baudrate” Header Block Field Description
Field Description
Length Number of following bytes in the header block. Always set to 02H
Message Type BSL Set session baud rate. Always set to 93H
FastLIN Baudrate Baud rate to be used, starting from the next frame:
Selector • 0 - 38.4 kBd
• 1 - 115.2 kBd
• 2 - 230.4 kBd
0 1 2 3
Response Response
Message Code Code
Length
Type Byte #0 Byte #1
(MSB) (LSB)
. BSL20 _MODE_RESPONSE
5 NVM
Bit: 31 30 29 0
R W Password
See also “Command 89H – NVM: Protection Set / Clear” on Page 54 for details on how to set or clear the NVM
protection password.
6 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.
6.6 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.
6.8.1 user_nvm_mapram_init
Description
This user API function triggers NVM FSM MapRAM update sequence from mapped sector.In case of mapping
errors (double or multiple mapping or faulty pages) the initialization of the MapRAM is stopped on the first
error found and the routine is exited reporting an error indication.
In case of fail, the content of the MapRAM might be only partial and the mapping information might be
corrupted.
Prototype
int32_t user_nvm_mapram_init (void)
Parameters
void
Return Values
6.8.2 user_bsl_config_get
Description
This user API function reads the user BSL interface selection value.
Prototype
BSL_INTERFACE_SELECT_t user_bsl_config_get (void)
Parameters
void
Return Values
6.8.3 user_bsl_config_set
Description
This user API function writes the user BSL interface selection value. This function returns an error in case the
NVM code segment is write protected.
Prototype
int32_t user_bsl_config_set (
BSL_INTERFACE_SELECT_t ser_if
)
Parameters
Return Values
Remarks
It is not allowed to be called by NVM callback routines.
6.8.4 user_ecc_events_get
Description
This user API function checks if any single or double ECC events have occurred during runtime. It reports any
single or double ECC event coming from NVM. The corresponding last double ECC failure address is returned
via modified pointer. Upon exit, the function will clear the current ECC status in the NVM module.
Prototype
int32_t user_ecc_events_get (
uint32_t * pNVM_Addr
)
Parameters
Return Values
Remarks
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.5 user_ecc_check
Description
This user API function checks for single and double ECC checking over the entire NVM (all NVM linear sectors
and all mapped pages inside the mapped NVM sector). Any existing ECC errors are cleared before the read
starts. Upon exit, the function will clear the current ECC status in the NVM module.
Prototype
int32_t user_ecc_check (void)
Parameters
void
Return Values
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.
6.8.6 user_mbist_set
Description
This user API function enables a separate MBIST for all possible reset sources, except POR reset and pin reset.
The MBIST is always performed for POR reset and pin reset. This function rejects with an error in case the NVM
code segment is write protected.
Prototype
int32_t user_mbist_set (
bool bEnable
)
Parameters
Return Values
Remarks
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.7 user_nac_get
Description
This user API function reads out the NAC value that is currently configured in the non volatile device
configuration memory.
Prototype
uint8_t user_nac_get (void)
Parameters
void
Return Values
6.8.8 user_nac_set
Description
This user API function configures the NAC value in the non volatile device configuration memory.
This function rejects with an error in case the NVM code segment is write protected.
Prototype
int32_t user_nac_set (
uint8_t nac
)
Parameters
Return Values
Remarks
Any NAC value larger than 28 gets clipped to 28.
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.
Prototype
uint8_t user_nad_get (void)
Parameters
void
Return Values
6.8.10 user_nad_set
Description
This user API function configures the LIN NAD value in the non volatile device configuration memory.
This function rejects with an error in case the NVM code segment is write protected.
Prototype
int32_t user_nad_set (
uint8_t nad
)
Parameters
Return Values
Remarks
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.11 user_nvm_100tp_read
Description
This user API function reads data from the customer accessible configuration pages (100TP), the read address
is relative inside the configuration NVM area (8x one page, 1024 bytes). An invalid parameter setup (page
number out of range, offset plus count larger than page boundary, count is 0) returns an error, no read
operation is performed. In case of a checksum error, the function also returns an error.
A maximum number of 127 bytes can be read by this function (the last byte contains the checksum and the
byte before the last byte contains the page counter).
Prototype
int32_t user_nvm_100tp_read (
uint32_t page_num
uint32_t offset
void * data
uint32_t count
)
Parameters
Return Values
Remarks
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.12 user_nvm_100tp_write
Description
This user API function writes data to the configuration NVM, the write address is relative inside the
configuration NVM area (8x one page, 1024 bytes). The function supports partial page programming,
preserving page data not passed as new input. The function performs an implicit update of the page checksum
and the write counter. The write counter is increased by 1 at each write operation, when 99 is reached, an error
is reported. The function does not allow the customer to change the page checksum or write counter. An
invalid parameter setup (page number out of range, offset plus count larger than page boundary, count is 0)
returns an error, no write operation is performed. The function also returns an error in case the NVM code
segment is write protected. The write counter and the page checksum are located in the last two bytes of the
page.
The maximum value for writing is 126 bytes.
Prototype
int32_t user_nvm_100tp_write (
uint32_t page_num
uint32_t offset
const void * data
uint32_t count
)
Parameters
Return Values
Remarks
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.13 user_nvm_config_get
Description
This user API function allows to gather the NVM configuration, this is the number of sectors for user code, user
data and user bsl.
Pointer must be within valid RAM range or an error code is returned.
Prototype
int32_t user_nvm_config_get (
uint8_t * cbsl_nvm_size
uint8_t * code_nvm_size
uint8_t * data_nvm_size
)
Parameters
Return Values
6.8.14 user_nvm_password_clear
Description
This user API function clears the NVM protection password for a given NVM code or data segment (not
supported for the BSL segment). The password is only removed in case the correct password is provided.
This function only removes the protection password from the device NVM configuration sector. It does not
remove the currently applied NVM HW access protection. The protection will not be applied until the next
system reboot, in case the password got removed successfully.
All NVM segment data (BSL-, Code- and Data- regions) and all passwords are erased in case a wrong password
is provided. Before erasing starts, all interrupts including NMI are temporarily disabled and any NVM and NVM
CS protection is disabled. Once erase is completed, protection and interrupts are restored to their original
state. The current protection status is not touched. The function rejects with an error in case the NVM code
segment is write protected.
Prototype
int32_t user_nvm_password_clear (
uint32_t password
NVM_PASSWORD_SEGMENT_t segment
)
Parameters
Return Values
Remarks
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.15 user_nvm_password_set
Description
This user API function sets a read and/or write protection for any NVM region individually. The API does not
change the protection state for a region where password protection is currently installed.
The password parameter consists of a 30-bit password (bit 0 ... 29) and two additional protection bits
(bit 30 + bit 31).
A valid password must be different from 0x3FFFFFFF and 0x00000000 (bit 0 ... 29). The two MS bits in the
password contain the protection type, where setting bit 31 activates the read protection and setting bit 30
activates the write protection. A non-compliant password is rejected. The function rejects with an error in case
the NVM code segment is write protected.
A password can only be applied in case no valid password is currently set for the requested region.
Prototype
int32_t user_nvm_password_set (
uint32_t password
NVM_PASSWORD_SEGMENT_t segment
)
Parameters
Return Values
Remarks
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.16 user_nvm_protect_get
Description
This user API function checks for the currently applied NVM hardware protection status.
Prototype
uint32_t user_nvm_protect_get (
NVM_PASSWORD_SEGMENT_t segment
)
Parameters
Return Values
6.8.17 user_nvm_protect_set
Description
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.
A valid password must be provided in case any valid NVM protection password is installed for this region.
All NVM segment data (BSL-, Code- and Data- regions) and all passwords are erased in case a wrong password
is provided. Before erasing starts, all interrupts including NMI are temporarily disabled and any NVM and NVM
CS protection is disabled. Once erase is completed, protection and interrupts are restored to their original
state.
Set bit 31 of the password parameter to enable read protection, set bit 30 of the password parameter to enable
write protection. The bits (0 ... 29) of the password parameter shall match the password installed before. In
case no valid protection password is currently installed, bits (0 ... 29) are ignored.
Prototype
int32_t user_nvm_protect_set (
uint32_t password
NVM_PASSWORD_SEGMENT_t segment
)
Parameters
Return Values
Remarks
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.18 user_nvm_protect_clear
Description
This user API function clears 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 (config sector).
A valid password must be provided in case any valid NVM protection password is installed for this region.
All NVM segment data (BSL-, Code- and Data- regions) and all passwords are erased in case a wrong password
is provided. Before erasing starts, all interrupts including NMI are temporarily disabled and any NVM and NVM
CS protection is disabled. Once erase is completed, protection and interrupts are restored to their original
state.
Set bit 31 of the password parameter to enable read protection, set bit 30 of the password parameter to enable
write protection. The bits (0 ... 29) of the password parameter shall match the password installed before. In
case no valid protection password is currently installed, bits (0 ... 29) are ignored.
Prototype
int32_t user_nvm_protect_clear (
uint32_t password
NVM_PASSWORD_SEGMENT_t segment
)
Parameters
Return Values
Remarks
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.19 user_nvm_ready_poll
Description
This user API function checks for the readiness of the NVM module. The API is called within the NVM
programming or erase branch callback operation. It checks if the NVM operation has finished and the callback
could return to the NVM routine.
Prototype
bool user_nvm_ready_poll (void)
Parameters
void
Return Values
6.8.20 user_nvm_page_erase
Description
This user API function erases a given NVM page (address). In case of an unused (new) page in non-linear sector,
the function does nothing and returns success. In case of erasing a page in linear sector, the function should
always perform the erase.
This function rejects with an error in case the accessed NVM page is write protected.
Prototype
int32_t user_nvm_page_erase (
uint32_t address
)
Parameters
Return Values
Remarks
This function does not support erasing any 100TP pages.
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.21 user_nvm_page_erase_branch
Description
This user API function erases a given NVM page (address) and branches to an address (branch_address) for
code execution during the NVM operation.
This function rejects with an error in case the accessed NVM page is write protected.
Prototype
int32_t user_nvm_page_erase_branch (
uint32_t address
user_callback_t branch_address
)
Parameters
Return Values
Remarks
This function does not support to erase any 100TP pages.
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.22 user_nvm_sector_erase
Description
This user API function erases the NVM sector-wise. It operates on user code and data NVM region.
This function rejects with an error in case the accessed NVM page is write protected.
Prototype
int32_t user_nvm_sector_erase (
uint32_t address
)
Parameters
Return Values
Remarks
It is not allowed to be called by NVM callback routines or any interrupt or multi-threaded environment in a re-
entrant context.
In case of non linear sector, the sector erase function has to run mapram init starting from a random position
to get a random spare page (for the next programming).
6.8.23 user_nvm_write
Description
This user API function programs the NVM. It operates on the user NVM, as well as on the user data NVM. The API
shall write a number of bytes (count) from the source (data) to the NVM location (address) with the
programming options (options). The options provide parameters like DH and fail scenario handling.
Supported option parameters:
• NVM_PROG_CORR_ACT (Disturb handling & retry enabled)
• NVM_PROG_NO_FAILPAGE_ERASE
The page programming stops at page boundary. If data is lost due to page boundary, an error code informs
that crossing page boundary is not supported. 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 (
uint32_t address
const void * data
uint8_t count
uint8_t options
)
Parameters
Return Values
Remarks
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.24 user_nvm_write_branch
Description
This user API function programs the NVM. It operates on the user NVM, as well as on the user data NVM. The API
shall write a number of bytes (count) from the source (data) to the NVM location (address) with the
programming options (options). During the NVM operation the program execution branches to a given SRAM
location (branch_address) and continues code execution from there. The options provide parameters like DH
and fail scenario handling.
Supported option parameters:
• NVM_PROG_CORR_ACT (Disturb handling & retry enabled)
• NVM_PROG_NO_FAILPAGE_ERASE
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
)
Parameters
Return Values
Remarks
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.25 user_ram_mbist
Description
This user API function performs a MBIST on the integrated SRAM. The range to check is provided as parameter.
The function rejects the call in case the parameter exceeds the RAM address range.
Prototype
int32_t user_ram_mbist (
uint32_t start_address
uint32_t end_address
)
Parameters
Return Values
Remarks
Customer needs to make attention to not destroy the BootROM stack pointer.
6.8.26 user_nvm_clk_factor_set
Description
This user API function sets the SCU_SYSCON0.NVMCLKFAC divider
Prototype
void user_nvm_clk_factor_set (
uint8_t clk_factor
)
Parameters
6.9.1 user_callback_t
Description
User NVM callback function
Prototype
typedef void(* user_callback_t) (void)
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,
}BSL_INTERFACE_SELECT_t;
Parameters
6.10.1.2 NVM_PASSWORD_SEGMENT_t
Description
NVM protection API password segment
Prototype
typedef enum
{
NVM_PASSWORD_SEGMENT_BOOT = 0,
NVM_PASSWORD_SEGMENT_CODE = 1,
NVM_PASSWORD_SEGMENT_DATA = 2,
}NVM_PASSWORD_SEGMENT_t;
Parameters
Example
int32_t User_Trimming_100TP(void)
{
int32_t status=0;
status = user_nvm_100tp_write(PAGE0,
ADC1_CNT_UPPER_OFFSET,
ADC1_TRIM_Data_table,
ADC1_CNT_UPPER_LEN);
return status;
}
Description
This function write into the 100TP page 0 at the offset 0x0C, which correspond to the address allowed for
ADC1_CNT8_11_UPPER. The length of the data to write is 12 bytes, which means 3 words:
ADC1_CNT8_11_UPPER, then ADC1_CNT4_7_UPPER and finally ADC1_CNT0_3_UPPER.
This function trims the following registers:
• ADC1_CNT8_11_UPPER = 0x11111111
• ADC1_CNT4_7_UPPER = 0x12121212
• ADC1_CNT0_3_UPPER = 0x13131313
Table 51 Alternative predefined values to trim in case 100TP page 0 and page 1 CRC is incorrect
100TP page 0
Data offset SFR registers Alternative backup values
0x00 ADC1_DUIN_SEL 0x00000000
0x04 ADC1_MMODE0_11 0x00000000
0x08 ADC1_DCHCNT1_4_UPPER 0x00000000
0x0C ADC1_CNT8_11_UPPER 0x00000000
0x10 ADC1_CNT4_7_UPPER 0x00000000
0x14 ADC1_CNT0_3_UPPER 0x00001b1a
0x18 ADC1_DCHCNT1_4_LOWER 0x00000000
0x1C ADC1_CNT8_11_LOWER 0x00000000
0x20 ADC1_CNT4_7_LOWER 0x00000000
0x24 ADC1_CNT0_3_LOWER 0x00001312
0x28 ADC1_DCHTH1_4_UPPER 0x00000000
0x2C ADC1_TH8_11_UPPER 0xffffffff
0x30 ADC1_TH4_7_UPPER 0xffffffff
0x34 ADC1_TH0_3_UPPER 0xffffc5c0
0x38 ADC1_TH8_11_LOWER 0x00000000
0x3C ADC1_CTRL2 0x00000fff
0x40 ADC1_TH4_7_LOWER 0x00000000
0x44 ADC1_TH0_3_LOWER 0x0000423a
0x48 ADC1_FILT_LO_CTRL 0x0000ffff
0x4C ADC1_FILT_UP_CTRL 0x0000ffff
0x50 ADC1_FILTCOEFF0_11 0x00ffffff
0x54 ADC1_CAL_CH10_11 0x00000000
0x58 ADC1_CAL_CH8_9 0x00000000
0x5C ADC1_CAL_CH6_7 0x00000000
0x60 ADC1_CAL_CH4_5 0x00000000
0x64 ADC1_CAL_CH2_3 0x00000000
0x68 ADC1_CAL_CH0_1 0x00000000
0x6C ADC1_SQ10_11 0x00000000
0x70 ADC1_SQ8_9 0x00000000
0x74 ADC1_SQ6_7 0x00000000
0x78 ADC1_SQ4_5 0x00000000
100TP page 1
Data Offset SFR registers Alternative backup values
0x00 ADC1_SQ2_3 0x00000000
0x04 ADC1_SQ0_1 0x00000000
0x08 ADC1_OFFSETCALIB 0x00000000
Table 55 General example of registers with changed default values done by bootROM
Module name Register name Default reset value Reconfigured value
T21 CON1 0x00000003 0x00000000
T2 CON1 0x00000003 0x00000000
ADC1 CTRL3 0x401 0x400
LS LS1_TRIM 0 Trimming value
LS2_TRIM 0 Trimming value
HS HS1_TRIM 0 Trimming value
HS2_TRIM 0 Trimming value
MF TEMPSENSE_CTRL 0x03 Trimming value
ADC2 CTRL1 0 Trimming value
LIN CTRL 0x180007 0x180207
SCU VTOR 0 0x02
PLL_CON 0xA4 Device variant dependent
APCLK 0 Device variant dependent
SYSCON0 0x80 0
SYS_STRTUP_STS 0 0x10
OSC_CON 0x10 0x18
NVM_PROT_STS 0 0x403F
SCUPM SYS_SUPPLY_IRQ_CTRL 0xFF 0
Table 56 Example of registers with changed default values for TLE9844-2QX 1) (cont’d)
Register name Default reset value After reconfiguration
(Evalboard)
TH0_3_LOWER 1D2F 423AH 0x0000423A
TH0_3_UPPER AB8D C5C0H 0xFFFFC5C0
TH4_7_UPPER 0000 0000H 0xFFFFFFFF
TH8_11_UPPER 0000 0000H 0xFFFFFFFF
Reset type values CCU6
INP 0000 0000H 0x3940
Reset type values CPU
SYSTICK_CALIB X0XX XXXXH 0
SYSTICK_CVR 00XX XXXXH 0x00FFFFFF
SYSTICK_RVR 00XX XXXXH 0x00FFFFFF
Reset type values GPT12E
ID 0000 0000H 0x00005804
Reset type values HS
HS1_TRIM 0000 0000H 0x09070001
HS2_TRIM 0000 0000H 0x09070001
LS1_TRIM 0000 0000H 0x12033F0F
LS2_TRIM 0000 0000H 0x10033F0F
Reset type values MF
REF1_STS 0000 00C1H 0x000000C5
TEMPSENSE_CTRL 0000 0003H 0x00000201
Reset type values PMU
MON_CNF1 0000 0000H 0x4747C7C7
MON_CNF2 0000 0000H 0x00000047
RESET_STS 0000 0000H 0x000002C8
Reset type values Port
P0_DATA 0000 00XXH 0x0000003A
P2_DATA 0000 00XXH 0x00000004
Reset type values SCU
APCLK 0000 0000H 0x02001301
APCLK_STS 0000 0000H 0x01000000
IEN0 0000 0000H 0x00DFFFFF
NVM_PROT_STS 0000 0000H 0x0000003F
OSC_CON 0000 0010H 0x00000018
PLL_CON 0000 00A4H 0x000000A1
SYS_STRTUP_STS 0000 0000H 0x00000010
SYSCON0 0000 0080H 0
VTOR 0000 0000H 0x00000002
Table 56 Example of registers with changed default values for TLE9844-2QX 1) (cont’d)
Register name Default reset value After reconfiguration
(Evalboard)
Reset type values SCUPM
AMCLK_TH_HYS D4E1 94B3H 0xD4E194B3
1) Order according to Evalboard.
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
A
API Application Programming Interface
B
BootROM Device-internal ROM code that the CPU executes directly after reset release
BSL Boot Strap Loader
BSL command The BootROM receives these messages via LIN. A message of this kind contains commands
message and related data. A complete command could consist of multiple messages. The BootROM
processes and execute these commands
BSL response The BootROM replies to BSL command messages by BSL response messages. A response
message message contains requested data or an error code. The response message format and
content depend on the given command
C
CS Configuration sector, see also NVM CS
D
Data block Part of the BSL command message. This block follows a header block for data download
commands.A data block could also be part of a BSL response message if the header block
message requests read-out of some data from the device. The last data block is always
followed by an EOT block
E
EOT block End of Transmission (EOT) block, part of the BSL command message or BSL response
message. This block follows a data block to terminate a larger data download message
F
FastLIN FastLIN is a LIN enhancement supporting higher baud rates of up 230.4 kBd. This rate is
higher than the standard LIN. This mode is especially useful during back-end
programming, where faster programming time is desirable
fINTOSC Internal oscillator (80 MHz)
G
H
HAL Hardware Abstraction Layer. This software layer abstracts all module-specific hardware
registers by API functions. It performs all device hardware register (SFR) accesses, which
includes timing of critical register accesses and polling mechanisms.
This layer exports its functionality to other software modules by means of API functions
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 TLE984x BootROM device over the LIN interface. The host
sends BSL command messages and receives BSL response messages
I
L
LIN Local Interconnect Network
M
MBIST Memory Built-In Self-Test (MBIST writes and reads all locations of the RAM to ensure that
its cells are operating correctly)
N
NAC No Activity Counter (millisecond timeout counter polling BSL LIN before jumping to user
mode code execution)
NAD Node Address for Diagnostics (LIN protocol parameter)
NVM Non-Volatile Memory (device-internal)
NVM CS NVM configuration sector. The BootROM uses one NVM sector to store device-specific
calibration and trimming values. It configures such values on the device during startup.
This sector also contains the One Time programmable and 100 Time programmable
sectors, which are offered to the user mode software.
The configuration sector is not directly accessible by user mode software
O
OSC Oscillator
P
POR Power-On Reset
PLL Phase-Locked Loop
Q
R
Response block Part of the BSL response message, in which the corresponding BSL command message
does not request read-out of data. This block reports the command execution status
ROM Read Only Memory
S
SA Service Algorithm
SCU System Control Unit
SFR Special Function Register (CPU memory-mapped device hardware registers)
SWD Serial Wire Debug
T
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. If the programming fails (e.g. because of power loss during the erase
or write procedure), either the old values are still present in the cell array or the verified
new values are present in the cell array. The firmware therefore can program a single page
in a tearing safe way
U
User mode code Customer application code for download and execution in NVM
UART Universal asynchronous receiver/transmitter
V
VTOR Vector Table Offset Register
W
WDT WatchDog Timer
Revision history
IMPORTANT NOTICE
Edition 2024-01-15 The information given in this document shall in no For further information on technology, delivery terms
event be regarded as a guarantee of conditions or and conditions and prices, please contact the nearest
Published by
characteristics ("Beschaffenheitsgarantie"). Infineon Technologies Office (www.infineon.com).
Infineon Technologies AG With respect to any examples, hints or any typical
81726 Munich, Germany values stated herein and/or any information regarding
the application of the product, Infineon Technologies WARNINGS
hereby disclaims any and all warranties and liabilities
© 2024 Infineon Technologies AG. of any kind, including without limitation warranties of Due to technical requirements products may contain
All Rights Reserved. non-infringement of intellectual property rights of any dangerous substances. For information on the types
third party. in question please contact your nearest Infineon
In addition, any information given in this document is Technologies office.
Do you have a question about any subject to customer's compliance with its obligations
aspect of this document? stated in this document and any applicable legal Except as otherwise explicitly approved by Infineon
Email: [email protected] requirements, norms and standards concerning Technologies in a written document signed by
customer's products and any use of the product of authorized representatives of Infineon Technologies,
Infineon Technologies in customer's applications. Infineon Technologies’ products may not be used in
The data contained in this document is exclusively any applications where a failure of the product or any
Document reference consequences of the use thereof can reasonably be
intended for technically trained staff. It is the
Z8F80561879 expected to result in personal injury.
responsibility of customer's technical departments to
evaluate the suitability of the product for the intended
application and the completeness of the product
information given in this document with respect to
such application.