PSoC™ 4 Forum Discussions
Hi,
I would first like to state that I am a beginner first (in programming, and microcontroller in general, only dealt with Arduino).
I am trying to use the Alert Notification Service (ANS) to send a Simple Text Alert (showing text, "Alert Received" or any other text) to my Android phone. However, I have looked around and couldn't find an example that does such a thing. I'm using the PSoC BLE as a GATT Server and GAP Peripheral, and my Android phone with the CySmart installed and my GATT Client and GAP Central.
Can anyone point me to the right direction?
Thanks
Show LessI'm looking to share hardware pins between Bootloader/Bootloadable firmware.
I was able to get the BLE_OTA_FixedStack_Bootloader example project working well on my target hardware, PRoC 4 family.
Currently I'm creating my own Bootloader/Bootloadable project from scratch to make sure I understand the example project.
I would like to share the digital output pins that are defined in the Bootloader project with the Bootloadable project, as was done in the BLE_OTA_FixedStack_Bootloader example. I defined the pin functions as "extern" in the Bootloadable project, but I get an M0120 build error, undefined reference.
For example, LED_G is a digital output defined in the Top Design of the Bootloader project.
In a Bootloadable header file
extern void LED_G_Write(uint8 value);
In Bootloadable main.c
LED_G_Write(LED_ON);
Then I get the undefined reference build error.
I feel like there's some extra magic at play to access the digital output of the Bootloader project, but I haven't found it yet.
Any suggestions would be appreciated.
Show LessHello,
I would like to use "Connectable directed" advertising packet in PSoC 4 BLE device, however I cannot find GAP setting tab in Component GUI when pulling down "Advertising type" function.
How can I chose the type on GUI?
Best regards,
Show LessI 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 Less