background image

            

TLE984x

 
       

   

   
       

 

Microcontroller with LIN and Power Switches for

Automotive Applications

Automotive Power

Firmware User Manual (AE-step)

Revision 1.02 
2019-04-24

Summary of Contents for TLE984 Series

Page 1: ...TLE984x Microcontroller with LIN and Power Switches for Automotive Applications Automotive Power Firmware User Manual AE step Revision 1 02 2019 04 24...

Page 2: ...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_b...

Page 3: ...3 8 2 RAM Test MBIST and RAM Initialization 16 3 8 3 Analog Module Trimming 17 3 8 4 Startup Error Handling 17 3 8 5 No Activity Counter NAC Configuration 17 3 8 6 LIN Node Address for Diagnostics NAD...

Page 4: ...2 NVM Write 71 5 3 Data Flash Initialization 72 6 User Routines 73 6 1 List of Supported Features 73 6 2 Reentrance Capability and Interrupts 73 6 3 Parameter Checks 73 6 4 NVM Region Write Protection...

Page 5: ...9 1 user_callback_t 99 6 10 Data Types and Structure Reference 99 6 10 1 Enumerator Reference 100 6 10 1 1 BSL_INTERFACE_SELECT_t 100 6 10 1 2 NVM_PASSWORD_SEGMENT_t 100 6 10 2 Constant Reference 101...

Page 6: ...handling e g program and erase 1 3 Abbreviations and Special Terms A list of terms and abbreviations used throughout the document is provided in Terminology on Page 102 Table 1 1 Document Content Desc...

Page 7: ...OM Figure 2 1 Block Diagram of the BootROM and its Interaction with other TLE984x Components The startup procedure is the first software controlled operation in the BootROM that is automatically execu...

Page 8: ...found at 11000004H values at 11000004H 11000007H not equal to FFFFFFFFH and a proper NAC value is found then the BootROM proceeds into user mode In case an invalid No Activity Counter value is found...

Page 9: ...Startup Procedure Architecture Overview The startup code performs different device initialization steps After initialization the BootROM either starts BSL communication according to configuration or...

Page 10: ...scribed in Startup Program Structure on Page 9 The BootROM then enters a waiting loop to synchronize with the debugger connected to the Serial Wire Debug SWD interface After that the BootROM finishes...

Page 11: ...ng to user code If NAC is 00H the BSL window is closed no BSL connection is possible and the user mode is entered without delay If NAC is FFH no timeout is used BootROM code will switch off WDT1 and w...

Page 12: ...the mapping might not be complete and any NVM operation like write or erase is not safe and might cause further inconsistencies inside the data flash As corrective actions the user might reset the de...

Page 13: ...imer Cold_ Reset OR NVM_CS bit0 1 RAM MBIST Disable Watchdog Enable debug loop Clear Timer Clear RAM Warm_Reset RAM test OK RAM test OK Loop forever SWD Debug mode User BSL mode Yes No No Yes Yes No N...

Page 14: ...ot reset user_mode_entry debug Hot_Reset BSL User mode error handling NVM init OR NVM Protection OR Analog module Trimm Error Clk to PLL switch Clear interrupts Timer UART LIN registers reset debug En...

Page 15: ...set After a Hot reset the following initialization steps listed in Table 3 1 are processed except RAM memory test MBIST only executed if forced by NVM CS configuration as described in RAM Test MBIST a...

Page 16: ...reset type This can be done by enabling the feature using the user API function user_mbist_set on Page 81 Exception for the forced test is that for WARM reset the first 1kB of the RAM will not be chec...

Page 17: ...Recommendations on Page 12 3 8 4 Startup Error Handling To ensure that the device is properly booted error checking and error handling are added to the startup procedure For USER_BSL_MODE the overall...

Page 18: ...ration Sector page During user mode this parameter is read from the NVM CS Configuration Sector and verified against the stored inverted value The parameter is provided as an API parameter when callin...

Page 19: ...hitecture 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 o...

Page 20: ...0x38 x 5ms 4 1 3 NVM RAM Range Access Some BSL commands allow access to the NVM and some to the RAM In BSL mode the following memory ranges are accessible for read and write operations All user acces...

Page 21: ...s 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 timout refer to Sect...

Page 22: ...gth 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...

Page 23: ...cution 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...

Page 24: ...ived BSL command The BootROM is not able to provide the response messages or able to receive new commands before this period expires The host must wait this length of time before sending a new command...

Page 25: ...all timeout calculations If timeout is reached this means NAC timer expired BSL has completed host synchronization All timeouts are based on interframe timeout value This means wait forever for frame...

Page 26: ...tus Valid frame received but invalid length wait interframe timeout then restart break sync detection Invalid length Get frame bytes Start frame time measurement Interframe timeout Received bytes Host...

Page 27: ...lly polls the LIN protocol layer to receive incoming frames and send out available response frames The LIN protocol layer parses all incoming LIN frames it rejects frames with wrong checksum calculati...

Page 28: ...quest messages see Response Message Protocol are transmitted to check the status of the operation and to read out the data requested e g read RAM command Upon a response request message the requested...

Page 29: ...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 4 9...

Page 30: ...or processing and executing BSL command is needed Otherwise no response is possible LIN_FRAME2_UML Host BootROM Master Request Header Master Request Block Command Slave Response Header Slave Response...

Page 31: ...Table 4 2 Master Request Header Field Description Field Description Synch Break At least 13 bits must be low Synch Char Always 55H Protected ID Always 3CH Master Request Block Commands as described in...

Page 32: ...Table 4 3 Master Request Block Field Description Field Description NAD Node Address for Diagnostic specifies the address of the active slave node See Chapter 4 2 1 3 BSL Protocol Block This field det...

Page 33: ...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 th...

Page 34: ...t of following bytes in the frame Num 1 byte field Number of data bytes the host wants to read or write exchanged by data EOT block frames Data Bytes Data bytes read or written Address 24 bit RAM offs...

Page 35: ...ld Number of data bytes the host wants to read or write exchanged by data EOT block frames Data Bytes Data bytes read or written Address 24 bit RAM offset to read data SYN 0x55 0x3C NAD Length 0x84 Ad...

Page 36: ...Functionality The following features are provided by the LIN HAL BREAK condition detection on the LIN interface used as indication for incoming packets Baud rate detection Data reception Data transmi...

Page 37: ...FastLIN checksum calculation algorithm is the same algorithm used for the LIN interface see BSL via LIN on Page 27 The checksum is the last field of Command and Response FastLIN frames The FastLIN pas...

Page 38: ...ution command messages directly jump to the requested code location These messages will only send a response message if the requested command could not be executed Each incoming message is verified In...

Page 39: ...n scheme against the NVM access request Details are given specifically with each BSL command description An errror is returned upon any access violation Table 4 7 states which NVM protection group is...

Page 40: ...VM HW read protection applied to any NVM region Command 83H RAM Execute Command 86H NVM Execute Command 87H NVM Read Data Command 84H RAM Read Data Command 8EH NVM 100TP Read Command 90H BSL Option Ge...

Page 41: ...VM access protection are given in Command 89H NVM Protection Set Clear on Page 56 It returns an error code in the response message This message supports downloading of a maximum of 128 bytes into the...

Page 42: ...ill up the packet Table 4 10 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 Dat...

Page 43: ...y from NVM CS settings All interrupts are cleared The timer is cleared In the SCU_VTOR VTOR register VTOR_BYP is set to 01b RAM It is not allowed for the RAM code to make a return call ARM LR register...

Page 44: ...evision1 02 2019 04 24 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_...

Page 45: ...It returns an error code in the response message This message supports reading of a maximum of 128 bytes from the RAM Larger memory blocks need to be split into multiple Command 84H RAM Read Data mes...

Page 46: ...set to 00H Data It contains the read data Table 4 14 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...

Page 47: ...o NVM read or write protection applied to any NVM region Details about the NVM access protection are given in Command 89H NVM Protection Set Clear This message supports downloading of a maximum of 128...

Page 48: ...ket Table 4 17 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 al...

Page 49: ...ECTED 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_SEMAPHO...

Page 50: ...R_BYP 10b It is not allowed for the NVM code to make a return call ARM LR register has been set to zero when jumping to NVM If BSL should be re entered a system reset must be performed This command do...

Page 51: ...rom an address which belongs to the non linear NVM region and the page is not mapped previous programmed the read is rejected This message supports reading of a maximum of 128 bytes from the NVM Large...

Page 52: ...ad data Table 4 21 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...

Page 53: ...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_INVA...

Page 54: ...figuration Sector pages The host waiting time before response is sent back can be asked for Page erase 128 bytes sector erase 4 KB 5 ms Header Block Returned error codes The message can return the fol...

Page 55: ...Firmware User Manual AE step 55 Revision1 02 2019 04 24 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...

Page 56: ...be cleared first and then a new one can be set When the password has been successfully cleared the password specified for the region in the options field will get set to 0xFFFFFFFF If the password us...

Page 57: ..._LOG_CODE_USER_PROTECT_NVM_AND_PWD_ERASED ERR_LOG_CODE_NVM_ADDR_RANGE_INVALID ERR_LOG_CODE_NVM_ERASE_PARAMS_INVALID includes NVM write protection check ERR_LOG_CODE_USER_PROTECT_PWD_EXISTS Table 4 24...

Page 58: ...ta not passed as an input After successful write operation the page write counter and checksum parameter are updated These two bytes are stored at the end of the page These two internal bytes reduce t...

Page 59: ...data to fill up the packet Table 4 27 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 D...

Page 60: ...al AE step 60 Revision1 02 2019 04 24 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_ACC...

Page 61: ...ing the internal used page programming counter Those parameters are set during the write operation Details can be found in Command 0DH NVM 100TP Write Header Block Data Block This block is only used f...

Page 62: ...Message Type Data block Always set to 00H Data It contains the read data Table 4 30 Command 8EH NVM 100TP Read EOT Block Field Description Field Description Length Number of following bytes in the EOT...

Page 63: ...ror codes ERR_LOG_SUCCESS ERR_LOG_CODE_NVM_IS_READ_PROTECTED ERR_LOG_CODE_USERAPI_CONFIG_SECTOR_WRITE_PROTECTED ERR_LOG_CODE_USERAPI_CONFIG_SET_PARAMS_INVALID ERR_LOG_CODE_NVM_SEMAPHORE_RESERVED ERR_L...

Page 64: ...tection is applied to any NVM region The BSL option can be changed by the Command 8FH BSL Option Set Header Block EOT block Table 4 32 Command 90H BSL Option Get Header Block Field Description Field D...

Page 65: ...startup 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 timeo...

Page 66: ...the Command 92H LIN NAD Get command The host waiting time before response is sent back can be asked for 8 ms Header Block Returned error codes The message can return the following error codes ERR_LOG...

Page 67: ...91H LIN NAD Set command Header Block EOT Block Returned error codes The message can return the following error codes ERR_LOG_CODE_NVM_IS_READ_PROTECTED Table 4 35 Command 92H LIN NAD Get Header Block...

Page 68: ...ied to any NVM region The host waiting time before response is sent back can be asked for 8 ms NOTE When sending this command the response to the command will use the old baudrate The new baudrate wil...

Page 69: ...uring processing the requested command data Response Block Table 4 38 Acknowledge Response Block Field Description Field Description Length Number of following bytes in the Response Block Always set t...

Page 70: ...on is implemented It is intended to store dynamical application data inside this NVM region Constant data is recommended to be stored inside the user code area The EEPROM emulation is being achieved b...

Page 71: ...ddressed NVM page is being erased afterwards the content of the AB is written to the erased page For writing a new data flash page the user API function checks the content of the MapRAM for the given...

Page 72: ...artup by the MapRAM initialization function and only if failures occurred during the MapRAM initialization The Service Algorithm scans the entire data flash sector and tries to repair as much as possi...

Page 73: ...er application must not call these routines from different multitask levels e g different thread interrupt levels As user API routines are potentially timimg dependent it is recommended to disable int...

Page 74: ...isted in Appendix B Stack Usage of User API Functions Table 6 1 Resources used by User API functions User API function Non Re entrance NVM HW GPT12 timer user_nvm_mapram_init X X HW init user_bsl_conf...

Page 75: ...uring runtime It reports any single or double ECC event coming from NVM The corresponding last double ECC failure address is returned via modified pointer user_mbist_set This user API function enables...

Page 76: ...ped sector user_nvm_page_erase This user API function erases a given NVM page address This function rejects with an error in case the accessed NVM page is write protected In case of an unsused new pag...

Page 77: ...ed and the callback could return to the NVM routine user_nvm_sector_erase This user API function erases the NVM sector wise It operates on user code and data NVM region user_nvm_write This user API fu...

Page 78: ...NVM code segment is write protected Prototype int32_t user_bsl_config_set BSL_INTERFACE_SELECT_t ser_if Parameters Data Type Description int32_t Zero in case the function has been called successfully...

Page 79: ...ents_get uint32_t pNVM_Addr Parameters 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...

Page 80: ...OG_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 e...

Page 81: ...rototype 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 con...

Page 82: ...emarks Any NAC value larger than 28 gets clipped to 28 Data Type Description uint8_t NACvaluethatisfoundintheconfigurationmemory Itreturns waitforever 0xFF in case no NAC value is currently configured...

Page 83: ...turn 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...

Page 84: ...s an error A maximum number of 127 bytes can be read by this function including the page counter which is contained in the last byte of the page Prototype int32_t user_nvm_100tp_read uint32_t page_num...

Page 85: ...ndary 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...

Page 86: ...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 Pointer plus valid count must be within v...

Page 87: ...sabled 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 re...

Page 88: ...ected 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 in...

Page 89: ..._t password Protection password to apply on the given segment NVM_PASSWORD_SEG MENT_t segment Segment which should be password protected Data Type Description int32_t ERR_LOG_SUCCESS in case the passw...

Page 90: ...is completed protection and interrupts are restored to their original state Setbit31 ofthe passwordparameter to enablereadprotection set bit 30 of the passwordparameterto enable write protection The b...

Page 91: ...ection and interrupts are restored to their original state Setbit31 ofthe passwordparameter to enablereadprotection set bit 30 of the passwordparameterto enable write protection The bits 0 29 of the p...

Page 92: ...tion erases a given NVM page address In case of an unsused 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 al...

Page 93: ...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 ad...

Page 94: ..._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 Functioncallbackaddresswheretojumpwhilewaitingfor the NVM...

Page 95: ...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 boundar...

Page 96: ...e Description Dir 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 with...

Page 97: ...Dir 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...

Page 98: ...se 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_...

Page 99: ...e typedef void user_callback_t void 6 10 Data Types and Structure Reference This chapter contains the reference of data types and structures of all modules Data Type Description int32_t ERR_LOG_SUCCES...

Page 100: ...E_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_SEGMEN...

Page 101: ...M_PASSWORD_SEGMENT_DATA 2 NVM password for customer data segment Table 6 4 Constant Overview Name Value Description NVM_PASSWORD_PROTECTION_NO NE 0x00000000u NVM protection API password protection sta...

Page 102: ...iven 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 BS...

Page 103: ...er 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 con...

Page 104: ...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...

Page 105: ...alid FastLIN baudrate parameterorcurrentBSLinterface is not FASTLIN x ERR_LOG_CODE_NVM_ADDR_RANGE_INVALID 21D NVM address range is invalid ERR_LOG_CODE_ECC2READ_ERROR 22D ECC2READ error generated when...

Page 106: ...or checksum calculation failed x ERR_LOG_CODE_CS_PAGE_ECC2READ 47D NVM config sector checksum calculation failure based on NVM ECC2 error x ERR_LOG_CODE_MBIST_FAILED 62D MBIST test detected an error x...

Page 107: ...word_set provided password not valid x ERR_LOG_CODE_USER_PROTECT_PWD_EXISTS 78D nvm_protect_password_set segment password already exists when trying to set a new one in x ERR_LOG_CODE_USER_NVM_PROTECT...

Page 108: ...c_check 72D user_ecc_events_get 72D user_mbist_set 104D user_nac_get 8D user_nac_set 104D user_nad_get 8D user_nad_set 104D user_nvm_100tp_read 96D user_nvm_100tp_write 136D user_nvm_config_get 48D us...

Page 109: ...000107H user_nvm_protect_get 00000109H user_ecc_events_get 0000010DH user_ecc_check 0000010FH user_mbist_set 00000111H user_nac_get 00000113H user_nac_set 00000115H user_nad_get 00000117H user_nad_set...

Page 110: ...leads to a programming counter increase user_nvm_100tp_write returns with an error in case the user tries to program one page where the counter has reached 100 programming cycles Page programming coun...

Page 111: ...M_Data_table uint32_t ADC1_TRIM_Data_table 0x11111111 0x12121212 0x13131313 int32_t User_Trimming_100TP void int32_t status 0 status user_nvm_100tp_write PAGE0 ADC1_CNT_UPPER_OFFSET ADC1_TRIM_Data_tab...

Page 112: ...C1_CNT0_3_LOWER 0x12131312 0x28 ADC1_DCHTH1_4_UPPER 0x00000000 0x2C ADC1_TH8_11_UPPER 0x00000000 0x30 ADC1_TH4_7_UPPER 0x00000000 0x34 ADC1_TH0_3_UPPER 0xab8dc5c0 0x38 ADC1_TH8_11_LOWER 0x00000000 0x3...

Page 113: ...tup module configuration NVM CS entry Value Description CS_SCU_APCLK_CFG 0x02000B00 or 0x02001301 PLL divider settings depends on device variant 0x02000B00 25 MHz 0x02001301 40 MHz AnalogModuleClockFa...

Page 114: ...nac_get 0 0055 0 0034 0 0055 0 0034 user_nac_set 7 6129 7 5949 7 2798 7 2809 user_nad_get 0 0055 0 0034 0 0055 0 0034 user_nad_set 7 6133 7 5948 7 2823 7 2833 user_nvm_100tp_read 0 1235 0 0774 0 1234...

Page 115: ...s 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 LS...

Page 116: ...Inc TOKO of TOKO KABUSHIKI KAISHA TA UNIX of X Open Company Limited VERILOG PALLADIUM of Cadence Design Systems Inc VLYNQ of Texas Instruments Incorporated VXWORKS WIND RIVER of WIND RIVER SYSTEMS IN...

Reviews: