You are here

Update BLE values while connected | Cypress Semiconductor

Update BLE values while connected

Summary: 2 Replies, Latest post by pmartinez_1655886 on 12 Oct 2016 11:53 PM PDT
Verified Answers: 0
Last post
Log in to post new comments.
pmartinez_1655886's picture
16 posts

I am not sure about how this works. I have never tried to run a program with BLE before I think.

I have a program which I have to update. I modify some things (nothing related with ble behaviour). things like: now this sketch controls 5 motors and it has to control 10, not i has 2 force sensors and it has to control 3... This kind of stuff. BLE file is almost equal.  I just add notifications for new variables.

I have a problem when I try to run the program in my pioneer development board (ble version). It hangs and gives an error:

"Debugger exited unexpectedly during run. Encountered error (Target disconnected See output window for more information.)"

Clicking over Show more details" gives:

"There was an unhandled error during the debug session. This has forced the debugger to shutdown. Try again."

I am testing it without anything connected. Just to see if it works. So maybe this is the problem and I need to connect everything to make it working.

As soon as main function starts, InitializeSystem is called:


void InitializeSystem(void)
    CyGlobalIntEnable;                //Activate mask of interrupts
    CyBle_Start(CustomEventHandler);  //Init BLE and set event handler function
    ADC_IRQ_StartEx(ADC_ISR);         //Interrupt for reading ADC
    /*Set vector for WDT interrupt to desired function. This function will be in charge of updating values to be sent by BLE*/
    CyIntSetVector(WATCHDOG_INT_VEC_NUM, &WDT_INT_Handler); 
    OPA_Start();                     //Start OPA
    ADC_Start();                     //Start ADC


I have read on other post about in the latest version of BLE watchdog is not used. It is used something called BLESS??. Maybe this is the problem. The current version of my software was built with an older version of PSOC and components. And now I updated the whole project to the latest one.

My problem is that if I set watchdog as active (in Initialize function), that function never ends. And in case it does, something goes wrong and it crashes.

I would want the code to reach this line in main():


for(;;) {       



I am developing a pcb to keep all my stuff there but unitl I have it printed, I have to test my code in this board.

SmartPSoC's picture
Cypress Employee
68 posts

Are you facing the issue only while debugging?  WDT  will reset the device when the debugger stops code execution. This could be the reason debugger is stopping unexpectedly.

pmartinez_1655886's picture
16 posts

I have just tried debugging. And maybe it happens when I have a break point activated so it could be the reason as you said. Should I comment it while testing then?

Log in to post new comments.