PSoC™ 4 Forum Discussions
Have a cyble-222014 unit, I want to flash during the production. And i need to write diffrent serial number and settings into each device, can i do this with the psoc programmer? And how.
Br
Esben
Show Less
Hi all,
on a CYBLE-222014-01, we've implemented an application based on the 'Mesh Flood' example in PSoC Creator 4.4. We've recently received reports from a few customers about devices becoming 'invisible' after some time. We've examined the issue and concluded that the BLE stack (v3.65, as the affected application is ~2 years old as of today) sometimes won't restart advertising after disconnecting from our mobile app. We've managed to attach a debugger (CY8CKIT-42-BLE) to one such running target and found that GenericEventHandler() kept being called with its event parameter constantly set to 0x30303001u (henceforth, the 'magic number'), effectively deadlocking the BLE stack.
Side note: It seems that this behavior is observable only after accessing a series of certain (custom) characteristics, though; otherwise the application works fine.
TL;DR: The magic number seems to originate from the closed-source part of the stack, AFAICT.
The long story:
I've tried to backtrace the event parameter and found that GenericEventHandler() is passed as a callback function pointer to CyBle_Start(), where it is then assigned to the function pointer CyBle_ApplCallback (of type CYBLE_CALLBACK_T). The latter is always and exclusively being called in conjunction with enumerators of either CYBLE_EVENT_T or CYBLE_EVT_T for its corresponding parameter eventCode, with the largest theoretically possible value therefore being CYBLE_DEBUG_EVT_BLESS_INT, i.e. 0xE000u -- except for one location. This one location lies at the end of CyBle_EventHandler() (BLE_eventHandler.c @ l.2240), where it can be called with the function's parameter of the same name, depending on cyBle_eventHandlerFlag. Provided that eventCode is set to some value not handled by the switch statement (as would be the case with our magic number), the function effectively does nothing except definitely calling CyBle_ApplCallback() with its parameters simply passed through (the default label only contains a break statement, thus leaving cyBle_eventHandlerFlag's CYBLE_CALLBACK bit, set at the beginning of the function, unaffected).
This is as far as I've been able to investigate, as I cannot backtrace where CyBle_EventHandler() is being called. According to its description, it "handles the events from the BLE stack," and because our application calls neither CyBle_EventHandler() nor GenericEventHandler() directly, I can only conclude it must be called from some obscure layer of the BLE stack and that the magic number has to be generated and assigned from there as well.
I herewidth kindly ask you to investigate whether there might be a bug in the underlying implementation. Or, is this a known issue, and if so, will it be addressed in an upcoming version of the stack? In any case, please let me know if you need additional information.
In the meantime, we've set the watchdog timer to trigger a reset whenever advertising has not been restarted after a certain period of time, which appears to be an effective but 'dirty' work-around. Also, we've upgraded the BLE stack to the latest v3.66 and compiled using the latest ARM toolchain comprising GCC v10.3 instead of v5.4, which is the one provided by Cypress. ATM, we're testing whether applying either or both of these measures resolves our issue -- I'm going to post updates here.
Any help would be very much appreciated. Thanks in advance and best regards,
Dennis
Show LessHave a board with a cyble-222014-01 device
I want a simple example in how to write to user flash area and read again, i have tried foloowing code:
const uint8_t row[CY_FLASH_SIZEOF_ROW] CY_ALIGN(CY_FLASH_SIZEOF_ROW) = {0};
uint8_t data[CY_FLASH_SIZEOF_ROW];
int rowNum;
// calculate which row in the flash that the "row" array resides
rowNum = ((int)row - CY_FLASH_BASE) / CY_FLASH_SIZEOF_ROW;
memcpy(data,row,(int)CY_FLASH_SIZEOF_ROW);
data[1]=123;
uint32 rval = CySysFlashWriteRow(rowNum,data);
if(rval == CY_SYS_FLASH_SUCCESS )
{
uint8 ok = 1;
}
my problem here is that rval is not 0 but 4 = CY_SYS_FLASH_INVALID_ADDR, when i try to write.
Anyone can help here
Show LessHello everyone!
I am using Cy8ckit-145-40xx and I could not connect Launch Tuner. I am working on example project which is CAPSENSE SLIDER WITH GESTURES.
How can I connect to Launch Tuner? Please help me. I am adding all the files. You can find them below.
Regards,
Marcus.
Show LessHi,
I just trying to port my lora solution from stm8 to ASK6501 based module, and can't find any info about internall pin mapping beatween MCU CY8C414 and lora SX1262 chip and external ASR6501 pins.
What i found out is
- SX1262 is connected to SPI bus (it's easy cause there is only one available
- SX1262 DIO pins are conected to MCU, but what port/pins ?
- external ASR6501 pins from 19-22 are mapped to P4.0 to 4.3
Any idea how can I found more info.
Thank you in advance.
Kris
Show Less
Hi, I am wondering if I can use the Miniprog4 (CY8CKIT-005) to update the SFlash on the PSoC4 BLE mcu (CYBLE-014008-00). We currently use Miniprog3 but there are some issues with this and would like to try Miniprog4 to see if it is better for us.
We currently use PSoC4-BLE-SFLASH-Update.exe but only mentions minprog3 and I can't find any docs any where regarding its use with Miniprog4.
Don't want to shell out £90 to find it doesn't work. Any help / advice / pointers appreciated.
cheers, Colin
Show Lesshi everyone! now I meet a problem, I want to learn the CY8C4248LQI-BL583 low energy mode,so I use my CY8CKIT-042-BLE-A to test, and I find a program in CYPRESS web ,after I programed it to the kit ,I find my computer can not recognizing the chip now,who can help me.I guess the reason is that I used the P0.7 pin ,this is a SWDCLK pin . So ,how to solve it ,thanks !!!!!!
Show Less
Hello,
I am using the CY8c4247LQI-BL473 IC for my project. My requirement is to create a custom PCB using the IC and communicate with a mobile application over BLE. I have written the code and tested with a PSOC 4 pioneer kit, and it is working fine. But when i use my custom PCB, nothing is being advertised.
I have currently not used any external oscillators. Is an external oscillator mandatory for the BLE subsystem to work?. Also I am using a wired antenna of length approximately 7-8 cm. Will antenna tuning be required even for the advertisement to be read by the CySmart app?.
Thanks in advance.
Manu
Show LessHi,
How to know which enum element is behind a value ?
When I read a characteristic value, I can see the BLE stack send an event code 57 (decimal) but I don't know what is mean.
This code is send on my EventHandler function.
Thank you
We are evaluating various bluetooth hardware options for a high volume project. Our requirements for our bluetooth solution are the following:
- Supports role as BLE central device
- Supports mode 1 level 4 security
- Can set I/O capabilities to either "KeyboardOnly" or "KeyboardDisplay"
- implements GATT client that supports
- Primary Service Discovery
- Characteristic Discovery
- Characteristic Descriptor
Discovery - Characteristic Value Notification
- Write Without Response
I understand that the CY5677 BLE can be programmed in PSOC creator using the BLE component which implements a BT 5.0 stack. However documentation does not go into detail which BT 5.0 optional features the components supports. Even though it supports a 5.0 stack, the requirements listed are considered non-mandatory for BT 5.0 qualification.
Therefore my question is if the above features are supported by Cypress' BLE stack , and also, where can I find this information if it is documented
Show Less