Cascoda SDK
Cascoda SDK for building software to run with CA-821x transceivers
cascoda_dataflash_m2351_secure.c File Reference
#include <stdio.h>
#include <string.h>
#include "M2351.h"
#include "fmc.h"
#include "sys.h"
#include "cascoda-bm/cascoda_interface.h"
#include "cascoda-bm/cascoda_types.h"
#include "cascoda_chili.h"
Include dependency graph for cascoda_dataflash_m2351_secure.c:

Macros

#define CASCODA_CHILI_FLASH_PAGES   8
 
#define MANUFACTURER_DATA_FLASH_SIZE   (FMC_FLASH_PAGE_SIZE)
 
#define MANUFACTURER_DATA_FLASH_BASE   (FMC_APROM_END - MANUFACTURER_DATA_FLASH_SIZE)
 
#define DATA_FLASH_BASE   (MANUFACTURER_DATA_FLASH_BASE - (CASCODA_CHILI_FLASH_PAGES * FMC_FLASH_PAGE_SIZE))
 

Functions

__NONSECURE_ENTRY void BSP_GetFlashInfo (struct ca_flash_info *aFlashInfoOut)
 Get the flashinfo struct for the current platform. More...
 
__NONSECURE_ENTRY ca_error BSP_FlashWriteInitial (u32_t startaddr, void *data, u32_t datasize)
 Writes Dataflash Memory, relies on Memory erased. More...
 
__NONSECURE_ENTRY ca_error BSP_FlashErase (u32_t startaddr)
 Erases a Dataflash Memory page (All words in page set to 0xFFFFFFFF) More...
 
__NONSECURE_ENTRY ca_error BSP_FlashRead (u32_t startaddr, u32_t *data, u32_t datasize)
 Reads Dataflash Memory. More...
 
__NONSECURE_ENTRY ca_error BSP_FlashCheck (u32_t startaddr, u32_t checklen, u32_t crc32)
 Check that a given range of flash matches the provided CRC32 checksum. More...
 
__NONSECURE_ENTRY void CHILI_SetLDROMBoot (void)
 Configure the chili to boot from LDROM next time. More...
 
__NONSECURE_ENTRY void CHILI_SetAPROMBoot (void)
 Configure the chili to boot from APROM next time. More...
 
__NONSECURE_ENTRY void BSP_FlashLock (void)
 Prevent ICP access to Flash. More...
 

Variables

const struct ca_flash_info BSP_FlashInfo
 

Macro Definition Documentation

◆ CASCODA_CHILI_FLASH_PAGES

#define CASCODA_CHILI_FLASH_PAGES   8

◆ DATA_FLASH_BASE

#define DATA_FLASH_BASE   (MANUFACTURER_DATA_FLASH_BASE - (CASCODA_CHILI_FLASH_PAGES * FMC_FLASH_PAGE_SIZE))

◆ MANUFACTURER_DATA_FLASH_BASE

#define MANUFACTURER_DATA_FLASH_BASE   (FMC_APROM_END - MANUFACTURER_DATA_FLASH_SIZE)

◆ MANUFACTURER_DATA_FLASH_SIZE

#define MANUFACTURER_DATA_FLASH_SIZE   (FMC_FLASH_PAGE_SIZE)

Function Documentation

◆ CHILI_SetAPROMBoot()

__NONSECURE_ENTRY void CHILI_SetAPROMBoot ( void  )

Configure the chili to boot from APROM next time.

◆ CHILI_SetLDROMBoot()

__NONSECURE_ENTRY void CHILI_SetLDROMBoot ( void  )

Configure the chili to boot from LDROM next time.

Variable Documentation

◆ BSP_FlashInfo

const struct ca_flash_info BSP_FlashInfo
Initial value:
= {FMC_APROM_BASE,
FMC_FLASH_PAGE_SIZE,
#define CASCODA_CHILI_FLASH_PAGES
Definition: cascoda_dataflash_m2351_secure.c:51
#define MANUFACTURER_DATA_FLASH_BASE
Definition: cascoda_dataflash_m2351_secure.c:69
#define DATA_FLASH_BASE
Definition: cascoda_dataflash_m2351_secure.c:70