RF App Test¶
1 功能概述¶
此项目展示PAN10xx芯片射频测试的 demo,功能和“RF_TEST”测试固件一样,可以使用“PAN107x tool box”工具进行射频测试。客户可以移植到自己的产品上面用于产测阶段射频测试,也可以根据自己需求添加一些自定义的串口命令测试不同的的case。
2 环境要求¶
board:
pan10xx evb
uart(打印log): 波特率921600,选项
8n1
(option)uart(数据通信): 波特率115200,选项
8n1
(must)PAN107x ToolBox 下载
频谱仪
3 编译和烧录¶
pan107x
芯片例程位置:<home>\nimble\samples\solutions\rf_app_test\keil_107x
pan101x
芯片例程位置:<home>\nimble\samples\solutions\rf_app_test\keil_101x
使用keil
进行打开项目进行编译烧录。
4 演示说明¶
PAN10XX EVB板PIN脚接线说明:
PAN1070EVB板GPIO |
USB转串口工具 |
---|---|
ICEK_uart1_rx(P24) |
UART_TX |
ICED_uart1_tx(P10) |
UART_RX |
VBAT |
VCC(3.3V) |
GND |
GND |
PAN1010EVB板GPIO |
USB转串口工具 |
---|---|
ICEK_uart1_rx(P00) |
UART_TX |
ICED_uart1_tx(P01) |
UART_RX |
VBAT |
VCC(3.3V) |
GND |
GND |
串口引脚客户可以根据自己的需求进行修改,也可使用SWD烧录口复用成串口。
测试流程:
程序上电默认发送单载波,发送单载波的接口如下:
// 发送 2402 频点单载波
rf_test_start_constant_tone(0);
通过频谱仪可以检测射频的频偏和 evm 相关的参数,以确保设备射频模块的质量;
使用PAN1070 ToolBox工具测试流程请参考RF Test中的第四章RF性能测试。
5 串口HCI协议说明¶
1 LE Test End Reset¶
Command |
OCF |
Command Parameters |
Return Parameters |
---|---|---|---|
HCI_LE_Test_Reset |
0x0003 |
None |
Status |
Description:
每次测试前需要执行复位命令。
Command parameters:
None.
Return parameters:
Status:
Value |
Parameter Description |
---|---|
0x00 |
Command succeeded. |
0x01 to 0xFF |
Command failed. |
Event(s) generated (unless masked away):
复位完成后, 将会回复一个 HCI_Command_Complete event.
Sample Data:
Data Send (004) : 01 03 0C 00
Value
Description
0x01
HCI Packet: Command
0x0C03
Command_Opcode: LE_Test_Reset
0x00
Length of command parameters
Data Recv (009) : 04 0E 04 01 03 0C 00
Value
Description
0x04
HCI Packet: Event
0x0E
Event_Code: HCI_Command_Complete
0x04
Length of event parameters
0x01
Num_HCI_Command_Packets
0x0C03
Command_Opcode: LE_Test_Reset
0x00
Status: Success
2 LE Receiver Test Command¶
Command |
OCF |
Command Parameters |
Return Parameters |
---|---|---|---|
HCI_LE_Receiver_Test [v2] |
0x0033 |
RX_Channel, PHY, Modulation_Index |
Status |
Description:
This command is used to start a test where the DUT receives test reference packets at a fixed interval. The tester generates the test reference packets.
Command parameters:
RX_Channel: (Size: 1 octet)
Value |
Parameter Description |
---|---|
N = 0xXX |
N = (F-2402) / 2 |
PHY: (Size: 1 octet)
Value |
Parameter Description |
---|---|
0x01 |
Receiver set to use the LE 1M PHY. |
0x02 |
Receiver set to use the LE 2M PHY. |
0x03 |
Receiver set to use the LE Coded PHY. |
Others |
Reserved for future use. |
Modulation_Index: (Size: 1 octet)
Value |
Parameter Description |
---|---|
0x00 |
Assume transmitter will have a standard modulation index. |
0x01 |
Assume transmitter will have a stable modulation index. |
Others |
Reserved for future use. |
Return parameters:
Status: (Size: 1 octet)
Value |
Parameter Description |
---|---|
0x00 |
Command succeeded. |
0x01 to 0xFF |
Command failed. |
Event(s) generated (unless masked away):
设置完成后, 将会回复一个 HCI_Command_Complete event.
Sample Data:
LE_Receiver_Test_v2:
Data Send (007) : 01 33 20 03 00 02 00
Value
Description
0x01
HCI Packet: Command
0x2033
Command_Opcode: LE_Receiver_Test_v2
0x03
Length of command parameters
0x00
RX_Channel: 2402MHz
0x02
PHY: LE 2M PHY
0x00
Modulation Index: Standard
Data Recv (007) : 04 0E 04 01 33 20 00
Value
Description
0x04
HCI Packet: Event
0x0E
Event_Code: HCI_Command_Complete
0x04
Length of event parameters
0x01
Num_HCI_Command_Packets
0x2033
Command_Opcode: LE_Receiver_Test_v2
0x00
Status: Success
3 LE Transmitter Test command¶
Command |
OCF |
Command Parameters |
Return Parameters |
---|---|---|---|
HCI_LE_Transmitter_Test [v2] |
0x0034 |
TX_Channel, |
Status |
Description:
This command is used to start a test where the DUT generates test reference packets at a fixed interval.
Command parameters:
TX_Channel: (Size: 1 octet)
Value |
Parameter Description |
---|---|
N = 0xXX |
N = (F-2402) / 2 |
Test_Data_Length: (Size: 1 octet)
Value |
Parameter Description |
---|---|
0x00 to 0xFF |
Length in bytes of payload data in each packet. |
Packet_Payload: (Size: 1 octet)
Value |
Parameter Description |
---|---|
0x00 |
PRBS9 sequence ‘11111111100000111101…’(in transmission order). |
0x01 |
Repeated ‘11110000’ (in transmission order) sequence. |
0x02 |
Repeated ‘10101010’ (in transmission order) sequence. |
0x03 |
PRBS15 sequence. |
0x04 |
Repeated ‘11111111’ (in transmission order) sequence. |
0x05 |
Repeated ‘00000000’ (in transmission order) sequence. |
0x06 |
Repeated ‘00001111’ (in transmission order) sequence. |
0x07 |
Repeated ‘01010101’ (in transmission order) sequence. |
Others |
Reserved for future use. |
PHY: (Size: 1 octet)
Value |
Parameter Description |
---|---|
0x01 |
Transmitter set to use the LE 1M PHY. |
0x02 |
Transmitter set to use the LE 2M PHY. |
0x03 |
Transmitter set to use the LE Coded PHY with S=8 data coding. |
0x04 |
Transmitter set to use the LE Coded PHY with S=2 data coding |
Others |
Reserved for future use. |
Return parameters:
Status: (Size: 1 octet)
Value |
Parameter Description |
---|---|
0x00 |
Command succeeded. |
0x01 to 0xFF |
Command failed. |
Event(s) generated (unless masked away):
设置完成后, 将会回复一个 HCI_Command_Complete event.
LE_Transmitter_Test_v2:
Data Send (008) : 01 34 20 04 00 FF 01 02
Value
Description
0x01
HCI Packet: Command
0x2034
Command_Opcode: LE_Transmitter_Test_v2
0x04
Length of command parameters
0x00
TX_Channel: 2402MHz
0xFF
Length_Of_Test_Data: 255 octets
0x01
Packet_Payload: Repeated ‘11110000’
0x02
PHY: LE 2M PHY
Data Recv (007) : 04 0E 04 01 34 20 00
Value
Description
0x04
HCI Packet: Event
0x0E
Event_Code: HCI_Command_Complete
0x04
Length of event parameters
0x01
Num_HCI_Command_Packets
0x2034
Command_Opcode: LE_Transmitter_Test_v2
0x00
Status: Success
4 LE Test End command¶
Command |
OCF |
Command Parameters |
Return Parameters |
---|---|---|---|
HCI_LE_Test_End |
0x001F |
NULL |
Status, |
Description:
This command is used to stop any test which is in progress. The Num_Packets for a transmitter test shall be reported as 0x0000. The Num_Packets is an unsigned number and contains the number of received packets.
Command parameters:
None.
Return parameters:
Status: (Size: 1 octet)
Value |
Parameter Description |
---|---|
0x00 |
Command succeeded. |
0x01 to 0xFF |
Command failed. |
Num_Packets: (Size: 2 octets)
Value |
Parameter Description |
---|---|
0xXXXX |
Number of packets received. |
Event(s) generated (unless masked away):
设置完成后, 将会回复一个 HCI_Command_Complete event.
Sample Data:
Data Send (004) : 01 1F 20 00
Value
Description
0x01
HCI Packet: Command
0x201F
Command_Opcode: LE_Test_End
0x00
Length of command parameters
Data Recv (009) : 04 0E 06 01 1F 20 00 40 06
Value
Description
0x04
HCI Packet: Event
0x0E
Event_Code: HCI_Command_Complete
0x06
Length of event parameters
0x01
Num_HCI_Command_Packets
0x201F
Command_Opcode: LE_Test_End
0x00
Status: Success
0x0640
Number_Of_Packets: 1600
5 HCI Vendor Debug Write Tx Power Command¶
Command |
HCI_OCF_EXT |
Command Parameters |
Return Parameters |
---|---|---|---|
HCI_Vendor_Debug_Write_Tx_Power |
0x03 |
Tx_Power |
Status |
Description:
Command parameters:
Tx_Power:
Value |
Parameter Description |
---|---|
0xXX |
Range: -24 to +7 |
Return parameters:
Status:
Value |
Parameter Description |
---|---|
0x00 |
Command succeeded. |
0x01 to 0xFF |
Command failed. |
Event(s) generated (unless masked away):
设置完成后, 将会回复一个 HCI_Command_Complete event.
Sample Data:
Data Send (005) : 01 C3 FF 01 00
Value
Description
0x01
HCI Packet: Command
0xFFC3
Command_Opcode: HCI_Vendor_Debug_Write_Tx_Power
0x01
Length of command parameters
0x01
Tx Power: 0 dBm
Data Recv (007) : 04 0E 04 01 C3 FF 00
Value
Description
0x04
HCI Packet: Event
0x0E
Event_Code: HCI_Command_Complete
0x04
Length of event parameters
0x01
Num_HCI_Command_Packets
0xFFC3
Command_Opcode: HCI_Vendor_Debug_Write_Tx_Power
0x00
Status: Success
6 HCI Vendor Constant Tone Test Command¶
Command |
HCI_OCF_EXT |
Command Parameters |
Return Parameters |
---|---|---|---|
HCI_Vendor_Constant_Tone_Test [V1] |
0x0B |
TX_Channel |
Status |
Description:
启动单音测试模式.
HCI_Vendor_Constant_Tone_Test [v1]: Tx_Channel 与 HCI_LE_Transmitter_Test 中的 Tx_Channel 一致, 只支持切换 BLE 支持的 Channel.
Command parameters:
TX_Channel: (Size: 1 octet)
Value |
Parameter Description |
---|---|
N = 0xXX |
N = (F-2402) / 2 |
Return parameters:
Status: (Size: 1 octet)
Value |
Parameter Description |
---|---|
0x00 |
Command succeeded. |
0x01 to 0xFF |
Command failed. |
Event(s) generated (unless masked away):
设置完成后, 将会回复一个 HCI_Command_Complete event.
Sample Data:
HCI_Vendor_Constant_Tone_Test_v1
Data Send (006) : 01 CB FF 01 00
Value
Description
0x01
HCI Packet: Command
0xFFCB
Command_Opcode: HCI_VENDOR_CMD_OCF_DEBUG_CONSTANT_TONE_V1
0x01
Length of command parameters
0x00
TX_Channel: 2402MHz
Data Recv (007) : 04 0E 04 01 CB FF 00
Value
Description
0x04
HCI Packet: Event
0x0E
Event_Code: HCI_Command_Complete
0x04
Length of event parameters
0x01
Num_HCI_Command_Packets
0xFFCB
Command_Opcode: HCI_VENDOR_CMD_OCF_DEBUG_CONSTANT_TONE_V1
0x00
Status: Success
7 HCI Vendor Debug LE Transmitter Parameters Command¶
Command |
HCI_OCF_EXT |
Command Parameters |
Return Parameters |
---|---|---|---|
HCI_Vendor_Debug_LE_Transmitter_Parameters |
0x11 |
Tx_Interval , |
Status |
Description:
Command parameters:
Tx_Interval: (Size: 2 octet)
Value |
Parameter Description |
---|---|
0x0000 |
Use the default value. |
Others |
Tx interval time in us. If the value is less than the default value, it does not take effect. |
Packet_Count: (Size: 2 octet)
Value |
Parameter Description |
---|---|
0x0000 |
Transmitter will keep sending until the |
Others |
Tx packet count |
Return parameters:
Status:
Value |
Parameter Description |
---|---|
0x00 |
Command succeeded. |
0x01 to 0xFF |
Command failed. |
Event(s) generated (unless masked away):
设置完成后, 将会回复一个 HCI_Command_Complete event.
Sample Data:
Data Send (008) : 01 D1 FF 04 E8 03 E8 03
Value
Description
0x01
HCI Packet: Command
0xFFD1
Command_Opcode: HCI_VENDOR_CMD_OCF_DEBUG_LE_TRANSMITTER_PARAMS
0x04
Length of command parameters
0x03E8
Tx_Interval, 1000us
0x03E8
Packet_Count, 1000
Data Recv (007) : 04 0E 04 01 D1 FF 00
Value
Description
0x04
HCI Packet: Event
0x0E
Event_Code: HCI_Command_Complete
0x04
Length of event parameters
0x01
Num_HCI_Command_Packets
0xFFD1
Command_Opcode: HCI_VENDOR_CMD_OCF_DEBUG_LE_TRANSMITTER_PARAMS
0x00
Status: Success
8 HCI Vendor Read RSSI GAIN Command¶
Command |
HCI_OCF_EXT |
Command Parameters |
Return Parameters |
---|---|---|---|
HCI_Vendor_Debug_Read_RSSI_GAIN |
0x0A |
NULL |
Status, |
Description:
通过LL接口来读取RSSI和GAIN.
Command parameters:
None.
Return parameters:
Status: (Size: 1 octet)
Value |
Parameter Description |
---|---|
0x00 |
Command succeeded. |
0x01 to 0xFF |
Command failed. |
RSSI_OUT: (Size: 2 octet)
Value |
Parameter Description |
---|---|
0xXXXX |
RSSI OUT value. default value: 0x0248. RSSI value to dBm: (RSSI value - (2 << 14)) / 4.0 |
RSSI_RAW: (Size: 2 octet)
Value |
Parameter Description |
---|---|
0xXXXX |
RSSI RAW value. |
RSSI_SEG: (Size: 2 octet)
Value |
Parameter Description |
---|---|
0xXXXX |
RSSI SEG value. |
Note:
正常情况下, RSSI会一直变化, 当读取到的值不变时, 可能当前没有配置为接收, 或没有收到数据.
GAIN: (Size: 1 octet)
Value |
Parameter Description |
---|---|
0xXX |
GAIN value. |
Event(s) generated (unless masked away):
设置完成后, 将会回复一个 HCI_Command_Complete event.
Sample Data:
Data Send (004) : 01 CA FF 00
Value
Description
0x01
HCI Packet: Command
0xFFCA
Command_Opcode: HCI_VENDOR_CMD_OCF_DEBUG_READ_RSSI_GAIN
0x00
Length of command parameters
Data Recv (014) : 04 0E 0B 01 CA FF 00 D5 3E D9 00 40 3E 06
Value
Description
0x04
HCI Packet: Event
0x0E
Event_Code: HCI_Command_Complete
0x0B
Length of event parameters
0x01
Num_HCI_Command_Packets
0xFFCA
Command_Opcode: HCI_VENDOR_CMD_OCF_DEBUG_READ_RSSI_GAIN
0x00
Status: Success
0x3ED5
RSSI OUT: -74.75 dBm
0x00D9
RSSI RAW
0x3E40
RSSI SEG
0x06
GAIN
6 RAM/Flash资源使用情况¶
PAN107x:
Flash Size: 24.70k
RAM Size: 5.68 k
PAN101x:
Flash Size: 24.10k
RAM Size: 4.44 k