Ozone conditional breakpoints cause nrf52840 to hardfault after softdevice starts

I'm using Ozone 3.38, and SES 5.60a.  I'm using the usbd_ble_uart example in nrf5SDK v16.0.0.  I have other projects in production using this SDK version, but am using this example for simplicity.

When I set up conditional breakpoints on code before the softdevice is started, I can get them to work as expected.  But when the conditional breakpoint is after the start of the softdevice, I get a hardfault as soon as execution hits this line, regardless of whether the condition evaluates to true or false. If I get rid of the condition, a normal breakpoint is successful.

I am aware of the limitation that once you hit a breakpoint after the SD has started, restarting execution will fail.  Is this same limitation causing this conditional breakpoint issue?

  • Hello,

    Afaik in Ozone, when a conditional breakpoint is set, the debugger evaluates the condition every time the program execution reaches the breakpoint location. I don't see any other way than use if statements in code for temporary debugging.

    Kenneth

  • Hi Kenneth,

    I have had varying degrees of success, but the flakiness seems to come and go. Setting the breakpoint type to be software, rather than any, or hardware, has seemed to have had more success, but I still get hardfaults occasionally. Also, some of the conditions I tried out were problematic, even though they are valid C.  For instance array[0] == 'A'  doesn't seem to work, but array[0] == 0x41 is acceptable.

    Is there documentation of what constitutes valid syntax for the condition expressions? 

  • Hi,

    You would need to check with Segger. But if I am right that conditional breakpoint actually means that the debugger do halt the code execution for a short period to evaluate the condition, then that may brake the realtime requirements by the softdevice. So I suggest to add code such as an if statement and instead set a normal breakpoint within the if statement.

    Kenneth

Related