Other Parts Discussed in Thread: SYSCONFIG, BLE-STACK
Tool/software:
CCS version : 12.7.1
SDK version : 8.10.01.02
Project : basic_ble
Removed menu.c from basic_ble project.
sysconf:
Enabled Peripheral + Central roles.
Configured General Configuration.
Configured Central Configuration.
Configured Peripheral Configuration.
Configured FreeRTOS.
After choosing Central, I had to reduce the heap
Add in the project
UART is used to configure and manage connections.
Connections are initialized via UART, specifying the device address.
The function that calls the connection
static bool Connect_Device(uint32_t dev_addr)
{
bool ret=false;
uint8_t addr[8] = {0, 0, 0, 0x50, 0xBF, 0xA0, 0, 0};
addr[2] = (dev_addr >> 16) & 0xff;
addr[1] = (dev_addr >> 8) & 0xff;
addr[0] = dev_addr & 0xff;
// Temporarily disable advertising
BLEAppUtil_advStop(peripheralAdvHandle_1);
// Set the connection parameters
BLEAppUtil_ConnectParams_t connParams = {
.peerAddrType = ADDRTYPE_PUBLIC & MASK_ADDRTYPE_ID,
.phys = DEFAULT_INIT_PHY,
.timeout = 0
};
// Copy the selected address
memcpy(connParams.pPeerAddress, addr, B_ADDR_LEN);
//Initiate a connection
if (BLEAppUtil_connect(&connParams) == SUCCESS) {
ret = true;
}
// Re-enable advertising
BLEAppUtil_advStart(peripheralAdvHandle_1, &advSetStartParamsSet_1);
return ret;
}
The device works without problems in peripheral mode.
Activate GAP initiator the BLEAppUtil_connect function returns SUCCESS.
But there are no events and, as I understand it, there is no connection.
The Connection_start and Central_start functions also return SUCCESS.
My Connect_Device function, which is given above, is implemented similarly as in the menu.c.
What's wrong? Why doesn't CC2340R5 work as а central role?
Note: a similar project based on CC2642R1 works without problems.
Wireshark shows that advertisements from the connected device are being made.