PSoC™ 4 Forum Discussions
Hi Guys,
I am using C++ in PSoC project as a software programming language and I am using PSoC Creator 3.3 for my PSoC 4200 Chip. I am trying t send the data from my BLE device to the mobile phone with the following API -->
bool IonicDataController::SendIonicSessionData()
{
int bufferLength = 0x0;
nt lastPackage = 0x0;
int mtuSize = 0x0;
int i = 0x0;
uint8* ptrToBuffer= NULL;
mtuSize = GetMTUSize();
if(mtuSize <=3)
{
tracer.Trace()<<"Invalid MTU size";
}
ptrToBuffer = (uint8*)buffer;
tracer.Trace()<< "IONIC :: SendIonicSessionData ";
bufferLength= strlen((const char*)buffer);
mtuSize -= MTU_OPCODE_BYTES;
tracer.Trace()<<"SHREY:: mtuSize ="<<mtuSize;
lastPackage = (bufferLength + mtuSize - 1)/mtuSize;
tracer.Trace()<<"SHREY:: lastPackage ="<<lastPackage;
for(i=0; i<lastPackage; i++)
{
char *partofDataBuffer = new char[mtuSize+1];
if(NULL== partofDataBuffer)
{
tracer.Trace()<<"ERROR allocating buffer";
return false;
}
//if successful memory allocation
memset(partofDataBuffer, 0x0, sizeof(partofDataBuffer));
memcpy(partofDataBuffer, &ptrToBuffer[i*mtuSize], sizeof(char)*mtuSize);
CYBLE_GATT_HANDLE_VALUE_PAIR_T handleVal;
handleVal.attrHandle = CYBLE_FEED_TX_CHAR_HANDLE;
handleVal.value.val = (uint8*)partofDataBuffer;
handleVal.value.len = strlen((const char*)partofDataBuffer);
while (CyBle_GattGetBusyStatus() != CYBLE_STACK_STATE_FREE)
{
CyBle_ProcessEvents();
}
if(CyBle_GattsNotification(cyBle_connHandle, &handleVal)!= CYBLE_ERROR_OK)
{
tracer.Trace()<<"Packet Transmission Error = " << i;
}
delete[] partofDataBuffer;
}
return true;
}
As you guys are aware that some of the phones support an MTU size of 20Bytes only. Now can I create a temporary buffer in the heap to send these 20 byte packets? I see that when I do that, the data transmission over BLE is intermittent. I can see that the first 2 packets of 20 byte goes, however the rest of the packets don't go.
With the above code, I am trying to send 78 Bytes of data
Now, this means I need to send five 20 Byte packets, assuming MTU size is 23 bytes.
Packet 0 is successfully transferred
and Packet 1 is successfully transferred after that it fails.
However if I use a stack memory in the above snippet, everything works! Do you know why?
Regards,
Shrey
Show LessI have my Beta / pre production boards assembled, and when I fire up the board, it has an application already loaded into it, If I start Cysmart android app, it says EZ-Serial and the app can only do GATT db where it shows unknown service.
My question is where is the documentation for this? I can not find any.
Also, is this some kind of wireless bootloader? if so how does this work?
Thanks
Show LessHello,
I'm trying to get CYBLE-202007-EVAL to run Find Me Profile.
I plug the board into the CY8CKIT-042-BLE-A baseboard and communicate with CySmart.
But after connect for an hour, it just disconnect and the reason is CONNECT_TIMEOUT.
To extend range of BLE, I write the below code into file which I get from datasheet.
/* define the test register to switch the PA/LNA hardware control pins */
#define CYREG_SRSS_TST_DDFT_CTRL 0x40030008
/* Mandatory events to be handled by BLE application code */
case CYBLE_EVT_STACK_ON:
/* Configure the Link Layer to automatically switch PA control pin P3[2] and LNA control pin P3[3] */
CY_SET_XTND_REG32((void CYFAR *)(CYREG_BLE_BLESS_RF_CONFIG), 0x0331);
CY_SET_XTND_REG32((void CYFAR *)(CYREG_SRSS_TST_DDFT_CTRL), 0x80000302);
Does anyone have any ideas on this issue?
Thanks
Show LessHello All,
Is there a way to get the output of the ADC data-bus and route it to the UDBs/programmable logic? The PSoC 4200 does not have DMA, so I was hoping to get the output value via a digital bus and process it with the UDBs and/or programmable logic.
Thanks,
Diode Dan
Show LessHello,
Can me somebody help with WDT, please. When I make a new project and add Global Signal - WDT and connect interrupt, than i generate application with error:
Clock Model Error: (WDT interrupt generated by PSoC Creator will be overwritten by the 'isr_1' ISR handler of the 'GlobalSignal_2' component and the user will not be able to attach his functions to the individual WDT interrupts using callbacks. Either remove the component or change the interrupt generation option to 'Implementation by user').
I have Kit: CY8CKIT-042-BLE-A - PSoC 4200Ble.
When I delete interrupt - isr , it is without this problem.
Show LessHi everyone !
I work with CY8CKIT-042-BLE-A Pioneer Kit. I just want to program a BLE broadcaster application, on PSoC Creator 4.2. I just need to send, to a BLE Observer a "0" when all is good, and a "1" when a problem is detected. But i don't find a good exemple project to help myself. I search a broadcaster exemple project to send data to a BLE Observer. Someone can help me ?
PS : Forgive me, my english is not enough good
Thank you for your answers.
Have a good day.
Show LessHello everyone,
I have some question regarding bluetooth connection speed using Cypress CYBLE devices.
My application uses two CYBLE devices.
The peripheral is powered permanently. Advertising all the time, custom characteristics implemented
The central is a coin-cell powered device (Remote control fob) , which remains in hibernate all the time, until an external interrupt (push-button) wakes the device.
Once woken up, it reconnects to the previsouly paired / connected device.
I'm seeing quite some latency when ronnecting and writing 1 characteristic (4Byte). It takes 2 to 3 seconds.
As my application stores the peripheral MAC address in external I2C EEPROM, I'm skipping the scan process, and I'm directly connecting using "CyBle_GapcConnectDevice(..)"
I'd like to speed up this process, What to look out for? Any suggestions?
Kind regards,
Florian
Show LessCapSense IDACをキャリブレーションすべきタイミングを教えてください。
CapSense_Start()時に、キャリブレーションして、おりますが、
Start後は、キャリブレーションの必要はありますか。
温度変化(環境変化)が激しく、RawCount値が、大きく変わるようであれば、
キャリブレーションすべきなのでしょうか。
Show LessHi,
I am trying to use the KitProg2 included in the CY8CKIT-145-40XX PSoC 4 S-Series Prototyping Kit to program a CY8CMBR3106s. I have a board set up very similar to the example schematic in the 3106s datasheet. I have been unable to recognize the 3106s as an I2C device when I use EZ-Click or PSoC Creator. Do I need to attach external pull up resistors on the I2C lines, or are these lines pulled up internally on the KitProg2? Figure 3-2 in the CY8CKIT-145-40XX PSoC 4 S-Series Prototyping Kit Guide seems to suggest that the programmer has internal pull up resistors already.
Thanks,
John
Show LessI am trying to find the address of the ports in memory, the PSoC4 DS does not seem to have a memory map?