Part Number: CC2592
Hello everyone,
I'm working on an application for my customer who develloped a BLE board based on a CC2640RHB microcontroller SOC (5x5 chip), linked to a CC2592 RF amplifier.
The software application is based and derivated from SimpleCentral project included with simplelink_cc2640r2_sdk_3_10_00_15 SDK.
For tests, I use BLETools for Android on a smartphone, which can run as an adevertiser.
I made first tests with the LAUNCHXL developpment board and those were successfull :
- Peripheral discovering
- Connection (without pairing I removed)
- Service discovering
- Characteristic data write
Then I moved my application on the target board, and encounter problems with Connectin and/or Service dscovering.
I already spent long time trying to find the root cause of such issue, making many modifications, tracing software execution...
But still don't have found a solution.
So, do someone can help me on this topic ?
Here are explainations of what I could observe during this process :
Step 1 : starts a device discovery using SimpleCentral_doDiscoverDevices ()
Step 2 : asks for a connection using SimpleCentral_doConnect()
Step 3 : selects this connection using SimpleCentral_doSelectConn()
Step 4 : start Service Discovery using SimpleCentral_startSvcDiscovery()
Step 5 : discover services and characteristics for this device, using the following sub steps :
- receive GATT_MSG_EVENT from the stack, which is processed by SimpleCentral_processStackMsg() and then passed to SimpleCentral_processGATTMsg() function
- in SimpleCentral_processGATTMsg() there is a first step to check if link is still established : if (linkDB_Up(pMsg->connHandle))
- if so, the SimpleCentral_processGATTDiscEvent(pMsg) which includes a state machine is called with several steps during the discovery process :
discState == BLE_DISC_STATE_MTU (MTU size response => start discovery Services)
discState == BLE_DISC_STATE_SVC (Service found => start discovery Characteristics)
discState == BLE_DISC_STATE_CHAR (Characteristic found => OK, I can enable Write)
The above steps lists what I could analyze from SimpleCentral application project tracing execution.
All of them are correctly executed with the LAUNCXL board, but not on the target board.
Of course we tested the board first (for that we used a SimplePeripheral based application) and checked than a Central tool (BLE Tool smartphons for example) could connect and write characteristics.
These tests were successfull, so we may think that the board is OK (at least in peripheral mode).
Now, here is the problem found :
- When I run the same program on the target board, and make the same tests and same code tracing, I could see that the if (linkDB_Up(pMsg->connHandle)) test is false meaning that the link is not established.
- I tried many configuration changes on the signals driving the CC2592 (HGM, PA_EN, LNA_EN) but none of them changed anything
- I also tried to change GPO1 to GPO3 as I could read somewhere but it has no effect.
- How PA_EN and LNA_EN are managed and driven ?
- Is there any other change to make in the software (in particular for DIO13 and DIO14 configuration) ?
- Could someone help me and tell me how to investigate deeper and what may be the cause og the problem ?
Here is the schamatic of this part, and part of the code I changes from SimpleCentral.c application :
![]()
/*****************************************************************************/
/* INCLUDES */
/*****************************************************************************/
#include <string.h>
#include <stdio.h>
#include <ti/sysbios/knl/Task.h>
#include <ti/sysbios/knl/Clock.h>
#include <ti/sysbios/knl/Event.h>
#include <ti/sysbios/knl/Queue.h>
#include <ti/display/Display.h>
#include "bcomdef.h"
#include <icall.h>
#include "util.h"
#include "icall_ble_api.h" // This .h file contains all BLE API and icall structure definition
#include "board.h"
#include "ble_user_config.h"
#include "simple_gatt_profile.h"
#include "simple_central.h"
#include <driverlib/ioc.h> // ASE30 - ( POWER RF AMP)
...
/******************************************************************************
* @fn SimpleCentral_Init
* @brief Initialization function for the Simple Central App Task.
* This is called during initialization and should contain
* any application specific initialization (ie. hardware
* initialization/setup, table initialization, power up
* notification).
* @param none
* @return none
*****************************************************************************/
static void SimpleCentral_init(void)
{
uint8_t i;
// >>> N0 STACK API CALLS CAN OCCUR BEFORE THIS CALL TO ICall_registerApp <<<
// Register the current thread as an ICall dispatcher application
// so that the application can send and receive messages.
ICall_registerApp(&selfEntity, &syncEvent);
// Create an RTOS queue for message from profile to be sent to app.
appMsgQueue = Util_constructQueue(&appMsg);
//-------------------------------------------------------------------------
// Hardware initialization
//-------------------------------------------------------------------------
//*********************************** Initializations for GPIO input SWITCH
// install SWITCH callback
GPIO_setCallback(Board_GPIO_SWITCH, gpioSwitchCallbackFxn);
// Enable interrupts
GPIO_enableInt(Board_GPIO_SWITCH);
// Create the debounce clock object for SWITCH
SwitchDebounceClockHandle = Util_constructClock(&SwitchDebounceClock, SwitchDebounceSwiFxn, 50, 0, 0, Board_GPIO_SWITCH);
//***************************************** Initializations for RF Amplifier
// Map RFC_GPO0 to DIO13 (LNA Enable)
IOCPortConfigureSet(IOID_13, IOC_PORT_RFC_GPO0, IOC_IOMODE_NORMAL);
// Map RFC_GPO1 to DIO14 (PA Enable)
IOCPortConfigureSet(IOID_14, IOC_PORT_RFC_GPO1, IOC_IOMODE_NORMAL);
// Sets the High Gain Mode (HGM) - DIO12
GPIO_write(Board_GPIO_HGM, 0);
Thank you in advance for any help .
Ragards
Patrick