AM261x MCU+ SDK: FLSOPSKD

| AM261x MCU+ SDK 26.00.00 |

FLSOPSKD

# Example Usage

Include the below file to access the APIs

#include <drivers/flsopskd.h>

Example macros

#define FLASH_DATA_OFFSET (10 * 1024 * 1024U)
#define CALIBRATION_DATA_LENGTH (128 * 1024U)
#define EXT_FLASH_ERASE_OPCODE (0x21U)
#define EXT_FLASH_ERASE_EXTOPCODE (0x21U)
#define EXT_FLASH_ERASE_SIZE (4096U)
#define EXT_FLASH_PAGE_SIZE (256U)

Init API

uint32_t fw8051version = 0;
uint32_t totalDowntime = 0;
uint32_t totalPollsCount = 0;
FLSOPSKD_Handle gFlopsdkHandle;
FLSOPSKD_Params params;
FLSOPSKD_Params_init(&params);
params.eraseOpCode = EXT_FLASH_ERASE_OPCODE;
params.eraseExOpCode = EXT_FLASH_ERASE_EXTOPCODE;
params.pageSizeInBytes = EXT_FLASH_PAGE_SIZE;
params.eraseSizeInBytes = EXT_FLASH_ERASE_SIZE;
FLSOPSKD_init(&gFlopsdkHandle, &params);

Erase API

for(uint32_t i = 0; i < CALIBRATION_DATA_LENGTH / EXT_FLASH_ERASE_SIZE; i++)
{
FLSOPSKD_erase(&gFlopsdkHandle, FLASH_DATA_OFFSET + EXT_FLASH_ERASE_SIZE * i);
}

Write API

FLSOPSKD_write(&gFlopsdkHandle, FLASH_DATA_OFFSET, (uint8_t*)gWrCalibrationData, CALIBRATION_DATA_LENGTH);

Version Check API

FLSOPSKD_getFwVersion(&gFlopsdkHandle, &fw8051version);
DebugP_assert(fw8051version == FLSOPSKD_EXPECTED_FW_VERSION);

Performance API

FLSOPSKD_perfGetDowntime(&gFlopsdkHandle, &totalDowntime);
FLSOPSKD_perfGetPollCounts(&gFlopsdkHandle, &totalPollsCount);

# API

APIs for FLSOPSKD

FLSOPSKD_Handle
Definition: flsopskd.h:81
FLSOPSKD_Params::eraseSizeInBytes
uint32_t eraseSizeInBytes
Definition: flsopskd.h:76
FLSOPSKD_Params::eraseExOpCode
uint8_t eraseExOpCode
Definition: flsopskd.h:74
FLSOPSKD_init
int32_t FLSOPSKD_init(FLSOPSKD_Handle *pHandle, FLSOPSKD_Params *pParams)
Init the FLSOPSKD IP and driver.
FLSOPSKD_Params::eraseOpCode
uint8_t eraseOpCode
Definition: flsopskd.h:73
FLSOPSKD_Params
Definition: flsopskd.h:72
FLSOPSKD_perfGetDowntime
int32_t FLSOPSKD_perfGetDowntime(FLSOPSKD_Handle *pHandle, uint32_t *memLoc)
Get XIP downtime of last operation.
FLSOPSKD_perfGetPollCounts
int32_t FLSOPSKD_perfGetPollCounts(FLSOPSKD_Handle *pHandle, uint32_t *memLoc)
Get Busy poll status count.
FLSOPSKD_erase
int32_t FLSOPSKD_erase(FLSOPSKD_Handle *pHandle, uint32_t eraseOffsetInBytes)
Send erase scheduling request.
FLSOPSKD_EXPECTED_FW_VERSION
#define FLSOPSKD_EXPECTED_FW_VERSION
The version number that this driver expects from the firmware running in 8051.
Definition: flsopskd.h:69
FLSOPSKD_Params::pageSizeInBytes
uint16_t pageSizeInBytes
Definition: flsopskd.h:75
DebugP_assert
#define DebugP_assert(expression)
Function to call for assert check.
Definition: DebugP.h:187
FLSOPSKD_write
int32_t FLSOPSKD_write(FLSOPSKD_Handle *pHandle, uint32_t destAddr, uint8_t *pSrcBuffer, uint32_t bytesToWrite)
Sends write scheduling request to hardware IP.
FLSOPSKD_getFwVersion
int32_t FLSOPSKD_getFwVersion(FLSOPSKD_Handle *pHandle, volatile uint32_t *pVersion)
Get Firmware version.
FLSOPSKD_Params_init
int32_t FLSOPSKD_Params_init(FLSOPSKD_Params *pParams)
Init all params.