PSoC™ 4 Forum Discussions
Hi,
I am new to PSoC 4 , but have a handful of projects on PSoC 3. I want to use CY8CKIT-042 with a solar panel. Application is simple gross counting of pulses. How should I start? Also is there anything done already with this?
Thanks
Neha
Show LessI have seen the day 9 project, Dynamic Broadcaster, but still need assistance with its implementation. This partly may be a C Language issue but an understanding of the use of CyBle_GapUpdateAdvData is also lacking.
I successfully enter broadcasting mode (Broadcaster shows up under scan by CySmart 1.2), but with dynamic broadcasting I want to add and modify the Scan Response Packet each time. Not only with this snippet of code do I NOT create a Scan Response Packet (cannot be seen under CySmart 1.2 scan response data tab) but I also lose my Broadcaster Label - Public identifier-and revert to the Advertiser Label of BLE Serial.
Note that both my ScanData.scanRspDataLen variable and ScanData.scanRspData array fill out with the correct data.
void DynamicADVPayloadUpdate(char *p, uint16 DataLength)
{
uint16 i;
CYBLE_GAPP_SCAN_RSP_DATA_T ScanData;
uint8 test;
memset(ScanData.scanRspData,0,N_COUNT);
ScanData.scanRspDataLen = DataLength;
for(i=0; i < ScanData.scanRspDataLen; i++)
ScanData.scanRspData = *(p+i);
if(CyBle_GetBleSsState() == CYBLE_BLESS_STATE_EVENT_CLOSE)
{
CyBle_GapUpdateAdvData(cyBle_discoveryModeInfo.advData, &ScanData);
test = 1;
}//end if(CyBle_GetBleSsState()
}
*****************************************
If I replace the code above with this code, I resolve the issue having to do with losing the broadcaster label, but I still see nothing under the Scan Response Data Tab.
void DynamicADVPayloadUpdate(char *p, uint16 DataLength)
{
uint16 i;
CYBLE_GAPP_SCAN_RSP_DATA_T ScanData;
uint8 test;
memset(ScanData.scanRspData,0,31);
ScanData.scanRspDataLen = DataLength;
// for(i=0; i < ScanData.scanRspDataLen; i++)
// ScanData.scanRspData = *(p+i);
/* Define the Broadcast advertisement parameters - including the BD address,
* advertisement type, advertisement interval etc.
*/
CYBLE_GAPP_DISC_PARAM_T myAdvParameters =
{
// Minimum Advertisement interval = 100 ms
CYBLE_GAP_ADV_ADVERT_INTERVAL_NONCON_MIN,
// Maximum Advertisement interval = Minimum = 100 ms
CYBLE_GAP_ADV_ADVERT_INTERVAL_NONCON_MIN,
// Advertisement type - Non-connectable undirected (broadcasting)
CYBLE_GAPP_NON_CONNECTABLE_UNDIRECTED_ADV,
// Own BD address type - Public
CYBLE_GAP_ADDR_TYPE_PUBLIC,
// Address type of peer for directed advertisement - not applicable
CYBLE_GAP_ADDR_TYPE_PUBLIC,
// Address for directed advertisement - not applicable
{0},
// Channel map - advertise on all 3 channels
0x07,
// Advertisement filter policy - not applicable
0
};
// Define the advertisement data for the broadcast - this includes the
// advertisement flags and the device name advertised. The device name
// used for Broadcasting is different from the device name used when
// we want to connect to another device.
//
CYBLE_GAPP_DISC_DATA_T myAdvData =
{
{
2, // Length for Flags field - Counts as 1 Byte
1, // Identifier that following data is Flags field - Counts as 1 Byte
4, // Advertisement Flags - BR/EDR not supported - Counts as 1 Byte
12, // Length for Complete Name field - Counts as 1 Byte
0x09, // Identifier that following data is Complete Name field - plus 12
// Name
'B', 'r', 'o', 'a', 'd', 'c', 'a', 's', 't', 'e', 'r'
},
16 // Total bytes in the advertisement packet
};
// There is no scan response data configured for this broadcast
CYBLE_GAPP_SCAN_RSP_DATA_T myScanRespData =
{
{*p,*(p+1),*(p+2),*(p+3),*(p+4),*(p+5),*(p+6),*(p+7),*(p+8),*(p+9),*(p+10),*(p+11),*(p+12),\
*(p+13),*(p+14),*(p+15),*(p+16),*(p+18),*(p+19),*(p+20),*(p+21),*(p+22),*(p+23),*(p+24),*(p+25),\
*(p+26),*(p+27),*(p+28),*(p+29),*(p+30),*(p+31)}, // Scan response packet
ScanData.scanRspDataLen // Length of the scan response packet
};
// Top level structure for holding all advertisement parameters
CYBLE_GAPP_DISC_MODE_INFO_T discoveryModeInfo =
{
CYBLE_GAPP_NONE_DISC_BROADCAST_MODE, // Discoverable mode
&myAdvParameters, // Advertisement parameters
&myAdvData, // Advertisement data
&myScanRespData, // Scan response data
0 // Advertisement timeout: none
};
if(CyBle_GetBleSsState() == CYBLE_BLESS_STATE_EVENT_CLOSE)
{
CyBle_GapUpdateAdvData(discoveryModeInfo.advData,discoveryModeInfo.scanRspData);
//CyBle_GapUpdateAdvData(cyBle_discoveryModeInfo.advData,&ScanData);
test = 1;
}//end if(CyBle_GetBleSsState()
}
*****************************
I think I see one of the mistakes I am making. The Scan Response Packet is not a blind 31 byte field. It needs to be cast in one of the categories provided, like Manufacturer Specific Data. Correct? If this is the case, how do assign the data array to the Manufacturing Index? Your example requires only a single byte assignment to the manufacturing index. (eg, advPayload[MANUFACTURER_SPECIFIC_DYNAMIC_DATA_INDEX] = dynamicPayload++;, < 255). However, the ScanRespPayload will contain an array of data.
Show LessHi,
In a device, based on the CYBLE-222005-00 module, we need to distinguish between a power on and a software reset. We do this with the help of the CySysGetResetReason function and in a single application, which we program using an SWD programmer, it works. However, if we restructure the software to add an OTA upgrade possibility (i.e. prepare separate Upgradable Stack OTA Bootloader and Bootloadable User Application), the same function called in the Bootloable returns a reset reason value with the CY_SYS_RESET_SW bit – set. I tried but I could not find the answer of the following questions:
- How can I recognize a power on reset in a OTA Bootloadable application that works with an Upgradable Stack OTA Bootloader?
- Is there a way to pass a value from the bootloader to the bootloadable or to share a variable between them?
Thanks!
I am using Creator 4.1 with CY8CKIT-044 M-series. The first shift register instantiated (but not the next two) is missing the box around the shift_pin. It was there until a connection was made. A wire edit triggered its vanishing. It does not return. And I am curious. My project has yet to prove the pin works.... Obviously, if it works, no big deal.
regards
Tim Miner
Show LessHi there!
I'm using a CYBLE-222005-00 module, with security configuration for bonding with JustWorks since my device has NoInput/NoOuput (see attachement). However, the saving of the bonding data does not seem to work. After a wake-up from hibernate, I cannot re-connect with the previously bonded Smartphone getting a CYBLE_EVT_GAP_AUTH_FAILED event from the BLE stack.
Here is what I do in he code:
On the callback event CYBLE_EVT_GAP_AUTH_COMPLETE I call
while(CYBLE_ERROR_OK != CyBle_StoreBondingData(0));
and later I get the event CYBLE_EVT_PENDING_FLASH_WRITE where I do nothing in the code. This event seems to be triggered even when I don't call the CyBle_StoreBondingData() method before...
Is there a way to check, if the bonding data is stored correctly in the flash or am I missing some other things?
Thanks for your help!
Show Lesshow to interface ky001 Temperature sensor with Cy-8CKIT-042. I want to interface single ky001. Please help me.Even i am not able to find appropriate data on internet.
Show LessHello,
I'm using the ShiftReg component but not as expected
there are some glitch on the output I do not understand..
Can somebody help me?
Regards
<code>
Show Lessint main()
{
uint32 Current_Value = 0x884444;ShiftReg_1_Start();
ShiftReg_1_WriteRegValue((Current_Value<<2) | 0x2000001);...
</code>
Hello,
I am trying to make a wireless headset device using the HID profile.I am using CY8CKIT-042 and I was thinking of using a normal electret microphone. Please tell me the report map for using it as a headset.
Thanks and Regards
Show LessHello
I am working with the CY5672 Remote Control eval kit. I have the unit working with CySmart 1.0 and running in RDK emulator mode.I can see all the functions including sound data in the log working. When I connect through my PC directly all the functions seem to work well except sound. The Cypress Digital Audio driver is installed and the PC microphone is set to use it however while holding down the mic button on the remote I see no sound level registering and I cant hear it. Does anyone have any experience with this or know of a possible solution?
Thanks
Show Lesshello sir,
we are building a gamepad/joystick like device which needs to have both wireless(HID over BLE) & wired(USB HID) connectivity. we thought PROC /PSOC BLE modules can be a useful.but for USB-HID we are facing issues to find a proper solution. can some one guide us a best solution with lowest components cost and single firmware based solution., i mean to say that we are looking for a single MCU based solution to handle both BLE & USB.Thank u
Show Less