PSoC™ 4 Forum Discussions
Hi I have a strange issue.
I have a fairly simple psoc4 (cy8c4248 44 tqfp) design that is adapted from the motor drive reference (cy8ckit-042) and it's been working OK until under load. Under load, there have been a few tearful moments, exploding FETs etc, and I've not been able to put my finger on how and why.
One things that is consistently happening (other than smoke) is the the xres pin drives LOW, like the psoc4 is actively driving it. The parts aren't dead, and if I short xres to 3.3V they seem to work, I can talk to them using I2C and the bridge control software when xres shorted to 3.3V. This has happened on perfectly good units that have not leaked smoke from the h-bridge fets, and on ones that have suffered damage on the power drive stages. It seems to happen after a period of use/testing, never straight up.
So I'm thinking that the xres problem, might be causing a chip reset at a bad time, tristate drive, destroying my fets which aren't turning off gracefully. (I'm correcting that on next pcb rev of course but still need to hunt down this problem.) That was different to my initial thought that the even that killed the fets, also killed the psoc and xres low was chip damage.
The impedance of the low drive is strong but not short circuit, < 1k, probably less. A short to 3.3V does not make anything hot, I see now permanent issue. When I short xres to 3.3V up to 35mA can run (!) but then decays to 0. The xres pin has a top and tail BAT54 for a little more protection, and no capacitor.
Any ideas? POR, BOD? damage to the device? System sees 24V for testing, has been tested for a short period with 42V.
What kind of failure modes are there that look similar? Any errata? Or is there something like the p1[6] pin xres behaviour on psoc 4000 parts?
A lot of thanks in advance for your help.
Show LessOn boot up we are calling CyBle_GapRemoveOldestDeviceFromBondedList if the number of current bonded devices = 4, to allow rolling use of the last three bonded devices.
We do this curing CYBLE_EVT_STACK_ON. We get the number of bonded devices by calling CyBle_GapGetBondedDevicesList, and then remove the oldest if equal to four.
This works most of the time. We have experienced a number of times in testing when some number of different devices (more than 4) have been bonded. When in this state, we get CYBLE_EVT_GAP_DEVICE_DISCONNECTED with an event reason of 0x16. Once this occurs, we can only connect to the last three bonded devices. Our CYBL11573 based device stays in this state -- only connecting with last 3 bonded, 0x16 error if attempting to connect/bond to a 4th until we reflash the firmware.
CYBL11573 running BLE stack V3.10.
Show LessHello colleagues,
Event CYBLE_EVT_GAPC_SCAN_PROGRESS_RESULT is never generated. CYBLE_EVT_STACK_ON, CYBLE_EVT_GAPP_ADVERTISEMENT_START_STOP, CYBLE_EVT_GAP_DEVICE_CONNECTED and CYBLE_EVT_GAP_DEVICE_DISCONNECTED are generated correctly but not CYBLE_EVT_GAPC_SCAN_PROGRESS_RESULT. From the BLE Datasheet, I learned that probably I need to invoke the function CyBle_GapcStartScan(ScanType) but that is not recognized by PSoC Creator. What can I do to solve the issue?
Below is a piece of my code with all the events:
case CYBLE_EVT_STACK_ON:
CyBle_GappStartAdvertisement(CYBLE_ADVERTISING_FAST);
UART_PutString("Enter in Stack ON\r\n");
break;
case CYBLE_EVT_GAPP_ADVERTISEMENT_START_STOP:
UART_PutString("Enter in Start Stop\r\n");
break;
case CYBLE_EVT_GAPC_SCAN_PROGRESS_RESULT:
UART_PutString("Enter in Scan Progress\r\n");
break;
case CYBLE_EVT_GAP_DEVICE_CONNECTED:
UART_PutString("Enter in Device Connected\r\n");
break;
case CYBLE_EVT_GAP_DEVICE_DISCONNECTED:
UART_PutString("Enter in Device Disconnected\r\n");
If I set ScanInfo->scanType=0x01 (being CYBLE_GAPC_DISC_INFO_T *ScanInfo;) in the main, then the Stack is not started and CYBLE_EVT_STACK_ON event is not generated,
Peter
Show LessHi,
I am trying to pair cypress BLE with windows BLE. But every times it tries to connect it says that check the device is still discoverable or not.
I am using cy8ckit-002 program and debug kit and I am trying for the simple code example - Find Me target on PROC BLE.
Do i need to change any settings while trying to connect or pair it with CYPRESS BLE?
I am not able to see the proper BLE name as per UUID. It always display as UNKNOWN.
I tried other code example as well, but the same problem persist.
I am facing the same problem with Cysmart android app.
Do I need to do or try something else to make it work?
Show LessHi,
I have realized the BTLE device (attached the code). I need to send back 2 responses (a) one for status of a switch (b) and Timeout (by default it is 5 secs).
How do I do this?
a. When the device starts (it should update the switch status - and timeout value which is default).
b. How do I update when the value changes - I need to modify the switch status when the position is changed and when the timeout changed (this value is set by the central - so I would be getting CYBLE_EVT_GATTS_WRITE_REQ event)
With best regards,
Phani.
My main.c looks like as below....
unsigned char BTState;
unsigned char LockOpenDuration = 5; //5 secs the lock is open
uint8 UpperByte, LowerByte;
uint16 WriteVal;
unsigned char applicationPower;
CYBLE_API_RESULT_T apiResult;
void OpenTheLock(void)
{
SCB_1_UartPutString("Opening the lock\n\r");
//LED_2_Write (1); //Turn off the blue LED if on...
LED_2_Write (1);
CyDelay(LockOpenDuration * 1000);
LED_2_Write (0);
/* if you are done with everything and ready to go to sleep,
then set it up to go to sleep. Update the code inside if() specific
to your application*/
if(0)
{
applicationPower = SLEEP;
}
/* if you are done with everything and ready to go to deepsleep,
then set it up to go to deepsleep. Update the code inside if() specific
to your application*/
if (1)
{
applicationPower = DEEPSLEEP;
}
}
void AppCallBack (uint32 event, void * eventParam)
{
/* Structure to store data written by Client */
CYBLE_GATTS_WRITE_REQ_PARAM_T *wrReqParam;
CYBLE_BLESS_CLK_CFG_PARAMS_T clockConfig;
switch(event)
{
case CYBLE_EVT_STACK_ON:
/* This event is generated when BLE stack is ON */
/* BLE stack is on. Start BLE advertisement */
//In the final version this will depend on Switch to turn on the advertisement or not
SCB_1_UartPutString("CYBLE_EVT_STACK_ON\n\r");
/* C8. Get the configured clock parameters for BLE subsystem */
CyBle_GetBleClockCfgParam(&clockConfig);
/* C8. Set the device sleep-clock accuracy (SCA) based on the tuned ppm
of the WCO */
clockConfig.bleLlSca = CYBLE_LL_SCA_000_TO_020_PPM;
/* C8. Set the clock parameter of BLESS with updated values */
CyBle_SetBleClockCfgParam(&clockConfig);
/* Put the device into discoverable mode so that a Central device can
connect to it. */
apiResult = CyBle_GappStartAdvertisement(CYBLE_ADVERTISING_FAST);
CY_SET_XTND_REG32((void CYFAR *)(CYREG_BLE_BLERD_BB_XO_CAPTRIM), 0x0000BCBC);
break;
case CYBLE_EVT_GAP_DEVICE_DISCONNECTED:
/* This event is generated at GAP disconnection. */
/* Restart BLE advertisement */
//In the final version this will depend on Switch to turn on the advertisement or not
SCB_1_UartPutString("CYBLE_EVT_GAP_DEVICE_DISCONNECTED\n\r");
CyBle_GappStartAdvertisement(CYBLE_ADVERTISING_FAST);
break;
case CYBLE_EVT_GATTS_WRITE_REQ:
/* This event is generated when the connected Central */
/* device sends a Write request. */
/* The parameter ‘eventParam’ contains the data written */
/* Extract the Write data sent by Client */
SCB_1_UartPutString("CYBLE_EVT_GATTS_WRITE_REQ\n\r");
wrReqParam = (CYBLE_GATTS_WRITE_REQ_PARAM_T *) eventParam;
UpperByte = *((uint8 *)(wrReqParam->handleValPair.value.val));
SCB_1_UartPutString("Upper Byte = 0x"); PrintChar(UpperByte);SCB_1_UartPutString("\n\r");
LowerByte = *(((uint8 *)(wrReqParam->handleValPair.value.val))+1);
SCB_1_UartPutString("Lower byte = 0x"); PrintChar(LowerByte); SCB_1_UartPutString("\n\r");
//if( CYBLE_BT_LOCK_SERVICE_HANDLE == *(uint8 *)(wrReqParam->handleValPair.value.val))
if (UpperByte == 0x0AA)
{
/* Open the lock */
OpenTheLock();
}
else if (UpperByte == 0x55) //This is where I am setting the duration
{
/* Set the durarion */
LockOpenDuration = LowerByte;
WriteVal = UpperByte << 8; WriteVal = WriteVal | LowerByte;
SCB_1_UartPutString("WriteVal = 0x");
PrintChar(WriteVal>>8); //&0x00ff);
PrintChar(WriteVal); //&0xff);
SCB_1_UartPutString("\n\r");
CyBle_GattsWriteAttributeValue (&(wrReqParam->handleValPair),0, &(wrReqParam->connHandle), WriteVal);
}
else
SCB_1_UartPutString("Wrong data written. Check your data\n\r");
/* Send the response to the write request received. */
CyBle_GattsWriteRsp(cyBle_connHandle);
break;
default:
break;
}
}
int main()
{
/* Variable declarations for low power*/
CYBLE_LP_MODE_T lpMode;
CYBLE_BLESS_STATE_T blessState;
uint8 interruptStatus;
/* Enable global interrupts */
CyGlobalIntEnable; /* Uncomment this line to enable global interrupts. */
/* Place your initialization/startup code here (e.g. MyInst_Start()) */
/* For these C1, C2 etc Cx states - refer to AN92584 */
/* Designing for Low Power and Estimating Battery Life for BLE Applications */
/* C1. Stop the ILO to reduce current consumption */
CySysClkIloStop();
/* C2. Configure the divider values for the ECO, so that a 3-MHz ECO divided
c lock can be provided to the CPU in Sleep mode */
CySysClkWriteEcoDiv(CY_SYS_CLK_ECO_DIV8);
/* Start the BLE Component and register the generic event handler */
apiResult = CyBle_Start(AppCallBack);
/* Wait for BLE Component to initialize */
while (CyBle_GetState() == CYBLE_STATE_INITIALIZING)
{
CyBle_ProcessEvents();
}
applicationPower = ACTIVE;
/* main while loop of the application */
for(;;)
{
/* Process all pending BLE events in the stack */
CyBle_ProcessEvents();
//Is below code needed?
applicationPower = DEEPSLEEP;
/* C3. Call the function that manages the BLESS power modes */
CyBle_EnterLPM(CYBLE_BLESS_DEEPSLEEP);
/*C4. Run your application specific codehere */
//??? Nothing I (Phani) believe as of now...
//if(applicationPower == ACTIVE)
//{
// RunApplication();
//}
/*C6. Manage Application power mode */
//ManageApplicationPower();
/*C7. Manage System power mode */
//ManageSystemPower();
}
}
Hi all,
|
Hello,
I have a CYBLE-022001 design and I'm running the code in the BLE_Advertisement project of AN92584. I noticed that when the advertising times out after 32768s, or whatever time I change it to, that the advertisements do not restart after a power cycle. I have to physically reset the module, via a reset switch, to get the advertisements to start.
I don't understand why the power-on reset isn't working.
Thanks in advance for any thoughts.
Greg
Show LessHi Everyone,
Is there a Processor Module for the CY8CKIT-001 that has a CY8C4246(or 7 or 8)-L or -BL?
Also, what module(s) are available for the CY8CKIT-001 wireless radio connector (P17) at this time? ... that would allow/support bluetooth development in lew of a processor module with bluetooth on board. ... and yes, I think I want USB as well.
I currently have the CY8CKIT-038 with the 4245-AXI part on it.
Thanks
Tim Miner
Show LessI tried to do the ota according to the documents of the laboratory that i have and let here but these are focused on BLE as well as its libraries however I wish to do it through UART Could help me with this I send my workspace so that they could guide me how I must continue to achieve this.
Show Less