![]() |
Infineon MOTIX™ MCU TLE987x Device Family SDK
|
Go to the source code of this file.
BootROM low level access library.
Data Structures | |
union | CustomerID |
struct | Data |
struct | l00TP_Data |
union | User_100TP_Prog |
union | ProgFlag |
union | User_Prog |
union | User_OpenAB |
union | User_MAPRAM_Init |
union | User_NVM_ECC_Check |
union | User_ECC_Check |
union | User_ERASE_SECTOR_VERIFY |
union | User_ERASEPG_VERIFY |
union | User_VERIFY_PAGE |
Typedefs | |
typedef union CustomerID | TCustomerID |
typedef struct Data | TData |
typedef struct l00TP_Data | T100TP_Data |
typedef union User_100TP_Prog | TUser_100TP_Prog |
typedef union ProgFlag | TProgFlag |
typedef union User_Prog | TUser_Prog |
typedef union User_OpenAB | TUser_OpenAB |
typedef union User_MAPRAM_Init | TUser_MAPRAM_Init |
typedef union User_NVM_ECC_Check | TUser_NVM_ECC_Check |
typedef union User_ECC_Check | TUser_ECC_Check |
typedef union User_ERASE_SECTOR_VERIFY | TUser_ERASE_SECTOR_VERIFY |
typedef union User_ERASEPG_VERIFY | TUser_ERASEPG_VERIFY |
typedef union User_VERIFY_PAGE | TUser_VERIFY_PAGE |
Functions | |
uint8 | ProgramPage (uint32 addr, const uint8 *buf, uint8 Branch, uint8 Correct, uint8 FailPageErase) |
Programms a page to NVM. More... | |
bool | GetCustomerID (const TCustomerID *CustID) |
Reads the Customer ID out of the 100TP NVM. More... | |
Variables | |
bool(*const | USER_CFLASH_WR_PROT_EN )(uint16 cflash_pw) |
Sets the temporary code flash write protection. The password is compared against the. More... | |
bool(*const | USER_CFLASH_WR_PROT_DIS )(uint16 cflash_pw) |
Removes the temporary code flash write protection. The password is compared against the. More... | |
bool(*const | USER_CFLASH_RD_PROT_EN )(uint16 cflash_pw) |
Sets the temporary code flash read protection. The password is compared against the. More... | |
bool(*const | USER_CFLASH_RD_PROT_DIS )(uint16 cflash_pw) |
Removes the temporary code flash read protection. The password is compared against the. More... | |
bool(*const | USER_DFLASH_WR_PROT_EN )(uint16 dflash_pw) |
Sets the temporary data flash write protection. The password is compared against the. More... | |
bool(*const | USER_DFLASH_WR_PROT_DIS )(uint16 dflash_pw) |
Removes the temporary data flash write protection. The password is compared against the. More... | |
bool(*const | USER_DFLASH_RD_PROT_EN )(uint16 dflash_pw) |
Sets the temporary data flash read protection. The password is compared against the. More... | |
bool(*const | USER_DFLASH_RD_PROT_DIS )(uint16 dflash_pw) |
Removes the temporary data flash read protection. The password is compared against the. More... | |
uint8(*const | USER_OPENAB )(const uint32 NVMPAGEAddr) |
Opens the assembly buffer for writing to a flash page, for code flash as well as data flash. More... | |
uint8(*const | USER_PROG )(const uint8 PROG_FLAG) |
Writes the assembly buffer content to the flash page addressed by USER_OPENAB. More... | |
uint8(*const | USER_ERASEPG )(const uint32 *NVMPageAddr, const uint8 XRAM_RTNE_BRNCHNG) |
Erases a flash page, for code flash as well as data flash. More... | |
bool(*const | USER_ABORTPROG )(void) |
Closes the Assembly Buffer. More... | |
bool(*const | USER_NVMRDY )(void) |
Returns the status of the NVM module. More... | |
uint8(*const | USER_READ_CAL )(const uint8 NumOfBytes, const uint8 CSAddr, const uint16 RAMAddr) |
Reads the NVM calibration data. More... | |
bool(*const | USER_NVM_CONFIG )(const uint8 *NVMSize, const uint8 *MapRAMSize) |
Reads the total size of code flash and total size of data flash for this device. More... | |
uint8(*const | USER_NVM_ECC2ADDR )(const uint16 *ecc2addr) |
This function returns the last NVM address causing a double bit ECC failure. More... | |
uint8(*const | USER_MAPRAM_INIT )(void) |
This function performs a MapRAM reinitialization. More... | |
bool(*const | USER_READ_100TP )(const uint8 OTP_Page_Sel, const uint8 DataOffset, const uint32 *HundredTPData) |
This function reads four bytes from a selected 100TP page. More... | |
uint8(*const | USER_100TP_PROG )(const uint8 OTP_Page_Sel) |
This function writes data to a selected 100TP page. More... | |
uint8(*const | USER_ERASE_SECTOR )(const uint32 NVMSectorAddr) |
This function performs a sector erase. More... | |
uint8(*const | USER_RAM_MBIST_START )(const uint16 RAM_MBIST_Stop_Addr, const uint16 RAM_MBIST_Start_addr) |
This function performs a MBIST on the RAM for a given address range. More... | |
uint8(*const | USER_NVM_ECC_CHECK )(void) |
This function performs a ECC check on the entire NVM by reading the same. More... | |
uint8(*const | USER_ECC_CHECK )(const uint32 *ecc2addr) |
This function returns the address of the last ECC fail. More... | |
uint8(*const | USER_ERASE_SECTOR_VERIFY )(const uint32 sector_addr) |
This function performs a verify on an erased sector. More... | |
uint8(*const | USER_ERASEPG_VERIFY )(const uint32 page_addr) |
This function performs a verify on an erased page. More... | |
uint8(*const | USER_VERIFY_PAGE )(const uint32 page_addr) |
This function performs a verify on a programmed page. More... | |
#define addr_USER_100TP_PROG (0x386Du) |
#define addr_USER_ABORTPROG (0x38CDu) |
#define addr_USER_CFLASH_RD_PROT_DIS (0x390Du) |
#define addr_USER_CFLASH_RD_PROT_EN (0x3915u) |
#define addr_USER_CFLASH_WR_PROT_DIS (0x391Du) |
#define addr_USER_CFLASH_WR_PROT_EN (0x3925u) |
#define addr_USER_DFLASH_RD_PROT_DIS (0x38EDu) |
#define addr_USER_DFLASH_RD_PROT_EN (0x38F5u) |
#define addr_USER_DFLASH_WR_PROT_DIS (0x38FDu) |
#define addr_USER_DFLASH_WR_PROT_EN (0x3905u) |
#define addr_USER_ECC_CHECK (0x383Du) |
#define addr_USER_ERASE_SECTOR (0x3865u) |
#define addr_USER_ERASE_SECTOR_VERIFY (0x388Du) |
#define addr_USER_ERASEPG (0x38D5u) |
#define addr_USER_ERASEPG_VERIFY (0x3885u) |
#define addr_USER_MAPRAM_INIT (0x389Du) |
#define addr_USER_NVM_CONFIG (0x38B5u) |
#define addr_USER_NVM_ECC2ADDR (0x38ADu) |
#define addr_USER_NVM_ECC_CHECK (0x3845u) |
#define addr_USER_NVMRDY (0x38C5u) |
#define addr_USER_OPENAB (0x38E5u) |
#define addr_USER_PROG (0x38DDu) |
#define addr_USER_RAM_MBIST_START (0x384Du) |
#define addr_USER_READ_100TP (0x3875u) |
#define addr_USER_READ_CAL (0x38BDu) |
#define addr_USER_VERIFY_PAGE (0x3895u) |
#define FlashPageSize (128U) |
#define FlashSectorSize (4096U) |
typedef struct l00TP_Data T100TP_Data |
typedef union CustomerID TCustomerID |
typedef union User_100TP_Prog TUser_100TP_Prog |
typedef union User_ECC_Check TUser_ECC_Check |
typedef union User_ERASE_SECTOR_VERIFY TUser_ERASE_SECTOR_VERIFY |
typedef union User_ERASEPG_VERIFY TUser_ERASEPG_VERIFY |
typedef union User_MAPRAM_Init TUser_MAPRAM_Init |
typedef union User_NVM_ECC_Check TUser_NVM_ECC_Check |
typedef union User_OpenAB TUser_OpenAB |
typedef union User_Prog TUser_Prog |
typedef union User_VERIFY_PAGE TUser_VERIFY_PAGE |
bool GetCustomerID | ( | const TCustomerID * | CustID | ) |
Reads the Customer ID out of the 100TP NVM.
*CustID | pointer to the struct where the Customer ID will be stored |
Example
This example reads the Customer ID out of the first 100TP page.
uint8 ProgramPage | ( | uint32 | addr, |
const uint8 * | buf, | ||
uint8 | Branch, | ||
uint8 | Correct, | ||
uint8 | FailPageErase | ||
) |
Programms a page to NVM.
addr | logical address of the page to be programmed |
*buf | data buffer containing the data to be programmed, array of 128 bytes |
Branch | 0 = no RAM branch, 1 = RAM branch |
Correct | 0 = no corrective actions (retry/disturb handling) on verify fail 1 = corrective actions (retry/dirsturb handling) enabled |
FailPageErase | 0 = enabled, old data is kept, 1 = disable, old data erased |
Example
This example fills an array of 128 bytes with house numbers.
The page_data array will then be programmed to the first page
of the data flash.
The page programming is executed with no RAM branch,
with corrective actions (retry) and old data is kept in case of fail.
This function writes data to a selected 100TP page.
In order to write data to a 100TP page, the data has to be set up in a structure residing in RAM.
The structure has the following outline:
RAM Address | Function |
---|---|
0x18000400 | Number of Bytes to be programmed, max. 127 |
0x18000401 | page offset 1 |
0x18000402 | page data 1 |
0x18000403 | page offset 2 |
0x18000404 | page data 2 |
... | ... |
0x18000401 + ((N-1) x 2) | page offset N |
0x18000402 + ((N-1) x 2) | page data N |
OTP_Page_Sel | selects one out of eight 100TP pages, 0x11 is page 1, 0x12 is page 2, ..., 0x18 is page 8 |
true | = pass |
false | = fail |
Example
This example writes house numbers to the 2nd 100TP page.
|
extern |
Closes the Assembly Buffer.
true | = Assembly Buffer closed |
false | = Assembly buffer could not be close, programming already started |
Example
This example closes the Assembly Buffer intentionally.
Removes the temporary code flash read protection. The password is compared against the.
password stored in the 100TP page 1 offset 0x0C. The default password is 0x0000.
cflash_pw | password to validate function execution |
0 | = pass, |
1 | = fail, password doesn't match |
Example
This example removes the temporary code flash read protection by using the default password.
Sets the temporary code flash read protection. The password is compared against the.
password stored in the 100TP page 1 offset 0x0C. The default password is 0x0000.
cflash_pw | password to validate function execution |
0 | = pass, |
1 | = fail, password doesn't match |
Example
This example sets the temporary code flash read protection by using the default password.
Removes the temporary code flash write protection. The password is compared against the.
password stored in the 100TP page 1 offset 0x0C. The default password is 0x0000.
cflash_pw | password to validate function execution |
0 | = pass, |
1 | = fail, password doesn't match |
Example
This example removes the temporary code flash write protection by using the default password.
Sets the temporary code flash write protection. The password is compared against the.
password stored in the 100TP page 1 offset 0x0C. The default password is 0x0000.
cflash_pw | password to validate function execution |
0 | = pass, |
1 | = fail, password doesn't match |
Example
This example sets the temporary code flash write protection by using the default password.
Removes the temporary data flash read protection. The password is compared against the.
password stored in the 100TP page 1 offset 0x0E. The default password is 0x0000.
dflash_pw | password to validate function execution |
0 | = pass, |
1 | = fail, password doesn't match |
Example
This example removes the temporary data flash read protection by using the default password.
Sets the temporary data flash read protection. The password is compared against the.
password stored in the 100TP page 1 offset 0x0E. The default password is 0x0000.
dflash_pw | password to validate function execution |
0 | = pass, |
1 | = fail, password doesn't match |
Example
This example sets the temporary data flash read protection by using the default password.
Removes the temporary data flash write protection. The password is compared against the.
password stored in the 100TP page 1 offset 0x0E. The default password is 0x0000.
dflash_pw | password to validate function execution |
0 | = pass, |
1 | = fail, password doesn't match |
Example
This example removes the temporary data flash write protection by using the default password.
Sets the temporary data flash write protection. The password is compared against the.
password stored in the 100TP page 1 offset 0x0E. The default password is 0x0000.
dflash_pw | password to validate function execution |
0 | = pass, |
1 | = fail, password doesn't match |
Example
This example sets the temporary data flash write protection by using the default password.
This function returns the address of the last ECC fail.
Bit 0: single bit errors (SBE) 0 = pass, no SBEs detected 1 = fail, at least one SBE detected Bit 1: Double bit errors (DBE) 0 = pass, no DBEs detected 1 = fail, at least one DBE detected Bit 7: Execution status 0 = pass, routine executed successfully 1 = fail, routine failed to execute, due to nested call
Example
This example performs a ECC check on the entire flash.
This function performs a sector erase.
NVMSectorAddr | address of the sector which will be erased |
Bit 0: function status, OR'd all flags 0 = pass, sector erase successful 1 = fail, sector erase failed Bit 7: Execution status 0 = pass, routine executed successfully 1 = fail, routine failed to execute, due to sector protected, or nested call
Example
This example erases the data flash sector.
|
extern |
This function performs a verify on an erased sector.
This function checks if all pages within the sector are in proper erased state.
For the data flash sector it checks whether none of the pages are mapped and whether
a valid Spare Page is available an in proper erased state.
sector_addr | address of the sector which will be verified |
Bit 0: GlobFail, function status, OR'd all flags 0 = pass, sector erase verify successful 1 = fail, sector erase verify failed Bit 1: VerifyFail, Erase Verify Status 0 = pass, all pages are in proper erased state 1 = fail, at least one out of the 32 pages is not properly erased Bit 6: MapRAMFail, MapRAM Status, Data Flash sector only 0 = pass, MapRAM and Spare Page pass 1 = fail, mapped pages, or invalid Spare Page, or MapRAM ECC fail Bit 7: ExecFail, Execution status 0 = pass, routine executed successfully 1 = fail, routine failed to execute, due to invalid address, or assembly buffer open, or nested call
Example
This example verifies the erased state of the data flash sector after bootup.
|
extern |
Erases a flash page, for code flash as well as data flash.
NVMPageAddr | logical address to the flash page, the address has to be page aligned (128byte aligned) |
XRAM_RTNE_BRNCHNG | 0 = no RAM branch, 1 = RAM branch |
Example
This example performs a page erase of the first data flash page.
This function performs a verify on an erased page.
This function checks if a given page is in proper erased state.
For the data flash sector it checks whether the Spare Page is in proper erased state,
regardless of the provided page address. Because in the Data Flash the Spare Page is
the next physical page being used for writing.
page_addr | address of the page which will be verified |
Bit 0: GlobFail, function status, OR'd all flags 0 = pass, sector erase verify successful 1 = fail, sector erase verify failed Bit 1: VerifyFail, Erase Verify Status 0 = pass, all pages are in proper erased state 1 = fail, at least one out of the 32 pages is not properly erased Bit 6: MapRAMFail, MapRAM Status, Data Flash sector only 0 = pass, MapRAM and Spare Page pass 1 = fail, mapped pages, or invalid Spare Page, or MapRAM ECC fail Bit 7: ExecFail, Execution status 0 = pass, routine executed successfully 1 = fail, routine failed to execute, due to invalid address, or assembly buffer open, or nested call
Example
This example verifies the erased state of the Spare Page of the data flash sector after bootup.
|
extern |
This function performs a MapRAM reinitialization.
The MapRAM is the logic to physical address translation for the data flash.
This function invalidates the MapRAM content and rebuilds from the data flash content.
It furthermore checks the mapping integrity, in case the mapping is not unambiguous an error will be reported.
in this case the data flash cannot be used until the error is solved.
This function also randomizes the Spare Page newly.
Bit 0: function status, OR'd all flags 0 = pass, MapRAM initialized, no fails, data flash ready 1 = fail, see bits[5:7] for further details Bit 5: Double Mapping status 0 = pass, no double-mapping found 1 = fail, initialization failed due to double-mapping Bit 6: faulty Page status 0 = pass, no faulty page found 1 = fail, initialization failed due to faulty page Bit 7: Execution status 0 = pass, routine executed successfully 1 = fail, routine failed to execute
Example
This example performs a MapRAM initialization.
|
extern |
Reads the total size of code flash and total size of data flash for this device.
*NVMSize | a pointer to a variable where the code flash size will be stored |
*MapRAMSize | a pointer to a variable where the data flash size will be stored |
true | = successful |
false | = failed |
Example
This example performs read of the NVM configuration.
This function returns the last NVM address causing a double bit ECC failure.
*ecc2addr | a pointer to a variable where the last double bit ECC failing address will be stored |
Bit 0: ECC Double Bit error detection status 0 = no NVM double bit error found 1 = NVM double bit error detected Bit 7: Execution status 0 = pass, routine executed successfully, Bit0 valid 1 = fail, routine failed to execute
Example
This example performs read of the NVM Double Bit ECC fail location.
|
extern |
This function performs a ECC check on the entire NVM by reading the same.
This function does not alter any NVM content.
Bit 0: single bit errors (SBE) 0 = pass, no SBEs detected 1 = fail, at least one SBE detected Bit 1: Double bit errors (DBE) 0 = pass, no DBEs detected 1 = fail, at least one DBE detected Bit 7: Execution status 0 = pass, routine executed successfully 1 = fail, routine failed to execute, due to nested call
Example
This example performs a ECC check on the entire flash.
|
extern |
Returns the status of the NVM module.
This can be used in case of RAM Branch to check whether the NVM module
has finished its operation and a jump back to the BootROM should be done,
in order to finish the started NVM operation.
true | = NVM module is ready (not busy) |
false | = NVM module is not yet ready (busy) |
Example
This example performs a user action as long as the NVM module is busy.
Opens the assembly buffer for writing to a flash page, for code flash as well as data flash.
This function has to be called as a preparation for a flash programming by USER_PROG.
NVMPAGEAddr | logical address to the flash page, the address has to be page aligned (128byte aligned) |
Example
This example performs a page programming to the first data flash page.
Writes the assembly buffer content to the flash page addressed by USER_OPENAB.
PROG_FLAG | options to control the RAM branch and corrective action of the USER_PROG function |
Example
This example performs a page programming to the first data flash page.
|
extern |
This function performs a MBIST on the RAM for a given address range.
The RAM interface will be disabled for the duration of the MBIST,
accessing the RAM will not be possible for this time.
RAM_MBIST_Stop_Addr | end address for the MBIST, given as offset to RAMStart (0x18000000) |
RAM_MBIST_Start_addr | starting address for the MBIST, given as offset to RAMStart (0x18000000) |
Bit 0: function status, OR'd all flags 0 = pass, MBIST ran pass 1 = fail, MBIST failed Bit 1: Address range failed 0 = pass, address range good 1 = fail, address out of range Bit 7: Execution status 0 = pass, routine executed successfully 1 = fail, routine failed to execute, due to nested call
Example
This example performs a MBIST over the first half of the RAM.
|
extern |
This function reads four bytes from a selected 100TP page.
OTP_Page_Sel | selects one out of eight 100TP pages, 0x11 is page 1, 0x12 is page 2, ..., 0x18 is page 8 |
DataOffset | the offset within the selected page, starting from value 0x00 to 0x7F |
*HundredTPData | a pointer to a variable where the four bytes from the 100TP will be stored |
true | = pass |
false | = fail |
Example
This example performs a complete read of the first 100TP page.
|
extern |
Reads the NVM calibration data.
NumOfBytes | Number of Bytes to be copied from config sector into the RAM (allowed values are form 01H to 80H). |
CSAddr | 100TP page to take data from, 0x11 is page 1, 0x12 is page 2, ..., 0x18 is page 8 |
RAMAddr | RAM address offset to copy data to (03FFH < RAMAddr < RAMAddr + NumOfBytes < RAM size). |
Bit 0: Pass or Fail 0 = Read is successful 1 = Read is not successful due to invalid input values Bit 7: Execution Pass/Fail status 0 = Pass: Routine was correctly executed 1 = Fail: Routine was not executed
Example
This example reads 16 bytes from 100TP page 1 at offset 0 and stores them in an array.
This function performs a verify on a programmed page.
This function checks if a given page whether the content has a proper data integrity.
page_addr | address of the page which will be verified |
Bit 0: GlobFail, function status, OR'd all flags 0 = pass, sector erase verify successful 1 = fail, sector erase verify failed Bit 1: VerifyFail, Erase Verify Status 0 = pass, all pages are in proper erased state 1 = fail, at least one out of the 32 pages is not properly erased Bit 6: MapRAMFail, MapRAM Status, Data Flash sector only 0 = pass, MapRAM and Spare Page pass 1 = fail, mapped pages, or invalid Spare Page, or MapRAM ECC fail Bit 7: ExecFail, Execution status 0 = pass, routine executed successfully 1 = fail, routine failed to execute, due to invalid address, or assembly buffer open, or nested call
Example
This example verifies the data integrity of the 1st page of the data flash sector after bootup.