46683 Discussions
23234 Members
27046 Solved
Hello,
I have a PSOC 4 MCU with BLE 4.1
I would like to understand if there is a way to verify a write response was actually sent to a write request?
Today, I use this API function provided by cypress:
CyBle_GattsWriteRsp(cyBle_connHandle)
The function is said to return the following options:
* \return
* CYBLE_API_RESULT_T : Return value indicates if the function succeeded or
* failed. Following are the possible error codes.
*
* Errors codes | Description
* ------------ | -----------
* CYBLE_ERROR_OK | On successful operation
* CYBLE_ERROR_INVALID_PARAMETER | 'connHandle' value does not represent any existing entry in the Stack
* CYBLE_ERROR_INVALID_OPERATION | This operation is not permitted
* CYBLE_ERROR_MEMORY_ALLOCATION_FAILED | Memory allocation failed
So even if I get CYBLE_ERROR_OK returned, it doesn't necessarily mean that the response was sent yet. I understand that it just means that the request to send a response has been received successfully by the stack and it will now take care of it asynchronously. This is a problem for us because we need to reset the MCU immediately after receiving a specific write request. But we need to send a response before the reset, otherwise, it will cause a problem in the device that had sent the write request.
So we need to be able to know that the response has actually been sent. How can we know this?
Thanks,
Eyal
Show LessI am currently using a USB2 High-Speed FTDI chip for USB-to-SPI conversion.
I am trying to get the lowest possible time to send multiple, small datagrams over SPI. I am not too concerned about the time to actually send the bits (so far at least, maybe withFX3 that's a new constraint!) which is only a handful of microseconds.
To test the speeds, I perform a loop to send 6 bytes back-to-back (Windows 10, 6-core Xeon, C#) 100 times then calculate the average time with the following psuedocode:
1. Start stopwatch
2. Chip select assertion
3. Read+Write 6 bytes over SPI bus at 10 MHz clock
4. Chip select de-assertion
5. Repeat #2 through #4 until 100 cycles are reached
6. Stop Stopwatch
7. Calculate average total time per SPI transaction (= Elapsed time of stopwatch divided by 100)
This yields about 700 microseconds per SPI transaction (on average) when the computer is doing nothing but running this loop, so it's probably a best-case situation.
Here's my questions:
1. If I use GPIO-controlled slave-selects with FX3, what is an estimate of the total cycle time I would see per SPI transaction (assume 6 bytes transfer, 10MHz clock)...can that 700 microseconds number drop substantially?
2. Would this be done with DMA mode or register mode? If the number could be dropped low enough I could test with some dummy writes and an oscilloscope with an FX3 eval to ballpark it.
This isn't a legally-binding number :).
I'm just trying to estimate if it would be worth testing something with an FX3 eval board for example. If that 700 microseconds could come down to below something like 150 microseconds I would consider spending time on it, but if you think it's not going to get that low I would pass and live with what I have.
Thanks.
Show LessHi,
I have been trying to connect phone on the i.MX8QM development board with Bluetooth module Cypress CYW4356. My phone is connected to the board and i am able access the caller app on the board. Using that i made a call to another device and calling is done. But no audio is getting in both devices, which i guess some issues in routing call from the board. The board is connected with a speaker system and we can able able play a music from phone via Bluetooth using an app (media player). I think Bluetooth audio routing has any issue. Could you suggest a method so that i can able to use Bluetooth for telephonic purpose. Thank you.
Regards,
Aravind
I have a large project which I am trying to add a new characteristic to an existing service. I am using the CY8C4248LQI-BL583 chip and I can't seem to get the BLE APIs to properly generate. I keep getting an error when referencing the characteristic's handle. Note that this project is configured for OTA updates so I have a bootloader and a bootloadable projects.
Steps taken so far:
1. Go to the bootloader project, open the BLE 4.2 component, navigate to profiles, and add my new "custom glows" characteristic under the LED service. I set the read / write properties and the UUID of the characteristic.
2. I delete the automatically generated custom descriptor and add a CCCD, as instructed by the documentation.
3. Click OK, then clean / build the bootloader project.
4. I clean / build the bootloadable project.
5. I navigate to my bleCallback.c file in the bootloadable project and try to reference the newly added characteristic handle (as such: CYBLE_LEDS_GLOWS_CONTROL_CHAR_HANDLE) and it throws an error that I'm using an undeclared identifier.
The strange thing is if I navigate to the CyBle_custom.h file in the bootloader project, I see my CYBLE_LEDS_CUSTOM_GLOWS_CHAR_HANDLE value defined. I just can't reference it in my bootloadable project.
Also, my newly defined characteristic handle does not show up in the cyapicallbacks.h file of my bootloadable project. But, this file does contain all of the handles for my previously defined custom characteristics.
Does anyone have any thoughts as to what I'm doing wrong here?
I should note that I have recently migrated from a CY8C4148LQI-BL453 to the CY8C4248LQI-BL583 I'm using currently. This is my first time manipulating the BLE stack on this new MCU.
Show LessHello,
I am trying to read data from ADC. If I probe signal lines with a logic analyzer, I can see actual samples (with their respective headers). If I look at data read by SPI slave peripheral using a debugger, I just see some meaningless numbers. Do I have a mismatch on CPOL/CPHA?
CY_ISR_PROTO(RxC1);
CY_ISR_PROTO(RxC2);
void SendData();
uint8_t Data1[32] = {0};
uint8_t Data2[32] = {0};
uint8_t Ptr1 = 0;
uint8_t Ptr2 = 0;
volatile uint8_t Ready1 = 0;
volatile uint8_t Ready2 = 0;
uint32_t Channels[10] = {0};
uint8_t Usb[40] = {0};
void ADCData_Init()
{
Data1_RxC_StartEx(RxC1);
Data2_RxC_StartEx(RxC2);
SpiData1_Start();
SpiData2_Start();
}
CY_ISR(RxC1)
{
while(SpiData1_ReadRxStatus() & SpiData1_STS_RX_FIFO_NOT_EMPTY)
{
uint8_t dummy;
if(Ptr1 < 32)
{
Data1[Ptr1++] = SpiData1_ReadByte();
}
else
{
dummy = SpiData1_ReadByte();
if(dummy < 0xFF)
{
Data1[0] = dummy;
Ptr1 = 1;
}
}
if(Ptr1 == 32)
{
Ptr1++;
Ready1 = 1;
if(Ready2)
{
Ready1 = 0;
Ready2 = 0;
SendData();
}
}
}
}
CY_ISR(RxC2)
{
while(SpiData2_ReadRxStatus() & SpiData2_STS_RX_FIFO_NOT_EMPTY)
{
uint8_t dummy;
if(Ptr2 < 32)
{
Data2[Ptr2++] = SpiData2_ReadByte();
}
else
{
dummy = SpiData2_ReadByte();
if(dummy < 0xFF)
{
Data2[0] = dummy;
Ptr2 = 1;
}
}
if(Ptr2 == 32)
{
Ptr2++;
Ready2 = 1;
if(Ready1)
{
Ready1 = 0;
Ready2 = 0;
SendData();
}
}
}
}
Show Less
VDDIO5VポートとVDDIO3.3Vポートの入力信号を、
PSoCCreator上でLOGICに入力(例えばAND)してVDDIO5Vポートで出力したいのですが、
異なる入力電圧で正常に論理出力可能でしょうか。
よろしくお願い致します。
Expert II
Esteemed Contributor
Employee
Employee
Honored Contributor II
Honored Contributor
Honored Contributor
Employee