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

Debug problem on CDC ACM example

Hi everyone,

I'm using ses IDE to debug via J-link on nRF52840 DK.

I'm debbuging CDC ACM example (I haven't changed it) but  when I debug:   ret = app_usbd_cdc_acm_write(&m_app_cdc_acm, m_tx_buffer, size) I have that ret is not NRF_SUCCESS,

Why?

BR

  • Hello,

    I'm debbuging CDC ACM example (I haven't changed it) but  when I debug:   ret = app_usbd_cdc_acm_write(&m_app_cdc_acm, m_tx_buffer, size) I have that ret is not NRF_SUCCESS,

    Could you make sure that you have DEBUG defined in your preprocessor defines, like shown in the included image?
    This will make a more complete error message be printed to your logger output when an APP_ERROR_CHECK is passed a non-NRF_SUCCESS argument.
      
    Please do this, and let me know what is outputted to your log when the error occurs.

    Best regards,
    Karl

  • Yes, I have DEBUG defined in my preprocessor defines.

    How can I view the logger output?

    Sorry but I'm new at programming with SES

    BR

  • Hello,

    alexlöddeköpinge said:
    Yes, I have DEBUG defined in my preprocessor defines.

    Great!

    alexlöddeköpinge said:
    How can I view the logger output?

    The USB CDC ACM example uses the UART logger backend by default.
    Are you familiar with using serial terminals?
    If you open a serial terminal, like PuTTY or Termite, and open the port to which the device is connected, then you should see outputs by the device when it is running. It will print some messages as the application initializing, and then again if it encounters some error or receives data through the USB.
    Please let me know if you are not able to see the messages outputted by the device to the logger.

    alexlöddeköpinge said:
    Sorry but I'm new at programming with SES

    Welcome! No need to apologize, we've all been new to it at some point! :) 

    Please do not hesitate to ask if you should encounter any issues or questions!

    Best regards,
    Karl

  • If you open a serial terminal, like PuTTY or Termite, and open the port to which the device is connected, then you should see outputs by the device when it is running. It will print some messages as the application initializing, and then again if it encounters some error or receives data through the USB.

    Yes, now I see outputs on Termite. The problem is that there is not any error message (I see only info as the application initializing). The program works fine as ret=NRF_SUCCESS 

    The only problem is during debugging, when I debug seems that ret is not NRF_SUCCESS.

    It's like there's a difference beetween debug and when the program is flashed in the nRF52840.

    Thanks

    BR

  • alexlöddeköpinge said:
    Yes, now I see outputs on Termite. The problem is that there is not any error message (I see only info as the application initializing). The program works fine as ret=NRF_SUCCESS 

    Great!

    What is the error message generated when you are using the debugger?

    Please be advised that when you are using the debugger, and halting the program you are actually halting the CPU. This might cause certain timing-critical processes to fail ( such as the SoftDevice BLE communication ), as a result of the debugging.

    Best regards,
    Karl

Related