/
xilsfl

xilsfl

Introduction

This page provides details related to the xilsfl library.

  • Allows you to Write, Read, and Erase the Serial NOR flash.

  • Allows the user application to perform Control operations on Serial Flash.

  • Requires the underlying hardware platform to contain psv_ospi device for accessing the Serial Flash.

  • Uses the OSPI interface drivers in polled mode for communicating with the Serial Flash.

  • When the user application requests a library operation, it is initiated and control is given back to the application. The library tracks the status of the interface transfers, and notifies the user application upon completion of the selected library operation.

Library Sources

The source code for the library is included with the Vitis Unified Software Platform installation, as well as being available in the Xilinx Github repository. 

Driver Name

Path to Vitis

Path in Github

Driver Name

Path to Vitis

Path in Github

xilsfl

<Vitis Install Directory>/data/embedded/XilinxProcessorIPLib/lib/sw_services/xilsfl

https://github.com/Xilinx/embeddedsw/tree/xlnx_rel_v2024.2/lib/sw_services/xilsfl

Note: To view the sources for a particular release, use the rel-version tag in github.  For example, for the 2024.2 release, the proper version of the code is: https://github.com/Xilinx/embeddedsw/tree/xlnx_rel_v2024.2/lib/sw_services/xilsfl

 

The library source code is organized into different folders.  The table below shows the xilsfl library source organization. 

Directory

Description

Directory

Description

doc

Provides the API and data structure details

data

Driver .tcl, .mdd and .yaml file

examples

Example applications that show how to use the driver features

src

library source files, make and cmakelists file

Note: AMD Xilinx embeddedsw build flow has been changed from 2023.2 release to adapt to the new system device tree based flow. For further information, refer to the wiki link Porting embeddedsw components to system device tree (SDT) based flow

The .yaml(in data folder) and CMakeLists.txt(in src folder) files are needed for the System Device Tree based flow. The Driver .tcl and .mdd files are for the older build flow which will be deprecated in future.

Library Implementation

This library abstracts the flash device related configurations and simplify the user application by providing the simple user APIs (read/write/erase).

User doesn’t have to worry about the sequence of commands to send to the flash device and commands to be used for the flash device, all these flash related configurations, sequence of commands will be taken care by the XILSFL library.

This library designed in such a way that, it can be extended to support multiple controllers (for now XILSFL is supporting only OSPI controller interface).

User APIs

  • XSfl_FlashInit - This API will initialize the Controller and Flash device with the configurations selected by the application using “XSfl_UserConfig“ structure.

  • XSfl_FlashGetInfo - This API will get the Flash device information like Flash Id, Flash Size Sector Size, Page Size.

  • XSfl_FlashErase - This API will erase the Flash device based on the input address and size.

  • XSfl_FlashWrite - This API will write the data to the Flash device based on the input address, data buffer and size.

  • XSfl_FlashRead - This API will read the data from the Flash device based on the input address, data buffer and size.

Features support

This xilsfl library supports basic operations like read(),write(),erase() etc as below

  • DeviceControl

  • Read

  • Write

  • Erase

Supported flash devices

OSPI

  • MT35XU02GCBA

QSPI

  • n25q00a

Known issues and limitations

  • Only one OSPI and one QSPI flash devices are supported (support for more number of OSPI and QSPI flash devices is in progress)

  • DAC mode read/write is not supported

  • INDAC non-dma write is not supported

Example Application

Refer to the xilsfl library examples directory for various example applications that exercise the different features of the xilsfl.

Each application is linked in the table below. The following sections describe the usage and expected output of the various applications.

These example applications can be imported into the Vitis IDE from the Board Support Package settings tab. 

Links to Examples

Examples Path: https://github.com/Xilinx/embeddedsw/tree/xlnx_rel_v2024.2/lib/sw_services/xilsfl

Test Name

Example Source

Description

Test Name

Example Source

Description

xilsfl_ospi_flash_readwrite_example

xilsfl_ospi_flash_readwrite_example.c

This example tests the Erase, Read and Write features. The Page is erased and data is written to the page. The data is read back and compared with the data written for correctness.

Example Application Usage

xilsfl example

read and write test from NOR flash device.

Expected Output

SflReadWriteExample Test
Successfully ran SflReadWriteExample

 

Change Log

2024.2

embeddedsw/doc/ChangeLog at xilinx_v2024.2 · Xilinx/embeddedsw

Related content

© Copyright 2019 - 2022 Xilinx Inc. Privacy Policy