BLE- sending data

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
aliissa02
Level 4
Level 4
100 sign-ins 50 replies posted 5 likes given

Hello

I am using PSOC 6 and I want to establish a BLE connection and send data to mobile device. Please note that I have my own mobile app and wont be using cysmart. I have attached my project. I have already used 

https://github.com/Infineon/mtb-example-psoc6-ble-throughput-freertos

but it didnt work. Can you please help?

 

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
Yugandhar
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 5 likes given

Hello @aliissa02 , 

Please refer to the attached GATT_OUT code example from the PSoC Creator. You can check this code example with your application. In the mobile app, when you click on the 'Notify' then it will send the data to the mobile.

Thanks,

P Yugandhar. 

View solution in original post

0 Likes
27 Replies
Yugandhar
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 5 likes given

Hello @aliissa02 ,

The project which you are referring from the Github is MTB based project. For PSoC Creator, you can refer to the code examples (CE222046_GATT_OUT, CE215119_BLE_Battery_level) from the PSoC Creator. Please note that C++ is not supported by PSoC Creator.

Thanks,
P Yugandhar.

0 Likes
aliissa02
Level 4
Level 4
100 sign-ins 50 replies posted 5 likes given

 

Hello,

Your example only works with psoc 4 and not 6.

Thank you

0 Likes
lock attach
Attachments are accessible only for community members.
Yugandhar
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 5 likes given

Hello @aliissa02 , 

Please refer to the attached GATT_OUT code example from the PSoC Creator. You can check this code example with your application. In the mobile app, when you click on the 'Notify' then it will send the data to the mobile.

Thanks,

P Yugandhar. 

0 Likes
lock attach
Attachments are accessible only for community members.
aliissa02
Level 4
Level 4
100 sign-ins 50 replies posted 5 likes given

Thanks for your reply. I am getting the error attached. If you can please edit my file that I uploaded earlier.

0 Likes
Yugandhar
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 5 likes given

Hello @aliissa02 , 

Please download and install the latest PDL (3.1.5) from this link. 

Thanks,

P Yugandhar. 

0 Likes

Thanks for your reply. I am still having the same problem. It is still not working. All other projects that I have are working except this one.

0 Likes
Yugandhar
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 5 likes given

Hello @aliissa02,

In your PSoC Creator project, go to Project > Build Settings > Peripheral Driver Library. Make sure the PDL path exists based on the version you installed.

Yugandhar_0-1673009967195.png

 

Thanks,
P Yugandhar.

0 Likes
aliissa02
Level 4
Level 4
100 sign-ins 50 replies posted 5 likes given

Thank you very much for this. It is working now and I was able to program the psoc device. However, I am not able to see the device when I scan BLE devices around me on the mobile phone. Also, how can I send data to the mobile phone?

Thank you

0 Likes
Yugandhar
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 5 likes given

Hello @aliissa02 ,

Once you program the device, then it will advertise with GATT_Out name and address as shown below.

Yugandhar_0-1673025948684.png

If you didn't see the device advertising in your mobile app then please check with any of the BLE Apps like LightBlue once.

After you connect the device with your app, then click on the 'Notify' to receive data in the mobile.

Thanks,

P Yugandhar.

0 Likes
aliissa02
Level 4
Level 4
100 sign-ins 50 replies posted 5 likes given

Hello,

Thanks for your reply. I still cant see it when I scan BLE. I have tried different phones and apps but cant find it.

0 Likes
Yugandhar
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 5 likes given

Hello @aliissa02 , 

Are you using the Infineon Dev board or custom board? If you are using the custom board, then please share your schematic files.

Please open the Tera-term and check whether you are able to see the Advertising print or not as shown below.

Yugandhar_0-1673148834077.png

Thanks,

P Yugandhar. 

0 Likes
lock attach
Attachments are accessible only for community members.

Hello,

 

Thanks for your reply. This is exactly what's happening. The actual board works but using my custom board, it doesn't. I have attached the schematic of the custom board.

Thank you

0 Likes
Yugandhar
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 5 likes given

Hello @aliissa02

From your schematic files, i didn't see the WCO Crystal used.

In the code example, by default WCO will be enabled as LFCLK source for low power application, so you can either change to PILO clock (for LFCLK) and check or disable the BLE Low-power mode in the BLE component and check your application.
Please note that it is not recommended to use the PILO clock for the BLE low power application. It is recommended to use only WCO for the low power application. For more information, please refer to the BLE component datasheet and BLE_PDL documentation (Right click on the BLE Component to find the datasheets).

Thanks,

P Yugandhar. 

0 Likes

Okay, thank you for this. But what is a WCO crystal? can you please provide more information about it? and do you think that I shoukd redesign my board?

 

Thank you

0 Likes
Yugandhar
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 5 likes given

Hello @aliissa02 ,

Watch Crystal Oscillator (WCO) is an external high accurate 32.768-kHz clock source. It is the primary clock source for the RTC. The WCO can also be used as a source for CLK_LF. If you want the BLE low power operation, then WCO must be selected as the LFCLK source for proper BLE timings during low power mode. If you want to use the PILO instead of WCO, then they are some limitations, which you can refer from the BLE PDL documentation.

Thanks,
P Yugandhar.

0 Likes
lock attach
Attachments are accessible only for community members.

Hello,

 

Thank you for your reply. I have added the WCO to my schematic and I will produce a new board. Can you please check my new schematic? Do you think that it will work like this?

Thank you

0 Likes
Yugandhar
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 5 likes given

Hello @aliissa02 , 

Schematic looks good. How are you connecting the VBACKUP in the schematic?  VDD and VBACKUP may be shorted together externally. They are not required to be separate input voltages. Please refer to the page 18 in the CYBLE-416045-02 datasheet. 

For reference, you can refer to the CY8CPROTO-063-BLE PSoC 6 BLE Prototyping Kit schematic files.

Thanks,

P Yugandhar. 

0 Likes

Hello,

Regarding the VBACKUP, this pin is connected directly to the battery terminal (nominally 3.7 V), bypassing all the power management circuity. I did this to ensure that VBACKUP is always suppled, even when the device is turned off.

Thank you

0 Likes
Yugandhar
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 5 likes given

Hello @aliissa02 ,

Please make sure that the VBACKUP power pin can operate from 1.4 V to 3.6 V.

Please refer to the PSoC™ 6 MCU hardware design considerations datasheet for more information. 

The VBACKUP rail can be connected to a separate rail such as a coin cell battery or a super capacitor or tied to VDDD directly if the design does not support a separate VBACKUP supply. 

Thanks,

P Yugandhar. 

0 Likes

Hello,

The VBACKUP pin is connected directly to the LiPo battery which is nominally 3.7V. should we could include a supercap ? We are complying with the requirements so can you please check for me why it's not working?

Thank you

0 Likes
Yugandhar
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 5 likes given

Hello @aliissa02 , 

Could you please elaborate more on what is not working? I think you are now using your board with updated schematics.

Thanks,

P Yugandhar. 

 

0 Likes

It’s not establishing a BLE connection even though I am able to do it using the board developed by cypress.

0 Likes
Yugandhar
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 5 likes given

Hello @aliissa02 , 

Please share the screenshot of the errors if you are seeing anything. 

Please send the UART Terminal logs(TERA-TERM logs) of the GATT_Out example project.

Thanks,

P Yugandhar. 

0 Likes

Hello,

It is not showing anything at all. When I use the board developed by cypress it says advertising but eith my board it says nothing.

 

Thank you

0 Likes
lock attach
Attachments are accessible only for community members.
Yugandhar
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 5 likes given

Hello @aliissa02 , 

Please refer to the below attached project. I have not used the WCO in the projects.

Thanks,

P Yugandhar. 

0 Likes
aliissa02
Level 4
Level 4
100 sign-ins 50 replies posted 5 likes given

Thank you very much. It is working now. Can you please provide me with assistance in how to send data to a mobile phone app via the established BLE?

Thanks 

0 Likes
Yugandhar
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 5 likes given

Hello @aliissa02 ,

You can use the GATT_Out project (in the Throughput code example) and connect to the mobile phone. It has a custom service with Notify property. Once you connect the device with the mobile phone then press the Notify in the mobile. You can see the notifications data in the mobile. For more information, please refer to the CE222046_Throughput_Measurement datasheet.

Thanks,

P Yugandhar. 

0 Likes