K60 ezport笔记

EzPort是一个穿行flash编程接口,允许32位general purpose微控制器的flash存储器的在系统编程。

31.1.2 功能
EzPort 包含以下功能:
• Serial interface that is compatible with a subset of the SPI format.
• Able to read, erase and program flash memory.
• Able to reset the micro-controller, allowing it to boot from the flash memory after the
memory has been configured.

31.1.3 操作模式
The EzPort can operate in one of two different modes, enabled or disabled.
• Enabled — When enabled, the EzPort steals access to the flash memory, preventing
access from other cores or peripherals. The rest of the microcontroller is disabled to
avoid conflicts. The flash is configured for NVM Special Mode.
• Disabled — When the EzPort is disabled, the rest of the micro-controller can access
flash memory as normal.

31.2 外部信号描述
The following table contains a list of EzPort external signals, and the following sections
explain them in detail.
Table 31-1. EzPort External Signal Descriptions
Name        Description                I/O
EZP_CK   EzPort Clock              Input
EZP_CS   EzPort Chip Select     Input
EZP_D      EzPort Serial Data     In Input
EZP_Q      EzPort Serial Data     Out Output

EzPort时钟是数据传输的串行时钟。The serial data in (EZP_D) and chip select (EZP_CS)在时钟上升沿被注册,serial data out (EZP_Q)在时钟下降沿被驱动。

所有指令的最大频率的时钟是系统时钟频率的一半,除了读数据和读FlexRAM指令。执行读数据和读FlexRAM指令时,频率最大是系统时钟频率的1/8。

EzPort Chip Select (EZP_CS)是传输开始和结束的信号。当使能EzPort,片选生效就会开始串行数据传输,直到片选被否定。片选被否定表明当前指令结束,并重置EzPort的状态机,所以准备好接收下一条指令。

31.3 命令定义
EzPort接收来自外设的命令并且将命令传输到
flash存储器访问. 下面表格列出支持的命令.
Table 31-2. EzPort commands
Command             Description                               Code    Address Bytes    Data Bytes     Accepted when  secure?
WREN                 Write Enable                              0x06        0                        0                          Yes
WRDI                   Write Disable                             0x04        0                        0                          Yes
RDSR                 Read Status Register                 0x05  0                               1                          Yes
READ                 Flash Read Data                         0x03        3                        1+                         No
FAST_READ      Flash Read Data at High Speed 0x0B        3                        1+                         No
SP                      Flash Section Program                0x02       3                        8 - SECTION         No
SE                      Flash Sector Erase                      0xD8       3                        0                           No
BE                      Flash Bulk Erase                         0xC7       0                        0                          Yes

RESET               Reset Chip                                  0xB9       0                        0                          Yes
WRFCCOB        Write FCCOB Registers              0xBA       0                        12                        Yes
FAST_RDFCCOB   Read FCCOB registers at high speed  0xBB  0                1 - 12                  No
WRFLEXRAM    Write FlexRAM                             0xBC        3                          4                       No
RDFLEXRAM     Read FlexRAM                             0xBD       3                        1+                        No
FAST_RDFLEXRAM Read FlexRAM at high speed   0xBE    3                         1+                       No

31.3.1.1 Write Enable

写使能指令(WREN)置位写使能寄存器位在EzPort状态寄存器中。当重启时,写失能指令和写指令结束时被清除。

31.3.1.4 Read Data

读数据指令返回来自flash存储器或者FlexNVM的数据,取决于在指令字中指定的初始地址。初始地址必须是32位对齐的(两位LSBs必须是零)。

当在EzPort状态寄存器中的WEF,WIP或者FS位是置位时,该指令不被接受。

31.3.1.5 Read Data at High Speed

FAST_READ读数据高速指令是相对于READ指令,除了包含紧跟地址字节和在第一数据字节前的虚拟字节返回。该指令可以在一半的系统时钟频率下或者更低频率运行。

31.3.1.6 Section Program

Section Program( SP)指令编程由flash存储器的一个擦除过的section决定。一个section由比flash sector大小更小的或者一半FlexRAM/Programming Acceleration RAM定义。编程存储的起始地址在该指令后被发送,必须是64位对齐地址(三个LSBs必须是零)。

一次编程的字节数必须是8的倍数,最高是一个flash section。

默认的, after entering EzPort mode, the FlexRAM is
configured for traditional RAM operation. If the user reconfigures FlexRAM for
EEPROM operation (see Flash Memory chapter for details on how FlexRAM function is
modified), then the user should use the WRFCCOB command to configure FlexRAM
back to traditional RAM operation before issuing a SP command.

31.3.1.7 Sector Erase

Sector Erase(SE)指令擦除flash存储器的一个sector内容。在该指令后被发送的三个字节地址可以是在该sector内的任意地址来擦除,但必须是64位对齐地址(the three LSBs must be zero)。

31.3.1.8 Bulk Erase

Bulk Erase (BE)指令擦除flash存储器所有的内容,忽略任何被保护的sectors或者是flash security.Flash security is disabled upon successful completion of the BE command.

31.3.1.12 Write FlexRAM

该指令WRFLEXRAM仅在FlexRAM中被应用。

允许用户写4字节数据到FlexRAM中(接收时候12字节)。如果FlexRAM被配置为EEPROM操作,该指令可以高效的被用来创造在EEPROM flash存储器中的数据记录。

FlexRAM位置地址时在该指令字之后被传送的,必须是32位对齐(the two LSBs must be zero).

接收四字节数据后, EzPort 将数据写入FlexRAM.

31.3.1.13 Read FlexRAM

该指令仅用于带有FlexRAM的设备中。RDFLEXRAM指令返回来自FlexRAM的数据。如果FlexRAM被配置成EEPROM操作,该指令可以有效地从EEPROM flash存储器中读取数据。

只要片选生效,数据就持续的被获得,伴随地址自动的增长。用这种方式,FlexRAM中的内容可以用一条指令就可以获得。

初始地址必须是32位对齐(the two LSBs must be zero).时钟是系统时钟的1/8的分频或者更慢。

31.4 Flash memory map for EzPort access

Table 31-5. Flash Memory Map for EzPort Access
Valid start address                       Size                                               Flash block                             Valid commands
0x0000_0000                    See device's chip configuration details    Flash               READ, FAST_READ, SP, SE, BE

0x0080_0000                                                                                    FlexNVM           READ, FAST_READ, SP, SE, BE

0x0000_0000                                                                                    FlexRAM           RDFLEXRAM,                               FAST_RDFLEXRAM,WRFLEXRAM, BE

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值