1、官方首页
2、sdk和工具介绍
// 获得mac
void Get_Mac_Address(uint8 *p_Address)
{
uint32 Mac0 = HWREG(FCFG1_BASE + FCFG1_O_MAC_BLE_0);
uint32 Mac1 = HWREG(FCFG1_BASE + FCFG1_O_MAC_BLE_1);
p_Address[5] = Mac0;
p_Address[4] = Mac0 >> 8;
p_Address[3] = Mac0 >> 16;
p_Address[2] = Mac0 >> 24;
p_Address[1] = Mac1;
p_Address[0] = Mac1 >> 8;
}
// 设置设备静态mac,
改变这个宏定义,最好用ADDRMODE_PUBLIC,否则广播出来的mac是逆序的
static GAP_Addr_Modes_t addrMode =ADDRMODE_PUBLIC;// ADDRMODE_RANDOM;
/
uint8_t mac_addr[6];
GetMacAddress(mac_addr);
//Initialize GAP layer for Peripheral role and register to receive GAP events
GAP_DeviceInit(GAP_PROFILE_PERIPHERAL, selfEntity, addrMode, mac_addr); //addrMode
在广播参数设置修改为 peerAddrType = PEER_ADDRTYPE_RANDOM_OR_RANDOM_ID,
GapAdv_params_t advParams = {
.eventProps = GAP_ADV_PROP_CONNECTABLE | GAP_ADV_PROP_LEGACY | GAP_ADV_PROP_SCANNABLE,
.primIntMin = 160,
.primIntMax = 160,
.primChanMap = GAP_ADV_CHAN_ALL,
.peerAddrType = PEER_ADDRTYPE_RANDOM_OR_RANDOM_ID,
.peerAddr = { 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa },
.filterPolicy = GAP_ADV_WL_POLICY_ANY_REQ,
.txPower = GAP_ADV_TX_POWER_NO_PREFERENCE,
.primPhy = GAP_ADV_PRIM_PHY_1_MBPS,
.secPhy = GAP_ADV_SEC_PHY_1_MBPS,
.sid = 0
};
问题: 用iar仿真,出现Warning: Failed to halt at after bootloader, forced stop at 然后就仿真不起来
解决:(1)该错误证实是因为 cc2650 SW下载模式,芯片复位引脚未接出来导致,芯片复位必须和下载器保持良好连接
(2),不需要重新安装IAR。是你修改了ccfg.c启动了bootloader导致的,每次IAR下载程序mcu进入了bootloader,无法在线仿真调试了。调试阶段将ccfg.c中bootloader相关设置关闭即可。
ti社区解决网址:网址
ti社区地址
ti社区网址