MAC帧,闪存中的程序启动流程
一、帧
参考《JN-AN-1001-Power-Estimation.pdf》
802.15.4在MAC层所有关于的信息操作都是基于符号率(symbol rate)。当工作在2.4-GHz 的时候the symbol rate is defined as 62500 symbols per second. Each symbol comprises four bits of information and, therefore, the over-air data rate is 250 kbps. Below are the formulae required to calculate the time taken to perform common 802.15.4 network operations, based on this data rate.
帧大小
The maximum size of a data frame is 127 bytes, of which 6 bytes form the Physical layerheader and 9 to 25 bytes form the MAC layer header. The size of the MAC layer header is dependent on the addressing mode used; see the table below for details.
当地址模式没有与地址没有目的地址,只有PAN ID的时候,MAC帧头大小为9字节
当地址模式为16位的短地址的时候,MAC帧头大小为9字节+4字节=13字节
当地址模式为64位的MAC地址的时候,MAC帧头大小为9字节+16字节=25字节
The remaining 96 to 112 bytes can be used for the transmission of data.
PayloadSize (bytes) = 1 to 112
HeaderSize (bytes) = 15 to 31
Data Frame Transmission Period (ms) = (HeaderSize + PayloadSize) x 8 / 250
二、启动操作Boot Loader Operation
参考《JN-AN-1003-Boot-Loader-Operation-1v5.pdf》
1.启动流程
一开始启动的时候,boot loader会进行下面几个操作之一:
下图是jn5139的启动流程图
2.闪存头部
任何烧写进闪存的程序必须包含一个头部,这个头部包含的这个程序的信息,这个设备的信息。下面描述了闪存头部的格式:
The Flash header is defined at compile/link time by the chip-specific linker file located in the SDK directory at Chip\JN513x\Build.
Flash Access Configuration Byte
If the first Flash access configuration byte is 0xFF, this indicates a blank Flash memory. Otherwise, the Flash access configuration byte is interpreted as follows:
The first four bytes will be read from Flash memory with a SPI clock speed of 1 MHz. The boot loader will then use the SPI clock divider from the Flash access configuration byte to set the SPI clock for the remaining reads.
3.外部存储-闪存
闪存相对zigbee协议栈芯片(CPU,RAM,ROM等)来说是串行外部存储,将两者特定的脚针相连。
4.RAM图示
JN5139有96KB的RAM存储,分配如下
4.串行接口通信协议
在向flash烧写程序的时候使用的协议。
zigbee芯片与PC机通信好像也会用到。