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

Table of err_codes

A quick one, where do I find a list of the err_codes? I have had a look in the documentation and I was expecting to find a table of them, but I couldn't locate one.

Thanks - RJH

Parents
  • As RK says there is no list. The various error codes are defined in the files they are related to. E.g. GAP errors are defined in nrf_gap.h, UART errors in nrf_uart.h, etc. This can can make it difficult to find the documentation on a particular error if you just have a number like you do. What you can do is to go to the declaration of the function that is returning an error. Above the declaration there is usually a list of errors that might be returned form the function. Then search for these errors in your project and you should be able to find its definition with a comment.

    Error 0x0002 is defined in nrf_error.h:

    #define NRF_ERROR_SOFTDEVICE_NOT_ENABLED      (NRF_ERROR_BASE_NUM + 2)  ///< SoftDevice has not been enabled
    
Reply
  • As RK says there is no list. The various error codes are defined in the files they are related to. E.g. GAP errors are defined in nrf_gap.h, UART errors in nrf_uart.h, etc. This can can make it difficult to find the documentation on a particular error if you just have a number like you do. What you can do is to go to the declaration of the function that is returning an error. Above the declaration there is usually a list of errors that might be returned form the function. Then search for these errors in your project and you should be able to find its definition with a comment.

    Error 0x0002 is defined in nrf_error.h:

    #define NRF_ERROR_SOFTDEVICE_NOT_ENABLED      (NRF_ERROR_BASE_NUM + 2)  ///< SoftDevice has not been enabled
    
Children
Related