Other Parts Discussed in Thread: CC1352P
Hi, my target uses CC2652P, SimpleLink cc13x2_cc26x2 SDKv4.20, my application is based on example CC1352P_2_LAUNCHXL ti54stack sensor_2_4g.
My target works well with 15.4stack when data tx and rx.
Now I have a new task.
I need to transmit BLE adv signal based on current system.
I did an experiment.
First, I comment all my 15.4 code including 15.4 int and 15.4 task.
In the picture above, the code in red box is 15.4 init and has been comment.
Now the project will not init 15.4 stack.
In my application task,
while (1) { Clock_setTimeout(clockHandle, 500 * 100); Clock_start(clockHandle); ble_nc_adv_tx(); Semaphore_pend(gSem, BIOS_WAIT_FOREVER); }
There is only one task in my application, ble_nv_adv_tx each 500ms.
ble_nc_adv_tx() is
void ble_nc_adv_tx(void) { uint8_t chan = 3; RF_Params rfParams; RF_Params_init(&rfParams); memset(&ble_adv_aoa_dat,0x00,sizeof(ble_adv_aoa_dat)); ble_adv_aoa_dat.len = sizeof(ble_adv_aoa_t)-sizeof(ble_adv_aoa_dat.len); ble_adv_aoa_dat.hdr[0] = 0xff; ble_adv_aoa_dat.hdr[1] = COMPANY_ID_TEXAS_INSTRUMENTS&0xff; ble_adv_aoa_dat.hdr[2] = COMPANY_ID_TEXAS_INSTRUMENTS>>8; ble_adv_aoa_dat.hdr[3] = 0x03; //memset(ble_adv_aoa_dat.padding,0xaa,4/*sizeof(ble_adv_aoa_dat.padding)*/); memcpy(&ble_adv_aoa_dat.padding[0],&tag_id,4); memcpy(&ble_adv_aoa_dat.padding[4],&seq,2); memcpy(ble_adv_aoa_dat.tone,tone_dat[37-TONE_DAT_CHAN],sizeof(ble_adv_aoa_dat.tone)); /* Request access to the radio */ rfHandle = RF_open(&rfObject, &RF_prop_bt5le1m_0, (RF_RadioSetup*)&RF_cmdBle5RadioSetup_bt5le1m_0, &rfParams); /* Set the frequency */ RF_cmdFs_bt5le1m_0.frequency = RFfrequencyTable_ble[chan].frequency; RF_cmdFs_bt5le1m_0.fractFreq = RFfrequencyTable_ble[chan].fractFreq; RF_runCmd(rfHandle, (RF_Op*)&RF_cmdFs_bt5le1m_0, RF_PriorityNormal, NULL, 0); RF_cmdBleAdvNc_bt5le1m_0.pParams->advLen = sizeof(ble_adv_aoa_t); RF_cmdBleAdvNc_bt5le1m_0.pParams->pAdvData = (uint8_t *)&ble_adv_aoa_dat; RF_cmdBleAdvNc_bt5le1m_0.startTrigger.triggerType = 0; RF_cmdBleAdvNc_bt5le1m_0.startTrigger.pastTrig = 1; RF_cmdBleAdvNc_bt5le1m_0.channel = 0xff; RF_cmdBleAdvNc_bt5le1m_0.whitening.bOverride = 1; RF_cmdBleAdvNc_bt5le1m_0.whitening.init = RFfrequencyTable_ble[chan].whitening; RF_cmdBleAdvNc_bt5le1m_0.startTime = 0; RF_runCmd(rfHandle, (RF_Op*)&RF_cmdBleAdvNc_bt5le1m_0, RF_PriorityNormal, NULL, 0); RF_close(rfHandle); }
The RF_cmd above is
// TI-RTOS RF Mode Object RF_Mode RF_prop_bt5le1m_0 = { .rfMode = RF_MODE_AUTO, .cpePatchFxn = &rf_patch_cpe_bt5, .mcePatchFxn = 0, .rfePatchFxn = 0 }; // Overrides for CMD_BLE5_RADIO_SETUP uint32_t pOverrides_bt5le1m_0Common[] = { // override_ble5_setup_override_common.json // DC/DC regulator: In Tx, use DCDCCTL5[3:0]=0x3 (DITHER_EN=0 and IPEAK=3). (uint32_t)0x00F388D3, // Bluetooth 5: Set pilot tone length to 20 us Common HW_REG_OVERRIDE(0x6024,0x2E20), // Bluetooth 5: Compensate for reduced pilot tone length (uint32_t)0x01280263, // Bluetooth 5: Default to no CTE. HW_REG_OVERRIDE(0x5328,0x0000), // Synth: Increase mid code calibration time to 5 us (uint32_t)0x00058683, // Synth: Increase mid code calibration time to 5 us HW32_ARRAY_OVERRIDE(0x4004,1), // Synth: Increase mid code calibration time to 5 us (uint32_t)0x38183C30, // Bluetooth 5: Move synth start code HW_REG_OVERRIDE(0x4064,0x3C), // Bluetooth 5: Set DTX gain -5% for 1 Mbps (uint32_t)0x00E787E3, // Bluetooth 5: Set DTX threshold 1 Mbps (uint32_t)0x00950803, // Bluetooth 5: Set DTX gain -2.5% for 2 Mbps (uint32_t)0x00F487F3, // Bluetooth 5: Set DTX threshold 2 Mbps (uint32_t)0x012A0823, // Bluetooth 5: Set synth fine code calibration interval HW32_ARRAY_OVERRIDE(0x4020,1), // Bluetooth 5: Set synth fine code calibration interval (uint32_t)0x41005F00, // Bluetooth 5: Adapt to synth fine code calibration interval (uint32_t)0xC0040141, // Bluetooth 5: Adapt to synth fine code calibration interval (uint32_t)0x0007DD44, // Bluetooth 5: Set enhanced TX shape (uint32_t)0x000D8C73, (uint32_t)0xFFFFFFFF }; // Overrides for CMD_BLE5_RADIO_SETUP uint32_t pOverrides_bt5le1m_01Mbps[] = { // override_ble5_setup_override_1mbps.json // Bluetooth 5: Set pilot tone length to 20 us HW_REG_OVERRIDE(0x5320,0x03C0), // Bluetooth 5: Compensate syncTimeadjust (uint32_t)0x015302A3, (uint32_t)0xFFFFFFFF }; // Overrides for CMD_BLE5_RADIO_SETUP uint32_t pOverrides_bt5le1m_02Mbps[] = { // override_ble5_setup_override_2mbps.json // Bluetooth 5: Set pilot tone length to 20 us HW_REG_OVERRIDE(0x5320,0x03C0), // Bluetooth 5: Compensate syncTimeAdjust (uint32_t)0x00F102A3, // Bluetooth 5: increase low gain AGC delay for 2 Mbps HW_REG_OVERRIDE(0x60A4,0x7D00), (uint32_t)0xFFFFFFFF }; // Overrides for CMD_BLE5_RADIO_SETUP uint32_t pOverrides_bt5le1m_0Coded[] = { // override_ble5_setup_override_coded.json // Bluetooth 5: Set pilot tone length to 20 us HW_REG_OVERRIDE(0x5320,0x03C0), // Bluetooth 5: Compensate syncTimeadjust (uint32_t)0x07A902A3, // Rx: Set AGC reference level to 0x1B (default: 0x2E) HW_REG_OVERRIDE(0x609C,0x001B), (uint32_t)0xFFFFFFFF }; // CMD_BLE5_RADIO_SETUP // Bluetooth 5 Radio Setup Command for all PHYs rfc_CMD_BLE5_RADIO_SETUP_t RF_cmdBle5RadioSetup_bt5le1m_0 = { .commandNo = 0x1820, .status = 0x0000, .pNextOp = 0, .startTime = 0x00000000, .startTrigger.triggerType = 0x0, .startTrigger.bEnaCmd = 0x0, .startTrigger.triggerNo = 0x0, .startTrigger.pastTrig = 0x0, .condition.rule = 0x1, .condition.nSkip = 0x0, .defaultPhy.mainMode = 0x0, .defaultPhy.coding = 0x0, .loDivider = 0x00, .config.frontEndMode = 0x0, .config.biasMode = 0x1, .config.analogCfgMode = 0x0, .config.bNoFsPowerUp = 0x0, .config.bSynthNarrowBand = 0x0, .txPower = 0x7217, .pRegOverrideCommon = pOverrides_bt5le1m_0Common, .pRegOverride1Mbps = pOverrides_bt5le1m_01Mbps, .pRegOverride2Mbps = pOverrides_bt5le1m_02Mbps, .pRegOverrideCoded = pOverrides_bt5le1m_0Coded }; // CMD_FS // Frequency Synthesizer Programming Command rfc_CMD_FS_t RF_cmdFs_bt5le1m_0 = { .commandNo = 0x0803, .status = 0x0000, .pNextOp = 0, .startTime = 0x00000000, .startTrigger.triggerType = 0x0, .startTrigger.bEnaCmd = 0x0, .startTrigger.triggerNo = 0x0, .startTrigger.pastTrig = 0x0, .condition.rule = 0x1, .condition.nSkip = 0x0, .frequency = 0x0962, .fractFreq = 0x0000, .synthConf.bTxMode = 0x0, .synthConf.refFreq = 0x0, .__dummy0 = 0x00, .__dummy1 = 0x00, .__dummy2 = 0x00, .__dummy3 = 0x0000 }; // Structure for CMD_BLE_ADV_NC.pParam rfc_bleAdvPar_t bleAdv_bt5le1m_0Par = { .pRxQ = 0, .rxConfig.bAutoFlushIgnored = 0x0, .rxConfig.bAutoFlushCrcErr = 0x0, .rxConfig.bAutoFlushEmpty = 0x0, .rxConfig.bIncludeLenByte = 0x0, .rxConfig.bIncludeCrc = 0x0, .rxConfig.bAppendRssi = 0x0, .rxConfig.bAppendStatus = 0x0, .rxConfig.bAppendTimestamp = 0x0, .advConfig.advFilterPolicy = 0x0, .advConfig.deviceAddrType = 0x0, .advConfig.peerAddrType = 0x0, .advConfig.bStrictLenFilter = 0x0, .advConfig.chSel = 0x0, .advConfig.privIgnMode = 0x0, .advConfig.rpaMode = 0x0, .advLen = 0x18, .scanRspLen = 0x00, .pAdvData = 0, .pScanRspData = 0, .pDeviceAddress = 0, .pWhiteList = 0, .behConfig.scanRspEndType = 0x0, .__dummy0 = 0x0000, .endTrigger.triggerType = 0x0, .endTrigger.bEnaCmd = 0x0, .endTrigger.triggerNo = 0x0, .endTrigger.pastTrig = 0x0, .endTime = 0x00000000 }; // CMD_BLE_ADV_NC // BLE Non-Connectable Advertiser Command rfc_CMD_BLE_ADV_NC_t RF_cmdBleAdvNc_bt5le1m_0 = { .commandNo = 0x1805, .status = 0x0000, .pNextOp = 0, .startTime = 0x00000000, .startTrigger.triggerType = 0x0, .startTrigger.bEnaCmd = 0x0, .startTrigger.triggerNo = 0x0, .startTrigger.pastTrig = 0x0, .condition.rule = 0x1, .condition.nSkip = 0x0, .channel = 0x66, .whitening.init = 0x51, .whitening.bOverride = 0x1, .pParams = &bleAdv_bt5le1m_0Par, .pOutput = 0 };
When I run this project, the program died when run ble_nc_adv_tx(), and system reset.
So, how to run this ble_nv_adv_tx() in my application, thank you.