Bouffalo SDK  1.0
Bouffalolab Software Development Kit
FLASH
Collaboration diagram for FLASH:

Modules

 flash iomode definition
 
 flash aes key type definition
 

Data Structures

struct  bflb_flash_aes_config_s
 

Functions

int bflb_flash_init (void)
 Initialize flash. More...
 
uint32_t bflb_flash_get_jedec_id (void)
 Get flash jedec id. More...
 
uint32_t bflb_flash_get_size (void)
 get flash size More...
 
void bflb_flash_get_cfg (uint8_t **cfg_addr, uint32_t *len)
 Get flash config. More...
 
void bflb_flash_set_iomode (uint8_t iomode)
 Set flash iomode. More...
 
uint32_t bflb_flash_get_image_offset (void)
 Get flash image offset. More...
 
int bflb_flash_erase (uint32_t addr, uint32_t len)
 Erase flash with sectors. More...
 
int bflb_flash_write (uint32_t addr, uint8_t *data, uint32_t len)
 Write data into flash. More...
 
int bflb_flash_read (uint32_t addr, uint8_t *data, uint32_t len)
 Read data from flash. More...
 
int bflb_flash_get_unique_id (uint8_t *data, uint8_t id_len)
 read flash unique id More...
 
int bflb_flash_set_cache (uint8_t cont_read, uint8_t cache_enable, uint8_t cache_way_disable, uint32_t flash_offset)
 Config flash cache. More...
 
void bflb_flash_aes_init (struct bflb_flash_aes_config_s *config)
 Initialize flash aes controller. More...
 
void bflb_flash_aes_enable (void)
 Enable flash decrypt with aes. More...
 
void bflb_flash_aes_disable (void)
 Disable flash decrypt with aes. More...
 
void bflb_flash_jump_encrypted_app (uint8_t index, uint32_t flash_addr, uint32_t len)
 Initialize flash jump to encrypted app. More...
 

Detailed Description

Function Documentation

◆ bflb_flash_aes_disable()

void bflb_flash_aes_disable ( void  )

Disable flash decrypt with aes.

◆ bflb_flash_aes_enable()

void bflb_flash_aes_enable ( void  )

Enable flash decrypt with aes.

◆ bflb_flash_aes_init()

void bflb_flash_aes_init ( struct bflb_flash_aes_config_s config)

Initialize flash aes controller.

Parameters
[in]configpointer to flash aes config.

◆ bflb_flash_erase()

int bflb_flash_erase ( uint32_t  addr,
uint32_t  len 
)

Erase flash with sectors.

Parameters
[in]addr
[in]len
Returns
Zero on success; a negated errno value on failure

◆ bflb_flash_get_cfg()

void bflb_flash_get_cfg ( uint8_t **  cfg_addr,
uint32_t *  len 
)

Get flash config.

Parameters
[out]cfg_addrpointer to save config
[in]lenflash config size

◆ bflb_flash_get_image_offset()

uint32_t bflb_flash_get_image_offset ( void  )

Get flash image offset.

Returns
flash image offset

◆ bflb_flash_get_jedec_id()

uint32_t bflb_flash_get_jedec_id ( void  )

Get flash jedec id.

Returns
uint32_t

◆ bflb_flash_get_size()

uint32_t bflb_flash_get_size ( void  )

get flash size

Returns
flash size

◆ bflb_flash_get_unique_id()

int bflb_flash_get_unique_id ( uint8_t *  data,
uint8_t  id_len 
)

read flash unique id

Parameters
data
id_len
Returns
int

◆ bflb_flash_init()

int bflb_flash_init ( void  )

Initialize flash.

Returns
Zero on success; a negated errno value on failure

◆ bflb_flash_jump_encrypted_app()

void bflb_flash_jump_encrypted_app ( uint8_t  index,
uint32_t  flash_addr,
uint32_t  len 
)

Initialize flash jump to encrypted app.

Parameters
[in]indexregion index
[in]flash_addrflash physical address.
[in]lenfirmware length.

◆ bflb_flash_read()

int bflb_flash_read ( uint32_t  addr,
uint8_t *  data,
uint32_t  len 
)

Read data from flash.

Parameters
[in]addrflash physical address
[out]datapointer to data buffer
[in]lenlength of data
Returns
Zero on success; a negated errno value on failure

◆ bflb_flash_set_cache()

int bflb_flash_set_cache ( uint8_t  cont_read,
uint8_t  cache_enable,
uint8_t  cache_way_disable,
uint32_t  flash_offset 
)

Config flash cache.

Parameters
[in]cont_readenable or not continuous read mode.
[in]cache_enableenable cache or not
[in]cache_way_disableways of cache to disable
[in]flash_offsetflash image offset
Returns
Zero on success; a negated errno value on failure

◆ bflb_flash_set_iomode()

void bflb_flash_set_iomode ( uint8_t  iomode)

Set flash iomode.

Parameters
[in]iomodeflash iomode, use flash iomode definition

◆ bflb_flash_write()

int bflb_flash_write ( uint32_t  addr,
uint8_t *  data,
uint32_t  len 
)

Write data into flash.

Parameters
[in]addrflash physical address
[in]datapointer to data buffer
[in]lenlength of data
Returns
Zero on success; a negated errno value on failure