SDAA260 April 2026 CC1310 , CC1311P3 , CC1312PSIP , CC1312R , CC1312R7 , CC1314R10 , CC1350 , CC1352P , CC1352P7 , CC1352R , CC1354P10 , CC1354R10
The header is written to the packet with least significant byte first, so the packet that the CMD_PROP_TX_ADV command should transmit, would be 0x07, 0x08, 0x01, 0x02, 0x03.
Since the length field is 11 bits the max number of payload bytes are 2045 when using a 2 byte long CRC, and 2043 when the CRC is 4 bytes long. The following shows code that can be used to transmit a packet using the advanced packet format.
1: //---------------------------------------------------------------------------------------------
2: // Transmit Advanced Packet Format with CMD_PROP_TX_ADV
3: //---------------------------------------------------------------------------------------------
4:
5: // Defines
6: #define PAYLOAD_LENGTH 3 // Max 2045 or 2043, depending on FSC type
7: #define HEADER_FIELD 2
8:
9: // #define _802_15_4_G_HEADER 0x00 // MS = 0, FCS = 0 (4 bytes CRC), DW = 0 (Whitening Off)
10: #define _802_15_4_G_HEADER 0x08 // MS = 0, FCS = 0 (4 bytes CRC), DW = 1 (Whitening On)
11: // #define _802_15_4_G_HEADER 0x10 // MS = 0, FCS = 1 (2 bytes CRC), DW = 0 (Whitening Off)
12: // #define _802_15_4_G_HEADER 0x18 // MS = 0, FCS = 1 (2 bytes CRC), DW = 1 (Whitening On)
13:
14: uint8_t packet[HEADER_FIELD + PAYLOAD_LENGTH];
15: uint16_t header;
16:
17: static RF_Object rfObject;
18: static RF_Handle rfHandle;
19:
20: void *mainThread(void *arg0)
21: {
22: RF_Params rfParams;
23: RF_Params_init(&rfParams);
24:
25: RF_cmdPropTxAdv.startTrigger.triggerType = 0x0; // Application specific settings
26: RF_cmdPropTxAdv.startTrigger.pastTrig = 0x0;
27: RF_cmdPropTxAdv.pktLen = HEADER_FIELD + PAYLOAD_LENGTH;
28: RF_cmdPropTxAdv.preTrigger.triggerType = 0x0;
29: RF_cmdPropTxAdv.preTrigger.pastTrig = 0x0;
30: RF_cmdPropTxAdv.pPkt = packet;
31:
32: rfHandle = RF_open(&rfObject, &RF_prop, (RF_RadioSetup*)&RF_cmdPropRadioDivSetup,
33: &rfParams);
34: RF_postCmd(rfHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, NULL, 0);
35:
36: while(1)
37: {
38: //-------------------------------------------------------------------------------------
39: // Could be placed outside the while(1) since the packet does not change
40: if((_802_15_4_G_HEADER == 0x00) || (_802_15_4_G_HEADER == 0x08))
41: {
42: header = (_802_15_4_G_HEADER << 8) + ((4 + PAYLOAD_LENGTH) & 0x07FF);
43: }
44: else
45: {
46: header = (_802_15_4_G_HEADER << 8) + ((2 + PAYLOAD_LENGTH) & 0x07FF);
47: }
48: packet[0] = (uint8_t)(header);
49: packet[1] = (uint8_t)(header >> 8);
50:
51: for (uint16_t i = 2; i < (HEADER_FIELD + PAYLOAD_LENGTH); i++)
52: {
53: packet[i] = i - 1;
54: }
55: //-------------------------------------------------------------------------------------
56: RF_runCmd(rfHandle, (RF_Op*)&RF_cmdPropTxAdv, RF_PriorityNormal, NULL, 0);
57: RF_yield(rfHandle);
58: usleep(500000);
59: }
60: }