Quantcast
Channel: Cypress Semiconductor - PSoC 4 BLE
Viewing all 726 articles
Browse latest View live

Connecting two CYBLE-224110-EVAL between them

$
0
0
Forums: 

Hi all,

For our current application, we need a long range link. As a first step, we would like to perform a range test. For this, we bought two CY8CKIT-042-BLE-A kits and two CYBLE-224110-EVAL. We want to connect them one to each other (Central and peripheral) and see how the link
behaves in terms of distance.

We found this project on the web https://github.com/cypresssemiconductorco/PSoC-4-BLE/blob/master/100_Projects_in_100_Days/Day020_BLE_UART/UART_to_BLE.pdf which we used to connect both boards.
First we tried with the two CY8C4248LQI-BL583 modules that come with the CY8CKIT.
We took the above mentioned SW, we update the sw modules (As PSoC Creator suggest) and we changed the device to CY8C4248LQI-BL583. Everything worked properly.

Then, we change the module to the CYBLE-224110 in the kit board acting as Central, changed the device in PSoc and tried again. It was OK.

The other way round, CYBLE-224110 as peripheral and CY8C4248 as central also work fine.

But when we switched to CYBLE-224110 in both kit boards, they cannot establish communication.

Anyone has an idea of what could be the reason for this?

We are new to BLE and PSoC and we are a bit lost.

Thank you very much in advance

Xavi


How to get what a long procedures triggered CYBLE_EVT_GATTC_LONG_PROCEDURE_END ?

$
0
0
Forums: 

    /** Event indicates that GATT long procedure is end and stack will not send any further
    * requests to peer. Either this event or 'CYBLE_EVT_GATTC_ERROR_RSP' will be received
    * by application. This event may get triggered for below GATT long procedures:
    *     1. CyBle_GattcDiscoverAllPrimaryServices
    *     2. CyBle_GattcDiscoverPrimaryServiceByUuid
    *     3. CyBle_GattcFindIncludedServices
    *     4. CyBle_GattcDiscoverAllCharacteristics
    *     5. CyBle_GattcDiscoverCharacteristicByUuid
    *     6. CyBle_GattcDiscoverAllCharacteristicDescriptors
    *     7. CyBle_GattcReadLongCharacteristicValues
    *     8. CyBle_GattcReadLongCharacteristicDescriptors    \n
    *     Event parameter is ATT opcode for the corresponding long GATT Procedure.
    */
    CYBLE_EVT_GATTC_LONG_PROCEDURE_END,

How to get what a long procedures triggered this ?

PSOC 4 BLE : central not connecting to peripheral. central scans peripherals properly, but dont connect.

$
0
0
Forums: 

I have two cy8ckit-042-ble and I am trying to connect my 1st BLE kit configured as GAP role: central and GATT Client with a 2nd BLE kit configured as GAP role: peripheral and GATT server. It can generate event
CYBLE_EVT_GAPC_SCAN_PROGRESS_RESULT: I can fetch address of peer device. STOP scanning using CyBle_GapcStopScan().
As a result following event is generated CYBLE_EVT_GAPC_SCAN_START_STOP: When I call  res = CyBle_GapcConnectDevice(&peerAddr); value in res is CYBLE_ERROR_OK, but not generating CYBLE_EVT_GAP_DEVICE_CONNECTED. I get HCI error.
CYBLE_HCI_COMMAND_DISALLOWED_ERROR.

*****Is thereany specific way to call : CyBle_GapcConnectDevice((const CYBLE_GAP_BD_ADDR_T* )&add);

i have called this API wen event  generated is CYBLE_EVT_GAPC_SCAN_START_STOP on calling CyBle_GapcStopScan().

code for central is as follows:

*************************

#include "project.h"

void ble(uint32 eventCode, void *eventParam);

CYBLE_GATTC_WRITE_REQ_T writeReqParam;

static volatile CYBLE_API_RESULT_T res;

static CYBLE_GAP_BD_ADDR_T add;

void v_workerBLE_slaveSelectionHandler(CYBLE_GAPC_ADV_REPORT_T* eventParam);

void resolveErr(CYBLE_HCI_ERROR_T *eventParam);

uint8 u8slaveFound;

int main(void)

{

CyGlobalIntEnable; /* Enable global interrupts. */

CyBle_Start(ble);

while(1)

{

CyBle_ProcessEvents();

}

}

void ble(uint32 eventCode, void *eventParam)

{

switch(eventCode)

{

case CYBLE_EVT_STACK:

          CyBle_GapcStartScan(CYBLE_SCANNING_FAST);

break;

case CYBLE_EVT_GAPC_SCAN_PROGRESS_RESULT:

         // call api to vew n list scanned device, and save the address of device

        // this API working fine and shows scanned devices and generates

        // CYBLE_EVT_GAPC_SCAN_START_STOP event.

v_workerBLE_slaveSelectionHandler((CYBLE_GAPC_ADV_REPORT_T *)eventParam);

break;

case CYBLE_EVT_GAPC_SCAN_START_STOP:

{

// **** error section. not generating next event. CYBLE_EVT_GAP_DEVICE_CONNECTED

// API - CyBle_GapcConnectDevice((const CYBLE_GAP_BD_ADDR_T* )&add); generates  

//  CYBLE_EVT_HCI_STATUS event , which is error. res variable shows all OK-no error.

if(u8slaveFound)

{

//peerAddr.type = 0u;

// connect to the device

// ** error API- THIS API GENERATES HCI ERROR

res = CyBle_GapcConnectDevice((const CYBLE_GAP_BD_ADDR_T* )&add);  

}

}

break;

case CYBLE_EVT_GAP_DEVICE_CONNECTED:

CyBle_GattcStartDiscovery(cyBle_connHandle);

break;

case CYBLE_EVT_GATTC_DISCOVERY_COMPLETE:

// do some work 

break;

case CYBLE_EVT_HCI_STATUS:

resolveErr(eventParam);

break;

default:

CyBle_GapcStartScan(CYBLE_SCANNING_FAST);

break;

}

}

void v_workerBLE_slaveSelectionHandler(CYBLE_GAPC_ADV_REPORT_T* eventParam)

{

uint8 newDevice = 0u, device = 0u;

uint8 i;

uint8 adStructPtr = 0u;

uint8 adTypePtr = 0u;

uint8 nextPtr = 0u;

// copy peer device address- address of device which we want to connect to

memcpy(add.bdAddr, eventParam->peerBdAddr, CYBLE_GAP_BD_ADDR_SIZE);

add.type = eventParam->eventType;

{

// convert little endian to big endian as for now

add.bdAddr[0] = eventParam->peerBdAddr[5];

add.bdAddr[1] = eventParam->peerBdAddr[4];

add.bdAddr[2] = eventParam->peerBdAddr[3];

add.bdAddr[3] = eventParam->peerBdAddr[2];

add.bdAddr[4] = eventParam->peerBdAddr[1];

add.bdAddr[5] = eventParam->peerBdAddr[0];

u8slaveFound = 1u;

CyBle_GapcStopScan();

}

}

void resolveErr(CYBLE_HCI_ERROR_T *eventParam)

{

// see error code- CYBLE_HCI_COMMAND_DISALLOWED_ERROR in my case

volatile uint8 err = *eventParam;

}

Need help Bringing up CY8CKIT-042-BLE

$
0
0
Forums: 

Hi,

 

I have couple of CY8CKIT-042-BLE

I went on Cypress website and downloaded and installed  PSoCCreatorSetup_3.3_sp2_b9604.exe,CY8CKIT042Setup_RevSC.exe,PSoCProgrammer_3.25.0.b2504.iso,PSoCCreatorSetup_4_Update_1

Question is which ones are needed? I read CY8CKIT-042-BLE Quick Start Guide and then looking at other Cypress website, I see creator 4

I am trying to follow http://www.cypress.com/products/psoc-creator-integrated-design-environment-ide site as well as

http://www.cypress.com/documentation/development-kitsboards/cy8ckit-042-ble-bluetooth-low-energy-ble-pioneer-kit

Which exact loadables do I need?

Thanks,

Asha

 

to compare peerbdaddr from scan report to whitelist address

$
0
0
Forums: 

how to convert peerbdaddr of scan report to CYBLE_GAP_BD_ADDR_T, so that i can compare the scan report address with whitelist address
or is there another way to compare the same. I was trying to write the code for comparison as
if(scanreport->peerbdaddr == whitelistbackup[i])
then execute this...
whitelistbackup holds all the address in the whitelist and it is of the struct CYBLE_GAP_BD_ADDR_T, but for peerbd address i cannot use that. please help

Vaisakh Haridas
vaisakh.hari21@gmail.com
+91 8879009971

One-shot beacon example?

$
0
0
Forums: 

I'm looking for example code for a one-shot beacon.  That is, a user presses a button on the broadcaster, some processing work is done, and then it beacons once (no BLE connection), then goes back into deep sleep or hibernate.

I've been trying to adapt one of the synchronous (periodic) beaconing examples, but I'm running into an issue that I can't figure out.  The first button press works as expected (one beacon), but subsequent presses result in two beacons, one of which comes before the processing work.  It would seem that there is a residual message in the BLESS or something.

Can anyone point me at an example that is NOT periodic in its broadcast (and does NOT require a connection)?

How to overwrite the PSOC Creator generated code

$
0
0
Forums: 

Hi,

On CY8CKIT-042-BLE -- created new project and added the BLE Temperature Measurement to it. Built, loaded, and ran via the PSOC Creator. I can see the advertisement "Thermometer" on my Samsung phone.  I than wanted to modify this name in BLE.c, table

CYBLE_GAPP_DISC_DATA_T cyBle_discoveryData =

{

{ 0x02u, 0x01u, 0x06u, 0x0Cu, 0x09u, 0x54u, 0x68u,

0x65u, 0x72u, 0x6Du, 0x6Fu, 0x6Du, 0x65u, 0x74u, 0x65u,

0x72u, 0x03u, 0x02u, 0x09u, 0x18u, 0x00u, 0x00u, 0x00u,

0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u }, /* uint8 advertising_data[CYBLE_MAX_ADV_DATA_LEN] */

0x14u, /* uint8 adv_data_length */

};

 but this is a generated file.  How can I overwrite this so that I can have another name?

Thanks,

Asha

Piconet

$
0
0
Forums: 

Hello, I am new learning BLE and now I'm using the CY8CKIT-042_BLE PIONEER KIT, the question that I´ve

How can I create a piconet between 5 devices as slave and one master? I've read already that it's possible up to 7 connections. If someone knows about documentation that I can read, it'd be so usefull.

 

Thanks

David Caraveo


Wake Up PSoC 4 BLE While Staying Connected - Sending Data

$
0
0
Forums: 

Hello,

 

I have managed to put the PSoC 4 BLE to sleep, thanks to the forum. While the device is asleep, the BLE connection can be sustained. However, when I wake up the device and try to send data to the other device, I believe it cannot send the data and it is stuck in the while loop below:

    CYBLE_GATTS_HANDLE_VALUE_NTF_T nHandle;
    nHandle.attrHandle = CYBLE_BLE_PROFILE_SERVICE_TRIGGERS_CHAR_HANDLE;
    nHandle.value.val = valueBuf;
    nHandle.value.len = sizeof(valueBuf);
    while (CyBle_GattsNotification(cyBle_connHandle, &nHandle) != CYBLE_ERROR_OK) {
        CyBle_ProcessEvents();
    }

The valueBuf is a buffer of the values that I want to send to the other device.

Is the code above a sufficient way to send data between devices? And does anyone have any idea as to why the code above does not pass when the device is woken up from deep sleep?

 

Thanks in advance.

Cypress BLE-Beacon IOS source code

$
0
0
Forums: 

Hello everyone,

I am trying to locate the source code for BLE-Beacon IOS app. Has anyone worked with it?

Thanks,
Apoorva

C# Data Logging to interface with PSOC4 BLE device

$
0
0
Forums: 

Good day,

I have developed a prototype PSOC BLE 4.1 board that captures analog data from a sensor and this information is sent via BLE to a windows PC via the Cypress BLE Dongle.

 I am using C# (Visual Studio 2015) for the windows based test program development.

The c# program is developed based on api examples found in the Cypress Community.

In that example, it is divided into 2 segments, notifications and scanner project.

I have integrated both the segment into my test program as shown in the attached file.

On program launch, the program is able to connect to the dongle and detect the BLE device as shown in the attached.

However, when one click on the <Select> checkbox, it is not able to connect to the BLE device.

If one skip the scanning segment and set the notification segment with the BLE address of that device, then connection is established and notification is able to read the periodic information sent from the BLE device.

Initial analysis seems to point to the AutoResetEvent from either the Scanner or the Notification fucntions to be the caused of the issue.

My C# project can be downloaded via this link 

https://www.dropbox.com/s/sa55zhyasc76yki/aMixerBLEApp.zip?dl=0

I am hence seeking your expertise advice as to how the connection issue can be resolved.

Thank you very much in advance.

 

 

 

Cannot upgrade firmware on CY8CKIT-042-BLE Kit

$
0
0
Forums: 

Hi,

In PSoC Creator, I received the message that I needed to upgrade the firmware on the kit.  So, I went to the PSoC Programmer and attempted to upgrade the firmware, but it failed.  How can I get the kit back to factory settings?

Here's what I do, from scratch (no programs open, kit disconnected):

  • Open PSoC Programmer (Version 3.25.0.2504), output shown:

​                                                   | Select Port in the PortList, then try to connect
Device set to CY8C4127FNI-BL483 at 8:47:13 AM      | 131072  FLASH bytes
Device Family set to CY8C4xxx-BLE at 8:47:12 AM    | 
Active HEX file set at 8:47:12 AM                  | C:\Program Files (x86)\Cypress\CY8CKIT-042-BLE Kit\1.0\Firmware\Programmer\KitProg\KitProg.cyacd
                                                   |  
                                                   | Users must be aware that the following PSoC device should not be powered or programmed at 5V. Doing so will cause damage to the device: CYRF89xxx
Session Started at 8:47:12 AM                      | PPCOM Version 22.0

  • I then connect the CY8CKIT-042-BLE PIONEER BASEBOARD.  LED2 (status) starts solid, but quickly goes to 4Hz flash.  PSoC Programmer output window displays (in red):

Connected at 8:48:24 AM                            | KitProg bootloader device is detected
                                                   | Please close all ports, then navigate to the Utilities tab and click the Upgrade Firmware button to recover Bridge

 

  • On the Utilities tab, the Upgrade Firmware is now clickable.  No ports are listed in the Port Section window.  I click Upgrade Firmware and get:

Firmware Update Finished at 8:52:42 AM             | 
                                                   | FAILED! Bootloader Port is not connected!
                                                   | Initializing...
Firmware Upgrade Started at 8:52:42 AM             | 
Firmware Upgrade Requested at 8:52:42 AM           | 

What am I doing wrong?  User's Guide says flashing LED indicates "LED starts blinking at power up, if bootloadable file is corrupt." Clearly the device is connecting, but I can't get it out of the corrupted state.

Any ideas?

Other info:

  • I'm using the kit version install from:  CY8CKIT042BLEKITSetupOnlyPackage_RevSE_3-25-16.exe
  • I'm running on Windows 8.1 on VMWare on an MAC
  • Pioneer baseboard silkscreen version: 600-60194-01 REV03
  • Pioneer baseboard sticker version: 121-60158-01 rev 06

Brian

 

 

Weird disconnection issue after several seconds

$
0
0
Forums: 

Hi all,

In our BLE application, I am facing a weird disconnection issue.
In general, the peripheral is working good, it is connected with the central device and it sends notifications.
After several seconds it disconnects. It could be 10sec or a few minutes the time until the disconnection happens. The weird thing is that no disconnection events are propagated to the event stack handler function and as a result, I have no idea why it disconnects. Furthermore, since the disconnection event is not handled, the peripheral does not start advertising after disconnection so the central cannot re-establish connection.

The rest functionality of the application is continued normally after disconnection and all interrupts, analog-to-digital conversions, UART/I2C transactions are working good. Only the BLE functionality stops operating. I would like to mention that notifications are sent very frequently. We send a notification packet every 50ms. I do not know if this has to do with the disconnection issue (availability of internal buffers or anything relative).

Are there any ideas what could have happened?

Best Regards,
Yiannis

CYBLE-214009-00 no SCB1_MOSI ?

$
0
0
Forums: 

Dear folks,

In a project requiring two master SPI modules we intend to use the CYBLE-214009-00.

In the documentation as well as in PSOC creator (v4 update 1, projects components are up to date) SCB1_MOSI is missing.

Am I missing some (obivous ?) detail or does it mean two SPI master modules are not possible with this chip ?

If so is there some workaround I could use to use this chip with my two SPI slaves ?

Thanks a lot for your help,

Maximilien.

PSoC4 BLE Power Management

$
0
0
Forums: 

I'm very new to BLE for PSoC4 so I'm making a lot of assumptions I want to check:

  1. Can I call CyBle_EnterLPM() basically any time, in any state?  Why doesn't BLE just do this automatically then?
  2. Should I only call this immediately before a CPU sleep? ie. does it change CPU clock/speed?
  3. Will an interrupt will always be fired when CyBle_GetBleSsState changes?

(history as to why I'm asking:)

I have a relatively large system of software pieces that may or may not be active, with different tolerances for sleep states, so I've implemented some power savings code to help with that.

Each piece, including interrupts, indicates what sleep state is acceptable at the time.  Here my attempt at BLE - this function is called basically any time there is a BLE interrupt, whenever the main loop changes a BLE condition, and after any call to CyBle_ProcessEvents.


void UpdateSleepState(void)
{
    CYBLE_LP_MODE_T bleMode;

    if(CyBle_GetState() != CYBLE_STATE_CONNECTED) // Is this even necessary?
    {
        RequestSleep(SL_AWAKE);
        return;
    }
    
    /* Request BLE subsystem to enter into Deep-Sleep mode between connection and advertising intervals */
    bleMode = CyBle_EnterLPM(CYBLE_BLESS_DEEPSLEEP);

    switch(CyBle_GetBleSsState())
    {
        case CYBLE_BLESS_STATE_DEEPSLEEP:
        case CYBLE_BLESS_STATE_ECO_ON:
        case CYBLE_BLESS_STATE_HIBERNATE: /* Hibernate is not documented, aside from saying CPU can deep sleep. */
            RequestSleep(SL_DEEP_SLEEP);
            break;
        case CYBLE_BLESS_STATE_ECO_STABLE:
        case CYBLE_BLESS_STATE_SLEEP:
        case CYBLE_BLESS_STATE_ACTIVE:
            RequestSleep(SL_SLEEP);
            break;
        case CYBLE_BLESS_STATE_EVENT_CLOSE:
            RequestSleep(SL_AWAKE); /* Force the CPU to stay awake even if other things have requested sleep */
            break;
        case CYBLE_BLESS_STATE_INVALID:
            break; /* We don't anticipate this state. */
    }
}

This only works if there is always an interrupt for every time there is a change in the need for sleep.


Interface PSOC with ESP8266(WIFI connect)

$
0
0
Forums: 

How to interface PSOC 4 with Esp8266 module to connect to wifi and upload simple data . We wanted to upload the peer address to cloud using esp8266 module interfaced to PSOC BLE4. please suggest as to how to transmit the data and if possible a sample project file.

Also suggest if i should work with any other wifi module.

Unable to connect with mobile

$
0
0
Forums: 

I have a strange problem that my MacBook could connect with the LightBlue software, while my PC is also OK with CySmart and the USB dongle.  However, when using an iPhone or Samsung S7 to connect and read my BLE peripheral, it would either not able to connect, or disconnect after a few seconds. 

Is there anything special about timeout etc that I should change and check? 

Current I am testing with the cycling example.  The last messages output from the UART is:

CYBLE_EVT_GATT_DISCONNECT_IND

CYBLE_EVT_GAP_DEVICE_DISCONNECTED

CYBLE_EVT_GAPP_ADVERTISEMENT_START_STOP, state: 3

 

Not quite sure how I could debug the problem. Please help me, thank you!

 

How to properly setup Cmod and Csh when using CYBLE-014008-EVAL module for CapSense application

$
0
0
Forums: 

I have setup a project based on the CE210291_CapSense_One_Button example code using a CY8CKIT-042-BLE pioneer kit and a CYBLE-014008-EVAL module. The configuration I need to test requires to enable a shield pin in addition to the Button pin (i.e. sensor), so I have enabled the shield tank (Csh) capacitor in CapSense->CSD_Settings (CapSense_P4_v3_10 component). Now, in the Desig_Wide_Resources->Pins window I am required to setup the modulator capacitor “CapSense:Cmod” and the shield-tank capacitor “CapSense:Csh”. I have consulted the CYBLE-014008-00 datasheet and I understand the module includes a Cmod = 2.2nF (located at port P4_0) and Ctank=10nF (located at port P4_1) , so I have assigned P4_0 port to “CapSense:Cmod” and P4_1 to “CapSense:Csh”. At this point, in the Pin tab window, under the Pin_name section I get a warning icon “Invalid pin assignment P4[0]. This pin does not support ANALOG.” for CapSense:Cmod and another warning icon “Invalid pin assignment P4[1]. This pin does not support ANALOG.” for CapSense:Csh; furthermore, port P4_0 gets assigned Pin 33 and port P4_1 gets assigned pin 34, however the CYBLE-014008-EVAL module only has 32 pins. Any comments on what is the proper way to setup this configuration for the CYBLE-014008-EVAL module?

HCI Commands

$
0
0
Forums: 

Hi.

Is there any specific Cypress HCI command to change device's MAC address?

I am asking this question because Bluetooth standard does not cover this command.

I am developping for an CYBL11573 IC (CY5677 Dongle), and it supports BLE 4.2 specification.

Thank you.

No AesDecrypt method

$
0
0
Forums: 

Hello guys,

 

I want to manually encrypt and decrypt my data using AES-128. I took a look at the documentation and I found the following method:

CYBLE_API_RESULT_T CyBle_AesEncrypt (uint8 * plainData, uint8 * aesKey, uint8 * encryptedData)

The problem is that I can't find the CyBle_AesDecrypt method or similar, to decrypt the data I receive. Is there a method like this?

 

NOTE: I know about the CyBle_AesCcmEncrypt and CyBle_AesCcmDecrypt methods, but I did not want to use them because I do not want to have to transmit the NONCE and the MIC in every message. If there is any safe way of using these functions without having to transmit the NONCE and the MIC in every message it would be a good solution as well.

Viewing all 726 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>