You are here

Update BLE values while connected | Cypress Semiconductor

Update BLE values while connected

Summary: 4 Replies, Latest post by Jenson Yan on 08 Nov 2016 09:42 PM PST
Verified Answers: 2
Last post
Log in to post new comments.
pmartinez_1655886's picture
User
20 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:

[code]

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
    isr_button_StartEx(MyISR);
    /*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); 
    InitializeWatchdog();
    OPA_Start();                     //Start OPA
    OPA_Enable();
    ADC_Start();                     //Start ADC
    ADC_StartConvert();
    //CyDelay(1000);
}

[/code]

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():

[code]

for(;;) {       
        CyBle_ProcessEvents();

        ...

[/code]

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
70 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
User
20 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?

SmartPSoC's picture
Cypress Employee
70 posts

Please disable WDT in firmware and try to debug.

Jenson Yan's picture
Cypress Employee
1 post

Please make sure the settings of .cydwr file:  .cydwr ->System: Debug select: SWD

Log in to post new comments.