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

Error codes

Is there an error code range reserved for user application errors?

I wish to return application specific errors without defining a new error type, to maintain a unified approach to error handling.

Parents Reply
  • Hello,

    I was searching the DevZone for the same question. And I don't think that @bjorn-spockeli's answer is still valid. In sdk_errors.h there for 14.2 SDK there is :

       #define NRF_ERROR_SDK_ERROR_BASE (NRF_ERROR_BASE_NUM + 0x8000) /**< Base value defined for SDK module identifiers. */

    Since NRF_ERROR_BASE_NUM is 0, this means that the 0x8000 can no longer be used as a base. Looking further into sdk_errors.h it seems that the application can start errors codes from 0xB000 (that is NRF_ERROR_IOT_ERR_BASE_STOP+1).

    Anyway, this just shows that the SDK should have some NRF_USER_APP_ERR_BASE #define somewhere.

Children
Related