由于国庆节假期,帖子审批以及工程师回复将会有所延迟,敬请谅解。

CC1352P RF配置菜单问题

TI 达人:

          我在ble5_host_test_cc13x2p4lp_app 工程上 复制 粘贴 到一个新的工程,在配置RF选项时遇到问题,使用sysconfig_1.3.1030是根本无法编辑的,在CCS环境下编辑又出现新的问题。我点 USE CUSTOM BOARD 配置成自己的板子,Custom这块菜单就会出现异常,会多出一个菜单!见图:

如果我点了 USE CUSTOM BOARD ,配置成自己的板子,修改相应GPIO

那么 Custom 和 RF选项就会变成这样

RF这边也不正常

最终会导致在 ti_drivers_config.c 里面生成的代码出错。

正常 生成的代码如下

static void rfDriverCallback(RF_Handle client, RF_GlobalEvent event, void* arg);

const RFCC26XX_HWAttrsV2 RFCC26XX_hwAttrs = {
.hwiPriority = (~0),
.swiPriority = (uint8_t)0,
.xoscHfAlwaysNeeded = true,
.globalCallback = rfDriverCallback,
.globalEventMask = RF_GlobalEventRadioPowerDown | RF_GlobalEventRadioSetup
};

/*
* ======== rfDriverCallback ========
* Sets up the antenna switch depending on the current PHY configuration.
* Truth table:
*
* Path DIO28 DIO29 DIO30
* =========== ===== ===== =====
* Off 0 0 0
* Sub-1 GHz 0 0 1
* 2.4 GHz 1 0 0
* 20 dBm TX 0 1 0
*/
static void rfDriverCallback(RF_Handle client, RF_GlobalEvent events, void *arg)
{
/* Local variable. */
bool sub1GHz = false;
uint8_t loDivider = 0;

/* Initialize front-end (will only be done once) */
initRfFrontend();

/* Switch off all paths first. Needs to be done anyway in every sub-case below. */
PINCC26XX_setOutputValue(CONFIG_RF_24GHZ, 0);
PINCC26XX_setOutputValue(CONFIG_RF_HIGH_PA, 0);
PINCC26XX_setOutputValue(CONFIG_RF_SUB1GHZ, 0);

if (events & RF_GlobalEventRadioSetup) {
/* Decode the current PA configuration. */
RF_TxPowerTable_PAType paType = (RF_TxPowerTable_PAType)RF_getTxPower(client).paType;

/* Decode the generic argument as a setup command. */
RF_RadioSetup* setupCommand = (RF_RadioSetup*)arg;

switch (setupCommand->common.commandNo) {
case (CMD_RADIO_SETUP):
case (CMD_BLE5_RADIO_SETUP):
loDivider = RF_LODIVIDER_MASK & setupCommand->common.loDivider;

/* Sub-1GHz front-end. */
if (loDivider != 0) {
sub1GHz = true;
}
break;
case (CMD_PROP_RADIO_DIV_SETUP):
loDivider = RF_LODIVIDER_MASK & setupCommand->prop_div.loDivider;

/* Sub-1GHz front-end. */
if (loDivider != 0) {
sub1GHz = true;
}
break;
default:break;
}

if (sub1GHz) {
/* Sub-1 GHz */
if (paType == RF_TxPowerTable_HighPA) {
/* PA enable --> HIGH PA
* LNA enable --> Sub-1 GHz
*/
PINCC26XX_setMux(frontendPins, CONFIG_RF_24GHZ, PINCC26XX_MUX_GPIO);
/* Note: RFC_GPO3 is a work-around because the RFC_GPO1 (PA enable signal) is sometimes not
de-asserted on CC1352 Rev A. */
PINCC26XX_setMux(frontendPins, CONFIG_RF_HIGH_PA, PINCC26XX_MUX_RFC_GPO3);
PINCC26XX_setMux(frontendPins, CONFIG_RF_SUB1GHZ, PINCC26XX_MUX_RFC_GPO0);
} else {
/* RF core active --> Sub-1 GHz */
PINCC26XX_setMux(frontendPins, CONFIG_RF_24GHZ, PINCC26XX_MUX_GPIO);
PINCC26XX_setMux(frontendPins, CONFIG_RF_HIGH_PA, PINCC26XX_MUX_GPIO);
PINCC26XX_setMux(frontendPins, CONFIG_RF_SUB1GHZ, PINCC26XX_MUX_GPIO);
PINCC26XX_setOutputValue(CONFIG_RF_SUB1GHZ, 1);
}
} else {
/* 2.4 GHz */
if (paType == RF_TxPowerTable_HighPA)
{
/* PA enable --> HIGH PA
* LNA enable --> 2.4 GHz
*/
PINCC26XX_setMux(frontendPins, CONFIG_RF_24GHZ, PINCC26XX_MUX_RFC_GPO0);
/* Note: RFC_GPO3 is a work-around because the RFC_GPO1 (PA enable signal) is sometimes not
de-asserted on CC1352 Rev A. */
PINCC26XX_setMux(frontendPins, CONFIG_RF_HIGH_PA, PINCC26XX_MUX_RFC_GPO3);
PINCC26XX_setMux(frontendPins, CONFIG_RF_SUB1GHZ, PINCC26XX_MUX_GPIO);
} else {
/* RF core active --> 2.4 GHz */
PINCC26XX_setMux(frontendPins, CONFIG_RF_24GHZ, PINCC26XX_MUX_GPIO);
PINCC26XX_setMux(frontendPins, CONFIG_RF_HIGH_PA, PINCC26XX_MUX_GPIO);
PINCC26XX_setMux(frontendPins, CONFIG_RF_SUB1GHZ, PINCC26XX_MUX_GPIO);
PINCC26XX_setOutputValue(CONFIG_RF_24GHZ, 1);
}
}
} else {
/* Reset the IO multiplexer to GPIO functionality */
PINCC26XX_setMux(frontendPins, CONFIG_RF_24GHZ, PINCC26XX_MUX_GPIO);
PINCC26XX_setMux(frontendPins, CONFIG_RF_HIGH_PA, PINCC26XX_MUX_GPIO);
PINCC26XX_setMux(frontendPins, CONFIG_RF_SUB1GHZ, PINCC26XX_MUX_GPIO);
}
}

不正常生成的代码如下:

* =============================== RF Driver ===============================
*/

#include <ti/drivers/rf/RF.h>
/*
* Board-specific callback function to set the correct antenna path.
*
* NB! The RF Driver callback function must be implemented by the user.
*
*/
extern void rfDriverCallbackCustom(RF_Handle client, RF_GlobalEvent event, void* arg);

const RFCC26XX_HWAttrsV2 RFCC26XX_hwAttrs = {
.hwiPriority = (~0),
.swiPriority = (uint8_t)0,
.xoscHfAlwaysNeeded = true,
.globalCallback = rfDriverCallbackCustom,
.globalEventMask = RF_GlobalEventRadioPowerDown | RF_GlobalEventRadioSetup
};

所以编译不通过,即便是通过了CC1352P工作也不会正常,我自己的板子在RF这块是与CC1352P_4_LAUNCHXL一致,那么这个问题该如何解决?如果是使用CC1352P_4_LAUNCHXL开发板配置,其它方面就无法变更。

5 个回复