RZT Flexible Software Package Documentation
Release v2.2.0
|
|
Functions | |
fsp_err_t | R_BSC_NOR_Open (nor_flash_ctrl_t *p_ctrl, nor_flash_cfg_t const *const p_cfg) |
fsp_err_t | R_BSC_NOR_Write (nor_flash_ctrl_t *p_ctrl, uint8_t const *const p_src, uint8_t *const p_dest, uint32_t byte_count) |
fsp_err_t | R_BSC_NOR_Erase (nor_flash_ctrl_t *p_ctrl, uint8_t *const p_device_address, uint32_t byte_count) |
fsp_err_t | R_BSC_NOR_StatusGet (nor_flash_ctrl_t *p_ctrl, uint8_t *const p_device_address, nor_flash_status_t *const p_status) |
fsp_err_t | R_BSC_NOR_Close (nor_flash_ctrl_t *p_ctrl) |
Driver for the BSC peripheral on RZ microprocessor. This module implements the NOR Flash Interface.
The BSC NOR driver has the following key features:
Configuration | Options | Default | Description |
---|---|---|---|
Parameter Checking Enable |
| Default (BSP) | If selected code for parameter checking is included in the build. |
Configuration | Options | Default | Description |
---|---|---|---|
General > Name | Name must be a valid C symbol | g_nor_flash0 | Module name. |
General > Chip Select |
| Chip Select 0 | Specify the NOR Flash chip select line to use. |
General > Data Bus With | 16-bit | 16-bit | Select the number of NOR Flash data bus width. |
Idle Cycles > Read-Read Cycles In The Same CS Space |
| 4 CYCLES | Idle cycle insertion between Read-Read cycles in the same CS space. |
Idle Cycles > Read-Read Cycles In The Different CS Spaces |
| 4 CYCLES | Idle cycle insertion between Read-Read cycles in different CS space. |
Idle Cycles > Read-Write Cycles In The Same CS Spaces |
| 4 CYCLES | Idle cycle insertion between Read-Write cycles in the same CS space. |
Idle Cycles > Read-Write Cycles In The Different CS Spaces |
| 4 CYCLES | Idle cycle insertion between Read-Write cycles in different CS space. |
Idle Cycles > Write-Read Cycles And Write-Write Cycles |
| 4 CYCLES | Idle cycles between Write-Read cycles and Write-Write cycles. |
Chip Select Timing > CS Negate (RD#,WE# to CSn#) Delay Timing (CS0,5 only) |
| 0.5 CYCLES | Delay States from RD#, WEn# Negation to Address, CSn# Negation. |
Chip Select Timing > CS Assert (CSn# to RD#,WE#) Delay Timing (CS0,5 only) |
| 0.5 CYCLES | Number of Delay Cycles from Address, CSn# Assertion to RD#, WE# Assertion. |
Number of Access Wait > Access Wait For Read | Refer to the RZT Configuration tool for available options. | 14 WAITS | The number of waits that are necessary for read access. |
Number of Access Wait > Access Wait For Write |
| The Same As Number Of Read Access Wait (Select when use CS0,2,3) | The number of waits that are necessary for write access. |
The BSC clock is derived from External bus clock (BSC_CLK, CKIO). You can set the clock frequency using the Clocks tab of the FSP Configuration editor or by using the CGC Interface at run-time.
After R_BSC_NOR_Open() completes successfully, the connected BSC device contents are mapped to address 0x70000000(External address space) or 0x50000000(Mirror area External address space) and can be read like internal memory.
When not using the cache, access the memory via the mirror area.
The BSC NOR driver supports flash memory that is compatible with the JEDEC standard command system.
The command set issued by BSC NOR driver is as follows. For 16-bit data bus width connections, issue a 1-bit left-shifted address.
Issue Program command sequence when programming single word as follows:
Command Cycle | Address | Data |
---|---|---|
1st | 0x555 | 0xAA |
2nd | 0x2AA | 0x55 |
3rd | 0x555 | 0xA0 |
4th | Program Address | Program Data |
Issue Write to Buffer sequence and Program Buffer to Flash (confirm) sequence when programming multiple words as follows:
Command Cycle | Address | Data |
---|---|---|
1st | 0x555 | 0xAA |
2nd | 0x2AA | 0x55 |
3rd | Sector Address | 0x25 |
4th | Sector Address | Program Count |
5th | Program Address | Program Data |
6th | Write Buffer Location | Program Data |
Last | Sector Address | 0x29 |
Issue Sector Erase sequence as follows:
Command Cycle | Address | Data |
---|---|---|
1st | 0x555 | 0xAA |
2nd | 0x2AA | 0x55 |
3rd | 0x555 | 0x80 |
4th | 0x555 | 0xAA |
5th | 0x2AA | 0x55 |
6th | Sector Address | 0x30 |
Issue Chip Erase sequence as follows:
Command Cycle | Address | Data |
---|---|---|
1st | 0x555 | 0xAA |
2nd | 0x2AA | 0x55 |
3rd | 0x555 | 0x80 |
4th | 0x555 | 0xAA |
5th | 0x2AA | 0x55 |
6th | 0x555 | 0x10 |
Status register 6th bit toggle monitors whether the program/erase operation has completed its operations or not.
This is a basic example of minimal use of the BSC_NOR in an application.
This is an example of using a CFI query to get the device size.
Data Structures | |
struct | bsc_nor_block_info_t |
struct | bsc_nor_extended_cfg_t |
struct | bsc_nor_instance_ctrl_t |
Enumerations | |
enum | bsc_nor_idle_cycle_t |
enum | bsc_nor_access_wait_cycle_t |
enum | bsc_nor_cs_wait_cycle_t |
struct bsc_nor_block_info_t |
Store CFI query result of Flash memory sector block information.
struct bsc_nor_extended_cfg_t |
Extended configuration.
Data Fields | ||
---|---|---|
bsc_nor_idle_cycle_t | r_r_same_space_idle_cycle |
Idle cycle between Read-Read cycles in the same CS space |
bsc_nor_idle_cycle_t | r_r_different_space_idle_cycle |
Idle cycle between Read-Read cycles in the different CS space |
bsc_nor_idle_cycle_t | r_w_same_space_idle_cycle |
Idle cycle between Read-Write cycles in the same CS space |
bsc_nor_idle_cycle_t | r_w_different_space_idle_cycle |
Idle cycle between Read-Write cycles in the different CS space |
bsc_nor_idle_cycle_t | w_r_w_w_idle_cycle |
Idle cycle between Write-Read cycles and Write-Write cycles |
bsc_nor_access_wait_cycle_t | read_access_wait_cycle | Number of read access cycle waits. |
bsc_nor_access_wait_cycle_t | write_access_wait_cycle | Number of write access cycle waits. |
bsc_nor_cs_wait_cycle_t | cs_pullup_lag | Duration to de-assert CS line after RD#,WE# de-assert. |
bsc_nor_cs_wait_cycle_t | cs_pulldown_lead | Duration to assert CS line before RD#,WE# assert. |
struct bsc_nor_instance_ctrl_t |
Instance control block. DO NOT INITIALIZE. Initialization occurs when nor_flash_api_t::open is called
enum bsc_nor_idle_cycle_t |
Number of insertion idle cycle between access cycles
Number of insertion access wait cycle
fsp_err_t R_BSC_NOR_Open | ( | nor_flash_ctrl_t * | p_ctrl, |
nor_flash_cfg_t const *const | p_cfg | ||
) |
Open the BSC_NOR driver module. After the driver is open, the BSC can be accessed like internal flash memory starting at address 0x70000000 or 0x50000000.
Implements nor_flash_api_t::open.
FSP_SUCCESS | Configuration was successful. |
FSP_ERR_ASSERTION | The parameter p_instance_ctrl or p_cfg is NULL. Connected Flash memory device does not support CFI query, or insufficient memory area for storing CFI query. |
FSP_ERR_IP_CHANNEL_NOT_PRESENT | Invalid Channel. |
FSP_ERR_ALREADY_OPEN | Driver has already been opened with the same p_instance_ctrl. |
fsp_err_t R_BSC_NOR_Write | ( | nor_flash_ctrl_t * | p_ctrl, |
uint8_t const *const | p_src, | ||
uint8_t *const | p_dest, | ||
uint32_t | byte_count | ||
) |
Program data to the flash.
Implements nor_flash_api_t::write.
FSP_SUCCESS | The flash was programmed successfully. |
FSP_ERR_ASSERTION | p_instance_ctrl, p_dest or p_src is NULL. |
FSP_ERR_NOT_OPEN | Driver is not opened. |
FSP_ERR_DEVICE_BUSY | Another Write/Erase transaction is in progress. |
FSP_ERR_INVALID_ARGUMENT | p_dest is invalid for connected device. |
fsp_err_t R_BSC_NOR_Erase | ( | nor_flash_ctrl_t * | p_ctrl, |
uint8_t *const | p_device_address, | ||
uint32_t | byte_count | ||
) |
Erase a sector or a chip of flash.
Implements nor_flash_api_t::erase.
FSP_SUCCESS | The command to erase the flash was executed successfully. |
FSP_ERR_ASSERTION | p_instance_ctrl or p_device_address is NULL, or byte_count doesn't match the device defined erase size resulting from the CFI query. |
FSP_ERR_NOT_OPEN | Driver is not opened. |
FSP_ERR_DEVICE_BUSY | The device is busy. |
fsp_err_t R_BSC_NOR_StatusGet | ( | nor_flash_ctrl_t * | p_ctrl, |
uint8_t *const | p_device_address, | ||
nor_flash_status_t *const | p_status | ||
) |
Gets the write or erase status of the flash.
Implements nor_flash_api_t::statusGet.
FSP_SUCCESS | The write status is in p_status. |
FSP_ERR_ASSERTION | p_instance_ctrl, p_device_address or p_status is NULL. |
FSP_ERR_NOT_OPEN | Driver is not opened. |
fsp_err_t R_BSC_NOR_Close | ( | nor_flash_ctrl_t * | p_ctrl | ) |
Close the BSC_NOR driver module.
Implements nor_flash_api_t::close.
FSP_SUCCESS | Configuration was successful. |
FSP_ERR_ASSERTION | p_instance_ctrl is NULL. |
FSP_ERR_NOT_OPEN | Driver is not opened. |