This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

SEGGER debug "no code for breakpoint"

I can see that other people have run into the "no code for breakpoint" problem when attempting to use the SEGGER debugger.  I have read the earlier posts. I have not been able to fix my problem using the suggestions I have read.

My setup is a PCA10040 board, nRF5 SDK 15.3.0, and SEGGER Embedded Studio v.4.52.

I am unable to set a breakpoint on ANY line in the following function.

void thermistor_read(thermistor_t * thermistor)
{
    nrf_gpio_pin_write(thermistor->gpio_power, 1);
    nrf_delay_us(25);
    APP_ERROR_CHECK( nrf_drv_saadc_sample_convert(thermistor->channel,
                                                  &thermistor->data) );
    nrf_gpio_pin_write(thermistor->gpio_power, 0);
    nrf_delay_us(25);
}

I get a dialog box from SES stating "no code for breakpoint" when I try to run in Debug mode. 

However: I tried setting a breakpoint on various lines in another function elsewhere in the same .c file, and it always works perfectly.  Thinking that the problem might have something to do with the specific function(s) happen to call in thermistor_read(), I tried setting a breakpoint on a call to nrf_delay_us() in another function. It worked fine.

Please help me to understand how this is happening.  I can see the assembly code pop up in the left panel of SES when it claims that I have no code associated with any line of my function.  There's plenty of code there.

Thanks for your advice.

Parents
  • Hi,

    I think it is because of code optimization. set optimization level to 0 and try. 

  • Hello, Surya,

    Thanks for your reply.  I know this isn't a SEGGER forum, and perhaps you don't use SES.  Our team switched to SES because Nordic now recommends it, and the debugger (when it works) is helpful.

    I'm not quite sure where I should be looking to make the code optimization level change that you suggested, but here's what I found.  While my .c file of interest was open, I navigated to Project > Options > Public Configurations > Debug > Code Generation > Optimization Level.  The setting was None: I changed it to zero.

    On a Build and Debug, I was still unable to set a breakpoint within the function shown above.

    Am I looking in the right place?  Do you have any other suggestions?

Reply
  • Hello, Surya,

    Thanks for your reply.  I know this isn't a SEGGER forum, and perhaps you don't use SES.  Our team switched to SES because Nordic now recommends it, and the debugger (when it works) is helpful.

    I'm not quite sure where I should be looking to make the code optimization level change that you suggested, but here's what I found.  While my .c file of interest was open, I navigated to Project > Options > Public Configurations > Debug > Code Generation > Optimization Level.  The setting was None: I changed it to zero.

    On a Build and Debug, I was still unable to set a breakpoint within the function shown above.

    Am I looking in the right place?  Do you have any other suggestions?

Children
Related