PSoC™ 4 Forum Discussions
I am using a CYBLE-022001-00 chip, and I have made use of the bonding feature of the BLE so that I will only pair with a device once. I am well aware that enabling bonding means that automatic reconnection is inevitable.
Is there a way to bond with a SELECTED bonded device and prevent re-connection with a "not-selected" bonded device? thanks.
Show LessHi All,
I need to develop an application where I need to receive the advertisement data only from my peripheral devices and not other BLE devices that are present near by. We can add some control bytes in advertisement data and differentiate it from the rest of the BLE device or may be add a string to differentiate. But is there a better way to do this kind of filtering?
Thanks
Show LessOk, so I have had the updatable stack OTA working from an iPhone app for the past few months. I can save the 'target firmware' (stack and app) in the iOS phone build and if the target is determined to be out of date, then the phone will command the cypress to reboot into OTA/Bootloader mode and the update will proceed as expected.
Except for a few times in ~100 where the unit will reboot as commanded but continues to come back up in the App mode instead of OTA... This is rather critical because if it will only reboot back into the app mode, then it can never update the firmware and the feature suddenly doesn't exist for that unit. If I reprogram the device again with just the bootloader and stack, then it will work again for a while... but then later it stops rebooting into OTA mode...
So... ==> Is there any known issue with the PSoC/Cypress part not rebooting correctly back to OTA mode? This is using standard PSoC/Cypress code to accomplish the reboot.
Here are the notes I took as I was trying to figure this out... I sent them to someone else to explain the issue so it reads that way...
****
Ok, here is enough of the log to see the looping as printed out from the Cypress over UART.
It decides to reboot to OTA, starts printing the fact that it should and then boots back into normal mode (I can tell because of the FWDID that is only printed in normal mode - not OTA mode)…. Phone sees date is wrong and commands it to reboot again, etc…
[This is the output from the Cypress UART; the CYP: is prepended by my UART capture app.]
CYP: !Rebooting to OTA
CYP: !Bootloadab !FWSERN 0
CYP: !FWBOOT Dec 30 2017 16:39:17
CYP: !FWSTCK Jan 26 2018 07:57:21
CYP: !FWAPPL Feb 3 2018 11:32:10
CYP: !FWDID 0x1946de18 0x000b1a2b
CYP: ?DT4
CYP: ?!STARTBLE
CYP: ?DT4
CYP: ?
CYP: !FWADR -85 0x00a0503196ab
CYP: ! !Connected
CYP: +BLE SN: 12 ID: pogoGS UID: 18604204
CYP: ~BATT 5139
CYP: !Rebooting to OTA
CYP: !Bootloadab !FWSERN 0
CYP: !FWBOOT Dec 30 2017 16:39:17
CYP: !FWSTCK Jan 26 2018 07:57:21
CYP: !FWAPPL Feb 3 2018 11:32:10
CYP: !FWDID 0x1946de18 0x000b1a2b
CYP: ?DT4
CYP: ?!STARTBLE
CYP: ?DT4
CYP: ?
CYP: !FWADR -85 0x00a0503196ab
CYP: ! !Connected
CYP: +BLE SN: 12 ID: pogoGS UID: 18604204
CYP: ~BATT 5143
CYP: !Rebooting to OTA
CYP: !Bootloadab !FWSERN 0
CYP: !FWBOOT Dec 30 2017 16:39:17
CYP: !FWSTCK Jan 26 2018 07:57:21
CYP: !FWAPPL Feb 3 2018 11:32:10
CYP: !FWDID 0x1946de18 0x000b1a2b
CYP: ?DT4
CYP: ?!STARTBLE
CYP: ?DT4
CYP: ?
...etc
Here is the relevant cypress code. The Set active App is supposed to set something in flash (or ram) so it knows to boot to BL0 (bootload / OTA). The Bootloadable_Load() actually does it’s own CySoftwareReset so that is why the !Bootladable_Load UART above gets truncated (it rebooted before it finished sending the UART) and also why we don’t see the CySoftwareReset printout happening above.
// or we can command it to reset into bootloader mode
else if (wrReq->handleValPair.value.val[1] == 0x38)
{
UART_UartPutString("!Rebooting to OTA\r\n");
if (Bootloadable_SetActiveApplication(0) == CYRET_SUCCESS) {
UART_UartPutString("!Bootloadable_Load\r\n");
Bootloadable_Load();
UART_UartPutString("!CySoftwareReset\r\n");
CySoftwareReset();
}
else
UART_UartPutString("!Failed to SetActiveApplication\r\n");
}
The bootloadable load looks like this (so pretty brief) [this is PSoC generated code]
/*******************************************************************************
* Function Name: Bootloadable_Load
****************************************************************************//**
*
* \brief
* Schedules the Bootloader/Launcher to be launched and then performs
* a software reset to launch it
*
* \return
* This method will never return. It will load a new application and reset
* the device.
*
*******************************************************************************/
void Bootloadable_Load(void)
{
/* Schedule Bootloader to start after reset */
Bootloadable_SET_RUN_TYPE(Bootloadable_SCHEDULE_BTLDR);
CySoftwareReset();
}
The set run type is: [this is PSoC generated code]
/*******************************************************************************
* Schedule the Bootloader/Bootloadable to be run after a software reset.
*******************************************************************************/
#if(CY_PSOC4)
#define Bootloadable_SET_RUN_TYPE(x) (cyBtldrRunType = (x))
#else
#define Bootloadable_SET_RUN_TYPE(x) CY_SET_REG8(CYREG_RESET_SR0, (x))
#endif /* (CY_PSOC4) */
The cyBtldrRunType is just a location in flash (or ram…?) [this is PSoC generated code]
#if (CYDEV_PROJ_TYPE != CYDEV_PROJ_TYPE_STANDARD)
/*******************************************************************************
This variable is used by the Bootloader/Bootloadable components to schedule
what application will be started after a software reset.
*******************************************************************************/
#if (__ARMCC_VERSION)
__attribute__ ((section(".bootloaderruntype"), zero_init))
#elif defined (__GNUC__)
__attribute__ ((section(".bootloaderruntype")))
#elif defined (__ICCARM__)
#pragma location=".bootloaderruntype"
#endif /* (__ARMCC_VERSION) */
volatile uint32 cyBtldrRunType;
#endif /* (CYDEV_PROJ_TYPE != CYDEV_PROJ_TYPE_STANDARD) */
The memory map of that location across the BOOT / STACK / APP looks like this. The 0x2000000 is basically just at 512K so this is past flash area (unless they map it differently but the .ramvectors sounds like ram…)
BOOT:
.ramvectors 0x20000000 0xc0
0x20000000 __cy_region_start_ram = .
*(.ramvectors)
.ramvectors 0x20000000 0xc0 .\CortexM0\ARM_GCC_541\Debug\Cm0Start.o
0x20000000 CyRamVectors
.btldr_run 0x200000c0 0x4
*(.bootloaderruntype)
.bootloaderruntype
0x200000c0 0x4 .\CortexM0\ARM_GCC_541\Debug\Cm0Start.o
0x200000c0 cyBtldrRunType
.noinit
*(.noinit)
.data 0x200000c8 0xa0 load address 0x00001628
0x200000c8 __cy_region_start_data = .
STACK:
*(.ramvectors)
.ramvectors 0x20000000 0xc0 .\CortexM0\ARM_GCC_541\Debug\Cm0Start.o
0x20000000 CyRamVectors
.btldr_run 0x200000c0 0x4
*(.bootloaderruntype)
.bootloaderruntype
0x200000c0 0x4 .\CortexM0\ARM_GCC_541\Debug\Cm0Start.o
0x200000c0 cyBtldrRunType
.noinit
*(.noinit)
.data 0x200000c8 0x640 load address 0x0001fb98
0x200000c8 __cy_region_start_data = .
APPL:
.ramvectors 0x20000000 0xc0
0x20000000 __cy_region_start_ram = .
*(.ramvectors)
.ramvectors 0x20000000 0xc0 .\CortexM0\ARM_GCC_541\Debug\Cm0Start.o
0x20000000 CyRamVectors
.btldr_run 0x200000c0 0x4
*(.bootloaderruntype)
.bootloaderruntype
0x200000c0 0x4 .\CortexM0\ARM_GCC_541\Debug\Cm0Start.o
0x200000c0 cyBtldrRunType
0x00001938 BOOTLOADER_RAM_SIZE = (Bootloader___bss_end__ - 0x20000000)
.bootloader_data
0x200000c8 0x1938
0x20001a00 . = (. + BOOTLOADER_RAM_SIZE)
*fill* 0x200000c8 0x1938
.noinit 0x20001a00 0x1034
*(.noinit)
.noinit 0x20001a00 0x4 .\CortexM0\ARM_GCC_541\Debug\Cm0Start.o
*fill* 0x20001a04 0x4
.noinit 0x20001a08 0x102c .\CortexM0\ARM_GCC_541\Debug\FW-TRACKER.a(fwGS.o)
0x20001a08 cyBle_stackMemoryRam
.data 0x20002a38 0x920 load address 0x0002b408
0x20002a38 __cy_region_start_data = .
Only oddity I see here is the bootloader ram size stuff before the load address but maybe that is normal.
Hi All,
I have come across a sample program from the Cypress Website that focuses on the BLE Battery Level. However, this program only allows PSoC 6 BLE, whereas I need to use PSoC 4 BLE for it. Here is a link to the website:
http://www.cypress.com/documentation/code-examples/ce215119-ble-battery-level-psoc-6-ble
When I downloaded the program and tried to change the 'Device Selector' from the original device to whatever PSoC programming board I was using (CY8C4247LQI-BL483), I got an error message saying that the new device I have chosen is not compatible with the one that was already there.
Is there any way to fix this, or can I not use PSoC 4 BLE for this program?
Thanks,
Andrew Collins
Show LessHello,
I'm using BLE 4.2 in a project with GAP security level "Unauthenticated pairing with encryption" since I have no I/O capabilities currently available. I was wondering if there's any standard way to implement authentication for such devices? Is dedicating a GATT characteristic to exchange custom authentication keys, a good idea?
Any suggestions are much appreciated.
Thanks
Show LessHello once again everybody!
Today I am trying to program a PSOC CY8KIT-049_42 using another identical device.
I am following the method shown here: Using the CY8CKIT-049 to Program Another PSoC® 4 - KBA93541
yet there is a major problem!
When I try to build the project a plethora of errors springs up! They mainly seem to be complaining about the connections of a component in a cysh file.
When I navigate to the error it is apparent that the component has resized / been moved or something and when I move the block down so that clk aligns with clk, sda with sda etc I am left with some interrupt blocks connected together which throw their own error. I've tried connecting the line to the nearby available pins and none of them work.
My next move was to try 'updating' components to the original versions and this did not seem to work.
Deleted everything and downloaded again, and now the project compiles (With a tonne of warnins about the clock being outside its acceptable tolerance).
HOWEVER when I try to bootload (from the arm GCC 541 folder, the 471 folder is empty) I get
03:29:53 PM - Selected device: USB Serial Device (COM9) - UART
Generic Serial Port
03:31:25 PM - program Started
03:31:25 PM - The flash row is not valid for the selected array.
03:31:25 PM - program failed in 50 ms.
Does anyone know what I need to do to get this project working or better still,
DOES ANYONE JUST HAVE THE DAMN HEX FILE?
Hello,
I change LED blink period by using OTA external memory, I perform it with CYBLE-212006 module on custom PCB.
After hardware upgrade is completed through CySmart, the device isn't reset automactically and both LED and Bootlading_LED turn off.
I run in debug mode and verify Bootloader Host sent the "BootloaderEmulator_COMMAND_EXIT" command.
The code I use is below,F-RAM on custom PCB is MB85RC1MT and I2C address is same as the example.
VIO1 is connecting to F-RAM's VDD, I turn on VIO1 after enable the bootloader service.
Please help me to solve this problem.
Thanks.
Show LessHi,
I need to publish my public address in the device name so that I can connect to my IOS app .
I'm currently able to publish the address as follows: "00:05054885?" and it able connect to the app
this the code i use:
cyBle_deviceAddress.bdAddr[0] = (uint8)bdAddrLoc;
cyBle_deviceAddress.bdAddr[1] = (uint8)(bdAddrLoc >> 8u);
cyBle_deviceAddress.bdAddr[2] = (uint8)(bdAddrLoc >> 16u);
char DeviceName[16] = "NM2 ";
// convert the values to ascii and store in the device name field.
DeviceName[4] = ((cyBle_deviceAddress.bdAddr[5] & 0xF0) >> 4) + 48 ;
DeviceName[5] = (cyBle_deviceAddress.bdAddr[5] & 0x0F) + 48 ;
DeviceName[6] = ((cyBle_deviceAddress.bdAddr[4] & 0xF0) >> 4) + 48 ;
DeviceName[7] = (cyBle_deviceAddress.bdAddr[4] & 0x0F) + 48 ;
DeviceName[8] = ((cyBle_deviceAddress.bdAddr[3] & 0xF0) >> 4) + 48 ;
DeviceName[9] = (cyBle_deviceAddress.bdAddr[3] & 0x0F) + 48 ;
DeviceName[10] = ((cyBle_deviceAddress.bdAddr[2] & 0xF0) >> 4) + 48 ;
DeviceName[11] = (cyBle_deviceAddress.bdAddr[2] & 0x0F) + 48 ;
DeviceName[12] = ((cyBle_deviceAddress.bdAddr[1] & 0xF0) >> 4) + 48 ;
DeviceName[13] = (cyBle_deviceAddress.bdAddr[1] & 0x0F) + 48 ;
DeviceName[14] = ((cyBle_deviceAddress.bdAddr[0] & 0xF0) >> 4) + 48 ;
DeviceName[15] = (cyBle_deviceAddress.bdAddr[0] & 0x0F) + 48 ;
CyBle_GapSetLocalName(DeviceName);
}
But I have to translate the symbols ( : , ? ) into letters, I used the following code to get the public address in the correct format and got this : "00A05054885F" but now it does not connect to the application
char inline ReadDataName(uint8_t num){
char ch = num + 48;
if(ch > 57){
ch += 7;
}
return ch;
}
---------------------------------------------------------------------------------------------------------------------------
cyBle_deviceAddress.bdAddr[0] = (uint8)bdAddrLoc;
cyBle_deviceAddress.bdAddr[1] = (uint8)(bdAddrLoc >> 8u);
cyBle_deviceAddress.bdAddr[2] = (uint8)(bdAddrLoc >> 16u);
char DeviceName[16] = "NM2 ";
// convert the values to ascii and store in the device name field.
DeviceName[4] = ReadDataName((cyBle_deviceAddress.bdAddr[5] & 0xF0) >> 4) ;
DeviceName[5] = ReadDataName(cyBle_deviceAddress.bdAddr[5] & 0x0F) ;
DeviceName[6] = ReadDataName((cyBle_deviceAddress.bdAddr[4] & 0xF0) >> 4) ;
DeviceName[7] = ReadDataName(cyBle_deviceAddress.bdAddr[4] & 0x0F) ;
DeviceName[8] = ReadDataName((cyBle_deviceAddress.bdAddr[3] & 0xF0) >> 4) ;
DeviceName[9] = ReadDataName(cyBle_deviceAddress.bdAddr[3] & 0x0F) ;
DeviceName[10] = ReadDataName((cyBle_deviceAddress.bdAddr[2] & 0xF0) >> 4) ;
DeviceName[11] = ReadDataName(cyBle_deviceAddress.bdAddr[2] & 0x0F) ;
DeviceName[12] = ReadDataName((cyBle_deviceAddress.bdAddr[1] & 0xF0) >> 4) ;
DeviceName[13] = ReadDataName(cyBle_deviceAddress.bdAddr[1] & 0x0F) ;
DeviceName[14] = ReadDataName((cyBle_deviceAddress.bdAddr[0] & 0xF0) >> 4) ;
DeviceName[15] = ReadDataName(cyBle_deviceAddress.bdAddr[0] & 0x0F) ;
CyBle_GapSetLocalName(DeviceName);
}
Does anyone have an idea what could be the source of the problem?
Thanks
Hello PSoC Community,
First off, thank you for any help the community is able to provide.
We're looking to create a basic wireless tilt sensor system. Essentially we have a detector unit and an indicator unit. The detector unit is composed of a CYBLE-012011-00, on/off tilt sensor, and coin cell battery. This unit detects a tilt on a GPIO sensor and transmits the position to the indicator. The indicator unit is composed of a CYBLE-202007, an LED, and a hardwired power supply. This unit receives tilt information from the detector and turns on an LED corresponding to the tilt position.
We've developed the core of the application, that is to say the units automatically boot, establish communication, and transmit/indicate position. However we are having trouble decreasing the power usage, in particular on the detector unit. I’ve based most of our application on the Cypress 100 Projects in 100 Days, specifically project #47. This project automatically connects two modules and passes basic data along while switching one of the modules into low power mode. We’ve stripped out the ADC portion and are just using a GPIO. The code for this project has the data transmission set at a very high speed, on the order of milliseconds.
I am having trouble however trying to save power and slow down the amount of data sent between the two devices. The code for our the detector uses the same power scheme as listed in the ‘accelerometer’ code from project #47. It looks like they have the power savings setup, but I can’t seem to figure out how to save more power. Based on the code I’ve found, the module should go to sleep and wake from the BLE_bless_isr, which is governed I think by the connection interval. I’m assuming if I can slow down the connection interval (or similar timing parameter) then I can have the module remain in sleep longer. I’ve tried requesting connection parameters from the tailgate using the code illustrated in the power savings documentation, however it seems the central/cab is going to ignore this. In all the examples I've found the central manages this connection interval but requires input from say the Cypress Dongle or the iPhone dictates the position
I was wondering if anyone would be able to provide some direction? Am I on the right track with the power savings? And if so, how can I slow down the connection interval? I can’t seem to find specific code or the right search terms to find this.
Thank you for your help,
Alex
Show LessHi,
I apologize for this absolute beginner topic, but in the last days of my research I get more and more confused 😉
I have to do a (little) project with the PSoC4-BLE. Up to now I am familiar with (some) of the PSoC-Creator examples (and a lot of helpful videos) and I am able to receive data via BLE within the CySmart emulation tool. For example I can change a value in the emulation tool by using the CapSense on the development board.
But how do I exchange data with any self-made windows program??? I just need a very simple GUI just to see if a capsens has been touched or to send a value for changing the onboard LED color…
I didn’t find any Python, C or even Java library to include so that I can use the windows API. Can I program such a GUI with the WICED SDK? Or do you know any useful IDE that provides the possibility to communicate with the CY5677 USB Dongle. (A LabView-VI would help as well, but I didn’t find that at all.)
It would be perfect if I could get some code to start learning how to create a windows based communication to PSoC 4 via BLE.
I just get stuck in my research about the possibilities of the PSoC BLE…
Thank you very much,
Jens
Show Less