CycloneBOOT 2.6.6
Secure Bootloader for ARM Cortex-M MCU
Loading...
Searching...
No Matches
flash.h File Reference

CycloneBOOT Flash layer. More...

#include "compiler_port.h"
#include "error.h"
#include "memory/memory.h"
#include <stdint.h>
#include <stdlib.h>

Go to the source code of this file.

Classes

struct  FlashInfo
 Flash Information definition. More...
 
struct  FlashDriver
 Flash Driver definition. More...
 

Macros

#define FLASH_DRIVER_VERSION_MAJOR   0x01
 
#define FLASH_DRIVER_VERSION_MINOR   0x01
 
#define FLASH_DRIVER_VERSION_PATCH   0x00
 
#define FLASH_DRIVER_VERSION
 
#define FLASH_FLAGS_LATER_SWAP   0x1
 

Typedefs

typedef error_t(* FlashInit) (void)
 Flash initialization function.
 
typedef error_t(* FlashDeInit) (void)
 Flash de-initialization function.
 
typedef error_t(* FlashGetInfo) (const FlashInfo **info)
 Get Flash Information function.
 
typedef error_t(* FlashGetStatus) (FlashStatus *status)
 Get Flash Status function.
 
typedef error_t(* FlashWrite) (uint32_t address, uint8_t *data, size_t length)
 Write Data into Flash function.
 
typedef error_t(* FlashRead) (uint32_t address, uint8_t *data, size_t length)
 Read Data from Flash function.
 
typedef error_t(* FlashErase) (uint32_t address, size_t length)
 Erase Data from Flash function.
 
typedef error_t(* FlashSwapBanks) (void)
 Swap Flash Banks function.
 
typedef error_t(* FlashGetNextSector) (uint32_t address, uint32_t *sectorAddr)
 Get address of the neighbouring sector.
 
typedef bool_t(* FlashIsSectorAddr) (uint32_t address)
 Determine if a given address match the start address of a sector.
 
typedef error_t(* FlashActivateXiPMode) (bool_t activateXipMode)
 Switch between memory-mapped and R/W mode(s)
 

Enumerations

enum  FlashType {
  FLASH_TYPE_INTERNAL , FLASH_TYPE_EXTERNAL_PARALLEL , FLASH_TYPE_EXTERNAL_SPI , FLASH_TYPE_EXTERNAL_QSPI ,
  FLASH_TYPE_EXTERNAL_OSPI
}
 Flash Type definition.
 
enum  FlashStatus { FLASH_STATUS_OK = 0 , FLASH_STATUS_BUSY , FLASH_STATUS_ERR }
 Flash Status definition.
 

Detailed Description

CycloneBOOT Flash layer.

License

SPDX-License-Identifier: GPL-2.0-or-later

Copyright (C) 2021-2026 Oryx Embedded SARL. All rights reserved.

This file is part of CycloneBOOT Open.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
2.6.6

Macro Definition Documentation

◆ FLASH_DRIVER_VERSION

#define FLASH_DRIVER_VERSION
Value:
(uint32_t)(((FLASH_DRIVER_VERSION_MAJOR & 0xFF) << 16) | \
((FLASH_DRIVER_VERSION_MINOR & 0xFF) << 8) | (FLASH_DRIVER_VERSION_PATCH & 0xFF))

Typedef Documentation

◆ FlashGetNextSector

typedef error_t(* FlashGetNextSector) (uint32_t address, uint32_t *sectorAddr)

Get address of the neighbouring sector.

Parameters
[in]addressAddress inside the flash
[out]sectorAddrStart of the sector that begins at the address, else start of the next sector
Returns
Error code