Wi-SUN Configuration with RAILtest for EFR32FG25#

Wi-SUN FSK Configuration#

Set Up PHR and TX FIFO#

Wi-SUN FSK PHYs are configured to variable length packet encoding. Also, other configurable parameters are stored in the PHR field according to the standard. It might be difficult to set it up correctly. Therefore, a helper function – the set802154PHR CLI command – has been implemented in the RAILtest project, which simplifies configuration of a valid PHR field and the payload.

Using the RAILtest example, the transmitted packet length should be defined first with the setTxLength CLI command, including the PHR's size (2 bytes). This command sets up the Tx FIFO's length and allocates memory for it.

The set802154PHR CLI command for the FSK case sets the FCS type, Whitening bit, and Length fields of the PHR:

  1. The first argument selects the PHR format (1, 2, 4 bytes). For FSK, this should be always set to 1, which selects 2 bytes.

  2. The second argument sets the FCS type (it should be 0 for Wi-SUN FAN for 4 bytes FCS and 1 for ECHONET/HAN).

  3. The third argument specifies the payload whitening (0 for payload whitening disabled and 1 for payload whitening enabled). The payload whitening is mandatory for Wi-SUN, but some Wi-SUN conformance tests could require disabling it. The whitening mode must also be set in the radio_setting.radioconf.

See an example use case in A Complete FSK Configuration Example.

The Frame Length field of the PHR is configured according to the length that previously was configured by the setTxLength command. The payload will be padded by autogenerated data.

Warning: setTxLength must always precede the set802154PHR command when the Tx packet's length is changed.

Note: To comply with IEEE 802.15.4, the set802154PHR command should be used according to the configured PHY in the Radio Configurator. The command only changes the PHR field in the Tx frames. No FSK modem configurations are made through this command.

Configure PA for FSK#

The FSK PA (RAIL_TX_POWER_MODE_SUBGIG_POWERSETTING_TABLE) is configured by the RAIL_ConfigTxPower() RAIL API. This function is wrapped by the setPowerConfig CLI command.

A Complete FSK Configuration Example#

In this section, a complete example is presented of how to transmit FSK-modulated packets with the EFR32FG25 radio using the RAILtest application. It assumes the EFR32FG25 is flashed with an image with a Wi-SUN FSK configuration with whitening enabled set with the Radio Configurator.

The following CLI commands are used:

  • Set up the radio to use the FSK PA (only needed when also using OFDM PA).

  • Set the desired PA level (check the maximum level depending on the radio board).

  • Set the transmitted packet's length to 250 (= framelength field in the PHR of 252 – 4-byte FCS + 2 bytes of PHR).

  • Configure the PHR.

  • Transmit 10 packets.

    > rx 0
    {{(rx)}{Rx:Disabled}{Idle:Enabled}{Time:3295762881}}
    > setpowerconfig RAIL_TX_POWER_MODE_SUBGIG_POWERSETTING_TABLE 3600 10
    {{(setpowerconfig)}{success:true}{mode:RAIL_TX_POWER_MODE_SUBGIG_POWERSETTING_TABLE}{modeIndex:0}{voltage:3600}{rampTime:7}}
    > setpower 140
    {{(setpower)}{powerLevel:72}{power:140}}
    > setchannel 0
    {{(setchannel)}{channel:0}}
    > rx 1
    {{(rx)}{Rx:Enabled}{Idle:Disabled}{Time: 329573470724420}}
    > setTxLength 250
    {{(setTxLength)}{TxLength:250}{TxLength Written:250}}
    > Set802154phr 1 0 1
    {{(Set802154phr)}{PhrSize:2}{PHR: 0x3f10}}
    {{(Set802154phr)}{len:250}{payload: 0x10 0x3f 0x11 0x22 0x33 0x44 0x55 0x0f 0x77 0x88 0x99 0xaa 0xbb 0xcc 0xdd 0xee
     0x10 0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f 0x20 0x21 0x22 0x23 0x24 0x25 0x26
     0x27 0x28 0x29 0x2a 0x2b 0x2c 0x2d 0x2e 0x2f 0x30 0x31 0x32 0x33 0x34 0x35 0x36 0x37 0x38 0x39 0x3a 0x3b 0x3c 0x3d
     0x3e 0x3f 0x40 0x41 0x42 0x43 0x44 0x45 0x46 0x47 0x48 0x49 0x4a 0x4b 0x4c 0x4d 0x4e 0x4f 0x50 0x51 0x52 0x53 0x54
     0x55 0x56 0x57 0x58 0x59 0x5a 0x5b 0x5c 0x5d 0x5e 0x5f 0x60 0x61 0x62 0x63 0x64 0x65 0x66 0x67 0x68 0x69 0x6a 0x6b
     0x6c 0x6d 0x6e 0x6f 0x70 0x71 0x72 0x73 0x74 0x75 0x76 0x77 0x78 0x79 0x7a 0x7b 0x7c 0x7d 0x7e 0x7f 0x80 0x81 0x82
     0x83 0x84 0x85 0x86 0x87 0x88 0x89 0x8a 0x8b 0x8c 0x8d 0x8e 0x8f 0x90 0x91 0x92 0x93 0x94 0x95 0x96 0x97 0x98 0x99
     0x9a 0x9b 0x9c 0x9d 0x9e 0x9f 0xa0 0xa1 0xa2 0xa3 0xa4 0xa5 0xa6 0xa7 0xa8 0xa9 0xaa 0xab 0xac 0xad 0xae 0xaf 0xb0
     0xb1 0xb2 0xb3 0xb4 0xb5 0xb6 0xb7 0xb8 0xb9 0xba 0xbb 0xbc 0xbd 0xbe 0xbf 0xc0 0xc1 0xc2 0xc3 0xc4 0xc5 0xc6 0xc7
     0xc8 0xc9 0xca 0xcb 0xcc 0xcd 0xce 0xcf 0xd0 0xd1 0xd2 0xd3 0xd4 0xd5 0xd6 0xd7 0xd8 0xd9 0xda 0xdb 0xdc 0xdd 0xde
     0xdf 0xe0 0xe1 0xe2 0xe3 0xe4 0xe5 0xe6 0xe7 0xe8 0xe9 0xea 0xeb 0xec 0xed 0xee 0xef 0xf0 0xf1 0xf2 0xf3 0xf4 0xf5
     0xf6 0xf7 0xf8 0xf9}}
    > tx 10
    {{(tx)}{PacketTx:Enabled}{None:Disabled}{Time:3294056593}}
    {{(appMode)}{None:Enabled}{PacketTx:Disabled}{Time:3296735316}}
    {{(txEnd)}{txStatus:Complete}{transmitted:10}{lastTxTime:3296735238}{timePos:6}{lastTxStart:3296692963}{ccaSuccess:0}{failed:0}{lastTxStatus:0x000000000}{txRemain:0}{isAck:False}}

Notes:

  • The maximum framelength value in the PHR is 2047. Therefore, in Wi-SUN FSK, this provides a setTxLength RAILtest command of 2045 (= 2047 – 4 bytes FCS + 2 bytes of PHR).

  • Use setConfigIndex to select the appropriate Wi-SUN FSK mode available in the radio_settings.radioconf.

  • Use the help command for a full list of CLI command options.

Diagnostic Signals#

Both stream mode (PN9) and CW signal generation are supported.

PN9 stream mode also requires setting up PHR (with the set802154PHR command).

As an example, the following CLI commands configure and enable the PN9 stream transmission mode on the radio.

    > set802154Phr 1 0 1
    > setTxStream 1

Example:

    > set802154Phr 1 0 1
      {{(set802154Phr)}{PhrSize:2}{PHR:0x6010}}
      {{(set802154Phr)}{len:4}{payload: 0x10 0x60 0x00 0x00}}
    > setTxStream 1
    {{(setTxStream)}{Stream:Enabled}{StreamMode:PN9}{Time:2158238801}}

Use the following command to send a tone at the carrier frequency.

> setTxTone 1

Examples:

    # To Start the tone
    > setTxTone 1
      {{(setTxTone)}{Stream:Enabled}{None:Disabled}{StreamMode:Tone}{Time:1293513244}}
    # To Stop the tone
    > setTxTone 0
    {{(setTxTone)}{None:Enabled}{Stream:Disabled}{Time:1298384979}}

Wi-SUN OFDM Configuration#

Set Up PHR and TX FIFO#

Wi-SUN OFDM PHYs are configured to variable packet length encoding. Also, other configurable parameters are stored in the PHR field according to the standard 802.15.4-2020 (detailed in section 20.2.4). It might be difficult to set it up correctly. Therefore, a helper function – the set802154PHR CLI command – has been implemented in the RAILtest project, which simplifies configuration of a valid PHR field and the payload.

Using the RAILtest example, first the transmitted packet’s length should be defined with the setTxLength CLI command, including the PHR’s size (4 bytes). This command sets up the TX FIFO’s length and allocates memory for it.

The set802154PHR CLI command sets the Rate, Scrambler, and Length fields of the PHR:

  1. The first argument selects the PHR format (1, 2, 4 bytes). For OFDM, this should be always set to 2, selecting 4 bytes.

  2. The second argument sets the data Rate (“the numerical value of the MCS” as described in the standard in section 20.4).

  3. The third argument specifies the scrambling seed (both MSB and LSB bits), according to table 20-20 in the standard.

See an example use case in A Complete OFDM Configuration Example.

The Frame Length field of the PHR is configured according to the length that previously was configured by the setTxLength command. The payload will be padded by autogenerated data.

Note:

  • setTxLength must always precede the set802154PHR command when the TX packet’s length is changed.

  • Use the help command for a full listing of the CLI command options.

  • To comply with IEEE 802.15.4, the set802154PHR command should be used according to the configured OFDM option set in the Radio Configurator. The command changes the PHR field in the TX packet and for OFDM PHY selects the used MCS in TX.

Configure OFDM PA#

OFDM modulation uses a separate PA (Power Amplifier), which should be selected manually before the transmission.

The OFDM PA (RAIL_TX_POWER_MODE_SUBGIG_POWERSETTING_TABLE) is configured by the RAIL_ConfigTxPower() RAIL API. This function is wrapped by the setPowerConfig CLI command.

This configuration is useful only when changing from FSK modulation to OFDM modulation. It only needs to be done once at initialization.

For an example Multi-PHY configuration with FSK (channel 512) and OFDM (channel 21504), the recommended PA configuration with IR calibration (see IR Calibration Initialization for FSK or OFDM) is:

    > rx 0
    > setchannel 512
    > rx 1
    > rx 0
    > setpowerconfig RAIL_TX_POWER_MODE_SUBGIG_POWERSETTING_TABLE 3600 10
    > setpower 100
    > setchannel 512
    > rx 1
    > rx 0
    > setchannel 21504
    > rx 1
    > rx 0
    > setpowerconfig RAIL_TX_POWER_MODE_OFDM_PA_POWERSETTING_TABLE 3600 10
    > setpower 100
    > setchannel 21504
    > rx 1

A Complete OFDM Configuration Example#

This section contains a complete example of how to transmit OFDM modulated packets with the EFR32FG25 radio using the RAILtest application. It assumes the EFR32FG25 is flashed with an image with a Wi-SUN OFDM configuration set with the Radio Configurator.

The following CLI commands are used:

  • Set up the radio to use the OFDM PA (only done once when starting to use OFDM modulation).

  • Set the recommended PA level (check the maximum level depending on the radio board, 16 dBm for EFR32FG25).

  • Set the transmitted packet’s length to 250 (=246-byte payload including the 4-byte FCS field plus 4-byte PHR field).

  • Configure the PHR with MCS 6 with OFDM Option depending on the radio_settings.radioconf and using Wi-SUN 0b00010111 scrambling seed (value 0 in the PHR field).

  • Transmit 10 packets.

    > rx 0
    {{(rx)}{Rx:Disabled}{Idle:Enabled}{Time:3470713331}}
    > setpowerconfig RAIL_TX_POWER_MODE_OFDM_PA_POWERSETTING_TABLE 3600 10
    {{(setpowerconfig)}{success:true}{mode:RAIL_TX_POWER_MODE_OFDM_PA_POWERSETTING_TABLE}{modeIndex:2}{voltage:3600}{rampTime:7}}
    > setpower 140
    {{(setPower)}{powerLevel:151}{power:140}}
    > setchannel 0
    {{(setchannel)}{channel:0}}
    > rx 1
    {{(rx)}{Rx:Enabled}{Idle:Disabled}{Time: 3470724420}}
    > setTxLength 250
    {{(setTxLength)}{TxLength:250}{TxLength Written:250}}
    > Set802154phr 2 6 0
    {{(Set802154phr)}{PhrSize:4}{PHR:0xde0c00}}
    {{(Set802154phr)}{len:250}{payload: 0x00 0x0c 0xde 0x00 0x33 0x44 0x55 0x0f 0x77 0x88 0x99 0xaa 0xbb 0xcc 0xdd 0xee
     0x10 0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f 0x20 0x21 0x22 0x23 0x24 0x25 0x26
     0x27 0x28 0x29 0x2a 0x2b 0x2c 0x2d 0x2e 0x2f 0x30 0x31 0x32 0x33 0x34 0x35 0x36 0x37 0x38 0x39 0x3a 0x3b 0x3c 0x3d
     0x3e 0x3f 0x40 0x41 0x42 0x43 0x44 0x45 0x46 0x47 0x48 0x49 0x4a 0x4b 0x4c 0x4d 0x4e 0x4f 0x50 0x51 0x52 0x53 0x54
     0x55 0x56 0x57 0x58 0x59 0x5a 0x5b 0x5c 0x5d 0x5e 0x5f 0x60 0x61 0x62 0x63 0x64 0x65 0x66 0x67 0x68 0x69 0x6a 0x6b
     0x6c 0x6d 0x6e 0x6f 0x70 0x71 0x72 0x73 0x74 0x75 0x76 0x77 0x78 0x79 0x7a 0x7b 0x7c 0x7d 0x7e 0x7f 0x80 0x81 0x82
     0x83 0x84 0x85 0x86 0x87 0x88 0x89 0x8a 0x8b 0x8c 0x8d 0x8e 0x8f 0x90 0x91 0x92 0x93 0x94 0x95 0x96 0x97 0x98 0x99
     0x9a 0x9b 0x9c 0x9d 0x9e 0x9f 0xa0 0xa1 0xa2 0xa3 0xa4 0xa5 0xa6 0xa7 0xa8 0xa9 0xaa 0xab 0xac 0xad 0xae 0xaf 0xb0
     0xb1 0xb2 0xb3 0xb4 0xb5 0xb6 0xb7 0xb8 0xb9 0xba 0xbb 0xbc 0xbd 0xbe 0xbf 0xc0 0xc1 0xc2 0xc3 0xc4 0xc5 0xc6 0xc7
     0xc8 0xc9 0xca 0xcb 0xcc 0xcd 0xce 0xcf 0xd0 0xd1 0xd2 0xd3 0xd4 0xd5 0xd6 0xd7 0xd8 0xd9 0xda 0xdb 0xdc 0xdd 0xde
     0xdf 0xe0 0xe1 0xe2 0xe3 0xe4 0xe5 0xe6 0xe7 0xe8 0xe9 0xea 0xeb 0xec 0xed 0xee 0xef 0xf0 0xf1 0xf2 0xf3 0xf4 0xf5
     0xf6 0xf7 0xf8 0xf9}}
    > tx 10
    {{(tx)}{PacketTx:Enabled}{None:Disabled}{Time:3116912126}}
    {{(appMode)}{None:Enabled}{PacketTx:Disabled}{Time:3117028916}}
    {{(txEnd)}{txStatus:Complete}{transmitted:10}{lastTxTime:3117028845}{timePos:6}{lastTxStart:3117026790}{ccaSuccess:0}{failed:0}{lastTxStatus:0x000000000}{txRemain:0}{isAck:False}}

Notes:

  • setConfigIndex can be used to select the appropriate OFDM option available in the radio_settings.radioconf.

  • For Wi-SUN, the maximum framelength value in the PHR is 2047. So, in Wi-SUN OFDM, this provides a setTxLength RAILtest command of 2051 (= 2047 bytes including the 4 bytes FCS field + 4 bytes of PHR).

  • After set802154phr, the 4-byte FCS is not added in the packet payload replacing the 4 trailing bytes, but it will be added in the transmitted packet. At the receiving side, the Rx frame has the 4-byte FCS removed, and there are 6 trailing bytes added for debug.

    > {{(rxPacket)}{len:252}{timeUs:48492691}{timePos:5}{crc:Pass}{filterMask:0x0}{rssi:-97}{lqi:197}{phy:6}{isAck:False}
    {syncWordId:0}{antenna:0}{channelHopIdx:254}{payload: 0x03 0x0c 0xde 0x00 0x33 0x44 0x55 0x0f 0x77 0x88 0x99 0xaa 0xbb
    0xcc 0xdd 0xee 0x10 0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f 0x20 0x21 0x22 0x23 0x24
    0x25 0x26 0x27 0x28 0x29 0x2a 0x2b 0x2c 0x2d 0x2e 0x2f 0x30 0x31 0x32 0x33 0x34 0x35 0x36 0x37 0x38 0x39 0x3a 0x3b 0x3c
    0x3d 0x3e 0x3f 0x40 0x41 0x42 0x43 0x44 0x45 0x46 0x47 0x48 0x49 0x4a 0x4b 0x4c 0x4d 0x4e 0x4f 0x50 0x51 0x52 0x53 0x54
    0x55 0x56 0x57 0x58 0x59 0x5a 0x5b 0x5c 0x5d 0x5e 0x5f 0x60 0x61 0x62 0x63 0x64 0x65 0x66 0x67 0x68 0x69 0x6a 0x6b 0x6c
    0x6d 0x6e 0x6f 0x70 0x71 0x72 0x73 0x74 0x75 0x76 0x77 0x78 0x79 0x7a 0x7b 0x7c 0x7d 0x7e 0x7f 0x80 0x81 0x82 0x83 0x84
    0x85 0x86 0x87 0x88 0x89 0x8a 0x8b 0x8c 0x8d 0x8e 0x8f 0x90 0x91 0x92 0x93 0x94 0x95 0x96 0x97 0x98 0x99 0x9a 0x9b 0x9c
    0x9d 0x9e 0x9f 0xa0 0xa1 0xa2 0xa3 0xa4 0xa5 0xa6 0xa7 0xa8 0xa9 0xaa 0xab 0xac 0xad 0xae 0xaf 0xb0 0xb1 0xb2 0xb3 0xb4
    0xb5 0xb6 0xb7 0xb8 0xb9 0xba 0xbb 0xbc 0xbd 0xbe 0xbf 0xc0 0xc1 0xc2 0xc3 0xc4 0xc5 0xc6 0xc7 0xc8 0xc9 0xca 0xcb 0xcc
    0xcd 0xce 0xcf 0xd0 0xd1 0xd2 0xd3 0xd4 0xd5 0xd6 0xd7 0xd8 0xd9 0xda 0xdb 0xdc 0xdd 0xde 0xdf 0xe0 0xe1 0xe2 0xe3 0xe4
    0xe5 0xe6 0xe7 0xe8 0xe9 0xea 0xeb 0xec 0xed 0xee 0xef 0xf0 0xf1 0xf2 0xf3 0xf4 0xf5 0xc3 0xe2 0xa6 0x3f 0xc8 0x05}}

Diagnostic Signals#

With OFDM modulation configured, both stream mode (PN9) and CW signal generation are supported.

PN9 stream mode also requires setting up PHR (with the set802154PHR command) to select the MCS Level. It is also mandatory to configure the frame length field to 4 before the transmission, to set up the infinite stream needed for PN9.

As an example, the following CLI commands configure and enable the PN9 stream transmission mode on the radio in OFDM option 1 MCS4 at configindex 1.

    > setconfigindex 1
    > rx 0
    > setpowerconfig RAIL_TX_POWER_MODE_OFDM_PA_POWERSETTING_TABLE 3600 10
    > setpower 140
    > rx 1
    > setTxLength 4
    > set802154Phr 2 4 0
    > setTxStream 1

Example:

    > setconfigindex 1
      {{(setconfigindex)}{configIndex:1}{firstAvailableChannel:0}}
    > setpowerconfig RAIL_TX_POWER_MODE_OFDM_PA_POWERSETTING_TABLE 3600 10
      {{(setpowerconfig)}{success:true}{mode:RAIL_TX_POWER_MODE_OFDM_PA_POWERSETTING_TABLE}{modeIndex:2}{voltage:3600}{rampTime:7}}
    > setpower 140
      {{(setpower)}{powerLevel:151}{power:140}}
    > setTxLength 4
      {{(setTxLength)}{TxLength:4}{TxLength Written:4}}
    > set802154Phr 2 4 0
      {{(set802154Phr)}{PhrSize:4}{PHR:0x400}}
      {{(set802154Phr)}{len:4}{payload: 0x00 0x04 0x00 0x00}}
    > setTxStream 1
    {{(setTxStream)}{Stream:Enabled}{None:Disabled}{StreamMode:PN9}{Time:1737513509}}

Use the following command to send a tone at the carrier frequency.

> setTxTone 1

Examples:

    # To Start the tone
    > setTxTone 1
      {{(setTxTone)}{Stream:Enabled}{None:Disabled}{StreamMode:Tone}{Time:1293513244}}
    # To Stop the tone
    > setTxTone 0
    {{(setTxTone)}{None:Enabled}{Stream:Disabled}{Time:1298384979}}

It is equivalent to:

> setTxStream 1 0

IR Calibration Initialization for FSK or OFDM#

For FSK or OFDM PHY (during initialization), after a setchannel on the corresponding PHY, a rx 1 or tx 1 is required to perform the calibration.

When using multiple PHYs including an OFDM PhyModeID, an IR calibration for OFDM must be performed. Silicon Labs strongly recommends loading one OFDM PHY (during initialization) using the setchannel on the corresponding OFDM channel and a rx 1 RAILtest CLI command to perform the calibration. Once image rejection calibration has been performed with a Wi-SUN OFDM PHY, you do not need to do it with a Wi-SUN FSK PHY.