Skip to content

Commit ae716e2

Browse files
hennadiykytsunOren Cohen
authored andcommitted
PSOC6: update version of PDL flash driver
Flash driver 3.30: Moved ipcWaitMessageStc structure to the RAM section called ".cy_sharedmem" Added support Secure Boot devices Moved CY_FLASH_EFFECTIVE_PAGE_SIZE to flash_api.c (the macro is Mbed specific).
1 parent e830055 commit ae716e2

File tree

3 files changed

+346
-90
lines changed

3 files changed

+346
-90
lines changed

targets/TARGET_Cypress/TARGET_PSOC6/flash_api.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222

2323
#if DEVICE_FLASH
2424

25+
/** Flash effective page size */
26+
#define CY_FLASH_EFFECTIVE_PAGE_SIZE 32
27+
28+
2529
int32_t flash_init(flash_t *obj)
2630
{
2731
(void)(obj);

targets/TARGET_Cypress/TARGET_PSOC6/psoc6pdl/drivers/include/cy_flash.h

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/***************************************************************************//**
22
* \file cy_flash.h
3-
* \version 3.20
3+
* \version 3.30
44
*
55
* Provides the API declarations of the Flash driver.
66
*
@@ -104,15 +104,15 @@
104104
* Crypto).
105105
* -# If you do not use the default startup, perform the following steps
106106
* before any flash write/erase operations:
107-
* \snippet flash\3.20\snippet\main.c Flash Initialization
107+
* \snippet flash/snippet/main.c Flash Initialization
108108
*
109109
* \subsection group_flash_config_rww Partially Blocking:
110110
* This method has a much shorter time window during which Flash accesses are not
111111
* allowed. Application code execution from Flash is blocked for only a part of
112112
* Flash Write duration, for both cores. Blocking duration depends upon the API
113113
* sequence used.
114114
*
115-
* For API sequence Cy_Flash_StartErase() + Cy_Flash_StartProgram() there are
115+
* For API sequence Cy_Flash_StartEraseRow() + Cy_Flash_StartProgram() there are
116116
* four block-out regions during which the read is blocked using the software
117117
* driver (PDL). See <b>Figure 1</b>.
118118
*
@@ -216,7 +216,7 @@
216216
* (DMA and Crypto).
217217
* -# If you do not use the default startup, perform the following steps
218218
* before any flash write/erase operations:
219-
* \snippet flash\3.20\snippet\main.c Flash Initialization
219+
* \snippet flash/snippet/main.c Flash Initialization
220220
*
221221
* \subsection group_flash_config_emeeprom EEPROM section use:
222222
* If you plan to use "cy_em_eeprom" section for different purposes for both of
@@ -255,6 +255,21 @@
255255
* <table class="doxtable">
256256
* <tr><th>Version</th><th style="width: 52%;">Changes</th><th>Reason for Change</th></tr>
257257
* <tr>
258+
* <td rowspan="3">3.30</td>
259+
* <td>Moved ipcWaitMessageStc structure to the RAM section called ".cy_sharedmem".</td>
260+
* <td>Support Secure Boot devices.</td>
261+
* </tr>
262+
* <tr>
263+
* <td>Renamed Function Cy_Flash_StartErase() to Cy_Flash_StartEraseRow().</td>
264+
* <td>The driver improvements based on the usability feedback.</td>
265+
* </tr>
266+
* <tr>
267+
* <td>Added new API functions \ref Cy_Flash_EraseSector,
268+
* \ref Cy_Flash_StartEraseSector, \ref Cy_Flash_EraseSubsector,
269+
* \ref Cy_Flash_StartEraseSubsector </td>
270+
* <td>The driver improvements based on the usability feedback.</td>
271+
* </tr>
272+
* <tr>
258273
* <td rowspan="3">3.20</td>
259274
* <td>Flattened the organization of the driver source code into the single source directory and the single include directory.</td>
260275
* <td>Driver library directory-structure simplification.</td>
@@ -359,7 +374,7 @@ extern "C" {
359374
#define CY_FLASH_DRV_VERSION_MAJOR 3
360375

361376
/** Driver minor version */
362-
#define CY_FLASH_DRV_VERSION_MINOR 20
377+
#define CY_FLASH_DRV_VERSION_MINOR 30
363378

364379
#define CY_FLASH_ID (CY_PDL_DRV_ID(0x14UL)) /**< FLASH PDL ID */
365380

@@ -377,8 +392,6 @@ extern "C" {
377392

378393
/** Flash row size */
379394
#define CY_FLASH_SIZEOF_ROW (CPUSS_FLASHC_PA_SIZE * 4u)
380-
/** Flash effective page size */
381-
#define CY_FLASH_EFFECTIVE_PAGE_SIZE 32
382395
/** Long words flash row size */
383396
#define CY_FLASH_SIZEOF_ROW_LONG_UNITS (CY_FLASH_SIZEOF_ROW / sizeof(uint32_t))
384397

@@ -430,11 +443,15 @@ typedef enum cy_en_flashdrv_status
430443
*/
431444
void Cy_Flash_Init(void);
432445
cy_en_flashdrv_status_t Cy_Flash_EraseRow(uint32_t rowAddr);
446+
cy_en_flashdrv_status_t Cy_Flash_StartEraseRow(uint32_t rowAddr);
447+
cy_en_flashdrv_status_t Cy_Flash_EraseSector(uint32_t sectorAddr);
448+
cy_en_flashdrv_status_t Cy_Flash_StartEraseSector(uint32_t sectorAddr);
449+
cy_en_flashdrv_status_t Cy_Flash_EraseSubsector(uint32_t subSectorAddr);
450+
cy_en_flashdrv_status_t Cy_Flash_StartEraseSubsector(uint32_t subSectorAddr);
433451
cy_en_flashdrv_status_t Cy_Flash_ProgramRow(uint32_t rowAddr, const uint32_t* data);
434452
cy_en_flashdrv_status_t Cy_Flash_WriteRow(uint32_t rowAddr, const uint32_t* data);
435453
cy_en_flashdrv_status_t Cy_Flash_StartWrite(uint32_t rowAddr, const uint32_t* data);
436454
cy_en_flashdrv_status_t Cy_Flash_StartProgram(uint32_t rowAddr, const uint32_t* data);
437-
cy_en_flashdrv_status_t Cy_Flash_StartErase(uint32_t rowAddr);
438455
cy_en_flashdrv_status_t Cy_Flash_IsOperationComplete(void);
439456
cy_en_flashdrv_status_t Cy_Flash_RowChecksum(uint32_t rowAddr, uint32_t* checksumPtr);
440457
cy_en_flashdrv_status_t Cy_Flash_CalculateHash(const uint32_t* data, uint32_t numberOfBytes, uint32_t* hashPtr);
@@ -451,11 +468,15 @@ uint32_t Cy_Flash_GetExternalStatus(void);
451468
void Cy_Flash_ResumeIrqHandler(void);
452469
#endif
453470

454-
/* Macros to backward compatibility */
471+
/*******************************************************************************
472+
Backward compatibility macro. The following code is DEPRECATED and must
473+
not be used in new projects
474+
*******************************************************************************/
455475
#define Cy_Flash_IsWriteComplete(...) Cy_Flash_IsOperationComplete()
456476
#define Cy_Flash_IsProgramComplete(...) Cy_Flash_IsOperationComplete()
457477
#define Cy_Flash_IsEraseComplete(...) Cy_Flash_IsOperationComplete()
458-
#define CY_FLASH_NUMBER_ROWS (CY_FLASH_SIZE / CY_FLASH_SIZEOF_ROW)
478+
#define CY_FLASH_NUMBER_ROWS (CY_FLASH_SIZE / CY_FLASH_SIZEOF_ROW)
479+
#define Cy_Flash_StartErase Cy_Flash_StartEraseRow
459480

460481
/** \endcond */
461482

0 commit comments

Comments
 (0)