#include <stdint.h>
#include <string.h>
#include <ti/devices/DeviceFamily.h>
#include <DeviceFamily_constructPath(driverlib/xip.h)>
#include <DeviceFamily_constructPath(driverlib/ospi.h)>
#include <DeviceFamily_constructPath(driverlib/debug.h)>
Go to the source code of this file.
|
| void | FlashRead (uint32_t *readFromAddr, uint32_t *writeToAddr, uint32_t length) |
| | Read from external memory. More...
|
| |
| FlashStigStatus | FlashReadSTIG (uint32_t readStartAddr, uint32_t *writeToAddr, uint8_t DeviceNum) |
| | Read from external memory using STIG command. More...
|
| |
| FlashStigStatus | FlashExecuteReadSTIGCommand (uint32_t srcReadAddr, uint32_t *writeToAddr) |
| | Execute read of one word from Flash based on STIG write command. More...
|
| |
| void | FlashWrite (uint32_t *readFromAddr, uint32_t *writeToAddr, uint32_t length) |
| | Write to external memory. More...
|
| |
| FlashStigStatus | FlashWriteSTIG (uint32_t *readFromAddr, uint32_t *writeToAddr, uint8_t DeviceNum) |
| | Write to external memory using STIG command. More...
|
| |
| FlashStigStatus | FlashExecuteWriteSTIGCommand (uint32_t srcWriteData, uint32_t srcWriteAddrPhy) |
| | Execute write to Flash based on STIG write command. More...
|
| |
| void | FlashSetOTFDE (uint8_t setState) |
| | Enable/Disable the OTFDE. More...
|
| |
| uint32_t | FlashExecutePolling (void) |
| | read flash status register until WIP (write in process) indication is free. More...
|
| |
| FlashStigStatus | FlashExecuteEraseSTIGCommand (uint32_t EraseAddr_en, uint32_t srcEraseAddr) |
| | Execute erase Flash based on STIG command. More...
|
| |
| FlashStigStatus | FlashSectorErase (uint32_t eraseStartAddr, uint8_t DeviceNum) |
| | Execute erase Flash based on STIG command. More...
|
| |
| void | FlashSetTickPeriod (uint32_t TickPeriod) |
| | Store the ClockP period internally. More...
|
| |
| uint32_t | FlashIsXspiIdle () |
| | xSPI (accessible) idle check before STIG execution. More...
|
| |
§ FLASH_STATUS_SUCCESS
| #define FLASH_STATUS_SUCCESS 0x00000000 |
Function completed successfully
§ FLASH_TIMEOUT_REACHED_ERROR
| #define FLASH_TIMEOUT_REACHED_ERROR (-1300) |
§ PSRAM_XIP_OFFSET
| #define PSRAM_XIP_OFFSET (0x100) |
Offset for PSRAM XIP Configuration
§ DEVICE_SWITCH_ERROR
| #define DEVICE_SWITCH_ERROR (-1) |
§ FLASH_WR_BOUND_SIZE_IN_BYTES
| #define FLASH_WR_BOUND_SIZE_IN_BYTES 64U |
< UDMA Data movement boundary for write command (page program) Internal memory to External memory UDMA Data movement boundary for read command External memory to Internal memory
§ FLASH_RD_BOUND_SIZE_IN_BYTES
| #define FLASH_RD_BOUND_SIZE_IN_BYTES 256U |
§ __IF__
§ __THEN__
| #define __THEN__ |
( |
|
x | ) |
? (x) |
§ __ELSE__
| #define __ELSE__ |
( |
|
x | ) |
: (x) |
§ __ELSE_IF__
| #define __ELSE_IF__ |
( |
|
x | ) |
: (x) |
§ OSPI_IDLE_XSPI_COUNTER_BEFORE_TIMEOUT
| #define OSPI_IDLE_XSPI_COUNTER_BEFORE_TIMEOUT 100 |
§ BITMASK_x_0
Value: __THEN__(0xFFFFFFFF) \
__ELSE__((1 << ((x) + 1)) - 1))
#define __IF__(x)
Definition: FlashWFF3.h:73
BITMASK_x_0() returns a bit mask of "1" from Bits[x:0]
E.g., for x=5
BITMASK_x_0(5) = ........111111 Bits[5:0] = "111111" BITMASK_x_0(0) = .............1 Bits[0:0] = "000001"
§ BITMASK_x_y
| #define BITMASK_x_y |
( |
|
x, |
|
|
|
y |
|
) |
| |
Value:#define BITMASK_x_0(x)
Definition: FlashWFF3.h:88
#define __IF__(x)
Definition: FlashWFF3.h:73
BITMASK_x_y() returns a bit mask of "1" from Bits[x:y] (naturally, x >= y should be enforces by the caller!!)
E.g., for x=5, y=2
BITMASK_x_y(5,5) = ......1..... Bits[5:5] = "100000" BITMASK_x_y(5,2) = ......1111.. Bits[5:0] = "111100" BITMASK_x_0(5,1) = ......11111. Bits[5:1] = "111110" BITMASK_x_0(5,0) = ......111111 Bits[5:0] = "111111"
§ FLASH_STIG_CONFIG_ENTER
| #define FLASH_STIG_CONFIG_ENTER 0 |
§ FLASH_STIG_CONFIG_EXIT
| #define FLASH_STIG_CONFIG_EXIT 1 |
§ FLASH_STIG_CONFIG_PRE_READ
| #define FLASH_STIG_CONFIG_PRE_READ 2 |
§ FLASH_STIG_CONFIG_EXECUTE_READ
| #define FLASH_STIG_CONFIG_EXECUTE_READ 3 |
§ FLASH_STIG_CONFIG_POST_READ
| #define FLASH_STIG_CONFIG_POST_READ 4 |
§ FLASH_STIG_CONFIG_PRE_WRITE
| #define FLASH_STIG_CONFIG_PRE_WRITE 5 |
§ FLASH_STIG_CONFIG_EXECUTE_WRITE
| #define FLASH_STIG_CONFIG_EXECUTE_WRITE 6 |
§ FLASH_STIG_CONFIG_POST_WRITE
| #define FLASH_STIG_CONFIG_POST_WRITE 7 |
§ FLASH_STIG_CONFIG_PRE_ERASE
| #define FLASH_STIG_CONFIG_PRE_ERASE 8 |
§ FLASH_STIG_CONFIG_EXECUTE_ERASE
| #define FLASH_STIG_CONFIG_EXECUTE_ERASE 9 |
§ FLASH_STIG_CONFIG_POST_ERASE
| #define FLASH_STIG_CONFIG_POST_ERASE 10 |
§ FlashOtfdeStateSet
| Enumerator |
|---|
| FLASH_OTFDE_DISABLE | Bit configuration to disable OTFDE control over XSPI
|
| FLASH_OTFDE_ENABLE | Bit configuration to enable OTFDE control over XSPI
|
§ FlashUdmaJobStatus
| Enumerator |
|---|
| FLASH_UDMA_JOB_DONE | UDMA job completed successfully
|
| FLASH_UDMA_JOB_ERROR | UDMA job did not completed successfully
|
§ FlashStigStatus
| Enumerator |
|---|
| FLASH_STIG_DONE | STIG command completed successfully
|
| FLASH_STIG_TIMEOUT | STIG command completed with timeout
|
| FLASH_STIG_ERROR | STIG command did not completed successfully
|
§ FlashRead()
| void FlashRead |
( |
uint32_t * |
readFromAddr, |
|
|
uint32_t * |
writeToAddr, |
|
|
uint32_t |
length |
|
) |
| |
Read from external memory.
This function call to #XIPStartUDMATransaction() in order to execute copy transaction from external memory to internal memory.
- Parameters
-
| [in] | readFromAddr | is a pointer to the external memory source data. |
| [in] | writeToAddr | is a pointer to the internal memory destination data. |
| [in] | length | is the number of bytes to transfer. |
- Note
- Tested with flash only (did not test with PSRAM)
§ FlashReadSTIG()
| FlashStigStatus FlashReadSTIG |
( |
uint32_t |
readStartAddr, |
|
|
uint32_t * |
writeToAddr, |
|
|
uint8_t |
DeviceNum |
|
) |
| |
Read from external memory using STIG command.
This function call to FlashExecuteReadSTIGCommand() in order to Execute read Flash based on STIG command.
- Parameters
-
| [in] | readFromAddr | is a pointer to the external memory source data. |
| [in] | writeToAddr | is a pointer to the internal memory destination data. |
| [in] | DeviceNum | Device identifier (XMEM_FLASH or XMEM_PSRAM). |
- Returns
- FlashStigStatus of STIG execution command: FLASH_STIG_DONE - STIG command done. FLASH_STIG_TIMEOUT - STIG command not completed, finish with timeout. FLASH_STIG_ERROR - STIG erase command failed.
§ FlashExecuteReadSTIGCommand()
| FlashStigStatus FlashExecuteReadSTIGCommand |
( |
uint32_t |
srcReadAddr, |
|
|
uint32_t * |
writeToAddr |
|
) |
| |
Execute read of one word from Flash based on STIG write command.
- Parameters
-
| [in] | srcReadAddr | is the data to read from external memory. |
| [in] | writeToAddr | is a pointer to the internal memory destination data. |
- Returns
- FlashStigStatus of STIG execution command: FLASH_STIG_DONE - STIG command done. FLASH_STIG_TIMEOUT - STIG command not completed, finish with timeout. FLASH_STIG_ERROR - STIG command failed.
§ FlashWrite()
| void FlashWrite |
( |
uint32_t * |
readFromAddr, |
|
|
uint32_t * |
writeToAddr, |
|
|
uint32_t |
length |
|
) |
| |
Write to external memory.
This function call to #XIPStartUDMATransaction() in order to execute copy transaction from internal memory to external memory.
- Parameters
-
| [in] | readFromAddr | is a pointer to the internal memory source data. |
| [in] | writeToAddr | is a pointer to the external memory destination data. |
| [in] | length | is the number of bytes to transfer. Maximum configurable job size - 1 Mega byte (256K Words). |
- Note
- Tested with flash only (did not test with PSRAM)
§ FlashWriteSTIG()
| FlashStigStatus FlashWriteSTIG |
( |
uint32_t * |
readFromAddr, |
|
|
uint32_t * |
writeToAddr, |
|
|
uint8_t |
DeviceNum |
|
) |
| |
Write to external memory using STIG command.
This function call to FlashExecuteWriteSTIGCommand() in order to Execute write Flash based on STIG command.
- Parameters
-
| [in] | readFromAddr | is a pointer to the internal memory source data. |
| [in] | writeToAddr | is a pointer to the external memory destination data. |
| [in] | DeviceNum | Device identifier (XMEM_FLASH or XMEM_PSRAM). |
- Returns
- FlashStigStatus of STIG execution command: FLASH_STIG_DONE - STIG command done. FLASH_STIG_TIMEOUT - STIG command not completed, finish with timeout. FLASH_STIG_ERROR - STIG erase command failed.
- Note
- Tested with flash only (did not test with PSRAM)
§ FlashExecuteWriteSTIGCommand()
| FlashStigStatus FlashExecuteWriteSTIGCommand |
( |
uint32_t |
srcWriteData, |
|
|
uint32_t |
srcWriteAddrPhy |
|
) |
| |
Execute write to Flash based on STIG write command.
- Parameters
-
| [in] | srcWriteAddrPhy | is the address of the external memory destination data. |
| [in] | srcWriteData | is the data to write to external memory. |
- Returns
- FlashStigStatus of STIG execution command: FLASH_STIG_DONE - STIG command done. FLASH_STIG_TIMEOUT - STIG command not completed, finish with timeout. FLASH_STIG_ERROR - STIG command failed.
§ FlashSetOTFDE()
| void FlashSetOTFDE |
( |
uint8_t |
setState | ) |
|
Enable/Disable the OTFDE.
- Parameters
-
§ FlashExecutePolling()
| uint32_t FlashExecutePolling |
( |
void |
| ) |
|
§ FlashExecuteEraseSTIGCommand()
| FlashStigStatus FlashExecuteEraseSTIGCommand |
( |
uint32_t |
EraseAddr_en, |
|
|
uint32_t |
srcEraseAddr |
|
) |
| |
Execute erase Flash based on STIG command.
- Parameters
-
| [in] | EraseAddr_en | set in case the STIG command needs to use #srcEraseAddr. |
| [in] | srcEraseAddr | from where to start the flash erase. |
- Returns
- FlashStigStatus of STIG execution command: FLASH_STIG_DONE - STIG command done. FLASH_STIG_TIMEOUT - STIG command not completed, finish with timeout. FLASH_STIG_ERROR - STIG command failed.
§ FlashSectorErase()
| FlashStigStatus FlashSectorErase |
( |
uint32_t |
eraseStartAddr, |
|
|
uint8_t |
DeviceNum |
|
) |
| |
Execute erase Flash based on STIG command.
- Parameters
-
| [in] | eraseStartAddr | from where to start the sector erase. |
| [in] | DeviceNum | Device identifier (XMEM_FLASH or XMEM_PSRAM). |
- Returns
- FlashStigStatus of STIG execution command: FLASH_STIG_DONE - STIG command done. FLASH_STIG_TIMEOUT - STIG command not completed, finish with timeout. FLASH_STIG_ERROR - STIG command failed.
§ FlashSetTickPeriod()
| void FlashSetTickPeriod |
( |
uint32_t |
TickPeriod | ) |
|
Store the ClockP period internally.
- Parameters
-
| TickPeriod | Periodic interval in ClockP ticks |
§ FlashIsXspiIdle()
| uint32_t FlashIsXspiIdle |
( |
| ) |
|
xSPI (accessible) idle check before STIG execution.