Skip to content

Commit

Permalink
Upload serial-flash 1.0.1.15154
Browse files Browse the repository at this point in the history
  • Loading branch information
gitlab-runner committed Jun 24, 2020
1 parent 09337f5 commit 260c60e
Show file tree
Hide file tree
Showing 20 changed files with 87 additions and 379 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,31 @@

### Overview

Provides functions for interacting with an external flash connected through its Single SPI/Dual SPI/Quad SPI/Octal SPI interface. The flash operations read, write, and erase are implemented as blocking functions. This library accepts the configuration generated using the QSPI Configurator tool but supports only one memory slot. Note that PSoC 6 supports up to 4 memory slots on the same QSPI block.
Provides functions for interacting with an external flash connected through its Single SPI/Dual SPI/Quad SPI/Octal SPI interface. The flash operations read, write, and erase are implemented as blocking functions. This library accepts the configuration generated using the QSPI Configurator tool but supports only one memory slot. Note that PSoC 6 supports up to 4 memory slots on the same QSPI block.

### Features

* Accepts the configuration generated by the QSPI Configurator tool
* Supports Execute-in-Place (XIP) mode of operation
* Provides information about the external memory to the programming tool for it to be able to program the memory, for example, when user wants to place the code into the external memory for XIP operation.
* Provides information about the external memory to the programming tool for it to be able to program the memory, for example, when user wants to place the code into the external memory for XIP operation.
* Allows for programming external memory if CY_ENABLE_XIP_PROGRAM is defined when building the application

### Quick Start
1. Add \#include "cy_serial_flash_qspi.h"
2. See the [PSoC 6 MCU: QSPI Flash Read and Write](https://github.com/cypresssemiconductorco/mtb-example-psoc6-qspi-readwrite) code example to learn using this library

**NOTE:**
If you delete the contents of the GeneratedSource directory inside the BSP, you must re-generate the memory configuration files *cycfg_qspi_memslot.c/.h*. To do this from inside the ModusToolbox IDE, open the QSPI Configurator tool from the Quick Panel and press **Ctrl+S** or click **File > Save**. If you open the tool outside the IDE, you need to first open the *design.cyqspi* file in the tool. To do this, click **File > Import** and then locate the file inside the BSP under *COMPONENT_BSP_DESIGN_MODUS* directory.
**NOTE:**
If you delete the contents of the GeneratedSource directory inside the BSP, you must re-generate the memory configuration files *cycfg_qspi_memslot.c/.h*. To do this from inside the ModusToolbox IDE, open the QSPI Configurator tool from the Quick Panel and press **Ctrl+S** or click **File > Save**. If you open the tool outside the IDE, you need to first open the *design.cyqspi* file in the tool. To do this, click **File > Import** and then locate the file inside the BSP under *COMPONENT_BSP_DESIGN_MODUS* directory.

### More information

* [API Reference Guide](https://cypresssemiconductorco.github.io/serial-flash/html/index.html)
* [Cypress Semiconductor](http://www.cypress.com)
* [Cypress Semiconductor, an Infineon Technologies Company](http://www.cypress.com)
* [Cypress Semiconductor GitHub](https://github.com/cypresssemiconductorco)
* [ModusToolbox](https://www.cypress.com/products/modustoolbox-software-environment)
* [PSoC 6 Code Examples using ModusToolbox IDE](https://github.com/cypresssemiconductorco/Code-Examples-for-ModusToolbox-Software)
* [PSoC 6 Middleware](https://github.com/cypresssemiconductorco/psoc6-middleware)
* [PSoC 6 Resources - KBA223067](https://community.cypress.com/docs/DOC-14644)

---
© Cypress Semiconductor Corporation, 2019.
© Cypress Semiconductor Corporation, 2019-2020.
22 changes: 16 additions & 6 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
### Release Notes
Serial Flash version 1.0.0.
# Serial Flash Library Release Notes
Provides functions for interacting with an external flash connected through its Single/Dual/Quad/Octal SPI interface.

This is the first release of this library. See [README.md](README.md) for details on how to use this library.
### What's Included?
* APIs for Read/Write/Erase operations
* Supports Execute-in-Place (XIP) mode of operation
* Accepts the configuration generated by the QSPI Configurator tool
* Allows for providing information to the programming tool to program the external memory.

### What Changed?
#### v1.0.1
* Minor update for documentation & branding
#### v1.0.0
* Initial release

### Supported Software and Tools
This version of the Serial Flash library was validated for compatibility with the following Software and Tools:
Expand All @@ -15,13 +25,13 @@ This version of the Serial Flash library was validated for compatibility with th

### More information

* [API Reference Guide](https://cypresssemiconductorco.github.io/serial-flash/html/modules.html)
* [Cypress Semiconductor](http://www.cypress.com)
* [API Reference Guide](https://cypresssemiconductorco.github.io/serial-flash/html/index.html)
* [Cypress Semiconductor, an Infineon Technologies Company](http://www.cypress.com)
* [Cypress Semiconductor GitHub](https://github.com/cypresssemiconductorco)
* [ModusToolbox](https://www.cypress.com/products/modustoolbox-software-environment)
* [PSoC 6 Code Examples using ModusToolbox IDE](https://github.com/cypresssemiconductorco/Code-Examples-for-ModusToolbox-Software)
* [PSoC 6 Middleware](https://github.com/cypresssemiconductorco/psoc6-middleware)
* [PSoC 6 Resources - KBA223067](https://community.cypress.com/docs/DOC-14644)

---
© Cypress Semiconductor Corporation, 2019.
© Cypress Semiconductor Corporation, 2019-2020.
29 changes: 12 additions & 17 deletions cy_serial_flash_prog.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
********************************************************************************
* \copyright
* Copyright 2018-2019 Cypress Semiconductor Corporation
* Copyright 2018-2020 Cypress Semiconductor Corporation
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -27,12 +27,16 @@
*******************************************************************************/

/**
* \addtogroup group_serial_flash Serial Flash
* \addtogroup group_board_libs
* \{
* Variables for informing programming tools that there is an attached memory device and what
* its characteristics are so it can be programmed just like the on-chip memory.
*
* \defgroup group_serial_flash_variables Variables
* In addition to the APIs for reading and writting to memory at runtime, this library also
* provides support for informing programming tools about the external memory so it can be
* be written at the same time as internal flash. This support can be enabled by defining
* CY_ENABLE_XIP_PROGRAM while building the application. With this define in place, code
* will be generated in the .cy_sflash_user_data & .cy_toc_part2 sections. These locations
* can be read by programming tools (eg: Cypress Programmer, OpenOCD, pyOCD) to know that
* there is a memory device attached and how to program it.
* \} group_board_libs
*/

#include <stdint.h>
Expand All @@ -51,12 +55,7 @@ typedef struct
const uint32_t null_t; /* NULL termination */
} stc_smif_ipblocks_arr_t;

/**
* \addtogroup group_serial_flash_variables
* \{
*/

/**
/*
* This data can be placed anywhere in the internal memory, but it must be at a location that
* can be determined and used for the calculation of the CRC16 checksum in the cyToc below. There
* are multiple ways this can be accomplished including:
Expand All @@ -67,7 +66,7 @@ typedef struct
CY_SECTION(".cy_sflash_user_data") __attribute__( (used) )
const stc_smif_ipblocks_arr_t smifIpBlocksArr = {&smifBlockConfig, 0x00000000};

/**
/*
* This data is used to populate the table of contents part 2. When present, it is used by the boot
* process and programming tools to determine key characteristics about the memory usage including
* where the boot process should start the application from and what external memories are connected
Expand All @@ -92,12 +91,8 @@ const uint32_t cyToc[128] =
[127] = 0x3BB30000 /* Offset=0x01FC: CRC16-CCITT (the upper 2 bytes contain the CRC and the lower 2 bytes are 0) */
};

/** \} group_serial_flash_variables */

#endif /* defined(CY_ENABLE_XIP_PROGRAM) */

#if defined(__cplusplus)
}
#endif

/** \} group_serial_flash */
30 changes: 15 additions & 15 deletions cy_serial_flash_qspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
********************************************************************************
* \copyright
* Copyright 2018-2019 Cypress Semiconductor Corporation
* Copyright 2018-2020 Cypress Semiconductor Corporation
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -36,7 +36,7 @@ extern "C" {
#endif


/** \cond internal */
/** \cond INTERNAL */

/** Timeout to apply while polling the memory for its ready status after quad
* enable command has been sent out. Quad enable is a non-volatile write.
Expand Down Expand Up @@ -75,21 +75,21 @@ static cy_stc_smif_block_config_t qspi_block_config =
* configuration */
cy_rslt_t cy_serial_flash_qspi_init(
const cy_stc_smif_mem_config_t* mem_config,
cyhal_gpio_t io0,
cyhal_gpio_t io1,
cyhal_gpio_t io2,
cyhal_gpio_t io0,
cyhal_gpio_t io1,
cyhal_gpio_t io2,
cyhal_gpio_t io3,
cyhal_gpio_t io4,
cyhal_gpio_t io5,
cyhal_gpio_t io6,
cyhal_gpio_t io7,
cyhal_gpio_t io4,
cyhal_gpio_t io5,
cyhal_gpio_t io6,
cyhal_gpio_t io7,
cyhal_gpio_t sclk,
cyhal_gpio_t ssel,
cyhal_gpio_t ssel,
uint32_t hz)
{
cy_en_smif_status_t smifStatus = CY_SMIF_SUCCESS;


cy_rslt_t result = cyhal_qspi_init(&qspi_obj, io0, io1, io2, io3, io4, io5, io6, io7,
sclk, ssel, hz, 0);

Expand All @@ -106,7 +106,7 @@ cy_rslt_t cy_serial_flash_qspi_init(
/* Enable Quad mode (1-1-4 or 1-4-4 modes) to use all the four I/Os during
* communication.
*/

if(qspi_block_config.memConfig[MEM_SLOT]->deviceCfg->readCmd->dataWidth == CY_SMIF_WIDTH_QUAD
|| qspi_block_config.memConfig[MEM_SLOT]->deviceCfg->programCmd->dataWidth == CY_SMIF_WIDTH_QUAD)
{
Expand All @@ -126,13 +126,13 @@ cy_rslt_t cy_serial_flash_qspi_init(
if((CY_RSLT_SUCCESS != result) || (CY_SMIF_SUCCESS != smifStatus))
{
cy_serial_flash_qspi_deinit();

if(CY_SMIF_SUCCESS != smifStatus)
{
result = (cy_rslt_t)smifStatus;
}
}

return result;
}

Expand All @@ -142,7 +142,7 @@ void cy_serial_flash_qspi_deinit(void)
{
Cy_SMIF_MemDeInit(qspi_obj.base);
}

cyhal_qspi_free(&qspi_obj);
}

Expand Down
2 changes: 1 addition & 1 deletion cy_serial_flash_qspi.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
********************************************************************************
* \copyright
* Copyright 2018-2019 Cypress Semiconductor Corporation
* Copyright 2018-2020 Cypress Semiconductor Corporation
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
Binary file removed docs/html/cypress_logo.png
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/html/doxygen_style.css
Original file line number Diff line number Diff line change
Expand Up @@ -1488,7 +1488,7 @@ tr.heading h2 {
*/

/* cypress logo */
img[src="cypress_logo.png"]{
img[src="logo.png"]{
height:75px;
/*float: right;*/
}
Expand Down

0 comments on commit 260c60e

Please sign in to comment.