- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
According to the documentation for the block, the CYBLE_EVT_GAPP_ADVERTISEMENT_START_STOP event should be called when advertisement starts or stops. But if I run my code with the debugger on my CY8CKIT-042-BLE board, a breakpoint in the event is triggered over and over, with almost no time in between. Can anyone please tell me why this is happening ?
I'm using the attached code on a PRoC BLE module. At this point, there isn't much of my code left. The only thing on my TopDesign schematic is the BLE block (v2.00).
Solved! Go to Solution.
- Labels:
-
BLE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I did a quick test on your code and I can see the issue. But If you remove the breakpoint when it hits -> Run -> And again place a breakpoint, then it does not hit it again.
So I feel that the EVT is being called only once, but due to some debugger aberration you see the multiple hits on same breakpoint.
You can test it by placing a LED toggle code inside this event and observe how much toggling occurs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I did a quick test on your code and I can see the issue. But If you remove the breakpoint when it hits -> Run -> And again place a breakpoint, then it does not hit it again.
So I feel that the EVT is being called only once, but due to some debugger aberration you see the multiple hits on same breakpoint.
You can test it by placing a LED toggle code inside this event and observe how much toggling occurs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Roit,
Thanks for your response. It looks like this is correct.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
With enabled interrupts debugging can turn out to be complicated. The situation is:
- You stop at a breakpoint and watch debugging results
- During that time an interrupt occurs, but is not served because the processor is halted
- At resume, the pending interrupt becomes active and gets served.
- The return point for the interrupt handler is the instruction where you set the breakpoint to.
- The program breaks again at the same point, sometimes looking as if nothing has happened.
Remember: A breakpoint stops the CPU execution, but does not stop any hardware from running as there are counters, timers, radios, DMA etc.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your insight Bob. That makes a lot of sense. I guess for some of this stuff I need to go back to debugging with LEDs 😉
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A first solution might be to disable interrupts when you reached a brekpoint, there is a button for this function.
You may even use the USB-UART connection which is supported by the KitProg module of your PRoC BLE. Only the right io-pins have to be connected to an UART component. Shows some more than an LED.
Bob