SPRUI33H November 2015 – June 2024 TMS320F280040-Q1 , TMS320F280040C-Q1 , TMS320F280041 , TMS320F280041-Q1 , TMS320F280041C , TMS320F280041C-Q1 , TMS320F280045 , TMS320F280048-Q1 , TMS320F280048C-Q1 , TMS320F280049 , TMS320F280049-Q1 , TMS320F280049C , TMS320F280049C-Q1
Within secure ROM, functions are available to be called by the application to perform EXEONLY Flash/RAM tasks in a secure manner.
The application can disable interrupts before calling one of the EXEONLY function APIs.
If a vector fetch request is given by the CPU while the program counter (PC) is within the EXEONLY function API code of the Secure ROM, a reset fires. The consequence of this is if an NMI or ITRAP occurs while the PC is executing one of the EXEONLY API functions, the NMI/ITRAP cannot be serviced because a reset is fired to that subsystem.
The secure copy code zone 1 and zone 2 functions (Table 4-37) allow EXEONLY Flash to be copied to EXEONLY RAM in a secure manner. The source must be from EXEONLY Flash and the destination to EXEONLY RAM. There is no support to copy EXEONLY ROM or EXEONLY RAM to RAM. Both Flash and RAM must be set to EXEONLY and configured for the same zone. Additionally, the copy size must not cross over the Flash sector boundary. Any violations of these requirements results in a failure status returned. Upon successful copy of the data, the number of 16-bit words copied is returned.
Function Prototype | Function Parameters | Function Return Value |
---|---|---|
Uint16
SafeCopyCodeZ1(Uint32 size,
Uint16 *dst, Uint16 *src) |
size : The number of 16-bit words to copy | 0xXXXX : Returns the number of 16-bit words copied |
Uint16
SafeCopyCodeZ2(Uint32 size,
Uint16 *dst, Uint16 *src) |
dst : The destination memory address in EXEONLY RAM | 0x0000 : Indicates one of the following: Copy length is zero; Copy size crosses over Flash sector boundary; Flash and RAM do not belong to the same zone; Flash and/or RAM are not set to EXEONLY; Error occurred during data copy |
src : The source memory address in EXEONLY Flash |
The secure CRC calculation zone 1 and zone 2 functions (Table 4-38) allow a safety CRC check of EXEONLY memory in a secure manner. The CRC length provided must be a value from 1 to 8 where 1 represents a CRC size of 32 16-bit words and 8 represents a CRC size of 4096 16-bit words. The source address specifies the starting address for the CRC and the destination address is the location that the resulting CRC value is stored. The source and destination memories must be configured for the same zone. Additionally, the CRC length must not cross over the Flash sector or RAM block boundary. Any violations of these requirements results in a failure status returned. Upon successful CRC, the number of 16-bit words CRC'd is returned.
Function Prototype | Function Parameters | Function Return Value |
---|---|---|
Uint16
SafeCRCCalcZ1(Uint16
len_id, Uint16 *dst, Uint16 *src) |
len_id : A number from 1 to 8 which corresponds to length options of 32, 64, 128, 256, 512, 1024, 2048, or 4096 16-bit words | 0xXXXX : Returns the number of 16-bit words CRC'd |
Uint16
SafeCRCCalcZ2(Uint16
size, Uint16 *dst, Uint16 *src) |
dst : The destination memory address for resulting CRC | 0x0000 : Indicates one of the following: Invalid length option; Source address is not modulo of length value; Destination address is not within secure RAM; CRC size crosses over Flash sector or RAM block boundary; The source and destination memory do not belong to the same zone |
src : The source memory address to begin CRC calculation |