Consolidate error types (#7916)

* Consolidate error types

#### Problem

CHIP currently has `CHIP_ERROR`, `INET_ERROR`, `BLE_ERROR`,
`ASN1_ERROR`, `System::Error`. Since they're all integers underneath,
there is no type checking, and existing code routinely treats them
as interchangeable. There is also existing code that uses `int` and
`int32_t`.  Each also has a `…_NO_ERROR` code which is independently
configurable, but existing code assumes they are equal, and there is
exising code that assumes the C convention that the value is 0.

#### Change overview

Fixes #7688 Unify chip errors

This change is largely a mechanical replacement of type and some error
code names, with a few cleanups of weak typing.

Consolidated error types to one, `CHIP_ERROR`.

Removed configurability of `CHIP_NO_ERROR`; it must be 0.

Added `CHIP_ERROR_FORMAT` to replace hardcoded `PRI…32` in `printf()`
format strings.

Added `CHIP_ERROR_SENTINEL` to replace the use of `CHIP_ERROR_MAX` as a
sentinel.

Renamed or consolidated the following errors, which have the same
meaning. Merely similar codes are left alone. This change contains
compatibility defintitions to avoid breaking PRs in flight, which
will be removed in a followup.

| before                                 | after                               |
|:---------------------------------------|:------------------------------------|
| ASN1_ERROR                             | CHIP_ERROR                          |
| ASN1_NO_ERROR                          | CHIP_NO_ERROR                       |
| BLE_ERROR                              | CHIP_ERROR                          |
| BLE_NO_ERROR                           | CHIP_NO_ERROR                       |
| BLE_ERROR_BAD_ARGS                     | CHIP_ERROR_INVALID_ARGUMENT         |
| BLE_ERROR_INCORRECT_STATE              | CHIP_ERROR_INCORRECT_STATE          |
| BLE_ERROR_MESSAGE_INCOMPLETE           | CHIP_ERROR_MESSAGE_INCOMPLETE       |
| BLE_ERROR_NOT_IMPLEMENTED              | CHIP_ERROR_NOT_IMPLEMENTED          |
| BLE_ERROR_NO_ENDPOINTS                 | CHIP_ERROR_ENDPOINT_POOL_FULL       |
| BLE_ERROR_NO_MEMORY                    | CHIP_ERROR_NO_MEMORY                |
| BLE_ERROR_OUTBOUND_MESSAGE_TOO_BIG     | CHIP_ERROR_OUTBOUND_MESSAGE_TOO_BIG |
| BLE_ERROR_RECEIVED_MESSAGE_TOO_BIG     | CHIP_ERROR_INBOUND_MESSAGE_TOO_BIG  |
| CHIP_SYSTEM_NO_ERROR                   | CHIP_NO_ERROR                       |
| CHIP_SYSTEM_ERROR_ACCESS_DENIED        | CHIP_ERROR_ACCESS_DENIED            |
| CHIP_SYSTEM_ERROR_BAD_ARGS             | CHIP_ERROR_INVALID_ARGUMENT         |
| CHIP_SYSTEM_ERROR_NOT_SUPPORTED        | CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE |
| CHIP_SYSTEM_ERROR_NO_MEMORY            | CHIP_ERROR_NO_MEMORY                |
| CHIP_SYSTEM_ERROR_REAL_TIME_NOT_SYNCED | CHIP_ERROR_REAL_TIME_NOT_SYNCED     |
| CHIP_SYSTEM_ERROR_UNEXPECTED_EVENT     | CHIP_ERROR_UNEXPECTED_EVENT         |
| CHIP_SYSTEM_ERROR_UNEXPECTED_STATE     | CHIP_ERROR_INCORRECT_STATE          |
| INET_ERROR                             | CHIP_ERROR                          |
| INET_NO_ERROR                          | CHIP_NO_ERROR                       |
| INET_ERROR_BAD_ARGS                    | CHIP_ERROR_INVALID_ARGUMENT         |
| INET_ERROR_INBOUND_MESSAGE_TOO_BIG     | CHIP_ERROR_INBOUND_MESSAGE_TOO_BIG  |
| INET_ERROR_INCORRECT_STATE             | CHIP_ERROR_INCORRECT_STATE          |
| INET_ERROR_MESSAGE_TOO_LONG            | CHIP_ERROR_MESSAGE_TOO_LONG         |
| INET_ERROR_NO_CONNECTION_HANDLER       | CHIP_ERROR_NO_CONNECTION_HANDLER    |
| INET_ERROR_NO_ENDPOINTS                | CHIP_ERROR_ENDPOINT_POOL_FULL       |
| INET_ERROR_NOT_IMPLEMENTED             | CHIP_ERROR_NOT_IMPLEMENTED          |
| INET_ERROR_NOT_SUPPORTED               | CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE |
| INET_ERROR_NO_MEMORY                   | CHIP_ERROR_NO_MEMORY                |
| INET_ERROR_CONNECTION_ABORTED          | CHIP_ERROR_CONNECTION_ABORTED       |

#### Testing

Modified some unit tests to account for consolidated error codes.

Built locally with `CHIP_ERROR` hardcoded to `int32_t`, `uint32_t`,
`int16_t`, and `uint16_t` to shake out mistaken type assumptions.

* Build fixes

* Darwin
* Doxygen

* Fixes

* Change default CHIP_CONFIG_ERROR_TYPE back to `int32_t`.
* Fix CHIP_ERROR_INBOUND_MESSAGE_TOO_BIG message text.
* C++-style casts.

* fix: CHIPError.h uses stdint.h

* zap

* fix for Mbed merge
diff --git a/examples/all-clusters-app/all-clusters-common/gen/IMClusterCommandHandler.cpp b/examples/all-clusters-app/all-clusters-common/gen/IMClusterCommandHandler.cpp
index 4eedd8d..fc10455 100644
--- a/examples/all-clusters-app/all-clusters-common/gen/IMClusterCommandHandler.cpp
+++ b/examples/all-clusters-app/all-clusters-common/gen/IMClusterCommandHandler.cpp
@@ -144,8 +144,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -193,8 +193,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -384,8 +384,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -1475,8 +1475,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -1595,8 +1595,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -3002,8 +3002,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -3198,8 +3198,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -3564,8 +3564,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -3676,8 +3676,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -3790,8 +3790,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -4320,8 +4320,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -4375,8 +4375,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -5064,8 +5064,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -5345,8 +5345,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -5412,8 +5412,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -5920,8 +5920,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -6421,8 +6421,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -6488,8 +6488,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
diff --git a/examples/bridge-app/bridge-common/gen/IMClusterCommandHandler.cpp b/examples/bridge-app/bridge-common/gen/IMClusterCommandHandler.cpp
index 829363d..8fde99d 100644
--- a/examples/bridge-app/bridge-common/gen/IMClusterCommandHandler.cpp
+++ b/examples/bridge-app/bridge-common/gen/IMClusterCommandHandler.cpp
@@ -150,8 +150,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -346,8 +346,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -876,8 +876,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -1565,8 +1565,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -1632,8 +1632,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -2140,8 +2140,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
diff --git a/examples/lighting-app/efr32/src/AppTask.cpp b/examples/lighting-app/efr32/src/AppTask.cpp
index 79f32ef..1f3ad3c 100644
--- a/examples/lighting-app/efr32/src/AppTask.cpp
+++ b/examples/lighting-app/efr32/src/AppTask.cpp
@@ -82,7 +82,7 @@
 
 int AppTask::StartAppTask()
 {
-    int err = CHIP_ERROR_MAX;
+    int err = CHIP_CONFIG_CORE_ERROR_MAX;
 
     sAppEventQueue = xQueueCreateStatic(APP_EVENT_QUEUE_SIZE, sizeof(AppEvent), sAppEventQueueBuffer, &sAppEventQueueStruct);
     if (sAppEventQueue == NULL)
@@ -275,7 +275,7 @@
     }
     else
     {
-        err = CHIP_ERROR_MAX;
+        err = CHIP_CONFIG_CORE_ERROR_MAX;
     }
 
     if (err == CHIP_NO_ERROR)
@@ -419,7 +419,7 @@
     if (xTimerStop(sFunctionTimer, 0) == pdFAIL)
     {
         EFR32_LOG("app timer stop() failed");
-        appError(CHIP_ERROR_MAX);
+        appError(CHIP_CONFIG_CORE_ERROR_MAX);
     }
 
     mFunctionTimerActive = false;
@@ -439,7 +439,7 @@
     if (xTimerChangePeriod(sFunctionTimer, aTimeoutInMs / portTICK_PERIOD_MS, 100) != pdPASS)
     {
         EFR32_LOG("app timer start() failed");
-        appError(CHIP_ERROR_MAX);
+        appError(CHIP_CONFIG_CORE_ERROR_MAX);
     }
 
     mFunctionTimerActive = true;
diff --git a/examples/lighting-app/efr32/src/LightingManager.cpp b/examples/lighting-app/efr32/src/LightingManager.cpp
index 006b6d7..4f30a0b 100644
--- a/examples/lighting-app/efr32/src/LightingManager.cpp
+++ b/examples/lighting-app/efr32/src/LightingManager.cpp
@@ -40,7 +40,7 @@
     if (sLightTimer == NULL)
     {
         EFR32_LOG("sLightTimer timer create failed");
-        appError(CHIP_ERROR_MAX);
+        appError(CHIP_CONFIG_CORE_ERROR_MAX);
     }
 
     mState                 = kState_OffCompleted;
@@ -135,7 +135,7 @@
     if (xTimerChangePeriod(sLightTimer, (aTimeoutMs / portTICK_PERIOD_MS), 100) != pdPASS)
     {
         EFR32_LOG("sLightTimer timer start() failed");
-        appError(CHIP_ERROR_MAX);
+        appError(CHIP_CONFIG_CORE_ERROR_MAX);
     }
 }
 
@@ -144,7 +144,7 @@
     if (xTimerStop(sLightTimer, 0) == pdFAIL)
     {
         EFR32_LOG("sLightTimer stop() failed");
-        appError(CHIP_ERROR_MAX);
+        appError(CHIP_CONFIG_CORE_ERROR_MAX);
     }
 }
 
diff --git a/examples/lighting-app/efr32/src/Rpc.cpp b/examples/lighting-app/efr32/src/Rpc.cpp
index e1be7f2..846adc8 100644
--- a/examples/lighting-app/efr32/src/Rpc.cpp
+++ b/examples/lighting-app/efr32/src/Rpc.cpp
@@ -120,7 +120,7 @@
 
 int Init()
 {
-    int err = CHIP_ERROR_MAX;
+    int err = CHIP_CONFIG_CORE_ERROR_MAX;
     pw_sys_io_Init();
 
     // Start App task.
diff --git a/examples/lighting-app/efr32/src/main.cpp b/examples/lighting-app/efr32/src/main.cpp
index f6f850c..00e82ca 100644
--- a/examples/lighting-app/efr32/src/main.cpp
+++ b/examples/lighting-app/efr32/src/main.cpp
@@ -99,7 +99,7 @@
 // ================================================================================
 int main(void)
 {
-    int ret = CHIP_ERROR_MAX;
+    int ret = CHIP_CONFIG_CORE_ERROR_MAX;
 
     init_efrPlatform();
     mbedtls_platform_set_calloc_free(CHIPPlatformMemoryCalloc, CHIPPlatformMemoryFree);
diff --git a/examples/lighting-app/k32w/main/AppTask.cpp b/examples/lighting-app/k32w/main/AppTask.cpp
index b533022..8f44a64 100644
--- a/examples/lighting-app/k32w/main/AppTask.cpp
+++ b/examples/lighting-app/k32w/main/AppTask.cpp
@@ -72,7 +72,7 @@
     sAppEventQueue = xQueueCreate(APP_EVENT_QUEUE_SIZE, sizeof(AppEvent));
     if (sAppEventQueue == NULL)
     {
-        err = CHIP_ERROR_MAX;
+        err = CHIP_CONFIG_CORE_ERROR_MAX;
         K32W_LOG("Failed to allocate app event queue");
         assert(err == CHIP_NO_ERROR);
     }
@@ -408,7 +408,7 @@
     }
     else
     {
-        err = CHIP_ERROR_MAX;
+        err = CHIP_CONFIG_CORE_ERROR_MAX;
     }
 
     if (err == CHIP_NO_ERROR)
diff --git a/examples/lighting-app/k32w/main/main.cpp b/examples/lighting-app/k32w/main/main.cpp
index 6426a52..31737fc 100644
--- a/examples/lighting-app/k32w/main/main.cpp
+++ b/examples/lighting-app/k32w/main/main.cpp
@@ -55,7 +55,7 @@
 
 extern "C" void main_task(void const * argument)
 {
-    CHIP_ERROR ret = CHIP_ERROR_MAX;
+    CHIP_ERROR ret = CHIP_CONFIG_CORE_ERROR_MAX;
 
     /* Call C++ constructors */
     InitFunc * pFunc = &__init_array_start;
diff --git a/examples/lighting-app/lighting-common/gen/IMClusterCommandHandler.cpp b/examples/lighting-app/lighting-common/gen/IMClusterCommandHandler.cpp
index 829363d..8fde99d 100644
--- a/examples/lighting-app/lighting-common/gen/IMClusterCommandHandler.cpp
+++ b/examples/lighting-app/lighting-common/gen/IMClusterCommandHandler.cpp
@@ -150,8 +150,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -346,8 +346,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -876,8 +876,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -1565,8 +1565,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -1632,8 +1632,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -2140,8 +2140,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
diff --git a/examples/lighting-app/qpg6100/include/AppTask.h b/examples/lighting-app/qpg6100/include/AppTask.h
index baa87f2..23bfbb2 100644
--- a/examples/lighting-app/qpg6100/include/AppTask.h
+++ b/examples/lighting-app/qpg6100/include/AppTask.h
@@ -61,7 +61,7 @@
     static void FunctionHandler(AppEvent * aEvent);
 
     static void LightingActionEventHandler(AppEvent * aEvent);
-    static void TimerEventHandler(chip::System::Layer * aLayer, void * aAppState, chip::System::Error aError);
+    static void TimerEventHandler(chip::System::Layer * aLayer, void * aAppState, CHIP_ERROR aError);
 
     void StartTimer(uint32_t aTimeoutMs);
 
diff --git a/examples/lighting-app/qpg6100/src/AppTask.cpp b/examples/lighting-app/qpg6100/src/AppTask.cpp
index f7a29bb..d8d7e8d 100644
--- a/examples/lighting-app/qpg6100/src/AppTask.cpp
+++ b/examples/lighting-app/qpg6100/src/AppTask.cpp
@@ -251,7 +251,7 @@
     sAppTask.PostEvent(&button_event);
 }
 
-void AppTask::TimerEventHandler(chip::System::Layer * aLayer, void * aAppState, chip::System::Error aError)
+void AppTask::TimerEventHandler(chip::System::Layer * aLayer, void * aAppState, CHIP_ERROR aError)
 {
     AppEvent event;
     event.Type               = AppEvent::kEventType_Timer;
diff --git a/examples/lock-app/cc13x2x7_26x2x7/main/AppTask.cpp b/examples/lock-app/cc13x2x7_26x2x7/main/AppTask.cpp
index a14d391..8011191 100644
--- a/examples/lock-app/cc13x2x7_26x2x7/main/AppTask.cpp
+++ b/examples/lock-app/cc13x2x7_26x2x7/main/AppTask.cpp
@@ -77,7 +77,6 @@
 
 int AppTask::Init()
 {
-    int ret = CHIP_ERROR_MAX;
     LED_Params ledParams;
     Button_Params buttionParams;
     ConnectivityManager::ThreadPollingConfig pollingConfig;
@@ -87,7 +86,7 @@
     // Init Chip memory management before the stack
     chip::Platform::MemoryInit();
 
-    ret = PlatformMgr().InitChipStack();
+    CHIP_ERROR ret = PlatformMgr().InitChipStack();
     if (ret != CHIP_NO_ERROR)
     {
         PLAT_LOG("PlatformMgr().InitChipStack() failed");
diff --git a/examples/lock-app/cc13x2x7_26x2x7/main/main.cpp b/examples/lock-app/cc13x2x7_26x2x7/main/main.cpp
index b721f9e..1ed5409 100644
--- a/examples/lock-app/cc13x2x7_26x2x7/main/main.cpp
+++ b/examples/lock-app/cc13x2x7_26x2x7/main/main.cpp
@@ -62,8 +62,6 @@
 // ================================================================================
 int main(void)
 {
-    int ret = CHIP_ERROR_MAX;
-
     Board_init();
     bpool((void *) GlobalHeapZoneBuffer, TOTAL_ICALL_HEAP_SIZE);
 
@@ -79,7 +77,7 @@
 
     SHA2_init();
 
-    ret = GetAppTask().StartAppTask();
+    CHIP_ERROR ret = GetAppTask().StartAppTask();
     if (ret != CHIP_NO_ERROR)
     {
         // can't log until the kernel is started
diff --git a/examples/lock-app/efr32/src/AppTask.cpp b/examples/lock-app/efr32/src/AppTask.cpp
index 67ad41d..44144ca 100644
--- a/examples/lock-app/efr32/src/AppTask.cpp
+++ b/examples/lock-app/efr32/src/AppTask.cpp
@@ -77,7 +77,7 @@
 
 int AppTask::StartAppTask()
 {
-    int err = CHIP_ERROR_MAX;
+    int err = CHIP_CONFIG_CORE_ERROR_MAX;
 
     sAppEventQueue = xQueueCreate(APP_EVENT_QUEUE_SIZE, sizeof(AppEvent));
     if (sAppEventQueue == NULL)
@@ -271,7 +271,7 @@
     }
     else
     {
-        err = CHIP_ERROR_MAX;
+        err = CHIP_CONFIG_CORE_ERROR_MAX;
     }
 
     if (err == CHIP_NO_ERROR)
@@ -415,7 +415,7 @@
     if (xTimerStop(sFunctionTimer, 0) == pdFAIL)
     {
         EFR32_LOG("app timer stop() failed");
-        appError(CHIP_ERROR_MAX);
+        appError(CHIP_CONFIG_CORE_ERROR_MAX);
     }
 
     mFunctionTimerActive = false;
@@ -435,7 +435,7 @@
     if (xTimerChangePeriod(sFunctionTimer, aTimeoutInMs / portTICK_PERIOD_MS, 100) != pdPASS)
     {
         EFR32_LOG("app timer start() failed");
-        appError(CHIP_ERROR_MAX);
+        appError(CHIP_CONFIG_CORE_ERROR_MAX);
     }
 
     mFunctionTimerActive = true;
diff --git a/examples/lock-app/efr32/src/BoltLockManager.cpp b/examples/lock-app/efr32/src/BoltLockManager.cpp
index a7cfa06..b5acfa5 100644
--- a/examples/lock-app/efr32/src/BoltLockManager.cpp
+++ b/examples/lock-app/efr32/src/BoltLockManager.cpp
@@ -40,7 +40,7 @@
     if (sLockTimer == NULL)
     {
         EFR32_LOG("sLockTimer timer create failed");
-        appError(CHIP_ERROR_MAX);
+        appError(CHIP_CONFIG_CORE_ERROR_MAX);
     }
 
     mState              = kState_LockingCompleted;
@@ -135,7 +135,7 @@
     if (xTimerChangePeriod(sLockTimer, (aTimeoutMs / portTICK_PERIOD_MS), 100) != pdPASS)
     {
         EFR32_LOG("sLockTimer timer start() failed");
-        appError(CHIP_ERROR_MAX);
+        appError(CHIP_CONFIG_CORE_ERROR_MAX);
     }
 }
 
@@ -144,7 +144,7 @@
     if (xTimerStop(sLockTimer, 0) == pdFAIL)
     {
         EFR32_LOG("Lock timer timer stop() failed");
-        appError(CHIP_ERROR_MAX);
+        appError(CHIP_CONFIG_CORE_ERROR_MAX);
     }
 }
 
diff --git a/examples/lock-app/efr32/src/main.cpp b/examples/lock-app/efr32/src/main.cpp
index 67735ef..e1ba161 100644
--- a/examples/lock-app/efr32/src/main.cpp
+++ b/examples/lock-app/efr32/src/main.cpp
@@ -91,7 +91,7 @@
 // ================================================================================
 int main(void)
 {
-    int ret = CHIP_ERROR_MAX;
+    int ret = CHIP_CONFIG_CORE_ERROR_MAX;
 
     init_efrPlatform();
     mbedtls_platform_set_calloc_free(CHIPPlatformMemoryCalloc, CHIPPlatformMemoryFree);
diff --git a/examples/lock-app/esp32/main/AppTask.cpp b/examples/lock-app/esp32/main/AppTask.cpp
index f1c2487..fb243da 100644
--- a/examples/lock-app/esp32/main/AppTask.cpp
+++ b/examples/lock-app/esp32/main/AppTask.cpp
@@ -65,7 +65,7 @@
 
 int AppTask::StartAppTask()
 {
-    int err = CHIP_ERROR_MAX;
+    int err = CHIP_CONFIG_CORE_ERROR_MAX;
 
     sAppEventQueue = xQueueCreate(APP_EVENT_QUEUE_SIZE, sizeof(AppEvent));
     if (sAppEventQueue == NULL)
@@ -237,7 +237,7 @@
     }
     else
     {
-        err = CHIP_ERROR_MAX;
+        err = CHIP_CONFIG_CORE_ERROR_MAX;
     }
 
     if (err == CHIP_NO_ERROR)
diff --git a/examples/lock-app/esp32/main/BoltLockManager.cpp b/examples/lock-app/esp32/main/BoltLockManager.cpp
index 9df6bf1..661d576 100644
--- a/examples/lock-app/esp32/main/BoltLockManager.cpp
+++ b/examples/lock-app/esp32/main/BoltLockManager.cpp
@@ -39,7 +39,7 @@
     if (sLockTimer == NULL)
     {
         ESP_LOGE(TAG, "sLockTimer timer create failed");
-        return CHIP_ERROR_MAX;
+        return CHIP_CONFIG_CORE_ERROR_MAX;
     }
 
     mState              = kState_LockingCompleted;
diff --git a/examples/lock-app/k32w/main/AppTask.cpp b/examples/lock-app/k32w/main/AppTask.cpp
index c43ea73..36cfe0e 100644
--- a/examples/lock-app/k32w/main/AppTask.cpp
+++ b/examples/lock-app/k32w/main/AppTask.cpp
@@ -413,7 +413,7 @@
     }
     else
     {
-        err = CHIP_ERROR_MAX;
+        err = CHIP_ERROR_INTERNAL;
     }
 
     if (err == CHIP_NO_ERROR)
diff --git a/examples/lock-app/k32w/main/main.cpp b/examples/lock-app/k32w/main/main.cpp
index 0dd82eb..210b1cf 100644
--- a/examples/lock-app/k32w/main/main.cpp
+++ b/examples/lock-app/k32w/main/main.cpp
@@ -54,8 +54,6 @@
 
 extern "C" void main_task(void const * argument)
 {
-    CHIP_ERROR ret = CHIP_ERROR_MAX;
-
     /* Call C++ constructors */
     InitFunc * pFunc = &__init_array_start;
     for (; pFunc < &__init_array_end; ++pFunc)
@@ -77,7 +75,7 @@
     // Init Chip memory management before the stack
     chip::Platform::MemoryInit();
 
-    ret = PlatformMgr().InitChipStack();
+    CHIP_ERROR ret = PlatformMgr().InitChipStack();
     if (ret != CHIP_NO_ERROR)
     {
         K32W_LOG("Error during PlatformMgr().InitWeaveStack()");
diff --git a/examples/lock-app/lock-common/gen/IMClusterCommandHandler.cpp b/examples/lock-app/lock-common/gen/IMClusterCommandHandler.cpp
index 4c7374d..4e77593 100644
--- a/examples/lock-app/lock-common/gen/IMClusterCommandHandler.cpp
+++ b/examples/lock-app/lock-common/gen/IMClusterCommandHandler.cpp
@@ -150,8 +150,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -346,8 +346,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -1035,8 +1035,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -1102,8 +1102,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -1610,8 +1610,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
diff --git a/examples/lock-app/qpg6100/include/AppTask.h b/examples/lock-app/qpg6100/include/AppTask.h
index 7dc789c..74c3e6b 100644
--- a/examples/lock-app/qpg6100/include/AppTask.h
+++ b/examples/lock-app/qpg6100/include/AppTask.h
@@ -59,7 +59,7 @@
     static void FunctionTimerEventHandler(AppEvent * aEvent);
     static void FunctionHandler(AppEvent * aEvent);
     static void LockActionEventHandler(AppEvent * aEvent);
-    static void TimerEventHandler(chip::System::Layer * aLayer, void * aAppState, chip::System::Error aError);
+    static void TimerEventHandler(chip::System::Layer * aLayer, void * aAppState, CHIP_ERROR aError);
 
     void StartTimer(uint32_t aTimeoutMs);
 
diff --git a/examples/lock-app/qpg6100/src/AppTask.cpp b/examples/lock-app/qpg6100/src/AppTask.cpp
index aa6d773..51a9971 100644
--- a/examples/lock-app/qpg6100/src/AppTask.cpp
+++ b/examples/lock-app/qpg6100/src/AppTask.cpp
@@ -207,7 +207,7 @@
     }
     else
     {
-        err = CHIP_ERROR_MAX;
+        err = CHIP_ERROR_INTERNAL;
     }
 
     if (err == CHIP_NO_ERROR)
@@ -245,7 +245,7 @@
     }
 }
 
-void AppTask::TimerEventHandler(chip::System::Layer * aLayer, void * aAppState, chip::System::Error aError)
+void AppTask::TimerEventHandler(chip::System::Layer * aLayer, void * aAppState, CHIP_ERROR aError)
 {
     AppEvent event;
     event.Type               = AppEvent::kEventType_Timer;
diff --git a/examples/lock-app/qpg6100/src/BoltLockManager.cpp b/examples/lock-app/qpg6100/src/BoltLockManager.cpp
index 7bed6db..b60ccee 100644
--- a/examples/lock-app/qpg6100/src/BoltLockManager.cpp
+++ b/examples/lock-app/qpg6100/src/BoltLockManager.cpp
@@ -41,7 +41,7 @@
     {
         ChipLogProgress(NotSpecified, "sLockTimer timer create failed");
         // TODO:
-        // appError(CHIP_ERROR_MAX);
+        // appError(CHIP_CONFIG_CORE_ERROR_MAX);
     }
 
     mState              = kState_LockingCompleted;
@@ -136,7 +136,7 @@
     if (xTimerChangePeriod(sLockTimer, (aTimeoutMs / portTICK_PERIOD_MS), 100) != pdPASS)
     {
         ChipLogError(NotSpecified, "sLockTimer timer start() failed");
-        // appError(CHIP_ERROR_MAX);
+        // appError(CHIP_CONFIG_CORE_ERROR_MAX);
     }
 }
 
@@ -145,7 +145,7 @@
     if (xTimerStop(sLockTimer, 0) == pdFAIL)
     {
         ChipLogError(NotSpecified, "Lock timer timer stop() failed");
-        // appError(CHIP_ERROR_MAX);
+        // appError(CHIP_CONFIG_CORE_ERROR_MAX);
     }
 }
 
diff --git a/examples/minimal-mdns/client.cpp b/examples/minimal-mdns/client.cpp
index ddc1aba..b1ad74d 100644
--- a/examples/minimal-mdns/client.cpp
+++ b/examples/minimal-mdns/client.cpp
@@ -333,7 +333,7 @@
     {
         timer->Start(
             gOptions.runtimeMs,
-            [](System::Layer *, void *, System::Error err) {
+            [](System::Layer *, void *, CHIP_ERROR err) {
                 DeviceLayer::PlatformMgr().StopEventLoopTask();
                 DeviceLayer::PlatformMgr().Shutdown();
             },
diff --git a/examples/platform/nrfconnect/util/test/TestInetCommon.cpp b/examples/platform/nrfconnect/util/test/TestInetCommon.cpp
index a5a0ada..efd36a9 100644
--- a/examples/platform/nrfconnect/util/test/TestInetCommon.cpp
+++ b/examples/platform/nrfconnect/util/test/TestInetCommon.cpp
@@ -65,7 +65,7 @@
 
 void InetFailError(int32_t err, const char * msg)
 {
-    if (err != INET_NO_ERROR)
+    if (err != CHIP_NO_ERROR)
     {
         LOG_ERR("%s: %s", msg, ErrorStr(err));
         exit(-1);
diff --git a/examples/platform/qpg6100/app/main.cpp b/examples/platform/qpg6100/app/main.cpp
index 693aac1..6c05305 100644
--- a/examples/platform/qpg6100/app/main.cpp
+++ b/examples/platform/qpg6100/app/main.cpp
@@ -60,7 +60,7 @@
 
 int Application_Init(void)
 {
-    int ret = CHIP_ERROR_MAX;
+    int ret = CHIP_CONFIG_CORE_ERROR_MAX;
 
     /* Launch application task */
     ChipLogProgress(NotSpecified, "============================");
@@ -79,7 +79,7 @@
 
 int CHIP_Init(void)
 {
-    int ret = CHIP_ERROR_MAX;
+    int ret = CHIP_CONFIG_CORE_ERROR_MAX;
 
     ret = chip::Platform::MemoryInit();
     if (ret != CHIP_NO_ERROR)
diff --git a/examples/pump-app/cc13x2x7_26x2x7/main/AppTask.cpp b/examples/pump-app/cc13x2x7_26x2x7/main/AppTask.cpp
index 1682d81..01efb58 100644
--- a/examples/pump-app/cc13x2x7_26x2x7/main/AppTask.cpp
+++ b/examples/pump-app/cc13x2x7_26x2x7/main/AppTask.cpp
@@ -79,7 +79,7 @@
 
 int AppTask::Init()
 {
-    int ret = CHIP_ERROR_MAX;
+    int ret = CHIP_CONFIG_CORE_ERROR_MAX;
     LED_Params ledParams;
     Button_Params buttionParams;
     ConnectivityManager::ThreadPollingConfig pollingConfig;
diff --git a/examples/pump-app/cc13x2x7_26x2x7/main/main.cpp b/examples/pump-app/cc13x2x7_26x2x7/main/main.cpp
index b721f9e..091681d 100644
--- a/examples/pump-app/cc13x2x7_26x2x7/main/main.cpp
+++ b/examples/pump-app/cc13x2x7_26x2x7/main/main.cpp
@@ -62,7 +62,7 @@
 // ================================================================================
 int main(void)
 {
-    int ret = CHIP_ERROR_MAX;
+    int ret = CHIP_CONFIG_CORE_ERROR_MAX;
 
     Board_init();
     bpool((void *) GlobalHeapZoneBuffer, TOTAL_ICALL_HEAP_SIZE);
diff --git a/examples/pump-app/pump-common/gen/IMClusterCommandHandler.cpp b/examples/pump-app/pump-common/gen/IMClusterCommandHandler.cpp
index 511f2ea..22bacaf 100644
--- a/examples/pump-app/pump-common/gen/IMClusterCommandHandler.cpp
+++ b/examples/pump-app/pump-common/gen/IMClusterCommandHandler.cpp
@@ -79,8 +79,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -199,8 +199,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -395,8 +395,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -925,8 +925,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -1555,8 +1555,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -1622,8 +1622,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -2130,8 +2130,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
diff --git a/examples/pump-controller-app/cc13x2x7_26x2x7/main/AppTask.cpp b/examples/pump-controller-app/cc13x2x7_26x2x7/main/AppTask.cpp
index 1682d81..01efb58 100644
--- a/examples/pump-controller-app/cc13x2x7_26x2x7/main/AppTask.cpp
+++ b/examples/pump-controller-app/cc13x2x7_26x2x7/main/AppTask.cpp
@@ -79,7 +79,7 @@
 
 int AppTask::Init()
 {
-    int ret = CHIP_ERROR_MAX;
+    int ret = CHIP_CONFIG_CORE_ERROR_MAX;
     LED_Params ledParams;
     Button_Params buttionParams;
     ConnectivityManager::ThreadPollingConfig pollingConfig;
diff --git a/examples/pump-controller-app/cc13x2x7_26x2x7/main/main.cpp b/examples/pump-controller-app/cc13x2x7_26x2x7/main/main.cpp
index b721f9e..091681d 100644
--- a/examples/pump-controller-app/cc13x2x7_26x2x7/main/main.cpp
+++ b/examples/pump-controller-app/cc13x2x7_26x2x7/main/main.cpp
@@ -62,7 +62,7 @@
 // ================================================================================
 int main(void)
 {
-    int ret = CHIP_ERROR_MAX;
+    int ret = CHIP_CONFIG_CORE_ERROR_MAX;
 
     Board_init();
     bpool((void *) GlobalHeapZoneBuffer, TOTAL_ICALL_HEAP_SIZE);
diff --git a/examples/pump-controller-app/pump-controller-common/gen/IMClusterCommandHandler.cpp b/examples/pump-controller-app/pump-controller-common/gen/IMClusterCommandHandler.cpp
index 3412e53..c647760 100644
--- a/examples/pump-controller-app/pump-controller-common/gen/IMClusterCommandHandler.cpp
+++ b/examples/pump-controller-app/pump-controller-common/gen/IMClusterCommandHandler.cpp
@@ -79,8 +79,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -199,8 +199,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -395,8 +395,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -1084,8 +1084,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -1592,8 +1592,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
diff --git a/examples/shell/efr32/src/main.cpp b/examples/shell/efr32/src/main.cpp
index ea13605..bb6ee91 100644
--- a/examples/shell/efr32/src/main.cpp
+++ b/examples/shell/efr32/src/main.cpp
@@ -107,7 +107,7 @@
 
 int main(void)
 {
-    int ret = CHIP_ERROR_MAX;
+    int ret = CHIP_CONFIG_CORE_ERROR_MAX;
 
     init_efrPlatform();
     mbedtls_platform_set_calloc_free(CHIPPlatformMemoryCalloc, CHIPPlatformMemoryFree);
diff --git a/examples/shell/k32w/main/main.cpp b/examples/shell/k32w/main/main.cpp
index 6a90b26..cf5850e 100644
--- a/examples/shell/k32w/main/main.cpp
+++ b/examples/shell/k32w/main/main.cpp
@@ -64,7 +64,7 @@
 
 extern "C" void main_task(void const * argument)
 {
-    CHIP_ERROR ret = CHIP_ERROR_MAX;
+    CHIP_ERROR ret = CHIP_CONFIG_CORE_ERROR_MAX;
 
     /* Call C++ constructors */
     InitFunc * pFunc = &__init_array_start;
diff --git a/examples/shell/shell_common/cmd_misc.cpp b/examples/shell/shell_common/cmd_misc.cpp
index da05dbd..a99ec89 100644
--- a/examples/shell/shell_common/cmd_misc.cpp
+++ b/examples/shell/shell_common/cmd_misc.cpp
@@ -35,29 +35,29 @@
 using namespace chip::Shell;
 using namespace chip::Logging;
 
-int cmd_echo(int argc, char ** argv)
+CHIP_ERROR cmd_echo(int argc, char ** argv)
 {
     for (int i = 0; i < argc; i++)
     {
         streamer_printf(streamer_get(), "%s ", argv[i]);
     }
     streamer_printf(streamer_get(), "\n\r");
-    return 0;
+    return CHIP_NO_ERROR;
 }
 
-int cmd_log(int argc, char ** argv)
+CHIP_ERROR cmd_log(int argc, char ** argv)
 {
     for (int i = 0; i < argc; i++)
     {
         ChipLogProgress(chipTool, "%s", argv[i]);
     }
-    return 0;
+    return CHIP_NO_ERROR;
 }
 
-int cmd_rand(int argc, char ** argv)
+CHIP_ERROR cmd_rand(int argc, char ** argv)
 {
     streamer_printf(streamer_get(), "%d\n\r", GetRandU8());
-    return 0;
+    return CHIP_NO_ERROR;
 }
 
 static shell_command_t cmds_misc[] = {
diff --git a/examples/shell/shell_common/cmd_otcli.cpp b/examples/shell/shell_common/cmd_otcli.cpp
index 8d7fa00..8dbf9b6 100644
--- a/examples/shell/shell_common/cmd_otcli.cpp
+++ b/examples/shell/shell_common/cmd_otcli.cpp
@@ -61,21 +61,21 @@
 
 static chip::Shell::Engine sShellOtcliSubcommands;
 
-int cmd_otcli_help_iterator(shell_command_t * command, void * arg)
+CHIP_ERROR cmd_otcli_help_iterator(shell_command_t * command, void * arg)
 {
     streamer_printf(streamer_get(), "  %-15s %s\n\r", command->cmd_name, command->cmd_help);
-    return 0;
+    return CHIP_NO_ERROR;
 }
 
-int cmd_otcli_help(int argc, char ** argv)
+CHIP_ERROR cmd_otcli_help(int argc, char ** argv)
 {
     sShellOtcliSubcommands.ForEachCommand(cmd_otcli_help_iterator, nullptr);
-    return 0;
+    return CHIP_NO_ERROR;
 }
 
 #if CHIP_TARGET_STYLE_EMBEDDED
 
-int cmd_otcli_dispatch(int argc, char ** argv)
+CHIP_ERROR cmd_otcli_dispatch(int argc, char ** argv)
 {
     CHIP_ERROR error = CHIP_NO_ERROR;
 
@@ -116,10 +116,8 @@
 
 #elif CHIP_TARGET_STYLE_UNIX
 
-int cmd_otcli_dispatch(int argc, char ** argv)
+CHIP_ERROR cmd_otcli_dispatch(int argc, char ** argv)
 {
-    CHIP_ERROR error = CHIP_NO_ERROR;
-
     int pid;
     uid_t euid         = geteuid();
     char ctl_command[] = "/usr/local/sbin/ot-ctl";
@@ -128,15 +126,14 @@
     if (euid != 0)
     {
         streamer_printf(streamer_get(), "Error otcli: requires running chip-shell as sudo\n\r");
-        error = CHIP_ERROR_INCORRECT_STATE;
-        ExitNow();
+        return CHIP_ERROR_INCORRECT_STATE;
     }
 
-    VerifyOrExit(argc > 0, error = CHIP_ERROR_INVALID_ARGUMENT);
+    VerifyOrReturnError(argc > 0, CHIP_ERROR_INVALID_ARGUMENT);
 
     // Fork and execute the command.
     pid = fork();
-    VerifyOrExit(pid != -1, error = CHIP_ERROR_INCORRECT_STATE);
+    VerifyOrReturnError(pid != -1, CHIP_ERROR_INCORRECT_STATE);
 
     if (pid == 0)
     {
@@ -154,11 +151,8 @@
         // Parent process to wait on child.
         int status;
         wait(&status);
-        error = (status) ? CHIP_ERROR_INCORRECT_STATE : CHIP_NO_ERROR;
+        return (status) ? CHIP_ERROR_INCORRECT_STATE : CHIP_NO_ERROR;
     }
-
-exit:
-    return error;
 }
 
 #endif // CHIP_TARGET_STYLE_UNIX
diff --git a/examples/shell/shell_common/cmd_ping.cpp b/examples/shell/shell_common/cmd_ping.cpp
index c6a4415..aa4f889 100644
--- a/examples/shell/shell_common/cmd_ping.cpp
+++ b/examples/shell/shell_common/cmd_ping.cpp
@@ -132,7 +132,7 @@
 Transport::AdminPairingTable gAdmins;
 
 CHIP_ERROR SendEchoRequest(streamer_t * stream);
-void EchoTimerHandler(chip::System::Layer * systemLayer, void * appState, chip::System::Error error);
+void EchoTimerHandler(chip::System::Layer * systemLayer, void * appState, CHIP_ERROR error);
 
 Transport::PeerAddress GetEchoPeerAddress()
 {
@@ -166,7 +166,7 @@
     gSessionManager.Shutdown();
 }
 
-void EchoTimerHandler(chip::System::Layer * systemLayer, void * appState, chip::System::Error error)
+void EchoTimerHandler(chip::System::Layer * systemLayer, void * appState, CHIP_ERROR error)
 {
     if (gPingArguments.GetEchoRespCount() != gPingArguments.GetEchoCount())
     {
@@ -374,10 +374,9 @@
     streamer_printf(stream, "  -s  <size>      application payload size in bytes\n");
 }
 
-int cmd_ping(int argc, char ** argv)
+CHIP_ERROR cmd_ping(int argc, char ** argv)
 {
     streamer_t * sout = streamer_get();
-    int ret           = 0;
     int optIndex      = 0;
 
     gPingArguments.Reset();
@@ -388,7 +387,7 @@
         {
         case 'h':
             PrintUsage(sout);
-            return 0;
+            return CHIP_NO_ERROR;
 #if INET_CONFIG_ENABLE_TCP_ENDPOINT
         case 'u':
             gPingArguments.SetUsingTCP(false);
@@ -401,7 +400,7 @@
             if (++optIndex >= argc || argv[optIndex][0] == '-')
             {
                 streamer_printf(sout, "Invalid argument specified for -i\n");
-                return -1;
+                return CHIP_ERROR_INVALID_ARGUMENT;
             }
             else
             {
@@ -412,7 +411,7 @@
             if (++optIndex >= argc || argv[optIndex][0] == '-')
             {
                 streamer_printf(sout, "Invalid argument specified for -c\n");
-                return -1;
+                return CHIP_ERROR_INVALID_ARGUMENT;
             }
             else
             {
@@ -423,7 +422,7 @@
             if (++optIndex >= argc || argv[optIndex][0] == '-')
             {
                 streamer_printf(sout, "Invalid argument specified for -p\n");
-                return -1;
+                return CHIP_ERROR_INVALID_ARGUMENT;
             }
             else
             {
@@ -434,7 +433,7 @@
             if (++optIndex >= argc || argv[optIndex][0] == '-')
             {
                 streamer_printf(sout, "Invalid argument specified for -s\n");
-                return -1;
+                return CHIP_ERROR_INVALID_ARGUMENT;
             }
             else
             {
@@ -445,7 +444,7 @@
             if (++optIndex >= argc || argv[optIndex][0] == '-')
             {
                 streamer_printf(sout, "Invalid argument specified for -r\n");
-                return -1;
+                return CHIP_ERROR_INVALID_ARGUMENT;
             }
             else
             {
@@ -461,12 +460,12 @@
                 }
                 else
                 {
-                    ret = -1;
+                    return CHIP_ERROR_INVALID_ARGUMENT;
                 }
             }
             break;
         default:
-            ret = -1;
+            return CHIP_ERROR_INVALID_ARGUMENT;
         }
 
         optIndex++;
@@ -475,16 +474,13 @@
     if (optIndex >= argc)
     {
         streamer_printf(sout, "Missing IP address\n");
-        ret = -1;
+        return CHIP_ERROR_INVALID_ARGUMENT;
     }
 
-    if (ret == 0)
-    {
-        streamer_printf(sout, "IP address: %s\n", argv[optIndex]);
-        StartPinging(sout, argv[optIndex]);
-    }
+    streamer_printf(sout, "IP address: %s\n", argv[optIndex]);
+    StartPinging(sout, argv[optIndex]);
 
-    return ret;
+    return CHIP_NO_ERROR;
 }
 
 } // namespace
diff --git a/examples/shell/shell_common/cmd_send.cpp b/examples/shell/shell_common/cmd_send.cpp
index 45bdeb6..5caa790 100644
--- a/examples/shell/shell_common/cmd_send.cpp
+++ b/examples/shell/shell_common/cmd_send.cpp
@@ -312,10 +312,9 @@
     streamer_printf(stream, "  -s  <size>      application payload size in bytes\n");
 }
 
-int cmd_send(int argc, char ** argv)
+CHIP_ERROR cmd_send(int argc, char ** argv)
 {
     streamer_t * sout = streamer_get();
-    int ret           = 0;
     int optIndex      = 0;
 
     gSendArguments.Reset();
@@ -326,7 +325,7 @@
         {
         case 'h':
             PrintUsage(sout);
-            return 0;
+            return CHIP_NO_ERROR;
 #if INET_CONFIG_ENABLE_TCP_ENDPOINT
         case 'u':
             gSendArguments.SetUsingTCP(false);
@@ -339,7 +338,7 @@
             if (++optIndex >= argc || argv[optIndex][0] == '-')
             {
                 streamer_printf(sout, "Invalid argument specified for -P\n");
-                return -1;
+                return CHIP_ERROR_INVALID_ARGUMENT;
             }
             else
             {
@@ -350,7 +349,7 @@
             if (++optIndex >= argc || argv[optIndex][0] == '-')
             {
                 streamer_printf(sout, "Invalid argument specified for -T\n");
-                return -1;
+                return CHIP_ERROR_INVALID_ARGUMENT;
             }
             else
             {
@@ -361,7 +360,7 @@
             if (++optIndex >= argc || argv[optIndex][0] == '-')
             {
                 streamer_printf(sout, "Invalid argument specified for -p\n");
-                return -1;
+                return CHIP_ERROR_INVALID_ARGUMENT;
             }
             else
             {
@@ -372,7 +371,7 @@
             if (++optIndex >= argc || argv[optIndex][0] == '-')
             {
                 streamer_printf(sout, "Invalid argument specified for -s\n");
-                return -1;
+                return CHIP_ERROR_INVALID_ARGUMENT;
             }
             else
             {
@@ -383,7 +382,7 @@
             if (++optIndex >= argc || argv[optIndex][0] == '-')
             {
                 streamer_printf(sout, "Invalid argument specified for -r\n");
-                return -1;
+                return CHIP_ERROR_INVALID_ARGUMENT;
             }
             else
             {
@@ -399,12 +398,12 @@
                 }
                 else
                 {
-                    ret = -1;
+                    return CHIP_ERROR_INVALID_ARGUMENT;
                 }
             }
             break;
         default:
-            ret = -1;
+            return CHIP_ERROR_INVALID_ARGUMENT;
         }
 
         optIndex++;
@@ -413,16 +412,13 @@
     if (optIndex >= argc)
     {
         streamer_printf(sout, "Missing IP address\n");
-        ret = -1;
+        return CHIP_ERROR_INVALID_ARGUMENT;
     }
 
-    if (ret == 0)
-    {
-        streamer_printf(sout, "IP address: %s\n", argv[optIndex]);
-        ProcessCommand(sout, argv[optIndex]);
-    }
+    streamer_printf(sout, "IP address: %s\n", argv[optIndex]);
+    ProcessCommand(sout, argv[optIndex]);
 
-    return ret;
+    return CHIP_NO_ERROR;
 }
 
 } // namespace
diff --git a/examples/temperature-measurement-app/esp32/main/gen/IMClusterCommandHandler.cpp b/examples/temperature-measurement-app/esp32/main/gen/IMClusterCommandHandler.cpp
index 004f539..8dd624e 100644
--- a/examples/temperature-measurement-app/esp32/main/gen/IMClusterCommandHandler.cpp
+++ b/examples/temperature-measurement-app/esp32/main/gen/IMClusterCommandHandler.cpp
@@ -150,8 +150,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -346,8 +346,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -893,8 +893,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -1401,8 +1401,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
diff --git a/examples/tv-app/tv-common/gen/IMClusterCommandHandler.cpp b/examples/tv-app/tv-common/gen/IMClusterCommandHandler.cpp
index 669ce7d..85d53f1 100644
--- a/examples/tv-app/tv-common/gen/IMClusterCommandHandler.cpp
+++ b/examples/tv-app/tv-common/gen/IMClusterCommandHandler.cpp
@@ -138,8 +138,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -310,8 +310,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -359,8 +359,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -550,8 +550,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -730,8 +730,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -850,8 +850,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -1046,8 +1046,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -1576,8 +1576,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -1850,8 +1850,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -2539,8 +2539,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -2820,8 +2820,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -2887,8 +2887,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -3395,8 +3395,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
diff --git a/examples/window-app/common/gen/IMClusterCommandHandler.cpp b/examples/window-app/common/gen/IMClusterCommandHandler.cpp
index 776574b..d400e8b 100644
--- a/examples/window-app/common/gen/IMClusterCommandHandler.cpp
+++ b/examples/window-app/common/gen/IMClusterCommandHandler.cpp
@@ -226,8 +226,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -915,8 +915,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -1423,8 +1423,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -1736,8 +1736,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
diff --git a/examples/window-app/efr32/src/AppTask.cpp b/examples/window-app/efr32/src/AppTask.cpp
index 07628d5..c7a2ebd 100644
--- a/examples/window-app/efr32/src/AppTask.cpp
+++ b/examples/window-app/efr32/src/AppTask.cpp
@@ -78,7 +78,7 @@
 
 int AppTask::Start()
 {
-    int err = CHIP_ERROR_MAX;
+    int err = CHIP_CONFIG_CORE_ERROR_MAX;
 
     mQueue = xQueueCreateStatic(APP_EVENT_QUEUE_SIZE, sizeof(AppEvent), sAppEventQueueBuffer, &sAppEventQueueStruct);
     if (mQueue == NULL)
diff --git a/examples/window-app/efr32/src/AppTimer.cpp b/examples/window-app/efr32/src/AppTimer.cpp
index 3a67a29..397c63c 100644
--- a/examples/window-app/efr32/src/AppTimer.cpp
+++ b/examples/window-app/efr32/src/AppTimer.cpp
@@ -59,7 +59,7 @@
     if (xTimerStart(mHandler, 100) != pdPASS)
     {
         EFR32_LOG("AppTimer start() failed");
-        appError(CHIP_ERROR_MAX);
+        appError(CHIP_CONFIG_CORE_ERROR_MAX);
     }
 
     mIsActive = true;
@@ -79,7 +79,7 @@
     if (xTimerChangePeriod(mHandler, timeoutInMs / portTICK_PERIOD_MS, 100) != pdPASS)
     {
         EFR32_LOG("AppTimer start() failed");
-        appError(CHIP_ERROR_MAX);
+        appError(CHIP_CONFIG_CORE_ERROR_MAX);
     }
 
     mIsActive = true;
@@ -104,7 +104,7 @@
     if (xTimerStop(mHandler, 0) == pdFAIL)
     {
         EFR32_LOG("AppTimer stop() failed");
-        appError(CHIP_ERROR_MAX);
+        appError(CHIP_CONFIG_CORE_ERROR_MAX);
     }
 }
 
diff --git a/examples/window-app/efr32/src/main.cpp b/examples/window-app/efr32/src/main.cpp
index ed5d581..2831cfc 100644
--- a/examples/window-app/efr32/src/main.cpp
+++ b/examples/window-app/efr32/src/main.cpp
@@ -95,7 +95,7 @@
 // ================================================================================
 int main(void)
 {
-    int ret = CHIP_ERROR_MAX;
+    int ret = CHIP_CONFIG_CORE_ERROR_MAX;
 
     init_efrPlatform();
 
diff --git a/src/app/EventManagement.cpp b/src/app/EventManagement.cpp
index 9e30eba..431098d 100644
--- a/src/app/EventManagement.cpp
+++ b/src/app/EventManagement.cpp
@@ -403,7 +403,7 @@
     err = mpEventNumberCounter->Advance();
     if (err != CHIP_NO_ERROR)
     {
-        ChipLogError(EventLogging, "%s Advance() for priority %u failed with %" PRId32, __FUNCTION__,
+        ChipLogError(EventLogging, "%s Advance() for priority %u failed with %" CHIP_ERROR_FORMAT, __FUNCTION__,
                      static_cast<unsigned>(mPriority), err);
     }
 
diff --git a/src/app/reporting/Engine.cpp b/src/app/reporting/Engine.cpp
index c6b8ccf..a5215eb 100644
--- a/src/app/reporting/Engine.cpp
+++ b/src/app/reporting/Engine.cpp
@@ -76,8 +76,8 @@
 
     if (err != CHIP_NO_ERROR)
     {
-        ChipLogError(DataManagement, "Error retrieving data from clusterId: %" PRIx32 ", err = %" PRId32, aClusterInfo.mClusterId,
-                     err);
+        ChipLogError(DataManagement, "Error retrieving data from clusterId: %" PRIx32 ", err = %" CHIP_ERROR_FORMAT,
+                     aClusterInfo.mClusterId, err);
     }
 
     return err;
@@ -216,7 +216,7 @@
 exit:
     if (err != CHIP_NO_ERROR)
     {
-        ChipLogError(DataManagement, "Error retrieving events, err = %" PRId32, err);
+        ChipLogError(DataManagement, "Error retrieving events, err = %" CHIP_ERROR_FORMAT, err);
     }
 
     return err;
@@ -275,7 +275,8 @@
 
     ChipLogDetail(DataManagement, "<RE> Sending report...");
     err = SendReport(apReadHandler, std::move(bufHandle));
-    VerifyOrExit(err == CHIP_NO_ERROR, ChipLogError(DataManagement, "<RE> Error sending out report data with %" PRId32 "!", err));
+    VerifyOrExit(err == CHIP_NO_ERROR,
+                 ChipLogError(DataManagement, "<RE> Error sending out report data with %" CHIP_ERROR_FORMAT "!", err));
 
     ChipLogDetail(DataManagement, "<RE> ReportsInFlight = %" PRIu32 " with readHandler %" PRIu32 ", RE has %s", mNumReportsInFlight,
                   mCurReadHandlerIdx, mMoreChunkedMessages ? "more messages" : "no more messages");
@@ -294,7 +295,7 @@
     return err;
 }
 
-void Engine::Run(System::Layer * aSystemLayer, void * apAppState, System::Error)
+void Engine::Run(System::Layer * aSystemLayer, void * apAppState, CHIP_ERROR)
 {
     Engine * const pEngine = reinterpret_cast<Engine *>(apAppState);
     pEngine->Run();
diff --git a/src/app/reporting/Engine.h b/src/app/reporting/Engine.h
index efa0d5a..5ab45ab 100644
--- a/src/app/reporting/Engine.h
+++ b/src/app/reporting/Engine.h
@@ -100,7 +100,7 @@
      * Generate and send the report data request when there exists subscription or read request
      *
      */
-    static void Run(System::Layer * aSystemLayer, void * apAppState, System::Error);
+    static void Run(System::Layer * aSystemLayer, void * apAppState, CHIP_ERROR);
 
     /**
      * Boolean to show if more chunk message on the way
diff --git a/src/app/server/RendezvousServer.cpp b/src/app/server/RendezvousServer.cpp
index 25aa9b2..a578692 100644
--- a/src/app/server/RendezvousServer.cpp
+++ b/src/app/server/RendezvousServer.cpp
@@ -55,7 +55,8 @@
         }
         else
         {
-            ChipLogError(Discovery, "Commissioning errored out with error %" PRId32, event->CommissioningComplete.status);
+            ChipLogError(Discovery, "Commissioning errored out with error %" CHIP_ERROR_FORMAT,
+                         event->CommissioningComplete.status);
         }
         // TODO: Commissioning complete means we can finalize the admin in our storage
     }
diff --git a/src/app/tests/integration/MockEvents.cpp b/src/app/tests/integration/MockEvents.cpp
index 1836814..2f02cbf 100644
--- a/src/app/tests/integration/MockEvents.cpp
+++ b/src/app/tests/integration/MockEvents.cpp
@@ -151,7 +151,7 @@
     return err;
 }
 
-void MockEventGeneratorImpl::HandleNextEvent(chip::System::Layer * apSystemLayer, void * apAppState, chip::System::Error aErr)
+void MockEventGeneratorImpl::HandleNextEvent(chip::System::Layer * apSystemLayer, void * apAppState, CHIP_ERROR aErr)
 {
     MockEventGeneratorImpl * generator = static_cast<MockEventGeneratorImpl *>(apAppState);
     if (gMockEventStop)
diff --git a/src/app/tests/integration/MockEvents.h b/src/app/tests/integration/MockEvents.h
index e79d05e..ab318e4 100644
--- a/src/app/tests/integration/MockEvents.h
+++ b/src/app/tests/integration/MockEvents.h
@@ -66,7 +66,7 @@
     bool IsEventGeneratorStopped();
 
 private:
-    static void HandleNextEvent(chip::System::Layer * apSystemLayer, void * apAppState, chip::System::Error aErr);
+    static void HandleNextEvent(chip::System::Layer * apSystemLayer, void * apAppState, CHIP_ERROR aErr);
     chip::Messaging::ExchangeManager * mpExchangeMgr;
     uint32_t mTimeBetweenEvents; //< delay, in miliseconds, between events.
     bool mEventWraparound;       //< does the event generator run indefinitely, or does it stop after iterating through its states
diff --git a/src/app/tests/integration/chip_im_initiator.cpp b/src/app/tests/integration/chip_im_initiator.cpp
index 6fe8fdf..f96f097 100644
--- a/src/app/tests/integration/chip_im_initiator.cpp
+++ b/src/app/tests/integration/chip_im_initiator.cpp
@@ -309,7 +309,7 @@
     }
     CHIP_ERROR ReportError(const chip::app::ReadClient * apReadClient, CHIP_ERROR aError) override
     {
-        printf("ReportError with err %d", aError);
+        printf("ReportError with err %" CHIP_ERROR_FORMAT, aError);
         return CHIP_NO_ERROR;
     }
     CHIP_ERROR CommandResponseStatus(const chip::app::CommandSender * apCommandSender,
diff --git a/src/app/util/af-event.cpp b/src/app/util/af-event.cpp
index 6ade0c4..a43ddd8 100644
--- a/src/app/util/af-event.cpp
+++ b/src/app/util/af-event.cpp
@@ -96,7 +96,7 @@
     { NULL, NULL }
 };
 
-void EventControlHandler(chip::System::Layer * systemLayer, void * appState, chip::System::Error error)
+void EventControlHandler(chip::System::Layer * systemLayer, void * appState, CHIP_ERROR error)
 {
     EmberEventControl * control = reinterpret_cast<EmberEventControl *>(appState);
     if (control->status != EMBER_EVENT_INACTIVE)
diff --git a/src/app/zap-templates/templates/app/im-cluster-command-handler.zapt b/src/app/zap-templates/templates/app/im-cluster-command-handler.zapt
index c327817..7a0f532 100644
--- a/src/app/zap-templates/templates/app/im-cluster-command-handler.zapt
+++ b/src/app/zap-templates/templates/app/im-cluster-command-handler.zapt
@@ -79,7 +79,7 @@
                                                        (chip::app::CommandPathFlags::kEndpointIdValid) };
       apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id,
         Protocols::InteractionModel::ProtocolCode::InvalidCommand);
-      ChipLogProgress(Zcl, "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
+      ChipLogProgress(Zcl, "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
 
diff --git a/src/ble/BLEEndPoint.cpp b/src/ble/BLEEndPoint.cpp
index 4abe18b..a303f11 100644
--- a/src/ble/BLEEndPoint.cpp
+++ b/src/ble/BLEEndPoint.cpp
@@ -101,9 +101,9 @@
 namespace chip {
 namespace Ble {
 
-BLE_ERROR BLEEndPoint::StartConnect()
+CHIP_ERROR BLEEndPoint::StartConnect()
 {
-    BLE_ERROR err = BLE_NO_ERROR;
+    CHIP_ERROR err = CHIP_NO_ERROR;
     BleTransportCapabilitiesRequestMessage req;
     PacketBufferHandle buf;
     constexpr uint8_t numVersions =
@@ -111,12 +111,12 @@
     static_assert(numVersions <= NUM_SUPPORTED_PROTOCOL_VERSIONS, "Incompatibly protocol versions");
 
     // Ensure we're in the correct state.
-    VerifyOrExit(mState == kState_Ready, err = BLE_ERROR_INCORRECT_STATE);
+    VerifyOrExit(mState == kState_Ready, err = CHIP_ERROR_INCORRECT_STATE);
     mState = kState_Connecting;
 
     // Build BLE transport protocol capabilities request.
     buf = System::PacketBufferHandle::New(System::PacketBuffer::kMaxSize);
-    VerifyOrExit(!buf.IsNull(), err = BLE_ERROR_NO_MEMORY);
+    VerifyOrExit(!buf.IsNull(), err = CHIP_ERROR_NO_MEMORY);
 
     // Zero-initialize BLE transport capabilities request.
     memset(&req, 0, sizeof(req));
@@ -154,7 +154,7 @@
 
 exit:
     // If we failed to initiate the connection, close the end point.
-    if (err != BLE_NO_ERROR)
+    if (err != CHIP_NO_ERROR)
     {
         StopConnectTimer();
         DoClose(kBleCloseFlag_AbortTransmission, err);
@@ -163,9 +163,9 @@
     return err;
 }
 
-BLE_ERROR BLEEndPoint::HandleConnectComplete()
+CHIP_ERROR BLEEndPoint::HandleConnectComplete()
 {
-    BLE_ERROR err = BLE_NO_ERROR;
+    CHIP_ERROR err = CHIP_NO_ERROR;
 
     mState = kState_Connected;
 
@@ -176,7 +176,7 @@
     if (mBleTransport != nullptr)
     {
         // Indicate connect complete to next-higher layer.
-        mBleTransport->OnEndPointConnectComplete(this, BLE_NO_ERROR);
+        mBleTransport->OnEndPointConnectComplete(this, CHIP_NO_ERROR);
     }
     else
     {
@@ -187,9 +187,9 @@
     return err;
 }
 
-BLE_ERROR BLEEndPoint::HandleReceiveConnectionComplete()
+CHIP_ERROR BLEEndPoint::HandleReceiveConnectionComplete()
 {
-    BLE_ERROR err = BLE_NO_ERROR;
+    CHIP_ERROR err = CHIP_NO_ERROR;
 
     ChipLogDebugBleEndPoint(Ble, "entered HandleReceiveConnectionComplete");
     mState = kState_Connected;
@@ -213,10 +213,10 @@
 
 void BLEEndPoint::HandleSubscribeReceived()
 {
-    BLE_ERROR err = BLE_NO_ERROR;
+    CHIP_ERROR err = CHIP_NO_ERROR;
 
-    VerifyOrExit(mState == kState_Connecting || mState == kState_Aborting, err = BLE_ERROR_INCORRECT_STATE);
-    VerifyOrExit(!mSendQueue.IsNull(), err = BLE_ERROR_INCORRECT_STATE);
+    VerifyOrExit(mState == kState_Connecting || mState == kState_Aborting, err = CHIP_ERROR_INCORRECT_STATE);
+    VerifyOrExit(!mSendQueue.IsNull(), err = CHIP_ERROR_INCORRECT_STATE);
 
     // Send BTP capabilities response to peripheral via GATT indication.
 #if CHIP_ENABLE_CHIPOBLE_TEST
@@ -263,7 +263,7 @@
     } // Else State == kState_Aborting, so we'll close end point when indication confirmation received.
 
 exit:
-    if (err != BLE_NO_ERROR)
+    if (err != CHIP_NO_ERROR)
     {
         DoClose(kBleCloseFlag_SuppressCallback | kBleCloseFlag_AbortTransmission, err);
     }
@@ -274,11 +274,11 @@
     ChipLogProgress(Ble, "subscribe complete, ep = %p", this);
     mConnStateFlags.Clear(ConnectionStateFlag::kGattOperationInFlight);
 
-    BLE_ERROR err = DriveSending();
+    CHIP_ERROR err = DriveSending();
 
-    if (err != BLE_NO_ERROR)
+    if (err != CHIP_NO_ERROR)
     {
-        DoClose(kBleCloseFlag_AbortTransmission, BLE_NO_ERROR);
+        DoClose(kBleCloseFlag_AbortTransmission, CHIP_NO_ERROR);
     }
 }
 
@@ -308,7 +308,7 @@
     OnCommandReceived = NULL;
 #endif
 
-    DoClose(kBleCloseFlag_SuppressCallback | kBleCloseFlag_AbortTransmission, BLE_NO_ERROR);
+    DoClose(kBleCloseFlag_SuppressCallback | kBleCloseFlag_AbortTransmission, CHIP_NO_ERROR);
 }
 
 void BLEEndPoint::Close()
@@ -321,10 +321,10 @@
     OnCommandReceived = NULL;
 #endif
 
-    DoClose(kBleCloseFlag_SuppressCallback, BLE_NO_ERROR);
+    DoClose(kBleCloseFlag_SuppressCallback, CHIP_NO_ERROR);
 }
 
-void BLEEndPoint::DoClose(uint8_t flags, BLE_ERROR err)
+void BLEEndPoint::DoClose(uint8_t flags, CHIP_ERROR err)
 {
     uint8_t oldState = mState;
 
@@ -374,7 +374,7 @@
     }
 }
 
-void BLEEndPoint::FinalizeClose(uint8_t oldState, uint8_t flags, BLE_ERROR err)
+void BLEEndPoint::FinalizeClose(uint8_t oldState, uint8_t flags, CHIP_ERROR err)
 {
     mState = kState_Closed;
 
@@ -424,7 +424,7 @@
                 // received in the downcall to UnsubscribeCharacteristic, so set timer for the unsubscribe to complete.
                 err = StartUnsubscribeTimer();
 
-                if (err != BLE_NO_ERROR)
+                if (err != CHIP_NO_ERROR)
                 {
                     Free();
                 }
@@ -440,7 +440,7 @@
     }
 }
 
-void BLEEndPoint::DoCloseCallback(uint8_t state, uint8_t flags, BLE_ERROR err)
+void BLEEndPoint::DoCloseCallback(uint8_t state, uint8_t flags, CHIP_ERROR err)
 {
     if (state == kState_Connecting)
     {
@@ -528,36 +528,36 @@
     mBtpEngine.ClearRxPacket();
 }
 
-BLE_ERROR BLEEndPoint::Init(BleLayer * bleLayer, BLE_CONNECTION_OBJECT connObj, BleRole role, bool autoClose)
+CHIP_ERROR BLEEndPoint::Init(BleLayer * bleLayer, BLE_CONNECTION_OBJECT connObj, BleRole role, bool autoClose)
 {
     // Fail if already initialized.
-    VerifyOrReturnError(mBle == nullptr, BLE_ERROR_INCORRECT_STATE);
+    VerifyOrReturnError(mBle == nullptr, CHIP_ERROR_INCORRECT_STATE);
 
     // Validate args.
-    VerifyOrReturnError(bleLayer != nullptr, BLE_ERROR_BAD_ARGS);
-    VerifyOrReturnError(connObj != BLE_CONNECTION_UNINITIALIZED, BLE_ERROR_BAD_ARGS);
-    VerifyOrReturnError((role == kBleRole_Central || role == kBleRole_Peripheral), BLE_ERROR_BAD_ARGS);
+    VerifyOrReturnError(bleLayer != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
+    VerifyOrReturnError(connObj != BLE_CONNECTION_UNINITIALIZED, CHIP_ERROR_INVALID_ARGUMENT);
+    VerifyOrReturnError((role == kBleRole_Central || role == kBleRole_Peripheral), CHIP_ERROR_INVALID_ARGUMENT);
 
     // If end point plays peripheral role, expect ack for indication sent as last step of BTP handshake.
     // If central, periperal's handshake indication 'ack's write sent by central to kick off the BTP handshake.
     bool expectInitialAck = (role == kBleRole_Peripheral);
 
-    BLE_ERROR err = mBtpEngine.Init(this, expectInitialAck);
-    if (err != BLE_NO_ERROR)
+    CHIP_ERROR err = mBtpEngine.Init(this, expectInitialAck);
+    if (err != CHIP_NO_ERROR)
     {
         ChipLogError(Ble, "BtpEngine init failed");
         return err;
     }
 
 #if CHIP_ENABLE_CHIPOBLE_TEST
-    err = (BLE_ERROR) mTxQueueMutex.Init(mTxQueueMutex);
-    if (err != BLE_NO_ERROR)
+    err = static_cast<CHIP_ERROR>(mTxQueueMutex.Init(mTxQueueMutex));
+    if (err != CHIP_NO_ERROR)
     {
         ChipLogError(Ble, "%s: Mutex init failed", __FUNCTION__);
         return err;
     }
     err = mBtpEngineTest.Init(this);
-    if (err != BLE_NO_ERROR)
+    if (err != CHIP_NO_ERROR)
     {
         ChipLogError(Ble, "BTP test init failed");
         return err;
@@ -583,7 +583,7 @@
     // End point is ready to connect or receive a connection.
     mState = kState_Ready;
 
-    return BLE_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 void BLEEndPoint::Release()
@@ -597,9 +597,9 @@
     }
 }
 
-BLE_ERROR BLEEndPoint::SendCharacteristic(PacketBufferHandle && buf)
+CHIP_ERROR BLEEndPoint::SendCharacteristic(PacketBufferHandle && buf)
 {
-    BLE_ERROR err = BLE_NO_ERROR;
+    CHIP_ERROR err = CHIP_NO_ERROR;
 
     if (mRole == kBleRole_Central)
     {
@@ -659,14 +659,14 @@
     QueueTxUnlock();
 }
 
-BLE_ERROR BLEEndPoint::Send(PacketBufferHandle && data)
+CHIP_ERROR BLEEndPoint::Send(PacketBufferHandle && data)
 {
     ChipLogDebugBleEndPoint(Ble, "entered Send");
 
-    BLE_ERROR err = BLE_NO_ERROR;
+    CHIP_ERROR err = CHIP_NO_ERROR;
 
-    VerifyOrExit(!data.IsNull(), err = BLE_ERROR_BAD_ARGS);
-    VerifyOrExit(IsConnected(mState), err = BLE_ERROR_INCORRECT_STATE);
+    VerifyOrExit(!data.IsNull(), err = CHIP_ERROR_INVALID_ARGUMENT);
+    VerifyOrExit(IsConnected(mState), err = CHIP_ERROR_INCORRECT_STATE);
 
     // Ensure outgoing message fits in a single contiguous packet buffer, as currently required by the
     // message fragmentation and reassembly engine.
@@ -676,7 +676,7 @@
 
         if (data->HasChainedBuffer())
         {
-            err = BLE_ERROR_OUTBOUND_MESSAGE_TOO_BIG;
+            err = CHIP_ERROR_OUTBOUND_MESSAGE_TOO_BIG;
             ExitNow();
         }
     }
@@ -690,7 +690,7 @@
 
 exit:
     ChipLogDebugBleEndPoint(Ble, "exiting Send");
-    if (err != BLE_NO_ERROR)
+    if (err != CHIP_NO_ERROR)
     {
         DoClose(kBleCloseFlag_AbortTransmission, err);
     }
@@ -719,7 +719,7 @@
     return mBtpEngine.HandleCharacteristicSend(std::move(data), sentAck);
 }
 
-BLE_ERROR BLEEndPoint::SendNextMessage()
+CHIP_ERROR BLEEndPoint::SendNextMessage()
 {
     // Get the first queued packet to send
     QueueTxLock();
@@ -729,7 +729,7 @@
     if (mSendQueue.IsNull())
     {
         QueueTxUnlock();
-        return BLE_NO_ERROR;
+        return CHIP_NO_ERROR;
     }
 #endif
 
@@ -774,7 +774,7 @@
     return StartAckReceivedTimer();
 }
 
-BLE_ERROR BLEEndPoint::ContinueMessageSend()
+CHIP_ERROR BLEEndPoint::ContinueMessageSend()
 {
     bool sentAck;
 
@@ -799,11 +799,11 @@
     return StartAckReceivedTimer();
 }
 
-BLE_ERROR BLEEndPoint::HandleHandshakeConfirmationReceived()
+CHIP_ERROR BLEEndPoint::HandleHandshakeConfirmationReceived()
 {
     ChipLogDebugBleEndPoint(Ble, "entered HandleHandshakeConfirmationReceived");
 
-    BLE_ERROR err      = BLE_NO_ERROR;
+    CHIP_ERROR err     = CHIP_NO_ERROR;
     uint8_t closeFlags = kBleCloseFlag_AbortTransmission;
 
     // Free capabilities request/response payload.
@@ -856,7 +856,7 @@
 exit:
     ChipLogDebugBleEndPoint(Ble, "exiting HandleHandshakeConfirmationReceived");
 
-    if (err != BLE_NO_ERROR)
+    if (err != CHIP_NO_ERROR)
     {
         DoClose(closeFlags, err);
     }
@@ -864,9 +864,9 @@
     return err;
 }
 
-BLE_ERROR BLEEndPoint::HandleFragmentConfirmationReceived()
+CHIP_ERROR BLEEndPoint::HandleFragmentConfirmationReceived()
 {
-    BLE_ERROR err = BLE_NO_ERROR;
+    CHIP_ERROR err = CHIP_NO_ERROR;
 
     ChipLogDebugBleEndPoint(Ble, "entered HandleFragmentConfirmationReceived");
 
@@ -878,7 +878,7 @@
     }
 
     // Ensure we're in correct state to receive confirmation of non-handshake GATT send.
-    VerifyOrExit(IsConnected(mState), err = BLE_ERROR_INCORRECT_STATE);
+    VerifyOrExit(IsConnected(mState), err = CHIP_ERROR_INCORRECT_STATE);
 
     // TODO Packet buffer high water mark optimization: if ack pending, but fragmenter state == complete, free fragmenter's
     // tx buf before sending ack.
@@ -910,7 +910,7 @@
     }
 
 exit:
-    if (err != BLE_NO_ERROR)
+    if (err != CHIP_NO_ERROR)
     {
         DoClose(kBleCloseFlag_AbortTransmission, err);
     }
@@ -918,7 +918,7 @@
     return err;
 }
 
-BLE_ERROR BLEEndPoint::HandleGattSendConfirmationReceived()
+CHIP_ERROR BLEEndPoint::HandleGattSendConfirmationReceived()
 {
     ChipLogDebugBleEndPoint(Ble, "entered HandleGattSendConfirmationReceived");
 
@@ -936,7 +936,7 @@
     return HandleFragmentConfirmationReceived();
 }
 
-BLE_ERROR BLEEndPoint::DriveStandAloneAck()
+CHIP_ERROR BLEEndPoint::DriveStandAloneAck()
 {
     // Stop send-ack timer if running.
     StopSendAckTimer();
@@ -945,14 +945,14 @@
     if (mAckToSend.IsNull())
     {
         mAckToSend = System::PacketBufferHandle::New(kTransferProtocolStandaloneAckHeaderSize);
-        VerifyOrReturnError(!mAckToSend.IsNull(), BLE_ERROR_NO_MEMORY);
+        VerifyOrReturnError(!mAckToSend.IsNull(), CHIP_ERROR_NO_MEMORY);
     }
 
     // Attempt to send stand-alone ack.
     return DriveSending();
 }
 
-BLE_ERROR BLEEndPoint::DoSendStandAloneAck()
+CHIP_ERROR BLEEndPoint::DoSendStandAloneAck()
 {
     ChipLogDebugBleEndPoint(Ble, "entered DoSendStandAloneAck; sending stand-alone ack");
 
@@ -970,7 +970,7 @@
     return StartAckReceivedTimer();
 }
 
-BLE_ERROR BLEEndPoint::DriveSending()
+CHIP_ERROR BLEEndPoint::DriveSending()
 {
     ChipLogDebugBleEndPoint(Ble, "entered DriveSending");
 
@@ -999,7 +999,7 @@
 #endif
 
         // Can't send anything.
-        return BLE_NO_ERROR;
+        return CHIP_NO_ERROR;
     }
 
     // Otherwise, let's see what we can send.
@@ -1043,7 +1043,7 @@
         else if (mState == kState_Closing && !mBtpEngine.ExpectingAck()) // and mSendQueue is NULL, per above...
         {
             // If end point closing, got last ack, and got out-of-order confirmation for last send, finalize close.
-            FinalizeClose(mState, kBleCloseFlag_SuppressCallback, BLE_NO_ERROR);
+            FinalizeClose(mState, kBleCloseFlag_SuppressCallback, CHIP_NO_ERROR);
         }
         else
         {
@@ -1051,16 +1051,16 @@
         }
     }
 
-    return BLE_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
-BLE_ERROR BLEEndPoint::HandleCapabilitiesRequestReceived(PacketBufferHandle && data)
+CHIP_ERROR BLEEndPoint::HandleCapabilitiesRequestReceived(PacketBufferHandle && data)
 {
     BleTransportCapabilitiesRequestMessage req;
     BleTransportCapabilitiesResponseMessage resp;
     uint16_t mtu;
 
-    VerifyOrReturnError(!data.IsNull(), BLE_ERROR_BAD_ARGS);
+    VerifyOrReturnError(!data.IsNull(), CHIP_ERROR_INVALID_ARGUMENT);
 
     mState = kState_Connecting;
 
@@ -1068,7 +1068,7 @@
     ReturnErrorOnFailure(BleTransportCapabilitiesRequestMessage::Decode(data, req));
 
     PacketBufferHandle responseBuf = System::PacketBufferHandle::New(kCapabilitiesResponseLength);
-    VerifyOrReturnError(!responseBuf.IsNull(), BLE_ERROR_NO_MEMORY);
+    VerifyOrReturnError(!responseBuf.IsNull(), CHIP_ERROR_NO_MEMORY);
 
     // Determine BLE connection's negotiated ATT MTU, if possible.
     if (req.mMtu > 0) // If MTU was observed and provided by central...
@@ -1135,11 +1135,11 @@
     return StartReceiveConnectionTimer();
 }
 
-BLE_ERROR BLEEndPoint::HandleCapabilitiesResponseReceived(PacketBufferHandle && data)
+CHIP_ERROR BLEEndPoint::HandleCapabilitiesResponseReceived(PacketBufferHandle && data)
 {
     BleTransportCapabilitiesResponseMessage resp;
 
-    VerifyOrReturnError(!data.IsNull(), BLE_ERROR_BAD_ARGS);
+    VerifyOrReturnError(!data.IsNull(), CHIP_ERROR_INVALID_ARGUMENT);
 
     // Decode BTP capabilities response.
     ReturnErrorOnFailure(BleTransportCapabilitiesResponseMessage::Decode(data, resp));
@@ -1216,10 +1216,10 @@
     return static_cast<uint8_t>(newRemoteWindowBoundary - newestUnackedSentSeqNum);
 }
 
-BLE_ERROR BLEEndPoint::Receive(PacketBufferHandle && data)
+CHIP_ERROR BLEEndPoint::Receive(PacketBufferHandle && data)
 {
     ChipLogDebugBleEndPoint(Ble, "+++++++++++++++++++++ entered receive");
-    BLE_ERROR err                = BLE_NO_ERROR;
+    CHIP_ERROR err               = CHIP_NO_ERROR;
     SequenceNumber_t receivedAck = 0;
     uint8_t closeFlags           = kBleCloseFlag_AbortTransmission;
     bool didReceiveAck           = false;
@@ -1245,7 +1245,7 @@
             if (mRole == kBleRole_Central) // If we're a central receiving a capabilities response indication...
             {
                 // Ensure end point's in the right state before continuing.
-                VerifyOrExit(mState == kState_Connecting, err = BLE_ERROR_INCORRECT_STATE);
+                VerifyOrExit(mState == kState_Connecting, err = CHIP_ERROR_INCORRECT_STATE);
                 mConnStateFlags.Set(ConnectionStateFlag::kCapabilitiesMsgReceived);
 
                 err = HandleCapabilitiesResponseReceived(std::move(data));
@@ -1254,12 +1254,12 @@
             else // Or, a peripheral receiving a capabilities request write...
             {
                 // Ensure end point's in the right state before continuing.
-                VerifyOrExit(mState == kState_Ready, err = BLE_ERROR_INCORRECT_STATE);
+                VerifyOrExit(mState == kState_Ready, err = CHIP_ERROR_INCORRECT_STATE);
                 mConnStateFlags.Set(ConnectionStateFlag::kCapabilitiesMsgReceived);
 
                 err = HandleCapabilitiesRequestReceived(std::move(data));
 
-                if (err != BLE_NO_ERROR)
+                if (err != CHIP_NO_ERROR)
                 {
                     // If an error occurred decoding and handling the capabilities request, release the BLE connection.
                     // Central's connect attempt will time out if peripheral's application decides to keep the BLE
@@ -1281,7 +1281,7 @@
     if (!IsConnected(mState))
     {
         ChipLogError(Ble, "ep rx'd packet in bad state");
-        err = BLE_ERROR_INCORRECT_STATE;
+        err = CHIP_ERROR_INCORRECT_STATE;
 
         ExitNow();
     }
@@ -1315,7 +1315,7 @@
             if (mState == kState_Closing && mSendQueue.IsNull() && mBtpEngine.TxState() == BtpEngine::kState_Idle)
             {
                 // If end point closing, got confirmation for last send, and waiting for last ack, finalize close.
-                FinalizeClose(mState, kBleCloseFlag_SuppressCallback, BLE_NO_ERROR);
+                FinalizeClose(mState, kBleCloseFlag_SuppressCallback, CHIP_NO_ERROR);
                 ExitNow();
             }
         }
@@ -1403,7 +1403,7 @@
     }
 
 exit:
-    if (err != BLE_NO_ERROR)
+    if (err != CHIP_NO_ERROR)
     {
         DoClose(closeFlags, err);
     }
@@ -1425,71 +1425,69 @@
     return mBle->mPlatformDelegate->SendIndication(mConnObj, &CHIP_BLE_SVC_ID, &mBle->CHIP_BLE_CHAR_2_ID, std::move(buf));
 }
 
-BLE_ERROR BLEEndPoint::StartConnectTimer()
+CHIP_ERROR BLEEndPoint::StartConnectTimer()
 {
-    const chip::System::Error timerErr = mBle->mSystemLayer->StartTimer(BLE_CONNECT_TIMEOUT_MS, HandleConnectTimeout, this);
-    VerifyOrReturnError(timerErr == CHIP_SYSTEM_NO_ERROR, BLE_ERROR_START_TIMER_FAILED);
+    const CHIP_ERROR timerErr = mBle->mSystemLayer->StartTimer(BLE_CONNECT_TIMEOUT_MS, HandleConnectTimeout, this);
+    VerifyOrReturnError(timerErr == CHIP_NO_ERROR, BLE_ERROR_START_TIMER_FAILED);
     mTimerStateFlags.Set(TimerStateFlag::kConnectTimerRunning);
 
-    return BLE_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
-BLE_ERROR BLEEndPoint::StartReceiveConnectionTimer()
+CHIP_ERROR BLEEndPoint::StartReceiveConnectionTimer()
 {
-    const chip::System::Error timerErr =
-        mBle->mSystemLayer->StartTimer(BLE_CONNECT_TIMEOUT_MS, HandleReceiveConnectionTimeout, this);
-    VerifyOrReturnError(timerErr == CHIP_SYSTEM_NO_ERROR, BLE_ERROR_START_TIMER_FAILED);
+    const CHIP_ERROR timerErr = mBle->mSystemLayer->StartTimer(BLE_CONNECT_TIMEOUT_MS, HandleReceiveConnectionTimeout, this);
+    VerifyOrReturnError(timerErr == CHIP_NO_ERROR, BLE_ERROR_START_TIMER_FAILED);
     mTimerStateFlags.Set(TimerStateFlag::kReceiveConnectionTimerRunning);
 
-    return BLE_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
-BLE_ERROR BLEEndPoint::StartAckReceivedTimer()
+CHIP_ERROR BLEEndPoint::StartAckReceivedTimer()
 {
     if (!mTimerStateFlags.Has(TimerStateFlag::kAckReceivedTimerRunning))
     {
-        const chip::System::Error timerErr =
-            mBle->mSystemLayer->StartTimer(BTP_ACK_RECEIVED_TIMEOUT_MS, HandleAckReceivedTimeout, this);
-        VerifyOrReturnError(timerErr == CHIP_SYSTEM_NO_ERROR, BLE_ERROR_START_TIMER_FAILED);
+        const CHIP_ERROR timerErr = mBle->mSystemLayer->StartTimer(BTP_ACK_RECEIVED_TIMEOUT_MS, HandleAckReceivedTimeout, this);
+        VerifyOrReturnError(timerErr == CHIP_NO_ERROR, BLE_ERROR_START_TIMER_FAILED);
 
         mTimerStateFlags.Set(TimerStateFlag::kAckReceivedTimerRunning);
     }
 
-    return BLE_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
-BLE_ERROR BLEEndPoint::RestartAckReceivedTimer()
+CHIP_ERROR BLEEndPoint::RestartAckReceivedTimer()
 {
-    VerifyOrReturnError(mTimerStateFlags.Has(TimerStateFlag::kAckReceivedTimerRunning), BLE_ERROR_INCORRECT_STATE);
+    VerifyOrReturnError(mTimerStateFlags.Has(TimerStateFlag::kAckReceivedTimerRunning), CHIP_ERROR_INCORRECT_STATE);
 
     StopAckReceivedTimer();
 
     return StartAckReceivedTimer();
 }
 
-BLE_ERROR BLEEndPoint::StartSendAckTimer()
+CHIP_ERROR BLEEndPoint::StartSendAckTimer()
 {
     ChipLogDebugBleEndPoint(Ble, "entered StartSendAckTimer");
 
     if (!mTimerStateFlags.Has(TimerStateFlag::kSendAckTimerRunning))
     {
         ChipLogDebugBleEndPoint(Ble, "starting new SendAckTimer");
-        const chip::System::Error timerErr = mBle->mSystemLayer->StartTimer(BTP_ACK_SEND_TIMEOUT_MS, HandleSendAckTimeout, this);
-        VerifyOrReturnError(timerErr == CHIP_SYSTEM_NO_ERROR, BLE_ERROR_START_TIMER_FAILED);
+        const CHIP_ERROR timerErr = mBle->mSystemLayer->StartTimer(BTP_ACK_SEND_TIMEOUT_MS, HandleSendAckTimeout, this);
+        VerifyOrReturnError(timerErr == CHIP_NO_ERROR, BLE_ERROR_START_TIMER_FAILED);
 
         mTimerStateFlags.Set(TimerStateFlag::kSendAckTimerRunning);
     }
 
-    return BLE_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
-BLE_ERROR BLEEndPoint::StartUnsubscribeTimer()
+CHIP_ERROR BLEEndPoint::StartUnsubscribeTimer()
 {
-    const chip::System::Error timerErr = mBle->mSystemLayer->StartTimer(BLE_UNSUBSCRIBE_TIMEOUT_MS, HandleUnsubscribeTimeout, this);
-    VerifyOrReturnError(timerErr == CHIP_SYSTEM_NO_ERROR, BLE_ERROR_START_TIMER_FAILED);
+    const CHIP_ERROR timerErr = mBle->mSystemLayer->StartTimer(BLE_UNSUBSCRIBE_TIMEOUT_MS, HandleUnsubscribeTimeout, this);
+    VerifyOrReturnError(timerErr == CHIP_NO_ERROR, BLE_ERROR_START_TIMER_FAILED);
     mTimerStateFlags.Set(TimerStateFlag::kUnsubscribeTimerRunning);
 
-    return BLE_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 void BLEEndPoint::StopConnectTimer()
@@ -1527,7 +1525,7 @@
     mTimerStateFlags.Clear(TimerStateFlag::kUnsubscribeTimerRunning);
 }
 
-void BLEEndPoint::HandleConnectTimeout(chip::System::Layer * systemLayer, void * appState, chip::System::Error err)
+void BLEEndPoint::HandleConnectTimeout(chip::System::Layer * systemLayer, void * appState, CHIP_ERROR err)
 {
     BLEEndPoint * ep = static_cast<BLEEndPoint *>(appState);
 
@@ -1540,7 +1538,7 @@
     }
 }
 
-void BLEEndPoint::HandleReceiveConnectionTimeout(chip::System::Layer * systemLayer, void * appState, chip::System::Error err)
+void BLEEndPoint::HandleReceiveConnectionTimeout(chip::System::Layer * systemLayer, void * appState, CHIP_ERROR err)
 {
     BLEEndPoint * ep = static_cast<BLEEndPoint *>(appState);
 
@@ -1553,7 +1551,7 @@
     }
 }
 
-void BLEEndPoint::HandleAckReceivedTimeout(chip::System::Layer * systemLayer, void * appState, chip::System::Error err)
+void BLEEndPoint::HandleAckReceivedTimeout(chip::System::Layer * systemLayer, void * appState, CHIP_ERROR err)
 {
     BLEEndPoint * ep = static_cast<BLEEndPoint *>(appState);
 
@@ -1567,7 +1565,7 @@
     }
 }
 
-void BLEEndPoint::HandleSendAckTimeout(chip::System::Layer * systemLayer, void * appState, chip::System::Error err)
+void BLEEndPoint::HandleSendAckTimeout(chip::System::Layer * systemLayer, void * appState, CHIP_ERROR err)
 {
     BLEEndPoint * ep = static_cast<BLEEndPoint *>(appState);
 
@@ -1579,9 +1577,9 @@
         // If previous stand-alone ack isn't still in flight...
         if (!ep->mConnStateFlags.Has(ConnectionStateFlag::kStandAloneAckInFlight))
         {
-            BLE_ERROR sendErr = ep->DriveStandAloneAck();
+            CHIP_ERROR sendErr = ep->DriveStandAloneAck();
 
-            if (sendErr != BLE_NO_ERROR)
+            if (sendErr != CHIP_NO_ERROR)
             {
                 ep->DoClose(kBleCloseFlag_AbortTransmission, sendErr);
             }
@@ -1589,7 +1587,7 @@
     }
 }
 
-void BLEEndPoint::HandleUnsubscribeTimeout(chip::System::Layer * systemLayer, void * appState, chip::System::Error err)
+void BLEEndPoint::HandleUnsubscribeTimeout(chip::System::Layer * systemLayer, void * appState, CHIP_ERROR err)
 {
     BLEEndPoint * ep = static_cast<BLEEndPoint *>(appState);
 
diff --git a/src/ble/BLEEndPoint.h b/src/ble/BLEEndPoint.h
index 4503f52..f36f985 100644
--- a/src/ble/BLEEndPoint.h
+++ b/src/ble/BLEEndPoint.h
@@ -80,13 +80,13 @@
               // BLE transport protocol connection, not of underlying BLE connection.
 
     // Public function pointers:
-    typedef void (*OnConnectCompleteFunct)(BLEEndPoint * endPoint, BLE_ERROR err);
+    typedef void (*OnConnectCompleteFunct)(BLEEndPoint * endPoint, CHIP_ERROR err);
     OnConnectCompleteFunct OnConnectComplete;
 
     typedef void (*OnMessageReceivedFunct)(BLEEndPoint * endPoint, PacketBufferHandle && msg);
     OnMessageReceivedFunct OnMessageReceived;
 
-    typedef void (*OnConnectionClosedFunct)(BLEEndPoint * endPoint, BLE_ERROR err);
+    typedef void (*OnConnectionClosedFunct)(BLEEndPoint * endPoint, CHIP_ERROR err);
     OnConnectionClosedFunct OnConnectionClosed;
 
 #if CHIP_ENABLE_CHIPOBLE_TEST
@@ -99,9 +99,9 @@
 #endif
 
     // Public functions:
-    BLE_ERROR Send(PacketBufferHandle && data);
-    BLE_ERROR Receive(PacketBufferHandle && data);
-    BLE_ERROR StartConnect();
+    CHIP_ERROR Send(PacketBufferHandle && data);
+    CHIP_ERROR Receive(PacketBufferHandle && data);
+    CHIP_ERROR StartConnect();
 
     bool IsUnsubscribePending() const;
     bool ConnectionObjectIs(BLE_CONNECTION_OBJECT connObj) { return connObj == mConnObj; }
@@ -171,42 +171,42 @@
     BLEEndPoint()  = delete;
     ~BLEEndPoint() = delete;
 
-    BLE_ERROR Init(BleLayer * bleLayer, BLE_CONNECTION_OBJECT connObj, BleRole role, bool autoClose);
+    CHIP_ERROR Init(BleLayer * bleLayer, BLE_CONNECTION_OBJECT connObj, BleRole role, bool autoClose);
     bool IsConnected(uint8_t state) const;
-    void DoClose(uint8_t flags, BLE_ERROR err);
+    void DoClose(uint8_t flags, CHIP_ERROR err);
 
     // Transmit path:
-    BLE_ERROR DriveSending();
-    BLE_ERROR DriveStandAloneAck();
+    CHIP_ERROR DriveSending();
+    CHIP_ERROR DriveStandAloneAck();
     bool PrepareNextFragment(PacketBufferHandle && data, bool & sentAck);
-    BLE_ERROR SendNextMessage();
-    BLE_ERROR ContinueMessageSend();
-    BLE_ERROR DoSendStandAloneAck();
-    BLE_ERROR SendCharacteristic(PacketBufferHandle && buf);
+    CHIP_ERROR SendNextMessage();
+    CHIP_ERROR ContinueMessageSend();
+    CHIP_ERROR DoSendStandAloneAck();
+    CHIP_ERROR SendCharacteristic(PacketBufferHandle && buf);
     bool SendIndication(PacketBufferHandle && buf);
     bool SendWrite(PacketBufferHandle && buf);
 
     // Receive path:
-    BLE_ERROR HandleConnectComplete();
-    BLE_ERROR HandleReceiveConnectionComplete();
+    CHIP_ERROR HandleConnectComplete();
+    CHIP_ERROR HandleReceiveConnectionComplete();
     void HandleSubscribeReceived();
     void HandleSubscribeComplete();
     void HandleUnsubscribeComplete();
-    BLE_ERROR HandleGattSendConfirmationReceived();
-    BLE_ERROR HandleHandshakeConfirmationReceived();
-    BLE_ERROR HandleFragmentConfirmationReceived();
-    BLE_ERROR HandleCapabilitiesRequestReceived(PacketBufferHandle && data);
-    BLE_ERROR HandleCapabilitiesResponseReceived(PacketBufferHandle && data);
+    CHIP_ERROR HandleGattSendConfirmationReceived();
+    CHIP_ERROR HandleHandshakeConfirmationReceived();
+    CHIP_ERROR HandleFragmentConfirmationReceived();
+    CHIP_ERROR HandleCapabilitiesRequestReceived(PacketBufferHandle && data);
+    CHIP_ERROR HandleCapabilitiesResponseReceived(PacketBufferHandle && data);
     SequenceNumber_t AdjustRemoteReceiveWindow(SequenceNumber_t lastReceivedAck, SequenceNumber_t maxRemoteWindowSize,
                                                SequenceNumber_t newestUnackedSentSeqNum);
 
     // Timer control functions:
-    BLE_ERROR StartConnectTimer();           // Start connect timer.
-    BLE_ERROR StartReceiveConnectionTimer(); // Start receive connection timer.
-    BLE_ERROR StartAckReceivedTimer();       // Start ack-received timer if it's not already running.
-    BLE_ERROR RestartAckReceivedTimer();     // Restart ack-received timer.
-    BLE_ERROR StartSendAckTimer();           // Start send-ack timer if it's not already running.
-    BLE_ERROR StartUnsubscribeTimer();
+    CHIP_ERROR StartConnectTimer();           // Start connect timer.
+    CHIP_ERROR StartReceiveConnectionTimer(); // Start receive connection timer.
+    CHIP_ERROR StartAckReceivedTimer();       // Start ack-received timer if it's not already running.
+    CHIP_ERROR RestartAckReceivedTimer();     // Restart ack-received timer.
+    CHIP_ERROR StartSendAckTimer();           // Start send-ack timer if it's not already running.
+    CHIP_ERROR StartUnsubscribeTimer();
     void StopConnectTimer();           // Stop connect timer.
     void StopReceiveConnectionTimer(); // Stop receive connection timer.
     void StopAckReceivedTimer();       // Stop ack-received timer.
@@ -214,15 +214,15 @@
     void StopUnsubscribeTimer();       // Stop unsubscribe timer.
 
     // Timer expired callbacks:
-    static void HandleConnectTimeout(chip::System::Layer * systemLayer, void * appState, chip::System::Error err);
-    static void HandleReceiveConnectionTimeout(chip::System::Layer * systemLayer, void * appState, chip::System::Error err);
-    static void HandleAckReceivedTimeout(chip::System::Layer * systemLayer, void * appState, chip::System::Error err);
-    static void HandleSendAckTimeout(chip::System::Layer * systemLayer, void * appState, chip::System::Error err);
-    static void HandleUnsubscribeTimeout(chip::System::Layer * systemLayer, void * appState, chip::System::Error err);
+    static void HandleConnectTimeout(chip::System::Layer * systemLayer, void * appState, CHIP_ERROR err);
+    static void HandleReceiveConnectionTimeout(chip::System::Layer * systemLayer, void * appState, CHIP_ERROR err);
+    static void HandleAckReceivedTimeout(chip::System::Layer * systemLayer, void * appState, CHIP_ERROR err);
+    static void HandleSendAckTimeout(chip::System::Layer * systemLayer, void * appState, CHIP_ERROR err);
+    static void HandleUnsubscribeTimeout(chip::System::Layer * systemLayer, void * appState, CHIP_ERROR err);
 
     // Close functions:
-    void DoCloseCallback(uint8_t state, uint8_t flags, BLE_ERROR err);
-    void FinalizeClose(uint8_t state, uint8_t flags, BLE_ERROR err);
+    void DoCloseCallback(uint8_t state, uint8_t flags, CHIP_ERROR err);
+    void FinalizeClose(uint8_t state, uint8_t flags, CHIP_ERROR err);
     void ReleaseBleConnection();
     void Free();
     void FreeBtpEngine();
diff --git a/src/ble/BleConfig.h b/src/ble/BleConfig.h
index 0628a8c..5fa0dd9 100644
--- a/src/ble/BleConfig.h
+++ b/src/ble/BleConfig.h
@@ -173,35 +173,6 @@
 #endif
 
 /**
- *  @def BLE_CONFIG_ERROR_TYPE
- *
- *  @brief
- *    This defines the data type used to represent errors for the
- *    BleLayer subsystem.
- *
- */
-#ifndef BLE_CONFIG_ERROR_TYPE
-#include <stdint.h>
-#define BLE_CONFIG_ERROR_TYPE                              int32_t
-#define BLE_CONFIG_ERROR_FORMAT                            PRId32
-#else // BLE_CONFIG_ERROR_TYPE
-#ifndef BLE_CONFIG_ERROR_FORMAT
-#error "Must define BLE_CONFIG_ERROR_FORMAT when defining BLE_CONFIG_ERROR_TYPE"
-#endif // BLE_CONFIG_ERROR_FORMAT
-#endif // BLE_CONFIG_ERROR_TYPE
-
-/**
- *  @def BLE_CONFIG_NO_ERROR
- *
- *  @brief
- *    This defines the BleLayer error code for no error or success.
- *
- */
-#ifndef BLE_CONFIG_NO_ERROR
-#define BLE_CONFIG_NO_ERROR                                0
-#endif // BLE_CONFIG_NO_ERROR
-
-/**
  *  @def BLE_CONFIG_ERROR_MIN
  *
  *  @brief
@@ -224,16 +195,16 @@
 #endif // BLE_CONFIG_ERROR_MAX
 
 /**
- *  @def _BLE_CONFIG_ERROR
+ *  @def BLE_CONFIG_ERROR
  *
  *  @brief
  *    This defines a mapping function for BleLayer errors that allows
  *    mapping such errors into a platform- or system-specific range.
  *
  */
-#ifndef _BLE_CONFIG_ERROR
-#define _BLE_CONFIG_ERROR(e)                               (BLE_ERROR_MIN + (e))
-#endif // _BLE_CONFIG_ERROR
+#ifndef BLE_CONFIG_ERROR
+#define BLE_CONFIG_ERROR(e)                               (BLE_CONFIG_ERROR_MIN + (e))
+#endif // BLE_CONFIG_ERROR
 
 // clang-format on
 
diff --git a/src/ble/BleConnectionDelegate.h b/src/ble/BleConnectionDelegate.h
index 99eb36b..4eb8785 100644
--- a/src/ble/BleConnectionDelegate.h
+++ b/src/ble/BleConnectionDelegate.h
@@ -47,7 +47,7 @@
     typedef void (*OnConnectionCompleteFunct)(void * appState, BLE_CONNECTION_OBJECT connObj);
     OnConnectionCompleteFunct OnConnectionComplete;
 
-    typedef void (*OnConnectionErrorFunct)(void * appState, BLE_ERROR err);
+    typedef void (*OnConnectionErrorFunct)(void * appState, CHIP_ERROR err);
     OnConnectionErrorFunct OnConnectionError;
 
     // Call this function to delegate the connection steps required to get a BLE_CONNECTION_OBJECT
@@ -55,7 +55,7 @@
     virtual void NewConnection(BleLayer * bleLayer, void * appState, uint16_t connDiscriminator) = 0;
 
     // Call this function to stop the connection
-    virtual BLE_ERROR CancelConnection() = 0;
+    virtual CHIP_ERROR CancelConnection() = 0;
 };
 
 } /* namespace Ble */
diff --git a/src/ble/BleError.cpp b/src/ble/BleError.cpp
index a401c99..9940dcb 100644
--- a/src/ble/BleError.cpp
+++ b/src/ble/BleError.cpp
@@ -45,11 +45,11 @@
     RegisterErrorFormatter(&sBleLayerErrorFormatter);
 }
 
-bool FormatLayerError(char * buf, uint16_t bufSize, int32_t err)
+bool FormatLayerError(char * buf, uint16_t bufSize, CHIP_ERROR err)
 {
     const char * desc = nullptr;
 
-    if (err < BLE_ERROR_MIN || err > BLE_ERROR_MAX)
+    if (err < BLE_CONFIG_ERROR_MIN || err > BLE_CONFIG_ERROR_MAX)
     {
         return false;
     }
@@ -57,15 +57,6 @@
 #if !CHIP_CONFIG_SHORT_ERROR_STR
     switch (err)
     {
-    case BLE_ERROR_BAD_ARGS:
-        desc = "Bad arguments";
-        break;
-    case BLE_ERROR_INCORRECT_STATE:
-        desc = "Incorrect state";
-        break;
-    case BLE_ERROR_NO_ENDPOINTS:
-        desc = "No more BLE endpoints";
-        break;
     case BLE_ERROR_NO_CONNECTION_RECEIVED_CALLBACK:
         desc = "No chip over BLE connection received callback set";
         break;
@@ -84,9 +75,6 @@
     case BLE_ERROR_GATT_INDICATE_FAILED:
         desc = "GATT indicate characteristic operation failed";
         break;
-    case BLE_ERROR_NOT_IMPLEMENTED:
-        desc = "Not implemented";
-        break;
     case BLE_ERROR_CHIPOBLE_PROTOCOL_ABORT:
         desc = "BLE transport protocol fired abort";
         break;
@@ -96,21 +84,12 @@
     case BLE_ERROR_APP_CLOSED_CONNECTION:
         desc = "Application closed BLE connection";
         break;
-    case BLE_ERROR_OUTBOUND_MESSAGE_TOO_BIG:
-        desc = "Outbound message too big";
-        break;
     case BLE_ERROR_NOT_CHIP_DEVICE:
         desc = "BLE device doesn't seem to support chip";
         break;
     case BLE_ERROR_INCOMPATIBLE_PROTOCOL_VERSIONS:
         desc = "Incompatible BLE transport protocol versions";
         break;
-    case BLE_ERROR_NO_MEMORY:
-        desc = "No memory";
-        break;
-    case BLE_ERROR_MESSAGE_INCOMPLETE:
-        desc = "Message incomplete";
-        break;
     case BLE_ERROR_INVALID_FRAGMENT_SIZE:
         desc = "Invalid fragment size";
         break;
@@ -150,9 +129,6 @@
     case BLE_ERROR_REASSEMBLER_INCORRECT_STATE:
         desc = "BLE message reassembler received packet in incorrect state";
         break;
-    case BLE_ERROR_RECEIVED_MESSAGE_TOO_BIG:
-        desc = "Message received by BLE message reassembler was too large";
-        break;
     }
 #endif // !CHIP_CONFIG_SHORT_ERROR_STR
 
diff --git a/src/ble/BleError.h b/src/ble/BleError.h
index 8af6c59..2b0fb18 100644
--- a/src/ble/BleError.h
+++ b/src/ble/BleError.h
@@ -32,69 +32,25 @@
 
 #include "BleConfig.h"
 
+#include <core/CHIPError.h>
+
 // clang-format off
 
 /**
- *  @def BLE_NO_ERROR
- *
- *  @brief
- *    This defines the BleLayer error code for success or no
- *    error. This value may be configured via #BLE_CONFIG_NO_ERROR.
- *
- */
-#define BLE_NO_ERROR                   BLE_CONFIG_NO_ERROR
-
-/**
- *  @def BLE_ERROR_MIN
- *
- *  @brief
- *    This defines the base or minimum value of the BleLayer error number
- *    range. This value may be configured via #BLE_CONFIG_ERROR_MIN.
- *
- */
-#define BLE_ERROR_MIN                  BLE_CONFIG_ERROR_MIN
-
-/**
- *  @def BLE_ERROR_MAX
- *
- *  @brief
- *    This defines the top or maximum value of the BleLayer error number
- *    range. This value may be configured via #BLE_CONFIG_ERROR_MAX.
- *
- */
-#define BLE_ERROR_MAX                  BLE_CONFIG_ERROR_MAX
-
-/**
- *  @def _BLE_ERROR(e)
+ *  @def CHIP_BLE_ERROR(e)
  *
  *  @brief
  *    This defines a mapping function for BleLayer errors that allows
  *    mapping such errors into a platform- or system-specific
  *    range. This function may be configured via
- *    #_BLE_CONFIG_ERROR.
+ *    #BLE_CONFIG_ERROR.
  *
  *  @param[in]  e  The BleLayer error to map.
  *
  *  @return The mapped BleLayer error.
  *
  */
-#define _BLE_ERROR(e)                  _BLE_CONFIG_ERROR(e)
-
-/**
- *  @typedef BLE_ERROR
- *
- *  The basic type for all BleLayer errors.
- *
- *  This is defined to a platform- or system-specific type.
- *
- */
-typedef BLE_CONFIG_ERROR_TYPE BLE_ERROR;
-
-/**
- *  Format specifier for the BLE_ERROR type.
- *
- */
-#define BleErrorFormat BLE_CONFIG_ERROR_FORMAT
+#define CHIP_BLE_ERROR(e)                                  BLE_CONFIG_ERROR(e)
 
 /**
  *  @name Error Definitions
@@ -102,32 +58,9 @@
  *  @{
  */
 
-/**
- *  @def BLE_ERROR_BAD_ARGS
- *
- *  @brief
- *    An invalid argument or arguments were supplied.
- *
- */
-#define BLE_ERROR_BAD_ARGS                                 _BLE_ERROR(0)
-
-/**
- *  @def BLE_ERROR_INCORRECT_STATE
- *
- *  @brief
- *    An unexpected state was encountered.
- *
- */
-#define BLE_ERROR_INCORRECT_STATE                          _BLE_ERROR(1)
-
-/**
- *  @def BLE_ERROR_NO_ENDPOINTS
- *
- *  @brief
- *    No BLE endpoint is available.
- *
- */
-#define BLE_ERROR_NO_ENDPOINTS                             _BLE_ERROR(2)
+// unused                                                  CHIP_BLE_ERROR(0)
+// unused                                                  CHIP_BLE_ERROR(1)
+// unused                                                  CHIP_BLE_ERROR(2)
 
 /**
  *  @def BLE_ERROR_NO_CONNECTION_RECEIVED_CALLBACK
@@ -137,7 +70,7 @@
  *    connection.
  *
  */
-#define BLE_ERROR_NO_CONNECTION_RECEIVED_CALLBACK          _BLE_ERROR(3)
+#define BLE_ERROR_NO_CONNECTION_RECEIVED_CALLBACK          CHIP_BLE_ERROR(3)
 
 /**
  *  @def BLE_ERROR_CENTRAL_UNSUBSCRIBED
@@ -147,7 +80,7 @@
  *    Transport Protocol (BTP) transmit characteristic.
  *
  */
-#define BLE_ERROR_CENTRAL_UNSUBSCRIBED                     _BLE_ERROR(4)
+#define BLE_ERROR_CENTRAL_UNSUBSCRIBED                     CHIP_BLE_ERROR(4)
 
 /**
  *  @def BLE_ERROR_GATT_SUBSCRIBE_FAILED
@@ -157,7 +90,7 @@
  *    Transport Protocol (BTP) transmit characteristic.
  *
  */
-#define BLE_ERROR_GATT_SUBSCRIBE_FAILED                    _BLE_ERROR(5)
+#define BLE_ERROR_GATT_SUBSCRIBE_FAILED                    CHIP_BLE_ERROR(5)
 
 /**
  *  @def BLE_ERROR_GATT_UNSUBSCRIBE_FAILED
@@ -167,7 +100,7 @@
  *    BLE Transport Protocol (BTP) transmit characteristic.
  *
  */
-#define BLE_ERROR_GATT_UNSUBSCRIBE_FAILED                  _BLE_ERROR(6)
+#define BLE_ERROR_GATT_UNSUBSCRIBE_FAILED                  CHIP_BLE_ERROR(6)
 
 /**
  *  @def BLE_ERROR_GATT_WRITE_FAILED
@@ -176,7 +109,7 @@
  *    A General Attribute Profile (GATT) write operation failed.
  *
  */
-#define BLE_ERROR_GATT_WRITE_FAILED                        _BLE_ERROR(7)
+#define BLE_ERROR_GATT_WRITE_FAILED                        CHIP_BLE_ERROR(7)
 
 /**
  *  @def BLE_ERROR_GATT_INDICATE_FAILED
@@ -185,20 +118,10 @@
  *    A General Attribute Profile (GATT) indicate operation failed.
  *
  */
-#define BLE_ERROR_GATT_INDICATE_FAILED                     _BLE_ERROR(8)
+#define BLE_ERROR_GATT_INDICATE_FAILED                     CHIP_BLE_ERROR(8)
 
-/**
- *  @def BLE_ERROR_NOT_IMPLEMENTED
- *
- *  @brief
- *    A requested function or feature is not implemented.
- *
- */
-#define BLE_ERROR_NOT_IMPLEMENTED                          _BLE_ERROR(9)
-
-/*
- * Unused                                                  _BLE_ERROR(10)
- */
+// unused                                                  CHIP_BLE_ERROR(9)
+// unused                                                  CHIP_BLE_ERROR(10)
 
 /**
  *  @def BLE_ERROR_CHIPOBLE_PROTOCOL_ABORT
@@ -207,7 +130,7 @@
  *    A BLE Transport Protocol (BTP) error was encountered.
  *
  */
-#define BLE_ERROR_CHIPOBLE_PROTOCOL_ABORT                     _BLE_ERROR(11)
+#define BLE_ERROR_CHIPOBLE_PROTOCOL_ABORT                  CHIP_BLE_ERROR(11)
 
 /**
  *  @def BLE_ERROR_REMOTE_DEVICE_DISCONNECTED
@@ -217,7 +140,7 @@
  *    expiration of a BLE connection supervision timeout.
  *
  */
-#define BLE_ERROR_REMOTE_DEVICE_DISCONNECTED               _BLE_ERROR(12)
+#define BLE_ERROR_REMOTE_DEVICE_DISCONNECTED               CHIP_BLE_ERROR(12)
 
 /**
  *  @def BLE_ERROR_APP_CLOSED_CONNECTION
@@ -226,17 +149,9 @@
  *    The local application closed a BLE connection, and has informed BleLayer.
  *
  */
-#define BLE_ERROR_APP_CLOSED_CONNECTION                    _BLE_ERROR(13)
+#define BLE_ERROR_APP_CLOSED_CONNECTION                    CHIP_BLE_ERROR(13)
 
-/**
- *  @def BLE_ERROR_OUTBOUND_MESSAGE_TOO_BIG
- *
- *  @brief
- *    More outbound message data is pending than available buffer space
- *    available to copy it.
- *
- */
-#define BLE_ERROR_OUTBOUND_MESSAGE_TOO_BIG                 _BLE_ERROR(14)
+// unused                                                  CHIP_BLE_ERROR(14)
 
 /**
  *  @def BLE_ERROR_NOT_CHIP_DEVICE
@@ -246,7 +161,7 @@
  *    (GATT) service required by the Bluetooth Transport Protocol (BTP).
  *
  */
-#define BLE_ERROR_NOT_CHIP_DEVICE                         _BLE_ERROR(15)
+#define BLE_ERROR_NOT_CHIP_DEVICE                         CHIP_BLE_ERROR(15)
 
 /**
  *  @def BLE_ERROR_INCOMPATIBLE_PROTOCOL_VERSIONS
@@ -256,25 +171,10 @@
  *    Transport Protocol (BTP).
  *
  */
-#define BLE_ERROR_INCOMPATIBLE_PROTOCOL_VERSIONS           _BLE_ERROR(16)
+#define BLE_ERROR_INCOMPATIBLE_PROTOCOL_VERSIONS           CHIP_BLE_ERROR(16)
 
-/**
- *  @def BLE_ERROR_NO_MEMORY
- *
- *  @brief
- *    A request for memory could not be fulfilled.
- *
- */
-#define BLE_ERROR_NO_MEMORY                                _BLE_ERROR(17)
-
-/**
- *  @def BLE_ERROR_MESSAGE_INCOMPLETE
- *
- *  @brief
- *    A received Bluetooth Transport Protocol (BTP) message was incomplete.
- *
- */
-#define BLE_ERROR_MESSAGE_INCOMPLETE                       _BLE_ERROR(18)
+// unused                                                  CHIP_BLE_ERROR(17)
+// unused                                                  CHIP_BLE_ERROR(18)
 
 /**
  *  @def BLE_ERROR_INVALID_FRAGMENT_SIZE
@@ -284,7 +184,7 @@
  *    fragment size.
  *
  */
-#define BLE_ERROR_INVALID_FRAGMENT_SIZE                    _BLE_ERROR(19)
+#define BLE_ERROR_INVALID_FRAGMENT_SIZE                    CHIP_BLE_ERROR(19)
 
 /**
  *  @def BLE_ERROR_START_TIMER_FAILED
@@ -293,7 +193,7 @@
  *    A timer failed to start within BleLayer.
  *
  */
-#define BLE_ERROR_START_TIMER_FAILED                       _BLE_ERROR(20)
+#define BLE_ERROR_START_TIMER_FAILED                       CHIP_BLE_ERROR(20)
 
 /**
  *  @def BLE_ERROR_CONNECT_TIMED_OUT
@@ -303,7 +203,7 @@
  *    connect handshake response timed out.
  *
  */
-#define BLE_ERROR_CONNECT_TIMED_OUT                        _BLE_ERROR(21)
+#define BLE_ERROR_CONNECT_TIMED_OUT                        CHIP_BLE_ERROR(21)
 
 /**
  *  @def BLE_ERROR_RECEIVE_TIMED_OUT
@@ -313,7 +213,7 @@
  *    handshake timed out.
  *
  */
-#define BLE_ERROR_RECEIVE_TIMED_OUT                        _BLE_ERROR(22)
+#define BLE_ERROR_RECEIVE_TIMED_OUT                        CHIP_BLE_ERROR(22)
 
 /**
  *  @def BLE_ERROR_INVALID_MESSAGE
@@ -322,7 +222,7 @@
  *    An invalid Bluetooth Transport Protocol (BTP) message was received.
  *
  */
-#define BLE_ERROR_INVALID_MESSAGE                          _BLE_ERROR(23)
+#define BLE_ERROR_INVALID_MESSAGE                          CHIP_BLE_ERROR(23)
 
 /**
  *  @def BLE_ERROR_FRAGMENT_ACK_TIMED_OUT
@@ -332,7 +232,7 @@
  *    acknowledgement timed out.
  *
  */
-#define BLE_ERROR_FRAGMENT_ACK_TIMED_OUT                   _BLE_ERROR(24)
+#define BLE_ERROR_FRAGMENT_ACK_TIMED_OUT                   CHIP_BLE_ERROR(24)
 
 /**
  *  @def BLE_ERROR_KEEP_ALIVE_TIMED_OUT
@@ -342,7 +242,7 @@
  *    fragment timed out.
  *
  */
-#define BLE_ERROR_KEEP_ALIVE_TIMED_OUT                     _BLE_ERROR(25)
+#define BLE_ERROR_KEEP_ALIVE_TIMED_OUT                     CHIP_BLE_ERROR(25)
 
 /**
  *  @def BLE_ERROR_NO_CONNECT_COMPLETE_CALLBACK
@@ -352,7 +252,7 @@
  *    connect completion.
  *
  */
-#define BLE_ERROR_NO_CONNECT_COMPLETE_CALLBACK            _BLE_ERROR(26)
+#define BLE_ERROR_NO_CONNECT_COMPLETE_CALLBACK            CHIP_BLE_ERROR(26)
 
 /**
  *  @def BLE_ERROR_INVALID_ACK
@@ -361,7 +261,7 @@
  *    A Bluetooth Transport Protcol (BTP) fragment acknowledgement was invalid.
  *
  */
-#define BLE_ERROR_INVALID_ACK                              _BLE_ERROR(27)
+#define BLE_ERROR_INVALID_ACK                              CHIP_BLE_ERROR(27)
 
 /**
  *  @def BLE_ERROR_REASSEMBLER_MISSING_DATA
@@ -372,7 +272,7 @@
  *    the indicated size of the original fragmented message.
  *
  */
-#define BLE_ERROR_REASSEMBLER_MISSING_DATA                 _BLE_ERROR(28)
+#define BLE_ERROR_REASSEMBLER_MISSING_DATA                 CHIP_BLE_ERROR(28)
 
 /**
  *  @def BLE_ERROR_INVALID_BTP_HEADER_FLAGS
@@ -381,7 +281,7 @@
  *    A set of Bluetooth Transport Protocol (BTP) header flags is invalid.
  *
  */
-#define BLE_ERROR_INVALID_BTP_HEADER_FLAGS                 _BLE_ERROR(29)
+#define BLE_ERROR_INVALID_BTP_HEADER_FLAGS                 CHIP_BLE_ERROR(29)
 
 /**
  *  @def BLE_ERROR_INVALID_BTP_SEQUENCE_NUMBER
@@ -390,7 +290,7 @@
  *    A Bluetooth Transport Protocol (BTP) fragment sequence number is invalid.
  *
  */
-#define BLE_ERROR_INVALID_BTP_SEQUENCE_NUMBER              _BLE_ERROR(30)
+#define BLE_ERROR_INVALID_BTP_SEQUENCE_NUMBER              CHIP_BLE_ERROR(30)
 
 /**
  *  @def BLE_ERROR_REASSEMBLER_INCORRECT_STATE
@@ -400,17 +300,7 @@
  *    encountered an unexpected state.
  *
  */
-#define BLE_ERROR_REASSEMBLER_INCORRECT_STATE              _BLE_ERROR(31)
-
-/**
- *  @def BLE_ERROR_RECEIVED_MESSAGE_TOO_BIG
- *
- *  @brief
- *    More inbound message data is pending than available buffer space
- *    available to copy it.
- *
- */
-#define BLE_ERROR_RECEIVED_MESSAGE_TOO_BIG                 _BLE_ERROR(32)
+#define BLE_ERROR_REASSEMBLER_INCORRECT_STATE              CHIP_BLE_ERROR(31)
 
 // !!!!! IMPORTANT !!!!!  If you add new Ble errors, please update the translation
 // of error codes to strings in BleError.cpp, and add them to unittest
@@ -420,13 +310,27 @@
  *  @}
  */
 
+// !!!!! IMPORTANT !!!!!
+// These definitions are present temporarily in order to reduce breakage for PRs in flight.
+// TODO: remove compatibility definitions
+#define BLE_ERROR                               CHIP_ERROR
+#define BLE_NO_ERROR                            CHIP_NO_ERROR
+#define BLE_ERROR_BAD_ARGS                      CHIP_ERROR_INVALID_ARGUMENT
+#define BLE_ERROR_INCORRECT_STATE               CHIP_ERROR_INCORRECT_STATE
+#define BLE_ERROR_MESSAGE_INCOMPLETE            CHIP_ERROR_MESSAGE_INCOMPLETE
+#define BLE_ERROR_NOT_IMPLEMENTED               CHIP_ERROR_NOT_IMPLEMENTED
+#define BLE_ERROR_NO_ENDPOINTS                  CHIP_ERROR_ENDPOINT_POOL_FULL
+#define BLE_ERROR_NO_MEMORY                     CHIP_ERROR_NO_MEMORY
+#define BLE_ERROR_OUTBOUND_MESSAGE_TOO_BIG      CHIP_ERROR_OUTBOUND_MESSAGE_TOO_BIG
+#define BLE_ERROR_RECEIVED_MESSAGE_TOO_BIG      CHIP_ERROR_INBOUND_MESSAGE_TOO_BIG
+
 // clang-format on
 
 namespace chip {
 namespace Ble {
 
 extern void RegisterLayerErrorFormatter();
-extern bool FormatLayerError(char * buf, uint16_t bufSize, int32_t err);
+extern bool FormatLayerError(char * buf, uint16_t bufSize, CHIP_ERROR err);
 
 } /* namespace Ble */
 } /* namespace chip */
diff --git a/src/ble/BleLayer.cpp b/src/ble/BleLayer.cpp
index 851ad3d..de69288 100644
--- a/src/ble/BleLayer.cpp
+++ b/src/ble/BleLayer.cpp
@@ -169,12 +169,12 @@
     slot |= version;
 }
 
-BLE_ERROR BleTransportCapabilitiesRequestMessage::Encode(const PacketBufferHandle & msgBuf) const
+CHIP_ERROR BleTransportCapabilitiesRequestMessage::Encode(const PacketBufferHandle & msgBuf) const
 {
     uint8_t * p = msgBuf->Start();
 
     // Verify we can write the fixed-length request without running into the end of the buffer.
-    VerifyOrReturnError(msgBuf->MaxDataLength() >= kCapabilitiesRequestLength, BLE_ERROR_NO_MEMORY);
+    VerifyOrReturnError(msgBuf->MaxDataLength() >= kCapabilitiesRequestLength, CHIP_ERROR_NO_MEMORY);
 
     chip::Encoding::Write8(p, CAPABILITIES_MSG_CHECK_BYTE_1);
     chip::Encoding::Write8(p, CAPABILITIES_MSG_CHECK_BYTE_2);
@@ -189,16 +189,16 @@
 
     msgBuf->SetDataLength(kCapabilitiesRequestLength);
 
-    return BLE_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
-BLE_ERROR BleTransportCapabilitiesRequestMessage::Decode(const PacketBufferHandle & msgBuf,
-                                                         BleTransportCapabilitiesRequestMessage & msg)
+CHIP_ERROR BleTransportCapabilitiesRequestMessage::Decode(const PacketBufferHandle & msgBuf,
+                                                          BleTransportCapabilitiesRequestMessage & msg)
 {
     const uint8_t * p = msgBuf->Start();
 
     // Verify we can read the fixed-length request without running into the end of the buffer.
-    VerifyOrReturnError(msgBuf->DataLength() >= kCapabilitiesRequestLength, BLE_ERROR_MESSAGE_INCOMPLETE);
+    VerifyOrReturnError(msgBuf->DataLength() >= kCapabilitiesRequestLength, CHIP_ERROR_MESSAGE_INCOMPLETE);
 
     VerifyOrReturnError(CAPABILITIES_MSG_CHECK_BYTE_1 == chip::Encoding::Read8(p), BLE_ERROR_INVALID_MESSAGE);
     VerifyOrReturnError(CAPABILITIES_MSG_CHECK_BYTE_2 == chip::Encoding::Read8(p), BLE_ERROR_INVALID_MESSAGE);
@@ -211,17 +211,17 @@
     msg.mMtu        = chip::Encoding::LittleEndian::Read16(p);
     msg.mWindowSize = chip::Encoding::Read8(p);
 
-    return BLE_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 // BleTransportCapabilitiesResponseMessage implementation:
 
-BLE_ERROR BleTransportCapabilitiesResponseMessage::Encode(const PacketBufferHandle & msgBuf) const
+CHIP_ERROR BleTransportCapabilitiesResponseMessage::Encode(const PacketBufferHandle & msgBuf) const
 {
     uint8_t * p = msgBuf->Start();
 
     // Verify we can write the fixed-length request without running into the end of the buffer.
-    VerifyOrReturnError(msgBuf->MaxDataLength() >= kCapabilitiesResponseLength, BLE_ERROR_NO_MEMORY);
+    VerifyOrReturnError(msgBuf->MaxDataLength() >= kCapabilitiesResponseLength, CHIP_ERROR_NO_MEMORY);
 
     chip::Encoding::Write8(p, CAPABILITIES_MSG_CHECK_BYTE_1);
     chip::Encoding::Write8(p, CAPABILITIES_MSG_CHECK_BYTE_2);
@@ -232,16 +232,16 @@
 
     msgBuf->SetDataLength(kCapabilitiesResponseLength);
 
-    return BLE_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
-BLE_ERROR BleTransportCapabilitiesResponseMessage::Decode(const PacketBufferHandle & msgBuf,
-                                                          BleTransportCapabilitiesResponseMessage & msg)
+CHIP_ERROR BleTransportCapabilitiesResponseMessage::Decode(const PacketBufferHandle & msgBuf,
+                                                           BleTransportCapabilitiesResponseMessage & msg)
 {
     const uint8_t * p = msgBuf->Start();
 
     // Verify we can read the fixed-length response without running into the end of the buffer.
-    VerifyOrReturnError(msgBuf->DataLength() >= kCapabilitiesResponseLength, BLE_ERROR_MESSAGE_INCOMPLETE);
+    VerifyOrReturnError(msgBuf->DataLength() >= kCapabilitiesResponseLength, CHIP_ERROR_MESSAGE_INCOMPLETE);
 
     VerifyOrReturnError(CAPABILITIES_MSG_CHECK_BYTE_1 == chip::Encoding::Read8(p), BLE_ERROR_INVALID_MESSAGE);
     VerifyOrReturnError(CAPABILITIES_MSG_CHECK_BYTE_2 == chip::Encoding::Read8(p), BLE_ERROR_INVALID_MESSAGE);
@@ -250,7 +250,7 @@
     msg.mFragmentSize            = chip::Encoding::LittleEndian::Read16(p);
     msg.mWindowSize              = chip::Encoding::Read8(p);
 
-    return BLE_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 // BleLayer implementation:
@@ -260,20 +260,20 @@
     mState = kState_NotInitialized;
 }
 
-BLE_ERROR BleLayer::Init(BlePlatformDelegate * platformDelegate, BleConnectionDelegate * connDelegate,
-                         BleApplicationDelegate * appDelegate, chip::System::Layer * systemLayer)
+CHIP_ERROR BleLayer::Init(BlePlatformDelegate * platformDelegate, BleConnectionDelegate * connDelegate,
+                          BleApplicationDelegate * appDelegate, chip::System::Layer * systemLayer)
 {
     Ble::RegisterLayerErrorFormatter();
 
     // It is totally valid to not have a connDelegate. In this case the client application
     // will take care of the connection steps.
-    VerifyOrReturnError(platformDelegate != nullptr, BLE_ERROR_BAD_ARGS);
-    VerifyOrReturnError(appDelegate != nullptr, BLE_ERROR_BAD_ARGS);
-    VerifyOrReturnError(systemLayer != nullptr, BLE_ERROR_BAD_ARGS);
+    VerifyOrReturnError(platformDelegate != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
+    VerifyOrReturnError(appDelegate != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
+    VerifyOrReturnError(systemLayer != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
 
     if (mState != kState_NotInitialized)
     {
-        return BLE_ERROR_INCORRECT_STATE;
+        return CHIP_ERROR_INCORRECT_STATE;
     }
 
     mConnectionDelegate  = connDelegate;
@@ -289,22 +289,22 @@
     mTestBleEndPoint = NULL;
 #endif
 
-    return BLE_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
-BLE_ERROR BleLayer::Init(BlePlatformDelegate * platformDelegate, BleApplicationDelegate * appDelegate,
-                         chip::System::Layer * systemLayer)
+CHIP_ERROR BleLayer::Init(BlePlatformDelegate * platformDelegate, BleApplicationDelegate * appDelegate,
+                          chip::System::Layer * systemLayer)
 {
     return Init(platformDelegate, nullptr, appDelegate, systemLayer);
 }
 
-BLE_ERROR BleLayer::Shutdown()
+CHIP_ERROR BleLayer::Shutdown()
 {
     mState = kState_NotInitialized;
     return CloseAllBleConnections();
 }
 
-BLE_ERROR BleLayer::CloseAllBleConnections()
+CHIP_ERROR BleLayer::CloseAllBleConnections()
 {
     // Close and free all BLE end points.
     for (size_t i = 0; i < BLE_LAYER_NUM_BLE_ENDPOINTS; i++)
@@ -329,10 +329,10 @@
             }
         }
     }
-    return BLE_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
-BLE_ERROR BleLayer::CloseBleConnection(BLE_CONNECTION_OBJECT connObj)
+CHIP_ERROR BleLayer::CloseBleConnection(BLE_CONNECTION_OBJECT connObj)
 {
     // Close and free all BLE endpoints.
     for (size_t i = 0; i < BLE_LAYER_NUM_BLE_ENDPOINTS; i++)
@@ -357,66 +357,66 @@
             }
         }
     }
-    return BLE_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
-BLE_ERROR BleLayer::CancelBleIncompleteConnection()
+CHIP_ERROR BleLayer::CancelBleIncompleteConnection()
 {
-    VerifyOrReturnError(mState == kState_Initialized, BLE_ERROR_INCORRECT_STATE);
-    VerifyOrReturnError(mConnectionDelegate != nullptr, BLE_ERROR_INCORRECT_STATE);
+    VerifyOrReturnError(mState == kState_Initialized, CHIP_ERROR_INCORRECT_STATE);
+    VerifyOrReturnError(mConnectionDelegate != nullptr, CHIP_ERROR_INCORRECT_STATE);
 
-    BLE_ERROR err = mConnectionDelegate->CancelConnection();
-    if (err == BLE_ERROR_NOT_IMPLEMENTED)
+    CHIP_ERROR err = mConnectionDelegate->CancelConnection();
+    if (err == CHIP_ERROR_NOT_IMPLEMENTED)
     {
         ChipLogError(Ble, "BleConnectionDelegate::CancelConnection is not implemented.");
     }
     return err;
 }
 
-BLE_ERROR BleLayer::NewBleConnectionByDiscriminator(uint16_t connDiscriminator)
+CHIP_ERROR BleLayer::NewBleConnectionByDiscriminator(uint16_t connDiscriminator)
 {
 
-    VerifyOrReturnError(mState == kState_Initialized, BLE_ERROR_INCORRECT_STATE);
-    VerifyOrReturnError(mConnectionDelegate != nullptr, BLE_ERROR_INCORRECT_STATE);
-    VerifyOrReturnError(mBleTransport != nullptr, BLE_ERROR_INCORRECT_STATE);
+    VerifyOrReturnError(mState == kState_Initialized, CHIP_ERROR_INCORRECT_STATE);
+    VerifyOrReturnError(mConnectionDelegate != nullptr, CHIP_ERROR_INCORRECT_STATE);
+    VerifyOrReturnError(mBleTransport != nullptr, CHIP_ERROR_INCORRECT_STATE);
 
     mConnectionDelegate->OnConnectionComplete = OnConnectionComplete;
     mConnectionDelegate->OnConnectionError    = OnConnectionError;
     // TODO: We are passing the same parameter two times, should take a look at it to see if we can remove one of them.
     mConnectionDelegate->NewConnection(this, this, connDiscriminator);
 
-    return BLE_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
-BLE_ERROR BleLayer::NewBleConnectionByObject(BLE_CONNECTION_OBJECT connObj)
+CHIP_ERROR BleLayer::NewBleConnectionByObject(BLE_CONNECTION_OBJECT connObj)
 {
-    VerifyOrReturnError(mState == kState_Initialized, BLE_ERROR_INCORRECT_STATE);
-    VerifyOrReturnError(mBleTransport != nullptr, BLE_ERROR_INCORRECT_STATE);
+    VerifyOrReturnError(mState == kState_Initialized, CHIP_ERROR_INCORRECT_STATE);
+    VerifyOrReturnError(mBleTransport != nullptr, CHIP_ERROR_INCORRECT_STATE);
 
     OnConnectionComplete(this, connObj);
 
-    return BLE_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
-BLE_ERROR BleLayer::NewBleEndPoint(BLEEndPoint ** retEndPoint, BLE_CONNECTION_OBJECT connObj, BleRole role, bool autoClose)
+CHIP_ERROR BleLayer::NewBleEndPoint(BLEEndPoint ** retEndPoint, BLE_CONNECTION_OBJECT connObj, BleRole role, bool autoClose)
 {
     *retEndPoint = nullptr;
 
     if (mState != kState_Initialized)
     {
-        return BLE_ERROR_INCORRECT_STATE;
+        return CHIP_ERROR_INCORRECT_STATE;
     }
 
     if (connObj == BLE_CONNECTION_UNINITIALIZED)
     {
-        return BLE_ERROR_BAD_ARGS;
+        return CHIP_ERROR_INVALID_ARGUMENT;
     }
 
     *retEndPoint = sBLEEndPointPool.GetFree();
     if (*retEndPoint == nullptr)
     {
         ChipLogError(Ble, "%s endpoint pool FULL", "Ble");
-        return BLE_ERROR_NO_ENDPOINTS;
+        return CHIP_ERROR_ENDPOINT_POOL_FULL;
     }
 
     (*retEndPoint)->Init(this, connObj, role, autoClose);
@@ -426,13 +426,13 @@
     mTestBleEndPoint = *retEndPoint;
 #endif
 
-    return BLE_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 // Handle remote central's initiation of CHIP over BLE protocol handshake.
-BLE_ERROR BleLayer::HandleBleTransportConnectionInitiated(BLE_CONNECTION_OBJECT connObj, PacketBufferHandle && pBuf)
+CHIP_ERROR BleLayer::HandleBleTransportConnectionInitiated(BLE_CONNECTION_OBJECT connObj, PacketBufferHandle && pBuf)
 {
-    BLE_ERROR err             = BLE_NO_ERROR;
+    CHIP_ERROR err            = CHIP_NO_ERROR;
     BLEEndPoint * newEndPoint = nullptr;
 
     // Only BLE peripherals can receive GATT writes, so specify this role in our creation of the BLEEndPoint.
@@ -453,9 +453,9 @@
         mApplicationDelegate->NotifyChipConnectionClosed(connObj);
     }
 
-    if (err != BLE_NO_ERROR)
+    if (err != CHIP_NO_ERROR)
     {
-        ChipLogError(Ble, "HandleChipConnectionReceived failed, err = %" BleErrorFormat, err);
+        ChipLogError(Ble, "HandleChipConnectionReceived failed, err = %" CHIP_ERROR_FORMAT, err);
     }
 
     return err;
@@ -483,18 +483,18 @@
 
         if (endPoint != nullptr)
         {
-            BLE_ERROR status = endPoint->Receive(std::move(pBuf));
-            if (status != BLE_NO_ERROR)
+            CHIP_ERROR status = endPoint->Receive(std::move(pBuf));
+            if (status != CHIP_NO_ERROR)
             {
-                ChipLogError(Ble, "BLEEndPoint rcv failed, err = %" BleErrorFormat, status);
+                ChipLogError(Ble, "BLEEndPoint rcv failed, err = %" CHIP_ERROR_FORMAT, status);
             }
         }
         else
         {
-            BLE_ERROR status = HandleBleTransportConnectionInitiated(connObj, std::move(pBuf));
-            if (status != BLE_NO_ERROR)
+            CHIP_ERROR status = HandleBleTransportConnectionInitiated(connObj, std::move(pBuf));
+            if (status != CHIP_NO_ERROR)
             {
-                ChipLogError(Ble, "failed handle new chip BLE connection, status = %" BleErrorFormat, status);
+                ChipLogError(Ble, "failed handle new chip BLE connection, status = %" CHIP_ERROR_FORMAT, status);
             }
         }
     }
@@ -527,10 +527,10 @@
 
         if (endPoint != nullptr)
         {
-            BLE_ERROR status = endPoint->Receive(std::move(pBuf));
-            if (status != BLE_NO_ERROR)
+            CHIP_ERROR status = endPoint->Receive(std::move(pBuf));
+            if (status != CHIP_NO_ERROR)
             {
-                ChipLogError(Ble, "BLEEndPoint rcv failed, err = %" BleErrorFormat, status);
+                ChipLogError(Ble, "BLEEndPoint rcv failed, err = %" CHIP_ERROR_FORMAT, status);
             }
         }
         else
@@ -591,11 +591,11 @@
 
     if (endPoint != nullptr)
     {
-        BLE_ERROR status = endPoint->HandleGattSendConfirmationReceived();
+        CHIP_ERROR status = endPoint->HandleGattSendConfirmationReceived();
 
-        if (status != BLE_NO_ERROR)
+        if (status != CHIP_NO_ERROR)
         {
-            ChipLogError(Ble, "endpoint conf recvd failed, err = %" BleErrorFormat, status);
+            ChipLogError(Ble, "endpoint conf recvd failed, err = %" CHIP_ERROR_FORMAT, status);
         }
     }
     else
@@ -703,7 +703,7 @@
     return true;
 }
 
-void BleLayer::HandleConnectionError(BLE_CONNECTION_OBJECT connObj, BLE_ERROR err)
+void BleLayer::HandleConnectionError(BLE_CONNECTION_OBJECT connObj, CHIP_ERROR err)
 {
     // BLE connection has failed somehow, we must find and abort matching connection end point.
     BLEEndPoint * endPoint = sBLEEndPointPool.Find(connObj);
@@ -754,19 +754,19 @@
 {
     BleLayer * layer       = reinterpret_cast<BleLayer *>(appState);
     BLEEndPoint * endPoint = nullptr;
-    BLE_ERROR err          = BLE_NO_ERROR;
+    CHIP_ERROR err         = CHIP_NO_ERROR;
 
     SuccessOrExit(err = layer->NewBleEndPoint(&endPoint, connObj, kBleRole_Central, true));
     layer->mBleTransport->OnBleConnectionComplete(endPoint);
 
 exit:
-    if (err != BLE_NO_ERROR)
+    if (err != CHIP_NO_ERROR)
     {
         OnConnectionError(layer, err);
     }
 }
 
-void BleLayer::OnConnectionError(void * appState, BLE_ERROR err)
+void BleLayer::OnConnectionError(void * appState, CHIP_ERROR err)
 {
     BleLayer * layer = reinterpret_cast<BleLayer *>(appState);
     layer->mBleTransport->OnBleConnectionError(err);
diff --git a/src/ble/BleLayer.h b/src/ble/BleLayer.h
index 23e0df5..e506ca0 100644
--- a/src/ble/BleLayer.h
+++ b/src/ble/BleLayer.h
@@ -146,9 +146,9 @@
     void SetSupportedProtocolVersion(uint8_t index, uint8_t version);
 
     /// Must be able to reserve 20 byte data length in msgBuf.
-    BLE_ERROR Encode(const System::PacketBufferHandle & msgBuf) const;
+    CHIP_ERROR Encode(const System::PacketBufferHandle & msgBuf) const;
 
-    static BLE_ERROR Decode(const System::PacketBufferHandle & msgBuf, BleTransportCapabilitiesRequestMessage & msg);
+    static CHIP_ERROR Decode(const System::PacketBufferHandle & msgBuf, BleTransportCapabilitiesRequestMessage & msg);
 };
 
 class BleTransportCapabilitiesResponseMessage
@@ -180,9 +180,9 @@
     uint8_t mWindowSize;
 
     /// Must be able to reserve 20 byte data length in msgBuf.
-    BLE_ERROR Encode(const System::PacketBufferHandle & msgBuf) const;
+    CHIP_ERROR Encode(const System::PacketBufferHandle & msgBuf) const;
 
-    static BLE_ERROR Decode(const System::PacketBufferHandle & msgBuf, BleTransportCapabilitiesResponseMessage & msg);
+    static CHIP_ERROR Decode(const System::PacketBufferHandle & msgBuf, BleTransportCapabilitiesResponseMessage & msg);
 };
 
 /**
@@ -240,20 +240,21 @@
     // Public functions:
     BleLayer();
 
-    BLE_ERROR Init(BlePlatformDelegate * platformDelegate, BleApplicationDelegate * appDelegate, chip::System::Layer * systemLayer);
-    BLE_ERROR Init(BlePlatformDelegate * platformDelegate, BleConnectionDelegate * connDelegate,
-                   BleApplicationDelegate * appDelegate, chip::System::Layer * systemLayer);
-    BLE_ERROR Shutdown();
+    CHIP_ERROR Init(BlePlatformDelegate * platformDelegate, BleApplicationDelegate * appDelegate,
+                    chip::System::Layer * systemLayer);
+    CHIP_ERROR Init(BlePlatformDelegate * platformDelegate, BleConnectionDelegate * connDelegate,
+                    BleApplicationDelegate * appDelegate, chip::System::Layer * systemLayer);
+    CHIP_ERROR Shutdown();
 
-    BLE_ERROR CancelBleIncompleteConnection();
-    BLE_ERROR NewBleConnectionByDiscriminator(uint16_t connDiscriminator);
-    BLE_ERROR NewBleConnectionByObject(BLE_CONNECTION_OBJECT connObj);
-    BLE_ERROR NewBleEndPoint(BLEEndPoint ** retEndPoint, BLE_CONNECTION_OBJECT connObj, BleRole role, bool autoClose);
+    CHIP_ERROR CancelBleIncompleteConnection();
+    CHIP_ERROR NewBleConnectionByDiscriminator(uint16_t connDiscriminator);
+    CHIP_ERROR NewBleConnectionByObject(BLE_CONNECTION_OBJECT connObj);
+    CHIP_ERROR NewBleEndPoint(BLEEndPoint ** retEndPoint, BLE_CONNECTION_OBJECT connObj, BleRole role, bool autoClose);
 
-    BLE_ERROR CloseAllBleConnections();
-    BLE_ERROR CloseBleConnection(BLE_CONNECTION_OBJECT connObj);
+    CHIP_ERROR CloseAllBleConnections();
+    CHIP_ERROR CloseBleConnection(BLE_CONNECTION_OBJECT connObj);
 
-    chip::System::Error ScheduleWork(chip::System::Layer::TimerCompleteFunct aComplete, void * aAppState)
+    CHIP_ERROR ScheduleWork(chip::System::Layer::TimerCompleteFunct aComplete, void * aAppState)
     {
         return mSystemLayer->ScheduleWork(aComplete, aAppState);
     }
@@ -318,7 +319,7 @@
      *   NOTE: if the application explicitly closes a BLE connection with an associated chipConnection such that
      *   the BLE connection close will not generate an upcall to CHIP, HandleConnectionError must be called with
      *   err = BLE_ERROR_APP_CLOSED_CONNECTION to prevent the leak of this chipConnection and its end point object. */
-    void HandleConnectionError(BLE_CONNECTION_OBJECT connObj, BLE_ERROR err);
+    void HandleConnectionError(BLE_CONNECTION_OBJECT connObj, CHIP_ERROR err);
 
 #if CHIP_ENABLE_CHIPOBLE_TEST
     BLEEndPoint * mTestBleEndPoint;
@@ -342,12 +343,12 @@
     // Private functions:
     void HandleAckReceived(BLE_CONNECTION_OBJECT connObj);
     void DriveSending();
-    BLE_ERROR HandleBleTransportConnectionInitiated(BLE_CONNECTION_OBJECT connObj, System::PacketBufferHandle && pBuf);
+    CHIP_ERROR HandleBleTransportConnectionInitiated(BLE_CONNECTION_OBJECT connObj, System::PacketBufferHandle && pBuf);
 
     static BleTransportProtocolVersion GetHighestSupportedProtocolVersion(const BleTransportCapabilitiesRequestMessage & reqMsg);
 
     static void OnConnectionComplete(void * appState, BLE_CONNECTION_OBJECT connObj);
-    static void OnConnectionError(void * appState, BLE_ERROR err);
+    static void OnConnectionError(void * appState, CHIP_ERROR err);
 };
 
 } /* namespace Ble */
diff --git a/src/ble/BleLayerDelegate.h b/src/ble/BleLayerDelegate.h
index 78c78ef..63d4243 100644
--- a/src/ble/BleLayerDelegate.h
+++ b/src/ble/BleLayerDelegate.h
@@ -38,11 +38,11 @@
     virtual ~BleLayerDelegate() = default;
 
     virtual void OnBleConnectionComplete(BLEEndPoint * endpoint) = 0;
-    virtual void OnBleConnectionError(BLE_ERROR err)             = 0;
+    virtual void OnBleConnectionError(CHIP_ERROR err)            = 0;
 
-    virtual void OnEndPointConnectComplete(BLEEndPoint * endPoint, BLE_ERROR err)                     = 0;
+    virtual void OnEndPointConnectComplete(BLEEndPoint * endPoint, CHIP_ERROR err)                    = 0;
     virtual void OnEndPointMessageReceived(BLEEndPoint * endPoint, System::PacketBufferHandle && msg) = 0;
-    virtual void OnEndPointConnectionClosed(BLEEndPoint * endPoint, BLE_ERROR err)                    = 0;
+    virtual void OnEndPointConnectionClosed(BLEEndPoint * endPoint, CHIP_ERROR err)                   = 0;
 
     virtual CHIP_ERROR SetEndPoint(BLEEndPoint * endPoint) = 0;
 };
diff --git a/src/ble/BtpEngine.cpp b/src/ble/BtpEngine.cpp
index 58c9efc..d222d15 100644
--- a/src/ble/BtpEngine.cpp
+++ b/src/ble/BtpEngine.cpp
@@ -76,7 +76,7 @@
 const uint16_t BtpEngine::sDefaultFragmentSize = 20;  // 23-byte minimum ATT_MTU - 3 bytes for ATT operation header
 const uint16_t BtpEngine::sMaxFragmentSize     = 128; // Size of write and indication characteristics
 
-BLE_ERROR BtpEngine::Init(void * an_app_state, bool expect_first_ack)
+CHIP_ERROR BtpEngine::Init(void * an_app_state, bool expect_first_ack)
 {
     mAppState              = an_app_state;
     mRxState               = kState_Idle;
@@ -111,7 +111,7 @@
         mRxNextSeqNum = 1;
     }
 
-    return BLE_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 SequenceNumber_t BtpEngine::GetAndIncrementNextTxSeqNum()
@@ -171,7 +171,7 @@
     return (ack_num <= mTxNewestUnackedSeqNum || ack_num >= mTxOldestUnackedSeqNum);
 }
 
-BLE_ERROR BtpEngine::HandleAckReceived(SequenceNumber_t ack_num)
+CHIP_ERROR BtpEngine::HandleAckReceived(SequenceNumber_t ack_num)
 {
     ChipLogDebugBtpEngine(Ble, "entered HandleAckReceived, ack_num = %u", ack_num);
 
@@ -192,18 +192,18 @@
         IncSeqNum(mTxOldestUnackedSeqNum);
     }
 
-    return BLE_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 // Calling convention:
 //   EncodeStandAloneAck may only be called if data arg is commited for immediate, synchronous subsequent transmission.
-BLE_ERROR BtpEngine::EncodeStandAloneAck(const PacketBufferHandle & data)
+CHIP_ERROR BtpEngine::EncodeStandAloneAck(const PacketBufferHandle & data)
 {
     // Ensure enough headroom exists for the lower BLE layers.
-    VerifyOrReturnError(data->EnsureReservedSize(CHIP_CONFIG_BLE_PKT_RESERVED_SIZE), BLE_ERROR_NO_MEMORY);
+    VerifyOrReturnError(data->EnsureReservedSize(CHIP_CONFIG_BLE_PKT_RESERVED_SIZE), CHIP_ERROR_NO_MEMORY);
 
     // Ensure enough space for standalone ack payload.
-    VerifyOrReturnError(data->MaxDataLength() >= kTransferProtocolStandaloneAckHeaderSize, BLE_ERROR_NO_MEMORY);
+    VerifyOrReturnError(data->MaxDataLength() >= kTransferProtocolStandaloneAckHeaderSize, CHIP_ERROR_NO_MEMORY);
     uint8_t * characteristic = data->Start();
 
     // Since there's no preexisting message payload, we can write BTP header without adjusting data start pointer.
@@ -219,7 +219,7 @@
     // Set ack payload data length.
     data->SetDataLength(kTransferProtocolStandaloneAckHeaderSize);
 
-    return BLE_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 // Calling convention:
@@ -234,21 +234,21 @@
 //   or freed if it holds a stand-alone ack. In all cases, caller must clear its reference to data arg when this
 //   function returns.
 //
-//   Upper layer must immediately clean up and reinitialize protocol engine if returned err != BLE_NO_ERROR.
-BLE_ERROR BtpEngine::HandleCharacteristicReceived(System::PacketBufferHandle && data, SequenceNumber_t & receivedAck,
-                                                  bool & didReceiveAck)
+//   Upper layer must immediately clean up and reinitialize protocol engine if returned err != CHIP_NO_ERROR.
+CHIP_ERROR BtpEngine::HandleCharacteristicReceived(System::PacketBufferHandle && data, SequenceNumber_t & receivedAck,
+                                                   bool & didReceiveAck)
 {
-    BLE_ERROR err = BLE_NO_ERROR;
+    CHIP_ERROR err = CHIP_NO_ERROR;
     BitFlags<HeaderFlags> rx_flags;
     // BLE data uses little-endian byte order.
     Encoding::LittleEndian::Reader reader(data->Start(), data->DataLength());
 
-    VerifyOrExit(!data.IsNull(), err = BLE_ERROR_BAD_ARGS);
+    VerifyOrExit(!data.IsNull(), err = CHIP_ERROR_INVALID_ARGUMENT);
 
     mRxCharCount++;
 
     // Get header flags, always in first byte.
-    VerifyOrExit(reader.Read8(rx_flags.RawStorage()).StatusCode() == CHIP_NO_ERROR, err = BLE_ERROR_MESSAGE_INCOMPLETE);
+    VerifyOrExit(reader.Read8(rx_flags.RawStorage()).StatusCode() == CHIP_NO_ERROR, err = CHIP_ERROR_MESSAGE_INCOMPLETE);
 #if CHIP_ENABLE_CHIPOBLE_TEST
     if (rx_flags.Has(HeaderFlags::kCommandMessage))
         SetRxPacketType(kType_Control);
@@ -261,14 +261,14 @@
     // Get ack number, if any.
     if (didReceiveAck)
     {
-        VerifyOrExit(reader.Read8(&receivedAck).StatusCode() == CHIP_NO_ERROR, err = BLE_ERROR_MESSAGE_INCOMPLETE);
+        VerifyOrExit(reader.Read8(&receivedAck).StatusCode() == CHIP_NO_ERROR, err = CHIP_ERROR_MESSAGE_INCOMPLETE);
 
         err = HandleAckReceived(receivedAck);
         SuccessOrExit(err);
     }
 
     // Get sequence number.
-    VerifyOrExit(reader.Read8(&mRxNewestUnackedSeqNum).StatusCode() == CHIP_NO_ERROR, err = BLE_ERROR_MESSAGE_INCOMPLETE);
+    VerifyOrExit(reader.Read8(&mRxNewestUnackedSeqNum).StatusCode() == CHIP_NO_ERROR, err = CHIP_ERROR_MESSAGE_INCOMPLETE);
 
     // Verify that received sequence number is the next one we'd expect.
     VerifyOrExit(mRxNewestUnackedSeqNum == mRxNextSeqNum, err = BLE_ERROR_INVALID_BTP_SEQUENCE_NUMBER);
@@ -304,7 +304,7 @@
         // Verify StartMessage header flag set.
         VerifyOrExit(rx_flags.Has(HeaderFlags::kStartMessage), err = BLE_ERROR_INVALID_BTP_HEADER_FLAGS);
 
-        VerifyOrExit(startReader.Read16(&mRxLength).StatusCode() == CHIP_NO_ERROR, err = BLE_ERROR_MESSAGE_INCOMPLETE);
+        VerifyOrExit(startReader.Read16(&mRxLength).StatusCode() == CHIP_NO_ERROR, err = CHIP_ERROR_MESSAGE_INCOMPLETE);
 
         mRxState = kState_InProgress;
 
@@ -313,7 +313,7 @@
         // Create a new buffer for use as the Rx re-assembly area.
         mRxBuf = System::PacketBufferHandle::New(System::PacketBuffer::kMaxSize);
 
-        VerifyOrExit(!mRxBuf.IsNull(), err = BLE_ERROR_NO_MEMORY);
+        VerifyOrExit(!mRxBuf.IsNull(), err = CHIP_ERROR_NO_MEMORY);
 
         mRxBuf->AddToEnd(std::move(data));
         mRxBuf->CompactHead(); // will free 'data' and adjust rx buf's end/length
@@ -333,7 +333,7 @@
 
         // For now, limit BtpEngine message size to max length of 1 pbuf, as we do for chip messages sent via IP.
         // TODO add support for BtpEngine messages longer than 1 pbuf
-        VerifyOrExit(!mRxBuf->HasChainedBuffer(), err = BLE_ERROR_RECEIVED_MESSAGE_TOO_BIG);
+        VerifyOrExit(!mRxBuf->HasChainedBuffer(), err = CHIP_ERROR_INBOUND_MESSAGE_TOO_BIG);
     }
     else
     {
@@ -360,12 +360,12 @@
     }
 
 exit:
-    if (err != BLE_NO_ERROR)
+    if (err != CHIP_NO_ERROR)
     {
         mRxState = kState_Error;
 
         // Dump protocol engine state, plus header flags and received data length.
-        ChipLogError(Ble, "HandleCharacteristicReceived failed, err = %" BleErrorFormat ", rx_flags = %u", err, rx_flags.Raw());
+        ChipLogError(Ble, "HandleCharacteristicReceived failed, err = %" CHIP_ERROR_FORMAT ", rx_flags = %u", err, rx_flags.Raw());
         if (didReceiveAck)
         {
             ChipLogError(Ble, "With rx'd ack = %u", receivedAck);
diff --git a/src/ble/BtpEngine.h b/src/ble/BtpEngine.h
index 6e4e920..1123ed7 100644
--- a/src/ble/BtpEngine.h
+++ b/src/ble/BtpEngine.h
@@ -103,7 +103,7 @@
     static const uint16_t sMaxFragmentSize;
 
     // Public functions:
-    BLE_ERROR Init(void * an_app_state, bool expect_first_ack);
+    CHIP_ERROR Init(void * an_app_state, bool expect_first_ack);
 
     inline void SetTxFragmentSize(uint16_t size) { mTxFragmentSize = size; }
     inline void SetRxFragmentSize(uint16_t size) { mRxFragmentSize = size; }
@@ -150,10 +150,10 @@
 
     bool HasUnackedData() const;
 
-    BLE_ERROR HandleCharacteristicReceived(System::PacketBufferHandle && data, SequenceNumber_t & receivedAck,
-                                           bool & didReceiveAck);
+    CHIP_ERROR HandleCharacteristicReceived(System::PacketBufferHandle && data, SequenceNumber_t & receivedAck,
+                                            bool & didReceiveAck);
     bool HandleCharacteristicSend(System::PacketBufferHandle data, bool send_ack);
-    BLE_ERROR EncodeStandAloneAck(const PacketBufferHandle & data);
+    CHIP_ERROR EncodeStandAloneAck(const PacketBufferHandle & data);
 
     PacketBufferHandle TakeRxPacket();
     PacketBufferHandle BorrowRxPacket() { return mRxBuf.Retain(); }
@@ -198,7 +198,7 @@
 
     // Private functions:
     bool IsValidAck(SequenceNumber_t ack_num) const;
-    BLE_ERROR HandleAckReceived(SequenceNumber_t ack_num);
+    CHIP_ERROR HandleAckReceived(SequenceNumber_t ack_num);
 };
 
 } /* namespace Ble */
diff --git a/src/ble/tests/TestBleErrorStr.cpp b/src/ble/tests/TestBleErrorStr.cpp
index 0fb1043..e18f527 100644
--- a/src/ble/tests/TestBleErrorStr.cpp
+++ b/src/ble/tests/TestBleErrorStr.cpp
@@ -47,26 +47,19 @@
 // Test input data.
 
 // clang-format off
-static int32_t sContext[] =
+static CHIP_ERROR sContext[] =
 {
-    BLE_ERROR_BAD_ARGS,
-    BLE_ERROR_INCORRECT_STATE,
-    BLE_ERROR_NO_ENDPOINTS,
     BLE_ERROR_NO_CONNECTION_RECEIVED_CALLBACK,
     BLE_ERROR_CENTRAL_UNSUBSCRIBED,
     BLE_ERROR_GATT_SUBSCRIBE_FAILED,
     BLE_ERROR_GATT_UNSUBSCRIBE_FAILED,
     BLE_ERROR_GATT_WRITE_FAILED,
     BLE_ERROR_GATT_INDICATE_FAILED,
-    BLE_ERROR_NOT_IMPLEMENTED,
     BLE_ERROR_CHIPOBLE_PROTOCOL_ABORT,
     BLE_ERROR_REMOTE_DEVICE_DISCONNECTED,
     BLE_ERROR_APP_CLOSED_CONNECTION,
-    BLE_ERROR_OUTBOUND_MESSAGE_TOO_BIG,
     BLE_ERROR_NOT_CHIP_DEVICE,
     BLE_ERROR_INCOMPATIBLE_PROTOCOL_VERSIONS,
-    BLE_ERROR_NO_MEMORY,
-    BLE_ERROR_MESSAGE_INCOMPLETE,
     BLE_ERROR_INVALID_FRAGMENT_SIZE,
     BLE_ERROR_START_TIMER_FAILED,
     BLE_ERROR_CONNECT_TIMED_OUT,
@@ -80,7 +73,6 @@
     BLE_ERROR_INVALID_BTP_HEADER_FLAGS,
     BLE_ERROR_INVALID_BTP_SEQUENCE_NUMBER,
     BLE_ERROR_REASSEMBLER_INCORRECT_STATE,
-    BLE_ERROR_RECEIVED_MESSAGE_TOO_BIG
 };
 // clang-format on
 
@@ -95,7 +87,7 @@
     // For each defined error...
     for (size_t i = 0; i < kTestElements; i++)
     {
-        int32_t err         = sContext[i];
+        CHIP_ERROR err      = sContext[i];
         const char * errStr = ErrorStr(err);
         char expectedText[9];
 
diff --git a/src/channel/ChannelContext.cpp b/src/channel/ChannelContext.cpp
index 97798f6..9363eb2 100644
--- a/src/channel/ChannelContext.cpp
+++ b/src/channel/ChannelContext.cpp
@@ -187,7 +187,7 @@
     }
 }
 
-void ChannelContext::AddressResolveTimeout(System::Layer * aLayer, void * aAppState, System::Error aError)
+void ChannelContext::AddressResolveTimeout(System::Layer * aLayer, void * aAppState, CHIP_ERROR aError)
 {
     ChannelContext * me = static_cast<ChannelContext *>(aAppState);
     me->AddressResolveTimeout();
diff --git a/src/channel/ChannelContext.h b/src/channel/ChannelContext.h
index 393c1cb..6826eac 100644
--- a/src/channel/ChannelContext.h
+++ b/src/channel/ChannelContext.h
@@ -165,7 +165,7 @@
 
     // Preparing sub-states
     void EnterAddressResolve();
-    static void AddressResolveTimeout(System::Layer * aLayer, void * aAppState, System::Error aError);
+    static void AddressResolveTimeout(System::Layer * aLayer, void * aAppState, CHIP_ERROR aError);
     void AddressResolveTimeout();
     void ExitAddressResolve() {}
 
diff --git a/src/controller/CHIPCluster.cpp b/src/controller/CHIPCluster.cpp
index 7156ae9..5b62104 100644
--- a/src/controller/CHIPCluster.cpp
+++ b/src/controller/CHIPCluster.cpp
@@ -67,7 +67,7 @@
 exit:
     if (err != CHIP_NO_ERROR)
     {
-        ChipLogError(Controller, "Failed in sending cluster command. Err %" PRId32, err);
+        ChipLogError(Controller, "Failed in sending cluster command. Err %" CHIP_ERROR_FORMAT, err);
         mDevice->CancelResponseHandler(seqNum);
     }
 
diff --git a/src/controller/CHIPDevice.cpp b/src/controller/CHIPDevice.cpp
index 5daf9ad..f578fcf 100644
--- a/src/controller/CHIPDevice.cpp
+++ b/src/controller/CHIPDevice.cpp
@@ -252,7 +252,7 @@
 #if CHIP_SYSTEM_CONFIG_USE_LWIP
         LOCK_TCPIP_CORE();
 #endif
-        INET_ERROR inetErr = Inet::InterfaceNameToId(Uint8::to_const_char(serializable.mInterfaceName), interfaceId);
+        CHIP_ERROR inetErr = Inet::InterfaceNameToId(Uint8::to_const_char(serializable.mInterfaceName), interfaceId);
 #if CHIP_SYSTEM_CONFIG_USE_LWIP
         UNLOCK_TCPIP_CORE();
 #endif
@@ -291,7 +291,7 @@
                           error = mStorageDelegate->SyncSetKeyValue(key, serialized.inner, sizeof(serialized.inner)));
         if (error != CHIP_NO_ERROR)
         {
-            ChipLogError(Controller, "Failed to persist device %" PRId32, error);
+            ChipLogError(Controller, "Failed to persist device %" CHIP_ERROR_FORMAT, error);
         }
     }
     return error;
@@ -487,7 +487,7 @@
 
     if (err != CHIP_NO_ERROR)
     {
-        ChipLogError(Controller, "LoadSecureSessionParameters returning error %" PRId32, err);
+        ChipLogError(Controller, "LoadSecureSessionParameters returning error %" CHIP_ERROR_FORMAT, err);
     }
     return err;
 }
diff --git a/src/controller/CHIPDeviceController.cpp b/src/controller/CHIPDeviceController.cpp
index 3556b65..28d8f2a 100644
--- a/src/controller/CHIPDeviceController.cpp
+++ b/src/controller/CHIPDeviceController.cpp
@@ -222,7 +222,7 @@
 
     ChipLogProgress(Controller, "Getting intermediate CA certificate from the issuer");
     CHIP_ERROR err = mOperationalCredentialsDelegate->GetIntermediateCACertificate(0, icaCertSpan);
-    ChipLogProgress(Controller, "GetIntermediateCACertificate returned %" PRId32, err);
+    ChipLogProgress(Controller, "GetIntermediateCACertificate returned %" CHIP_ERROR_FORMAT, err);
     if (err == CHIP_ERROR_INTERMEDIATE_CA_NOT_REQUIRED)
     {
         // This implies that the commissioner application uses root CA to sign the operational
@@ -347,8 +347,8 @@
     //
     ReturnErrorOnFailure(DeviceLayer::PlatformMgr().Shutdown());
 #else
-    VerifyOrReturnError(mInetLayer->Shutdown() == INET_NO_ERROR, CHIP_ERROR_INTERNAL);
-    VerifyOrReturnError(mSystemLayer->Shutdown() == CHIP_SYSTEM_NO_ERROR, CHIP_ERROR_INTERNAL);
+    VerifyOrReturnError(mInetLayer->Shutdown() == CHIP_NO_ERROR, CHIP_ERROR_INTERNAL);
+    VerifyOrReturnError(mSystemLayer->Shutdown() == CHIP_NO_ERROR, CHIP_ERROR_INTERNAL);
     chip::Platform::Delete(mInetLayer);
     chip::Platform::Delete(mSystemLayer);
 #endif // CONFIG_DEVICE_LAYER
@@ -730,7 +730,7 @@
     }
     if (err != CHIP_NO_ERROR)
     {
-        ChipLogError(Controller, "Failed to initialize the device list with error: %" PRId32, err);
+        ChipLogError(Controller, "Failed to initialize the device list with error: %" CHIP_ERROR_FORMAT, err);
     }
 
     return err;
@@ -1488,7 +1488,7 @@
     }
 }
 
-void DeviceCommissioner::OnSessionEstablishmentTimeoutCallback(System::Layer * aLayer, void * aAppState, System::Error aError)
+void DeviceCommissioner::OnSessionEstablishmentTimeoutCallback(System::Layer * aLayer, void * aAppState, CHIP_ERROR aError)
 {
     reinterpret_cast<DeviceCommissioner *>(aAppState)->OnSessionEstablishmentTimeout();
 }
diff --git a/src/controller/CHIPDeviceController.h b/src/controller/CHIPDeviceController.h
index e11dd88..0bb5800 100644
--- a/src/controller/CHIPDeviceController.h
+++ b/src/controller/CHIPDeviceController.h
@@ -556,7 +556,7 @@
 
     void OnSessionEstablishmentTimeout();
 
-    static void OnSessionEstablishmentTimeoutCallback(System::Layer * aLayer, void * aAppState, System::Error aError);
+    static void OnSessionEstablishmentTimeoutCallback(System::Layer * aLayer, void * aAppState, CHIP_ERROR aError);
 
     /* This function sends an OpCSR request to the device.
        The function does not hold a refernce to the device object.
diff --git a/src/controller/data_model/gen/IMClusterCommandHandler.cpp b/src/controller/data_model/gen/IMClusterCommandHandler.cpp
index 2e990ae..d59ae6a 100644
--- a/src/controller/data_model/gen/IMClusterCommandHandler.cpp
+++ b/src/controller/data_model/gen/IMClusterCommandHandler.cpp
@@ -139,8 +139,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -253,8 +253,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -432,8 +432,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -1959,8 +1959,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -2203,8 +2203,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -2515,8 +2515,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -2623,8 +2623,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -2731,8 +2731,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -3429,8 +3429,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -4008,8 +4008,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -4213,8 +4213,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -4489,8 +4489,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -4961,8 +4961,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -5074,8 +5074,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -5188,8 +5188,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
@@ -5296,8 +5296,8 @@
         apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
                                     Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
         ChipLogProgress(Zcl,
-                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32
-                        ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32,
+                        "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
+                        ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
                         validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId);
     }
 }
diff --git a/src/controller/java/AndroidBleConnectionDelegate.cpp b/src/controller/java/AndroidBleConnectionDelegate.cpp
index 53609cb..1980edf 100644
--- a/src/controller/java/AndroidBleConnectionDelegate.cpp
+++ b/src/controller/java/AndroidBleConnectionDelegate.cpp
@@ -27,7 +27,7 @@
     }
 }
 
-BLE_ERROR AndroidBleConnectionDelegate::CancelConnection()
+CHIP_ERROR AndroidBleConnectionDelegate::CancelConnection()
 {
-    return BLE_ERROR_NOT_IMPLEMENTED;
+    return CHIP_ERROR_NOT_IMPLEMENTED;
 }
diff --git a/src/controller/java/AndroidBleConnectionDelegate.h b/src/controller/java/AndroidBleConnectionDelegate.h
index 9fd0080..bc5c5fd 100644
--- a/src/controller/java/AndroidBleConnectionDelegate.h
+++ b/src/controller/java/AndroidBleConnectionDelegate.h
@@ -26,7 +26,7 @@
 {
 public:
     void NewConnection(chip::Ble::BleLayer * bleLayer, void * appState, const uint16_t connDiscriminator);
-    BLE_ERROR CancelConnection();
+    CHIP_ERROR CancelConnection();
 
     void SetNewConnectionCallback(NotifyNewConnectionAvailable cb) { newConnectionCb = cb; }
 
diff --git a/src/credentials/CHIPCertFromX509.cpp b/src/credentials/CHIPCertFromX509.cpp
index 0654609..93fe709 100644
--- a/src/credentials/CHIPCertFromX509.cpp
+++ b/src/credentials/CHIPCertFromX509.cpp
@@ -49,9 +49,9 @@
 using namespace chip::Protocols;
 using namespace chip::Crypto;
 
-static ASN1_ERROR ParseChipAttribute(ASN1Reader & reader, uint64_t & chipAttrOut)
+static CHIP_ERROR ParseChipAttribute(ASN1Reader & reader, uint64_t & chipAttrOut)
 {
-    ASN1_ERROR err        = ASN1_NO_ERROR;
+    CHIP_ERROR err        = CHIP_NO_ERROR;
     const uint8_t * value = reader.GetValue();
     uint32_t valueLen     = reader.GetValueLen();
 
@@ -96,7 +96,7 @@
     // RDNSequence ::= SEQUENCE OF RelativeDistinguishedName
     ASN1_PARSE_ENTER_SEQUENCE
     {
-        while ((err = reader.Next()) == ASN1_NO_ERROR)
+        while ((err = reader.Next()) == CHIP_NO_ERROR)
         {
             // RelativeDistinguishedName ::= SET SIZE (1..MAX) OF AttributeTypeAndValue
             ASN1_ENTER_SET
@@ -180,7 +180,7 @@
 
                 // Only one AttributeTypeAndValue allowed per RDN.
                 err = reader.Next();
-                if (err == ASN1_NO_ERROR)
+                if (err == CHIP_NO_ERROR)
                 {
                     ExitNow(err = ASN1_ERROR_UNSUPPORTED_ENCODING);
                 }
@@ -350,7 +350,7 @@
                 ASN1_PARSE_ENTER_SEQUENCE
                 {
                     err = reader.Next();
-                    VerifyOrExit(err == ASN1_NO_ERROR, err = ASN1_ERROR_INVALID_ENCODING);
+                    VerifyOrExit(err == CHIP_NO_ERROR, err = ASN1_ERROR_INVALID_ENCODING);
 
                     // keyIdentifier [0] IMPLICIT KeyIdentifier,
                     // KeyIdentifier ::= OCTET STRING
@@ -419,7 +419,7 @@
 
                     // cA BOOLEAN DEFAULT FALSE
                     err = reader.Next();
-                    if (err == ASN1_NO_ERROR && reader.GetClass() == kASN1TagClass_Universal &&
+                    if (err == CHIP_NO_ERROR && reader.GetClass() == kASN1TagClass_Universal &&
                         reader.GetTag() == kASN1UniversalTag_Boolean)
                     {
                         ASN1_GET_BOOLEAN(isCA);
@@ -430,7 +430,7 @@
                     }
 
                     // pathLenConstraint INTEGER (0..MAX) OPTIONAL
-                    if (err == ASN1_NO_ERROR && reader.GetClass() == kASN1TagClass_Universal &&
+                    if (err == CHIP_NO_ERROR && reader.GetClass() == kASN1TagClass_Universal &&
                         reader.GetTag() == kASN1UniversalTag_Integer)
                     {
                         ASN1_GET_INTEGER(pathLenConstraint);
@@ -472,7 +472,7 @@
                 // ExtKeyUsageSyntax ::= SEQUENCE SIZE (1..MAX) OF KeyPurposeId
                 ASN1_PARSE_ENTER_SEQUENCE
                 {
-                    while ((err = reader.Next()) == ASN1_NO_ERROR)
+                    while ((err = reader.Next()) == CHIP_NO_ERROR)
                     {
                         // KeyPurposeId ::= OBJECT IDENTIFIER
                         OID keyPurposeOID;
@@ -522,7 +522,7 @@
     // Extensions ::= SEQUENCE SIZE (1..MAX) OF Extension
     ASN1_PARSE_ENTER_SEQUENCE
     {
-        while ((err = reader.Next()) == ASN1_NO_ERROR)
+        while ((err = reader.Next()) == CHIP_NO_ERROR)
         {
             err = ConvertExtension(reader, writer);
             SuccessOrExit(err);
@@ -643,20 +643,20 @@
 
             // issuerUniqueID [1] IMPLICIT UniqueIdentifier OPTIONAL,
             // Not supported.
-            if (err == ASN1_NO_ERROR && reader.GetClass() == kASN1TagClass_ContextSpecific && reader.GetTag() == 1)
+            if (err == CHIP_NO_ERROR && reader.GetClass() == kASN1TagClass_ContextSpecific && reader.GetTag() == 1)
             {
                 ExitNow(err = ASN1_ERROR_UNSUPPORTED_ENCODING);
             }
 
             // subjectUniqueID [2] IMPLICIT UniqueIdentifier OPTIONAL,
             // Not supported.
-            if (err == ASN1_NO_ERROR && reader.GetClass() == kASN1TagClass_ContextSpecific && reader.GetTag() == 2)
+            if (err == CHIP_NO_ERROR && reader.GetClass() == kASN1TagClass_ContextSpecific && reader.GetTag() == 2)
             {
                 ExitNow(err = ASN1_ERROR_UNSUPPORTED_ENCODING);
             }
 
             // extensions [3] EXPLICIT Extensions OPTIONAL
-            if (err == ASN1_NO_ERROR && reader.GetClass() == kASN1TagClass_ContextSpecific && reader.GetTag() == 3)
+            if (err == CHIP_NO_ERROR && reader.GetClass() == kASN1TagClass_ContextSpecific && reader.GetTag() == 3)
             {
                 ASN1_ENTER_CONSTRUCTED(kASN1TagClass_ContextSpecific, 3)
                 {
diff --git a/src/crypto/CHIPCryptoPALOpenSSL.cpp b/src/crypto/CHIPCryptoPALOpenSSL.cpp
index dd80ee2..c0bb69b 100644
--- a/src/crypto/CHIPCryptoPALOpenSSL.cpp
+++ b/src/crypto/CHIPCryptoPALOpenSSL.cpp
@@ -1655,6 +1655,7 @@
                                     size_t caCertificateLen, const uint8_t * leafCertificate, size_t leafCertificateLen)
 {
     CHIP_ERROR err             = CHIP_NO_ERROR;
+    int status                 = 0;
     X509_STORE_CTX * verifyCtx = nullptr;
     X509_STORE * store         = nullptr;
     X509 * x509RootCertificate = nullptr;
@@ -1670,23 +1671,23 @@
     x509RootCertificate = d2i_X509(NULL, &rootCertificate, static_cast<long>(rootCertificateLen));
     VerifyOrExit(x509RootCertificate != nullptr, err = CHIP_ERROR_NO_MEMORY);
 
-    err = X509_STORE_add_cert(store, x509RootCertificate);
-    VerifyOrExit(err == 1, err = CHIP_ERROR_INTERNAL);
+    status = X509_STORE_add_cert(store, x509RootCertificate);
+    VerifyOrExit(status == 1, err = CHIP_ERROR_INTERNAL);
 
     x509CACertificate = d2i_X509(NULL, &caCertificate, static_cast<long>(caCertificateLen));
     VerifyOrExit(x509CACertificate != nullptr, err = CHIP_ERROR_NO_MEMORY);
 
-    err = X509_STORE_add_cert(store, x509CACertificate);
-    VerifyOrExit(err == 1, err = CHIP_ERROR_INTERNAL);
+    status = X509_STORE_add_cert(store, x509CACertificate);
+    VerifyOrExit(status == 1, err = CHIP_ERROR_INTERNAL);
 
     x509LeafCertificate = d2i_X509(NULL, &leafCertificate, static_cast<long>(leafCertificateLen));
     VerifyOrExit(x509LeafCertificate != nullptr, err = CHIP_ERROR_NO_MEMORY);
 
-    err = X509_STORE_CTX_init(verifyCtx, store, x509LeafCertificate, NULL);
-    VerifyOrExit(err == 1, err = CHIP_ERROR_INTERNAL);
+    status = X509_STORE_CTX_init(verifyCtx, store, x509LeafCertificate, NULL);
+    VerifyOrExit(status == 1, err = CHIP_ERROR_INTERNAL);
 
-    err = X509_verify_cert(verifyCtx);
-    VerifyOrExit(err == 1, err = CHIP_ERROR_CERT_NOT_TRUSTED);
+    status = X509_verify_cert(verifyCtx);
+    VerifyOrExit(status == 1, err = CHIP_ERROR_CERT_NOT_TRUSTED);
 
     err = CHIP_NO_ERROR;
 
diff --git a/src/crypto/tests/AES_CCM_128_test_vectors.h b/src/crypto/tests/AES_CCM_128_test_vectors.h
index 2adac02..77edd74 100644
--- a/src/crypto/tests/AES_CCM_128_test_vectors.h
+++ b/src/crypto/tests/AES_CCM_128_test_vectors.h
@@ -40,7 +40,7 @@
     const uint8_t * tag;
     size_t tag_len;
     unsigned tcId;
-    int result;
+    CHIP_ERROR result;
 };
 
 static const uint8_t chiptest_dac9e1195a0d_pt_1[]                           = { 0xee };
diff --git a/src/crypto/tests/CHIPCryptoPALTest.cpp b/src/crypto/tests/CHIPCryptoPALTest.cpp
index 2a8aec5..5ccfdb9 100644
--- a/src/crypto/tests/CHIPCryptoPALTest.cpp
+++ b/src/crypto/tests/CHIPCryptoPALTest.cpp
@@ -1439,20 +1439,21 @@
 static void TestX509_PKCS7Extraction(nlTestSuite * inSuite, void * inContext)
 {
     CHIP_ERROR err = CHIP_NO_ERROR;
+    int status     = 0;
     X509DerCertificate x509list[3];
     uint32_t max_certs = sizeof(x509list) / sizeof(X509DerCertificate);
 
     err = LoadCertsFromPKCS7(pem_pkcs7_blob, x509list, &max_certs);
     NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR);
 
-    err = memcmp(certificate_blob_leaf, x509list[0], x509list[0].Length());
-    NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR);
+    status = memcmp(certificate_blob_leaf, x509list[0], x509list[0].Length());
+    NL_TEST_ASSERT(inSuite, status == 0);
 
-    err = memcmp(certificate_blob_intermediate, x509list[1], x509list[1].Length());
-    NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR);
+    status = memcmp(certificate_blob_intermediate, x509list[1], x509list[1].Length());
+    NL_TEST_ASSERT(inSuite, status == 0);
 
-    err = memcmp(certificate_blob_root, x509list[2], x509list[2].Length());
-    NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR);
+    status = memcmp(certificate_blob_root, x509list[2], x509list[2].Length());
+    NL_TEST_ASSERT(inSuite, status == 0);
 }
 
 static void TestPubkey_x509Extraction(nlTestSuite * inSuite, void * inContext)
diff --git a/src/crypto/tests/PBKDF2_SHA256_test_vectors.h b/src/crypto/tests/PBKDF2_SHA256_test_vectors.h
index ea64442..e1ab185 100644
--- a/src/crypto/tests/PBKDF2_SHA256_test_vectors.h
+++ b/src/crypto/tests/PBKDF2_SHA256_test_vectors.h
@@ -36,7 +36,7 @@
     uint32_t key_len;
     const uint8_t * key;
     unsigned tcId;
-    int result;
+    CHIP_ERROR result;
 };
 
 static const uint8_t chiptest_key1[]                          = { 0x9a, 0x87, 0xd2, 0x5e, 0x37, 0x40, 0x8f, 0xd7, 0x2f, 0x42,
diff --git a/src/include/platform/CHIPDeviceError.h b/src/include/platform/CHIPDeviceError.h
index 47b1f13..0f25adf 100644
--- a/src/include/platform/CHIPDeviceError.h
+++ b/src/include/platform/CHIPDeviceError.h
@@ -20,7 +20,7 @@
 
 #define CHIP_DEVICE_ERROR_MIN 11000000
 #define CHIP_DEVICE_ERROR_MAX 11000999
-#define _CHIP_DEVICE_ERROR(e) (CHIP_DEVICE_ERROR_MIN + (e))
+#define CHIP_DEVICE_ERROR(e) (CHIP_DEVICE_ERROR_MIN + (e))
 
 /**
  *  @def CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND
@@ -29,7 +29,7 @@
  *    The requested configuration value was not found.
  *
  */
-#define CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND _CHIP_DEVICE_ERROR(1)
+#define CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND CHIP_DEVICE_ERROR(1)
 
 /**
  *  @def CHIP_DEVICE_ERROR_NOT_SERVICE_PROVISIONED
@@ -38,7 +38,7 @@
  *    The device has not been service provisioned.
  *
  */
-#define CHIP_DEVICE_ERROR_NOT_SERVICE_PROVISIONED _CHIP_DEVICE_ERROR(2)
+#define CHIP_DEVICE_ERROR_NOT_SERVICE_PROVISIONED CHIP_DEVICE_ERROR(2)
 
 /**
  *  @def CHIP_DEVICE_ERROR_SOFTWARE_UPDATE_ABORTED
@@ -47,7 +47,7 @@
  *    The software update was aborted by application
  *
  */
-#define CHIP_DEVICE_ERROR_SOFTWARE_UPDATE_ABORTED _CHIP_DEVICE_ERROR(3)
+#define CHIP_DEVICE_ERROR_SOFTWARE_UPDATE_ABORTED CHIP_DEVICE_ERROR(3)
 
 /**
  *  @def CHIP_DEVICE_ERROR_SOFTWARE_UPDATE_IGNORED
@@ -56,4 +56,4 @@
  *    The software update was ignored by application.
  *
  */
-#define CHIP_DEVICE_ERROR_SOFTWARE_UPDATE_IGNORED _CHIP_DEVICE_ERROR(4)
+#define CHIP_DEVICE_ERROR_SOFTWARE_UPDATE_IGNORED CHIP_DEVICE_ERROR(4)
diff --git a/src/include/platform/GeneralUtils.h b/src/include/platform/GeneralUtils.h
index 99883f0..e7bfc17 100644
--- a/src/include/platform/GeneralUtils.h
+++ b/src/include/platform/GeneralUtils.h
@@ -31,7 +31,7 @@
 extern const char * CharacterizeIPv6Address(const chip::Inet::IPAddress & ipAddr);
 extern const char * CharacterizeIPv6Prefix(const chip::Inet::IPPrefix & inPrefix);
 extern void RegisterDeviceLayerErrorFormatter();
-extern bool FormatDeviceLayerError(char * buf, uint16_t bufSize, int32_t err);
+extern bool FormatDeviceLayerError(char * buf, uint16_t bufSize, CHIP_ERROR err);
 
 } // namespace DeviceLayer
 } // namespace chip
diff --git a/src/include/platform/PlatformManager.h b/src/include/platform/PlatformManager.h
index 273d9df..ce99010 100644
--- a/src/include/platform/PlatformManager.h
+++ b/src/include/platform/PlatformManager.h
@@ -31,11 +31,11 @@
 namespace Platform {
 namespace Layer {
 
-System::Error PostEvent(System::Layer & aLayer, void * aContext, System::Object & aTarget, System::EventType aType,
-                        uintptr_t aArgument);
-System::Error DispatchEvents(System::Layer & aLayer, void * aContext);
-System::Error DispatchEvent(System::Layer & aLayer, void * aContext, System::Event aEvent);
-System::Error StartTimer(System::Layer & aLayer, void * aContext, uint32_t aMilliseconds);
+CHIP_ERROR PostEvent(System::Layer & aLayer, void * aContext, System::Object & aTarget, System::EventType aType,
+                     uintptr_t aArgument);
+CHIP_ERROR DispatchEvents(System::Layer & aLayer, void * aContext);
+CHIP_ERROR DispatchEvent(System::Layer & aLayer, void * aContext, System::Event aEvent);
+CHIP_ERROR StartTimer(System::Layer & aLayer, void * aContext, uint32_t aMilliseconds);
 
 } // namespace Layer
 } // namespace Platform
@@ -183,14 +183,14 @@
     template <class>
     friend class Internal::GenericConfigurationManagerImpl;
     // Parentheses used to fix clang parsing issue with these declarations
-    friend ::chip::System::Error(::chip::System::Platform::Layer::PostEvent)(::chip::System::Layer & aLayer, void * aContext,
-                                                                             ::chip::System::Object & aTarget,
-                                                                             ::chip::System::EventType aType, uintptr_t aArgument);
-    friend ::chip::System::Error(::chip::System::Platform::Layer::DispatchEvents)(::chip::System::Layer & aLayer, void * aContext);
-    friend ::chip::System::Error(::chip::System::Platform::Layer::DispatchEvent)(::chip::System::Layer & aLayer, void * aContext,
-                                                                                 ::chip::System::Event aEvent);
-    friend ::chip::System::Error(::chip::System::Platform::Layer::StartTimer)(::chip::System::Layer & aLayer, void * aContext,
-                                                                              uint32_t aMilliseconds);
+    friend ::CHIP_ERROR(::chip::System::Platform::Layer::PostEvent)(::chip::System::Layer & aLayer, void * aContext,
+                                                                    ::chip::System::Object & aTarget,
+                                                                    ::chip::System::EventType aType, uintptr_t aArgument);
+    friend ::CHIP_ERROR(::chip::System::Platform::Layer::DispatchEvents)(::chip::System::Layer & aLayer, void * aContext);
+    friend ::CHIP_ERROR(::chip::System::Platform::Layer::DispatchEvent)(::chip::System::Layer & aLayer, void * aContext,
+                                                                        ::chip::System::Event aEvent);
+    friend ::CHIP_ERROR(::chip::System::Platform::Layer::StartTimer)(::chip::System::Layer & aLayer, void * aContext,
+                                                                     uint32_t aMilliseconds);
 
     void PostEvent(const ChipDeviceEvent * event);
     void DispatchEvent(const ChipDeviceEvent * event);
diff --git a/src/include/platform/TimeSyncManager.h b/src/include/platform/TimeSyncManager.h
index 1a0c29c..00e43fe 100644
--- a/src/include/platform/TimeSyncManager.h
+++ b/src/include/platform/TimeSyncManager.h
@@ -104,7 +104,7 @@
     static void TimeServiceSync_HandleSyncComplete(void * context, CHIP_ERROR result, int64_t syncedRealTimeUS);
 #endif
 
-    static void DriveTimeSync(::chip::System::Layer * layer, void * appState, ::chip::System::Error err);
+    static void DriveTimeSync(::chip::System::Layer * layer, void * appState, ::CHIP_ERROR err);
 
 protected:
     // Construction/destruction limited to subclasses.
diff --git a/src/include/platform/internal/DeviceControlServer.h b/src/include/platform/internal/DeviceControlServer.h
index 33de177..4c0bbc7 100644
--- a/src/include/platform/internal/DeviceControlServer.h
+++ b/src/include/platform/internal/DeviceControlServer.h
@@ -45,8 +45,8 @@
 private:
     // ===== Members for internal use by the following friends.
     static DeviceControlServer sInstance;
-    friend void CommissioningTimerFunction(System::Layer * layer, void * aAppState, System::Error aError);
-    void CommissioningFailedTimerComplete(System::Error aErrror);
+    friend void CommissioningTimerFunction(System::Layer * layer, void * aAppState, CHIP_ERROR aError);
+    void CommissioningFailedTimerComplete(CHIP_ERROR aErrror);
 
     // ===== Private members reserved for use by this class only.
 
diff --git a/src/include/platform/internal/GenericPlatformManagerImpl.cpp b/src/include/platform/internal/GenericPlatformManagerImpl.cpp
index 82990cc..f266b6a 100644
--- a/src/include/platform/internal/GenericPlatformManagerImpl.cpp
+++ b/src/include/platform/internal/GenericPlatformManagerImpl.cpp
@@ -67,7 +67,7 @@
     // Initialize the CHIP system layer.
     new (&SystemLayer) System::Layer();
     err = SystemLayer.Init(nullptr);
-    if (err != CHIP_SYSTEM_NO_ERROR)
+    if (err != CHIP_NO_ERROR)
     {
         ChipLogError(DeviceLayer, "SystemLayer initialization failed: %s", ErrorStr(err));
     }
@@ -76,7 +76,7 @@
     // Initialize the CHIP Inet layer.
     new (&InetLayer) Inet::InetLayer();
     err = InetLayer.Init(SystemLayer, nullptr);
-    if (err != INET_NO_ERROR)
+    if (err != CHIP_NO_ERROR)
     {
         ChipLogError(DeviceLayer, "InetLayer initialization failed: %s", ErrorStr(err));
     }
@@ -87,7 +87,7 @@
     // Initialize the CHIP BLE manager.
 #if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE
     err = BLEMgr().Init();
-    if (err != BLE_NO_ERROR)
+    if (err != CHIP_NO_ERROR)
     {
         ChipLogError(DeviceLayer, "BLEManager initialization failed: %s", ErrorStr(err));
     }
@@ -255,7 +255,7 @@
     // Invoke the System Layer's event handler function.
     err = SystemLayer.HandleEvent(*event->ChipSystemLayerEvent.Target, event->ChipSystemLayerEvent.Type,
                                   event->ChipSystemLayerEvent.Argument);
-    if (err != CHIP_SYSTEM_NO_ERROR)
+    if (err != CHIP_NO_ERROR)
     {
         ChipLogError(DeviceLayer, "Error handling CHIP System Layer event (type %d): %s", event->Type, ErrorStr(err));
     }
diff --git a/src/include/platform/internal/GenericPlatformManagerImpl_FreeRTOS.cpp b/src/include/platform/internal/GenericPlatformManagerImpl_FreeRTOS.cpp
index 0bd42ed..a83b6c3 100644
--- a/src/include/platform/internal/GenericPlatformManagerImpl_FreeRTOS.cpp
+++ b/src/include/platform/internal/GenericPlatformManagerImpl_FreeRTOS.cpp
@@ -139,7 +139,7 @@
                 // Call into the system layer to dispatch the callback functions for all timers
                 // that have expired.
                 err = SystemLayer.HandlePlatformTimer();
-                if (err != CHIP_SYSTEM_NO_ERROR)
+                if (err != CHIP_NO_ERROR)
                 {
                     ChipLogError(DeviceLayer, "Error handling CHIP timers: %s", ErrorStr(err));
                 }
diff --git a/src/include/platform/internal/GenericPlatformManagerImpl_POSIX.cpp b/src/include/platform/internal/GenericPlatformManagerImpl_POSIX.cpp
index c59f020..603d616 100644
--- a/src/include/platform/internal/GenericPlatformManagerImpl_POSIX.cpp
+++ b/src/include/platform/internal/GenericPlatformManagerImpl_POSIX.cpp
@@ -312,7 +312,7 @@
     // Call up to the base class _Shutdown() to perform the actual stack de-initialization
     // and clean-up
     //
-    return System::MapErrorPOSIX(GenericPlatformManagerImpl<ImplClass>::_Shutdown());
+    return GenericPlatformManagerImpl<ImplClass>::_Shutdown();
 }
 
 // Fully instantiate the generic implementation class in whatever compilation unit includes this file.
diff --git a/src/include/platform/internal/GenericSoftwareUpdateManagerImpl.cpp b/src/include/platform/internal/GenericSoftwareUpdateManagerImpl.cpp
index e1ce027..91e3a93 100644
--- a/src/include/platform/internal/GenericSoftwareUpdateManagerImpl.cpp
+++ b/src/include/platform/internal/GenericSoftwareUpdateManagerImpl.cpp
@@ -591,7 +591,7 @@
 
 template <class ImplClass>
 void GenericSoftwareUpdateManagerImpl<ImplClass>::HandleHoldOffTimerExpired(::chip::System::Layer * aLayer, void * aAppState,
-                                                                            ::chip::System::Error aError)
+                                                                            ::CHIP_ERROR aError)
 {
     GenericSoftwareUpdateManagerImpl<ImplClass> * self = &SoftwareUpdateMgrImpl();
 
diff --git a/src/include/platform/internal/GenericSoftwareUpdateManagerImpl.h b/src/include/platform/internal/GenericSoftwareUpdateManagerImpl.h
index 92454fe..08a4a56 100644
--- a/src/include/platform/internal/GenericSoftwareUpdateManagerImpl.h
+++ b/src/include/platform/internal/GenericSoftwareUpdateManagerImpl.h
@@ -96,7 +96,7 @@
 
     static void PrepareBinding(intptr_t arg);
     static void StartDownload(intptr_t arg);
-    static void HandleHoldOffTimerExpired(::chip::System::Layer * aLayer, void * aAppState, ::chip::System::Error aError);
+    static void HandleHoldOffTimerExpired(::chip::System::Layer * aLayer, void * aAppState, ::CHIP_ERROR aError);
     static void DefaultRetryPolicyCallback(void * aAppState, SoftwareUpdateManager::RetryParam & aRetryParam,
                                            uint32_t & aOutIntervalMsec);
 
diff --git a/src/inet/AsyncDNSResolverSockets.cpp b/src/inet/AsyncDNSResolverSockets.cpp
index 6dcb157..7a5f257 100644
--- a/src/inet/AsyncDNSResolverSockets.cpp
+++ b/src/inet/AsyncDNSResolverSockets.cpp
@@ -45,13 +45,13 @@
  *
  *  @param[in]  aInet  A pointer to the InetLayer object.
  *
- *  @retval #INET_NO_ERROR                   if initialization is
+ *  @retval #CHIP_NO_ERROR                   if initialization is
  *                                           successful.
  *  @retval other appropriate POSIX network or OS error.
  */
-INET_ERROR AsyncDNSResolverSockets::Init(InetLayer * aInet)
+CHIP_ERROR AsyncDNSResolverSockets::Init(InetLayer * aInet)
 {
-    INET_ERROR err = INET_NO_ERROR;
+    CHIP_ERROR err = CHIP_NO_ERROR;
     int pthreadErr;
 
     mInet = aInet;
@@ -80,12 +80,12 @@
  *  and it takes care of shutting the threads down and destroying the mutex
  *  and semaphore variables.
  *
- *  @retval #INET_NO_ERROR                   if shutdown is successful.
+ *  @retval #CHIP_NO_ERROR                   if shutdown is successful.
  *  @retval other appropriate POSIX network or OS error.
  */
-INET_ERROR AsyncDNSResolverSockets::Shutdown()
+CHIP_ERROR AsyncDNSResolverSockets::Shutdown()
 {
-    INET_ERROR err = INET_NO_ERROR;
+    CHIP_ERROR err = CHIP_NO_ERROR;
     int pthreadErr;
 
     AsyncMutexLock();
@@ -132,15 +132,15 @@
  *  @param[in]  appState    A pointer to the application state to be passed to
  *                          onComplete when a DNS request is complete.
  *
- *  @retval INET_NO_ERROR                   if a DNS request is handled
+ *  @retval CHIP_NO_ERROR                   if a DNS request is handled
  *                                          successfully.
  *
  */
-INET_ERROR AsyncDNSResolverSockets::PrepareDNSResolver(DNSResolver & resolver, const char * hostName, uint16_t hostNameLen,
+CHIP_ERROR AsyncDNSResolverSockets::PrepareDNSResolver(DNSResolver & resolver, const char * hostName, uint16_t hostNameLen,
                                                        uint8_t options, uint8_t maxAddrs, IPAddress * addrArray,
                                                        DNSResolver::OnResolveCompleteFunct onComplete, void * appState)
 {
-    INET_ERROR err = INET_NO_ERROR;
+    CHIP_ERROR err = CHIP_NO_ERROR;
 
     memcpy(resolver.asyncHostNameBuf, hostName, hostNameLen);
     resolver.asyncHostNameBuf[hostNameLen] = 0;
@@ -150,7 +150,7 @@
     resolver.AddrArray                     = addrArray;
     resolver.AppState                      = appState;
     resolver.OnComplete                    = onComplete;
-    resolver.asyncDNSResolveResult         = INET_NO_ERROR;
+    resolver.asyncDNSResolveResult         = CHIP_NO_ERROR;
     resolver.mState                        = DNSResolver::kState_Active;
     resolver.pNextAsyncDNSResolver         = nullptr;
 
@@ -162,16 +162,16 @@
  *
  *  @param[in]  resolver    A reference to the DNSResolver object.
  *
- *  @retval #INET_NO_ERROR                   if a DNS request is queued
+ *  @retval #CHIP_NO_ERROR                   if a DNS request is queued
  *                                           successfully.
- *  @retval #INET_ERROR_NO_MEMORY            if the Inet layer resolver pool
+ *  @retval #CHIP_ERROR_NO_MEMORY            if the Inet layer resolver pool
  *                                           is full.
  *  @retval other appropriate POSIX network or OS error.
  *
  */
-INET_ERROR AsyncDNSResolverSockets::EnqueueRequest(DNSResolver & resolver)
+CHIP_ERROR AsyncDNSResolverSockets::EnqueueRequest(DNSResolver & resolver)
 {
-    INET_ERROR err = INET_NO_ERROR;
+    CHIP_ERROR err = CHIP_NO_ERROR;
     int pthreadErr;
 
     AsyncMutexLock();
@@ -202,9 +202,9 @@
  * Make the worker thread block if there is no item in the queue.
  *
  */
-INET_ERROR AsyncDNSResolverSockets::DequeueRequest(DNSResolver ** outResolver)
+CHIP_ERROR AsyncDNSResolverSockets::DequeueRequest(DNSResolver ** outResolver)
 {
-    INET_ERROR err = INET_NO_ERROR;
+    CHIP_ERROR err = CHIP_NO_ERROR;
     int pthreadErr;
 
     AsyncMutexLock();
@@ -246,9 +246,9 @@
  *
  *  @param[in]    resolver   A reference to the DNSResolver object.
  */
-INET_ERROR AsyncDNSResolverSockets::Cancel(DNSResolver & resolver)
+CHIP_ERROR AsyncDNSResolverSockets::Cancel(DNSResolver & resolver)
 {
-    INET_ERROR err = INET_NO_ERROR;
+    CHIP_ERROR err = CHIP_NO_ERROR;
 
     AsyncMutexLock();
 
@@ -297,7 +297,7 @@
 }
 
 /* Event handler function for asynchronous DNS notification */
-void AsyncDNSResolverSockets::DNSResultEventHandler(chip::System::Layer * aLayer, void * aAppState, chip::System::Error aError)
+void AsyncDNSResolverSockets::DNSResultEventHandler(chip::System::Layer * aLayer, void * aAppState, CHIP_ERROR aError)
 {
     DNSResolver * resolver = static_cast<DNSResolver *>(aAppState);
 
@@ -319,7 +319,7 @@
 void * AsyncDNSResolverSockets::AsyncDNSThreadRun(void * args)
 {
 
-    INET_ERROR err                          = INET_NO_ERROR;
+    CHIP_ERROR err                          = CHIP_NO_ERROR;
     AsyncDNSResolverSockets * asyncResolver = static_cast<AsyncDNSResolverSockets *>(args);
 
     while (true)
@@ -332,7 +332,7 @@
 
         // If shutdown has been called, DeQueue would return with an empty request.
         // In that case, break out of the loop and exit thread.
-        VerifyOrExit(err == INET_NO_ERROR && request != nullptr, );
+        VerifyOrExit(err == CHIP_NO_ERROR && request != nullptr, );
 
         if (request->mState != DNSResolver::kState_Canceled)
         {
diff --git a/src/inet/AsyncDNSResolverSockets.h b/src/inet/AsyncDNSResolverSockets.h
index fb5becf..9cacceb 100644
--- a/src/inet/AsyncDNSResolverSockets.h
+++ b/src/inet/AsyncDNSResolverSockets.h
@@ -55,15 +55,15 @@
     friend class DNSResolver;
 
 public:
-    INET_ERROR EnqueueRequest(DNSResolver & resolver);
+    CHIP_ERROR EnqueueRequest(DNSResolver & resolver);
 
-    INET_ERROR Init(InetLayer * inet);
+    CHIP_ERROR Init(InetLayer * inet);
 
-    INET_ERROR Cancel(DNSResolver & resolver);
+    CHIP_ERROR Cancel(DNSResolver & resolver);
 
-    INET_ERROR Shutdown();
+    CHIP_ERROR Shutdown();
 
-    INET_ERROR PrepareDNSResolver(DNSResolver & resolver, const char * hostName, uint16_t hostNameLen, uint8_t options,
+    CHIP_ERROR PrepareDNSResolver(DNSResolver & resolver, const char * hostName, uint16_t hostNameLen, uint8_t options,
                                   uint8_t maxAddrs, IPAddress * addrArray, DNSResolver::OnResolveCompleteFunct onComplete,
                                   void * appState);
 
@@ -74,11 +74,10 @@
     volatile DNSResolver * mAsyncDNSQueueHead; /* The head of the asynchronous DNSResolver object queue. */
     volatile DNSResolver * mAsyncDNSQueueTail; /* The tail of the asynchronous DNSResolver object queue. */
     InetLayer * mInet;                         /* The pointer to the InetLayer. */
-    static void
-    DNSResultEventHandler(chip::System::Layer * aLayer, void * aAppState,
-                          chip::System::Error aError); /* Timer event handler function for asynchronous DNS notification */
+    static void DNSResultEventHandler(chip::System::Layer * aLayer, void * aAppState,
+                                      CHIP_ERROR aError); /* Timer event handler function for asynchronous DNS notification */
 
-    INET_ERROR DequeueRequest(DNSResolver ** outResolver);
+    CHIP_ERROR DequeueRequest(DNSResolver ** outResolver);
 
     bool ShouldThreadShutdown();
 
diff --git a/src/inet/DNSResolver.cpp b/src/inet/DNSResolver.cpp
index b217532..76bbdb9 100644
--- a/src/inet/DNSResolver.cpp
+++ b/src/inet/DNSResolver.cpp
@@ -76,10 +76,10 @@
  *  @param[in]  appState    A pointer to the application state to be passed to
  *                          onComplete when a DNS request is complete.
  *
- *  @retval INET_NO_ERROR                   if a DNS request is handled
+ *  @retval CHIP_NO_ERROR                   if a DNS request is handled
  *                                          successfully.
  *
- *  @retval INET_ERROR_NOT_IMPLEMENTED      if DNS resolution is not enabled on
+ *  @retval CHIP_ERROR_NOT_IMPLEMENTED      if DNS resolution is not enabled on
  *                                          the underlying platform.
  *
  *  @retval _other_                         if other POSIX network or OS error
@@ -87,14 +87,14 @@
  *                                          resolver implementation.
  *
  */
-INET_ERROR DNSResolver::Resolve(const char * hostName, uint16_t hostNameLen, uint8_t options, uint8_t maxAddrs,
+CHIP_ERROR DNSResolver::Resolve(const char * hostName, uint16_t hostNameLen, uint8_t options, uint8_t maxAddrs,
                                 IPAddress * addrArray, DNSResolver::OnResolveCompleteFunct onComplete, void * appState)
 {
-    INET_ERROR res = INET_NO_ERROR;
+    CHIP_ERROR res = CHIP_NO_ERROR;
 
 #if !CHIP_SYSTEM_CONFIG_USE_SOCKETS && !LWIP_DNS
     Release();
-    return INET_ERROR_NOT_IMPLEMENTED;
+    return CHIP_ERROR_NOT_IMPLEMENTED;
 #endif // !CHIP_SYSTEM_CONFIG_USE_SOCKETS && !LWIP_DNS
 
     uint8_t addrFamilyOption = (options & kDNSOption_AddrFamily_Mask);
@@ -107,7 +107,7 @@
         (optionFlags & ~kDNSOption_ValidFlags) != 0)
     {
         Release();
-        return INET_ERROR_BAD_ARGS;
+        return CHIP_ERROR_INVALID_ARGUMENT;
     }
 
 #if CHIP_SYSTEM_CONFIG_USE_SOCKETS || (CHIP_SYSTEM_CONFIG_USE_LWIP && LWIP_DNS)
@@ -163,7 +163,7 @@
 #endif
     {
         Release();
-        return INET_ERROR_NOT_IMPLEMENTED;
+        return CHIP_ERROR_NOT_IMPLEMENTED;
     }
 
 #endif // LWIP_VERSION_MAJOR <= 1 || LWIP_VERSION_MINOR < 5
@@ -229,7 +229,7 @@
     // Release DNSResolver object.
     Release();
 
-    return INET_NO_ERROR;
+    return CHIP_NO_ERROR;
 
 #endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS
 #endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS || (CHIP_SYSTEM_CONFIG_USE_LWIP && LWIP_DNS)
@@ -238,10 +238,10 @@
 /**
  *  This method cancels DNS requests that are in progress.
  *
- *  @retval INET_NO_ERROR.
+ *  @retval CHIP_NO_ERROR.
  *
  */
-INET_ERROR DNSResolver::Cancel()
+CHIP_ERROR DNSResolver::Cancel()
 {
 #if CHIP_SYSTEM_CONFIG_USE_LWIP
 
@@ -283,7 +283,7 @@
 #endif // INET_CONFIG_ENABLE_ASYNC_DNS_SOCKETS
 #endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS
 
-    return INET_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 #if CHIP_SYSTEM_CONFIG_USE_LWIP
@@ -297,7 +297,7 @@
 {
     // Call the application's completion handler if the request hasn't been canceled.
     if (OnComplete != NULL)
-        OnComplete(AppState, (NumAddrs > 0) ? INET_NO_ERROR : INET_ERROR_HOST_NOT_FOUND, NumAddrs, AddrArray);
+        OnComplete(AppState, (NumAddrs > 0) ? CHIP_NO_ERROR : INET_ERROR_HOST_NOT_FOUND, NumAddrs, AddrArray);
 
     // Release the resolver object.
     Release();
@@ -369,9 +369,9 @@
     hints.ai_flags = AI_ADDRCONFIG;
 }
 
-INET_ERROR DNSResolver::ProcessGetAddrInfoResult(int returnCode, struct addrinfo * results)
+CHIP_ERROR DNSResolver::ProcessGetAddrInfoResult(int returnCode, struct addrinfo * results)
 {
-    INET_ERROR err = INET_NO_ERROR;
+    CHIP_ERROR err = CHIP_NO_ERROR;
 
     // If getaddrinfo() succeeded, copy addresses in the returned addrinfo structures into the
     // application's output array...
diff --git a/src/inet/DNSResolver.h b/src/inet/DNSResolver.h
index 5fbad7f..6975dcc 100644
--- a/src/inet/DNSResolver.h
+++ b/src/inet/DNSResolver.h
@@ -101,7 +101,7 @@
      *  Provide a function of this type to the \c Resolve method to process
      *  completion events.
      */
-    typedef void (*OnResolveCompleteFunct)(void * appState, INET_ERROR err, uint8_t addrCount, IPAddress * addrArray);
+    typedef void (*OnResolveCompleteFunct)(void * appState, CHIP_ERROR err, uint8_t addrCount, IPAddress * addrArray);
 
     static chip::System::ObjectPool<DNSResolver, INET_CONFIG_NUM_DNS_RESOLVERS> sPool;
 
@@ -133,7 +133,7 @@
 #if CHIP_SYSTEM_CONFIG_USE_SOCKETS
 
     void InitAddrInfoHints(struct addrinfo & hints);
-    INET_ERROR ProcessGetAddrInfoResult(int returnCode, struct addrinfo * results);
+    CHIP_ERROR ProcessGetAddrInfoResult(int returnCode, struct addrinfo * results);
     void CopyAddresses(int family, uint8_t maxAddrs, const struct addrinfo * addrs);
     uint8_t CountAddresses(int family, const struct addrinfo * addrs);
 
@@ -142,7 +142,7 @@
     /* Hostname that requires resolution */
     char asyncHostNameBuf[NL_DNS_HOSTNAME_MAX_LEN + 1]; // DNS limits hostnames to 253 max characters.
 
-    INET_ERROR asyncDNSResolveResult;
+    CHIP_ERROR asyncDNSResolveResult;
     /* The next DNSResolver object in the asynchronous DNS resolution queue. */
     DNSResolver * pNextAsyncDNSResolver;
 
@@ -154,9 +154,9 @@
 
 #endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS
 
-    INET_ERROR Resolve(const char * hostName, uint16_t hostNameLen, uint8_t options, uint8_t maxAddrs, IPAddress * addrArray,
+    CHIP_ERROR Resolve(const char * hostName, uint16_t hostNameLen, uint8_t options, uint8_t maxAddrs, IPAddress * addrArray,
                        OnResolveCompleteFunct onComplete, void * appState);
-    INET_ERROR Cancel();
+    CHIP_ERROR Cancel();
 
 #if CHIP_SYSTEM_CONFIG_USE_LWIP
     void HandleResolveComplete(void);
diff --git a/src/inet/IPEndPointBasis.cpp b/src/inet/IPEndPointBasis.cpp
index 1efefb5..f5685fe 100644
--- a/src/inet/IPEndPointBasis.cpp
+++ b/src/inet/IPEndPointBasis.cpp
@@ -131,20 +131,20 @@
 #endif // CHIP_SYSTEM_CONFIG_USE_LWIP
 
 #if CHIP_SYSTEM_CONFIG_USE_LWIP || CHIP_SYSTEM_CONFIG_USE_SOCKETS
-static INET_ERROR CheckMulticastGroupArgs(InterfaceId aInterfaceId, const IPAddress & aAddress)
+static CHIP_ERROR CheckMulticastGroupArgs(InterfaceId aInterfaceId, const IPAddress & aAddress)
 {
     VerifyOrReturnError(IsInterfaceIdPresent(aInterfaceId), INET_ERROR_UNKNOWN_INTERFACE);
 
     VerifyOrReturnError(aAddress.IsMulticast(), INET_ERROR_WRONG_ADDRESS_TYPE);
 
-    return INET_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 #endif // CHIP_SYSTEM_CONFIG_USE_LWIP || CHIP_SYSTEM_CONFIG_USE_SOCKETS
 
 #if CHIP_SYSTEM_CONFIG_USE_LWIP
 #if INET_CONFIG_ENABLE_IPV4
 #if LWIP_IPV4 && LWIP_IGMP
-static INET_ERROR LwIPIPv4JoinLeaveMulticastGroup(InterfaceId aInterfaceId, const IPAddress & aAddress,
+static CHIP_ERROR LwIPIPv4JoinLeaveMulticastGroup(InterfaceId aInterfaceId, const IPAddress & aAddress,
                                                   err_t (*aMethod)(struct netif *, const LWIP_IPV4_ADDR_T *))
 {
     struct netif * const lNetif = IPEndPointBasis::FindNetifFromInterfaceId(aInterfaceId);
@@ -155,7 +155,7 @@
 
     if (lStatus == ERR_MEM)
     {
-        return INET_ERROR_NO_MEMORY;
+        return CHIP_ERROR_NO_MEMORY;
     }
     return chip::System::MapErrorLwIP(lStatus);
 }
@@ -173,7 +173,7 @@
 #endif
 
 #ifdef HAVE_IPV6_MULTICAST
-static INET_ERROR LwIPIPv6JoinLeaveMulticastGroup(InterfaceId aInterfaceId, const IPAddress & aAddress,
+static CHIP_ERROR LwIPIPv6JoinLeaveMulticastGroup(InterfaceId aInterfaceId, const IPAddress & aAddress,
                                                   err_t (*aMethod)(struct netif *, const LWIP_IPV6_ADDR_T *))
 {
     struct netif * const lNetif = IPEndPointBasis::FindNetifFromInterfaceId(aInterfaceId);
@@ -184,7 +184,7 @@
 
     if (lStatus == ERR_MEM)
     {
-        return INET_ERROR_NO_MEMORY;
+        return CHIP_ERROR_NO_MEMORY;
     }
     return chip::System::MapErrorLwIP(lStatus);
 }
@@ -193,7 +193,7 @@
 
 #if CHIP_SYSTEM_CONFIG_USE_SOCKETS
 #if IP_MULTICAST_LOOP || IPV6_MULTICAST_LOOP
-static INET_ERROR SocketsSetMulticastLoopback(int aSocket, bool aLoopback, int aProtocol, int aOption)
+static CHIP_ERROR SocketsSetMulticastLoopback(int aSocket, bool aLoopback, int aProtocol, int aOption)
 {
     const unsigned int lValue = aLoopback;
     if (setsockopt(aSocket, aProtocol, aOption, &lValue, sizeof(lValue)) != 0)
@@ -201,14 +201,14 @@
         return chip::System::MapErrorPOSIX(errno);
     }
 
-    return INET_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 #endif // IP_MULTICAST_LOOP || IPV6_MULTICAST_LOOP
 
-static INET_ERROR SocketsSetMulticastLoopback(int aSocket, IPVersion aIPVersion, bool aLoopback)
+static CHIP_ERROR SocketsSetMulticastLoopback(int aSocket, IPVersion aIPVersion, bool aLoopback)
 {
 #ifdef IPV6_MULTICAST_LOOP
-    INET_ERROR lRetval;
+    CHIP_ERROR lRetval;
 
     switch (aIPVersion)
     {
@@ -230,12 +230,12 @@
 
     return (lRetval);
 #else  // IPV6_MULTICAST_LOOP
-    return INET_ERROR_NOT_SUPPORTED;
+    return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
 #endif // IPV6_MULTICAST_LOOP
 }
 
 #if INET_CONFIG_ENABLE_IPV4
-static INET_ERROR SocketsIPv4JoinLeaveMulticastGroup(int aSocket, InterfaceId aInterfaceId, const IPAddress & aAddress,
+static CHIP_ERROR SocketsIPv4JoinLeaveMulticastGroup(int aSocket, InterfaceId aInterfaceId, const IPAddress & aAddress,
                                                      int aCommand)
 {
     IPAddress lInterfaceAddress;
@@ -267,20 +267,20 @@
     {
         return chip::System::MapErrorPOSIX(errno);
     }
-    return INET_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 #endif // INET_CONFIG_ENABLE_IPV4
 
 #if INET_IPV6_ADD_MEMBERSHIP || INET_IPV6_DROP_MEMBERSHIP
-static INET_ERROR SocketsIPv6JoinLeaveMulticastGroup(int aSocket, InterfaceId aInterfaceId, const IPAddress & aAddress,
+static CHIP_ERROR SocketsIPv6JoinLeaveMulticastGroup(int aSocket, InterfaceId aInterfaceId, const IPAddress & aAddress,
                                                      int aCommand)
 {
-    VerifyOrReturnError(CanCastTo<unsigned int>(aInterfaceId), INET_ERROR_UNEXPECTED_EVENT);
+    VerifyOrReturnError(CanCastTo<unsigned int>(aInterfaceId), CHIP_ERROR_UNEXPECTED_EVENT);
     const unsigned int lIfIndex = static_cast<unsigned int>(aInterfaceId);
 
     struct ipv6_mreq lMulticastRequest;
     memset(&lMulticastRequest, 0, sizeof(lMulticastRequest));
-    VerifyOrReturnError(CanCastTo<decltype(lMulticastRequest.ipv6mr_interface)>(lIfIndex), INET_ERROR_UNEXPECTED_EVENT);
+    VerifyOrReturnError(CanCastTo<decltype(lMulticastRequest.ipv6mr_interface)>(lIfIndex), CHIP_ERROR_UNEXPECTED_EVENT);
 
     lMulticastRequest.ipv6mr_interface = static_cast<decltype(lMulticastRequest.ipv6mr_interface)>(lIfIndex);
     lMulticastRequest.ipv6mr_multiaddr = aAddress.ToIPv6();
@@ -289,25 +289,25 @@
     {
         return chip::System::MapErrorPOSIX(errno);
     }
-    return INET_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 #endif // INET_IPV6_ADD_MEMBERSHIP || INET_IPV6_DROP_MEMBERSHIP
 
-static INET_ERROR SocketsIPv6JoinMulticastGroup(int aSocket, InterfaceId aInterfaceId, const IPAddress & aAddress)
+static CHIP_ERROR SocketsIPv6JoinMulticastGroup(int aSocket, InterfaceId aInterfaceId, const IPAddress & aAddress)
 {
 #if INET_IPV6_ADD_MEMBERSHIP
     return SocketsIPv6JoinLeaveMulticastGroup(aSocket, aInterfaceId, aAddress, INET_IPV6_ADD_MEMBERSHIP);
 #else
-    return INET_ERROR_NOT_SUPPORTED;
+    return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
 #endif
 }
 
-static INET_ERROR SocketsIPv6LeaveMulticastGroup(int aSocket, InterfaceId aInterfaceId, const IPAddress & aAddress)
+static CHIP_ERROR SocketsIPv6LeaveMulticastGroup(int aSocket, InterfaceId aInterfaceId, const IPAddress & aAddress)
 {
 #if INET_IPV6_DROP_MEMBERSHIP
     return SocketsIPv6JoinLeaveMulticastGroup(aSocket, aInterfaceId, aAddress, INET_IPV6_DROP_MEMBERSHIP);
 #else
-    return INET_ERROR_NOT_SUPPORTED;
+    return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
 #endif
 }
 
@@ -320,7 +320,7 @@
  *
  *  @param[in]   aLoopback
  *
- *  @retval  INET_NO_ERROR
+ *  @retval  CHIP_NO_ERROR
  *       success: multicast loopback behavior set
  *  @retval  other
  *       another system or platform error
@@ -330,14 +330,14 @@
  *     to this endpoint.
  *
  */
-INET_ERROR IPEndPointBasis::SetMulticastLoopback(IPVersion aIPVersion, bool aLoopback)
+CHIP_ERROR IPEndPointBasis::SetMulticastLoopback(IPVersion aIPVersion, bool aLoopback)
 {
-    INET_ERROR lRetval = INET_ERROR_NOT_IMPLEMENTED;
+    CHIP_ERROR lRetval = CHIP_ERROR_NOT_IMPLEMENTED;
 
 #if CHIP_SYSTEM_CONFIG_USE_LWIP || CHIP_SYSTEM_CONFIG_USE_SOCKETS
 #if CHIP_SYSTEM_CONFIG_USE_LWIP
 #if !HAVE_LWIP_MULTICAST_LOOP
-    lRetval = INET_ERROR_NOT_SUPPORTED;
+    lRetval = CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
 #else
     if (aLoopback)
     {
@@ -357,7 +357,7 @@
 #endif // INET_CONFIG_ENABLE_UDP_ENDPOINT
 
         default:
-            lRetval = INET_ERROR_NOT_SUPPORTED;
+            lRetval = CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
             break;
         }
     }
@@ -379,12 +379,12 @@
 #endif // INET_CONFIG_ENABLE_UDP_ENDPOINT
 
         default:
-            lRetval = INET_ERROR_NOT_SUPPORTED;
+            lRetval = CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
             break;
         }
     }
 
-    lRetval = INET_NO_ERROR;
+    lRetval = CHIP_NO_ERROR;
 #endif // !HAVE_LWIP_MULTICAST_LOOP
 #endif // CHIP_SYSTEM_CONFIG_USE_LWIP
 
@@ -407,7 +407,7 @@
  *  @param[in]   aAddress      the multicast group to add the
  *                             interface to
  *
- *  @retval  INET_NO_ERROR
+ *  @retval  CHIP_NO_ERROR
  *       success: multicast group removed
  *
  *  @retval  INET_ERROR_UNKNOWN_INTERFACE
@@ -425,9 +425,9 @@
  *     specified interface.
  *
  */
-INET_ERROR IPEndPointBasis::JoinMulticastGroup(InterfaceId aInterfaceId, const IPAddress & aAddress)
+CHIP_ERROR IPEndPointBasis::JoinMulticastGroup(InterfaceId aInterfaceId, const IPAddress & aAddress)
 {
-    INET_ERROR lRetval = INET_ERROR_NOT_IMPLEMENTED;
+    CHIP_ERROR lRetval = CHIP_ERROR_NOT_IMPLEMENTED;
 
 #if CHIP_SYSTEM_CONFIG_USE_LWIP || CHIP_SYSTEM_CONFIG_USE_SOCKETS
     const IPAddressType lAddrType = aAddress.Type();
@@ -443,7 +443,7 @@
 #if LWIP_IPV4 && LWIP_IGMP
         lRetval = LwIPIPv4JoinLeaveMulticastGroup(aInterfaceId, aAddress, igmp_joingroup_netif);
 #else  // LWIP_IPV4 && LWIP_IGMP
-        lRetval = INET_ERROR_NOT_SUPPORTED;
+        lRetval = CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
 #endif // LWIP_IPV4 && LWIP_IGMP
         SuccessOrExit(lRetval);
 #endif // CHIP_SYSTEM_CONFIG_USE_LWIP
@@ -468,7 +468,7 @@
 #ifdef HAVE_IPV6_MULTICAST
         lRetval = LwIPIPv6JoinLeaveMulticastGroup(aInterfaceId, aAddress, mld6_joingroup_netif);
 #else  // HAVE_IPV6_MULTICAST
-        lRetval = INET_ERROR_NOT_SUPPORTED;
+        lRetval = CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
 #endif // HAVE_IPV6_MULTICAST
         SuccessOrExit(lRetval);
 #endif // CHIP_SYSTEM_CONFIG_USE_LWIP
@@ -499,7 +499,7 @@
  *  @param[in]   aAddress      the multicast group to remove the
  *                             interface from
  *
- *  @retval  INET_NO_ERROR
+ *  @retval  CHIP_NO_ERROR
  *       success: multicast group removed
  *
  *  @retval  INET_ERROR_UNKNOWN_INTERFACE
@@ -517,9 +517,9 @@
  *     specified interface.
  *
  */
-INET_ERROR IPEndPointBasis::LeaveMulticastGroup(InterfaceId aInterfaceId, const IPAddress & aAddress)
+CHIP_ERROR IPEndPointBasis::LeaveMulticastGroup(InterfaceId aInterfaceId, const IPAddress & aAddress)
 {
-    INET_ERROR lRetval = INET_ERROR_NOT_IMPLEMENTED;
+    CHIP_ERROR lRetval = CHIP_ERROR_NOT_IMPLEMENTED;
 
 #if CHIP_SYSTEM_CONFIG_USE_LWIP || CHIP_SYSTEM_CONFIG_USE_SOCKETS
     const IPAddressType lAddrType = aAddress.Type();
@@ -535,7 +535,7 @@
 #if LWIP_IPV4 && LWIP_IGMP
         lRetval = LwIPIPv4JoinLeaveMulticastGroup(aInterfaceId, aAddress, igmp_leavegroup_netif);
 #else  // LWIP_IPV4 && LWIP_IGMP
-        lRetval = INET_ERROR_NOT_SUPPORTED;
+        lRetval = CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
 #endif // LWIP_IPV4 && LWIP_IGMP
         SuccessOrExit(lRetval);
 #endif // CHIP_SYSTEM_CONFIG_USE_LWIP
@@ -560,7 +560,7 @@
 #if LWIP_IPV6_MLD && LWIP_IPV6_ND && LWIP_IPV6
         lRetval = LwIPIPv6JoinLeaveMulticastGroup(aInterfaceId, aAddress, mld6_leavegroup_netif);
 #else  // LWIP_IPV6_MLD && LWIP_IPV6_ND && LWIP_IPV6
-        lRetval = INET_ERROR_NOT_SUPPORTED;
+        lRetval = CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
 #endif // LWIP_IPV6_MLD && LWIP_IPV6_ND && LWIP_IPV6
         SuccessOrExit(lRetval);
 #endif // CHIP_SYSTEM_CONFIG_USE_LWIP
@@ -607,7 +607,7 @@
         else
         {
             if (OnReceiveError != NULL)
-                OnReceiveError(this, INET_ERROR_INBOUND_MESSAGE_TOO_BIG, NULL);
+                OnReceiveError(this, CHIP_ERROR_INBOUND_MESSAGE_TOO_BIG, NULL);
         }
     }
 }
@@ -658,12 +658,12 @@
     return (lPacketInfo);
 }
 
-System::Error IPEndPointBasis::PostPacketBufferEvent(chip::System::Layer & aLayer, System::Object & aTarget,
-                                                     System::EventType aEventType, System::PacketBufferHandle && aBuffer)
+CHIP_ERROR IPEndPointBasis::PostPacketBufferEvent(chip::System::Layer & aLayer, System::Object & aTarget,
+                                                  System::EventType aEventType, System::PacketBufferHandle && aBuffer)
 {
-    System::Error error =
+    const CHIP_ERROR error =
         aLayer.PostEvent(aTarget, aEventType, (uintptr_t) System::LwIPPacketBufferView::UnsafeGetLwIPpbuf(aBuffer));
-    if (error == INET_NO_ERROR)
+    if (error == CHIP_NO_ERROR)
     {
         // If PostEvent() succeeded, it has ownership of the buffer, so we need to release it (without freeing it).
         static_cast<void>(std::move(aBuffer).UnsafeRelease());
@@ -674,9 +674,9 @@
 #endif // CHIP_SYSTEM_CONFIG_USE_LWIP
 
 #if CHIP_SYSTEM_CONFIG_USE_SOCKETS
-INET_ERROR IPEndPointBasis::Bind(IPAddressType aAddressType, const IPAddress & aAddress, uint16_t aPort, InterfaceId aInterfaceId)
+CHIP_ERROR IPEndPointBasis::Bind(IPAddressType aAddressType, const IPAddress & aAddress, uint16_t aPort, InterfaceId aInterfaceId)
 {
-    INET_ERROR lRetval = INET_NO_ERROR;
+    CHIP_ERROR lRetval = CHIP_NO_ERROR;
 
     if (aAddressType == kIPAddressType_IPv6)
     {
@@ -689,7 +689,7 @@
         sa.sin6_addr   = aAddress.ToIPv6();
         if (!CanCastTo<decltype(sa.sin6_scope_id)>(aInterfaceId))
         {
-            return INET_ERROR_INCORRECT_STATE;
+            return CHIP_ERROR_INCORRECT_STATE;
         }
         sa.sin6_scope_id = static_cast<decltype(sa.sin6_scope_id)>(aInterfaceId);
 
@@ -699,7 +699,7 @@
             // Instruct the kernel that any messages to multicast destinations should be
             // sent down the interface specified by the caller.
 #ifdef IPV6_MULTICAST_IF
-        if (lRetval == INET_NO_ERROR)
+        if (lRetval == CHIP_NO_ERROR)
             setsockopt(mSocket.GetFD(), IPPROTO_IPV6, IPV6_MULTICAST_IF, &aInterfaceId, sizeof(aInterfaceId));
 #endif // defined(IPV6_MULTICAST_IF)
 
@@ -728,7 +728,7 @@
             // Instruct the kernel that any messages to multicast destinations should be
             // sent down the interface to which the specified IPv4 address is bound.
 #ifdef IP_MULTICAST_IF
-        if (lRetval == INET_NO_ERROR)
+        if (lRetval == CHIP_NO_ERROR)
             setsockopt(mSocket.GetFD(), IPPROTO_IP, IP_MULTICAST_IF, &sa, sizeof(sa));
 #endif // defined(IP_MULTICAST_IF)
 
@@ -740,7 +740,7 @@
 #endif // defined(IP_MULTICAST_TTL)
 
         // Allow socket transmitting broadcast packets.
-        if (lRetval == INET_NO_ERROR)
+        if (lRetval == CHIP_NO_ERROR)
             setsockopt(mSocket.GetFD(), SOL_SOCKET, SO_BROADCAST, &enable, sizeof(enable));
     }
 #endif // INET_CONFIG_ENABLE_IPV4
@@ -750,9 +750,9 @@
     return (lRetval);
 }
 
-INET_ERROR IPEndPointBasis::BindInterface(IPAddressType aAddressType, InterfaceId aInterfaceId)
+CHIP_ERROR IPEndPointBasis::BindInterface(IPAddressType aAddressType, InterfaceId aInterfaceId)
 {
-    INET_ERROR lRetval = INET_NO_ERROR;
+    CHIP_ERROR lRetval = CHIP_NO_ERROR;
 
 #if HAVE_SO_BINDTODEVICE
     if (aInterfaceId == INET_NULL_INTERFACEID)
@@ -773,30 +773,30 @@
             lRetval = chip::System::MapErrorPOSIX(errno);
         }
 
-        if (lRetval == INET_NO_ERROR &&
+        if (lRetval == CHIP_NO_ERROR &&
             setsockopt(mSocket.GetFD(), SOL_SOCKET, SO_BINDTODEVICE, lInterfaceName, socklen_t(strlen(lInterfaceName))) == -1)
         {
             lRetval = chip::System::MapErrorPOSIX(errno);
         }
     }
 
-    if (lRetval == INET_NO_ERROR)
+    if (lRetval == CHIP_NO_ERROR)
         mBoundIntfId = aInterfaceId;
 
 #else  // !HAVE_SO_BINDTODEVICE
-    lRetval = INET_ERROR_NOT_IMPLEMENTED;
+    lRetval = CHIP_ERROR_NOT_IMPLEMENTED;
 #endif // HAVE_SO_BINDTODEVICE
 
     return (lRetval);
 }
 
-INET_ERROR IPEndPointBasis::SendMsg(const IPPacketInfo * aPktInfo, chip::System::PacketBufferHandle && aBuffer, uint16_t aSendFlags)
+CHIP_ERROR IPEndPointBasis::SendMsg(const IPPacketInfo * aPktInfo, chip::System::PacketBufferHandle && aBuffer, uint16_t aSendFlags)
 {
     // Ensure the destination address type is compatible with the endpoint address type.
-    VerifyOrReturnError(mAddrType == aPktInfo->DestAddress.Type(), INET_ERROR_BAD_ARGS);
+    VerifyOrReturnError(mAddrType == aPktInfo->DestAddress.Type(), CHIP_ERROR_INVALID_ARGUMENT);
 
     // For now the entire message must fit within a single buffer.
-    VerifyOrReturnError(!aBuffer->HasChainedBuffer(), INET_ERROR_MESSAGE_TOO_LONG);
+    VerifyOrReturnError(!aBuffer->HasChainedBuffer(), CHIP_ERROR_MESSAGE_TOO_LONG);
 
     struct iovec msgIOV;
     msgIOV.iov_base = aBuffer->Start();
@@ -816,7 +816,7 @@
         peerSockAddr.in6.sin6_family = AF_INET6;
         peerSockAddr.in6.sin6_port   = htons(aPktInfo->DestPort);
         peerSockAddr.in6.sin6_addr   = aPktInfo->DestAddress.ToIPv6();
-        VerifyOrReturnError(CanCastTo<decltype(peerSockAddr.in6.sin6_scope_id)>(aPktInfo->Interface), INET_ERROR_INCORRECT_STATE);
+        VerifyOrReturnError(CanCastTo<decltype(peerSockAddr.in6.sin6_scope_id)>(aPktInfo->Interface), CHIP_ERROR_INCORRECT_STATE);
         peerSockAddr.in6.sin6_scope_id = static_cast<decltype(peerSockAddr.in6.sin6_scope_id)>(aPktInfo->Interface);
         msgHeader.msg_namelen          = sizeof(sockaddr_in6);
     }
@@ -866,7 +866,7 @@
             struct in_pktinfo * pktInfo = reinterpret_cast<struct in_pktinfo *> CMSG_DATA(controlHdr);
             if (!CanCastTo<decltype(pktInfo->ipi_ifindex)>(intfId))
             {
-                return INET_ERROR_NOT_SUPPORTED;
+                return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
             }
 
             pktInfo->ipi_ifindex  = static_cast<decltype(pktInfo->ipi_ifindex)>(intfId);
@@ -874,7 +874,7 @@
 
             msgHeader.msg_controllen = CMSG_SPACE(sizeof(in_pktinfo));
 #else  // !defined(IP_PKTINFO)
-            return INET_ERROR_NOT_SUPPORTED;
+            return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
 #endif // !defined(IP_PKTINFO)
         }
 
@@ -890,19 +890,19 @@
             struct in6_pktinfo * pktInfo = reinterpret_cast<struct in6_pktinfo *> CMSG_DATA(controlHdr);
             if (!CanCastTo<decltype(pktInfo->ipi6_ifindex)>(intfId))
             {
-                return INET_ERROR_UNEXPECTED_EVENT;
+                return CHIP_ERROR_UNEXPECTED_EVENT;
             }
             pktInfo->ipi6_ifindex = static_cast<decltype(pktInfo->ipi6_ifindex)>(intfId);
             pktInfo->ipi6_addr    = aPktInfo->SrcAddress.ToIPv6();
 
             msgHeader.msg_controllen = CMSG_SPACE(sizeof(in6_pktinfo));
 #else  // !defined(IPV6_PKTINFO)
-            return INET_ERROR_NOT_SUPPORTED;
+            return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
 #endif // !defined(IPV6_PKTINFO)
         }
 
 #else  // !(defined(IP_PKTINFO) && defined(IPV6_PKTINFO))
-        return INET_ERROR_NOT_SUPPORTED;
+        return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
 #endif // !(defined(IP_PKTINFO) && defined(IPV6_PKTINFO))
     }
 
@@ -911,14 +911,12 @@
     if (lenSent == -1)
         return chip::System::MapErrorPOSIX(errno);
     if (lenSent != aBuffer->DataLength())
-        return INET_ERROR_OUTBOUND_MESSAGE_TRUNCATED;
-    return INET_NO_ERROR;
+        return CHIP_ERROR_OUTBOUND_MESSAGE_TOO_BIG;
+    return CHIP_NO_ERROR;
 }
 
-INET_ERROR IPEndPointBasis::GetSocket(IPAddressType aAddressType, int aType, int aProtocol)
+CHIP_ERROR IPEndPointBasis::GetSocket(IPAddressType aAddressType, int aType, int aProtocol)
 {
-    INET_ERROR res = INET_NO_ERROR;
-
     if (!mSocket.HasFD())
     {
         const int one = 1;
@@ -956,7 +954,7 @@
         // logic up to check for implementations of these options and
         // to provide appropriate HAVE_xxxxx definitions accordingly.
 
-        res = setsockopt(mSocket.GetFD(), SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one));
+        int res = setsockopt(mSocket.GetFD(), SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one));
         static_cast<void>(res);
 
 #ifdef SO_REUSEPORT
@@ -1022,15 +1020,15 @@
     }
     else if (mAddrType != aAddressType)
     {
-        return INET_ERROR_INCORRECT_STATE;
+        return CHIP_ERROR_INCORRECT_STATE;
     }
 
-    return INET_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 void IPEndPointBasis::HandlePendingIO(uint16_t aPort)
 {
-    INET_ERROR lStatus = INET_NO_ERROR;
+    CHIP_ERROR lStatus = CHIP_NO_ERROR;
     IPPacketInfo lPacketInfo;
     System::PacketBufferHandle lBuffer;
 
@@ -1068,7 +1066,7 @@
         }
         else if (rcvLen > lBuffer->AvailableDataLength())
         {
-            lStatus = INET_ERROR_INBOUND_MESSAGE_TOO_BIG;
+            lStatus = CHIP_ERROR_INBOUND_MESSAGE_TOO_BIG;
         }
         else
         {
@@ -1088,11 +1086,11 @@
 #endif // INET_CONFIG_ENABLE_IPV4
             else
             {
-                lStatus = INET_ERROR_INCORRECT_STATE;
+                lStatus = CHIP_ERROR_INCORRECT_STATE;
             }
         }
 
-        if (lStatus == INET_NO_ERROR)
+        if (lStatus == CHIP_NO_ERROR)
         {
             for (struct cmsghdr * controlHdr = CMSG_FIRSTHDR(&msgHeader); controlHdr != nullptr;
                  controlHdr                  = CMSG_NXTHDR(&msgHeader, controlHdr))
@@ -1104,7 +1102,7 @@
                     struct in_pktinfo * inPktInfo = reinterpret_cast<struct in_pktinfo *> CMSG_DATA(controlHdr);
                     if (!CanCastTo<InterfaceId>(inPktInfo->ipi_ifindex))
                     {
-                        lStatus = INET_ERROR_INCORRECT_STATE;
+                        lStatus = CHIP_ERROR_INCORRECT_STATE;
                         break;
                     }
                     lPacketInfo.Interface   = static_cast<InterfaceId>(inPktInfo->ipi_ifindex);
@@ -1120,7 +1118,7 @@
                     struct in6_pktinfo * in6PktInfo = reinterpret_cast<struct in6_pktinfo *> CMSG_DATA(controlHdr);
                     if (!CanCastTo<InterfaceId>(in6PktInfo->ipi6_ifindex))
                     {
-                        lStatus = INET_ERROR_INCORRECT_STATE;
+                        lStatus = CHIP_ERROR_INCORRECT_STATE;
                         break;
                     }
                     lPacketInfo.Interface   = static_cast<InterfaceId>(in6PktInfo->ipi6_ifindex);
@@ -1133,10 +1131,10 @@
     }
     else
     {
-        lStatus = INET_ERROR_NO_MEMORY;
+        lStatus = CHIP_ERROR_NO_MEMORY;
     }
 
-    if (lStatus == INET_NO_ERROR)
+    if (lStatus == CHIP_NO_ERROR)
     {
         lBuffer.RightSize();
         OnMessageReceived(this, std::move(lBuffer), &lPacketInfo);
@@ -1152,9 +1150,9 @@
 #endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS
 
 #if CHIP_SYSTEM_CONFIG_USE_NETWORK_FRAMEWORK
-INET_ERROR IPEndPointBasis::ConfigureProtocol(IPAddressType aAddressType, const nw_parameters_t & aParameters)
+CHIP_ERROR IPEndPointBasis::ConfigureProtocol(IPAddressType aAddressType, const nw_parameters_t & aParameters)
 {
-    INET_ERROR res = INET_NO_ERROR;
+    CHIP_ERROR res = CHIP_NO_ERROR;
 
     nw_protocol_stack_t protocolStack = nw_parameters_copy_default_protocol_stack(aParameters);
     nw_protocol_options_t ipOptions   = nw_protocol_stack_copy_internet_protocol(protocolStack);
@@ -1182,47 +1180,47 @@
     return res;
 }
 
-INET_ERROR IPEndPointBasis::Bind(IPAddressType aAddressType, const IPAddress & aAddress, uint16_t aPort,
+CHIP_ERROR IPEndPointBasis::Bind(IPAddressType aAddressType, const IPAddress & aAddress, uint16_t aPort,
                                  const nw_parameters_t & aParameters)
 {
     nw_endpoint_t endpoint = nullptr;
 
-    VerifyOrReturnError(aParameters != NULL, INET_ERROR_BAD_ARGS);
+    VerifyOrReturnError(aParameters != NULL, CHIP_ERROR_INVALID_ARGUMENT);
 
     ReturnErrorOnFailure(ConfigureProtocol(aAddressType, aParameters));
 
-    INET_ERROR res = GetEndPoint(endpoint, aAddressType, aAddress, aPort);
+    CHIP_ERROR res = GetEndPoint(endpoint, aAddressType, aAddress, aPort);
     nw_parameters_set_local_endpoint(aParameters, endpoint);
     nw_release(endpoint);
     ReturnErrorOnFailure(res);
 
     mDispatchQueue = dispatch_queue_create("inet_dispatch_global", DISPATCH_QUEUE_CONCURRENT);
-    VerifyOrReturnError(mDispatchQueue != NULL, INET_ERROR_NO_MEMORY);
+    VerifyOrReturnError(mDispatchQueue != NULL, CHIP_ERROR_NO_MEMORY);
     dispatch_retain(mDispatchQueue);
 
     mConnectionSemaphore = dispatch_semaphore_create(0);
-    VerifyOrReturnError(mConnectionSemaphore != NULL, INET_ERROR_NO_MEMORY);
+    VerifyOrReturnError(mConnectionSemaphore != NULL, CHIP_ERROR_NO_MEMORY);
     dispatch_retain(mConnectionSemaphore);
 
     mSendSemaphore = dispatch_semaphore_create(0);
-    VerifyOrReturnError(mSendSemaphore != NULL, INET_ERROR_NO_MEMORY);
+    VerifyOrReturnError(mSendSemaphore != NULL, CHIP_ERROR_NO_MEMORY);
     dispatch_retain(mSendSemaphore);
 
     mAddrType   = aAddressType;
     mConnection = NULL;
 
-    return INET_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
-INET_ERROR IPEndPointBasis::SendMsg(const IPPacketInfo * aPktInfo, chip::System::PacketBufferHandle && aBuffer, uint16_t aSendFlags)
+CHIP_ERROR IPEndPointBasis::SendMsg(const IPPacketInfo * aPktInfo, chip::System::PacketBufferHandle && aBuffer, uint16_t aSendFlags)
 {
     dispatch_data_t content;
 
     // Ensure the destination address type is compatible with the endpoint address type.
-    VerifyOrReturnError(mAddrType == aPktInfo->DestAddress.Type(), INET_ERROR_BAD_ARGS);
+    VerifyOrReturnError(mAddrType == aPktInfo->DestAddress.Type(), CHIP_ERROR_INVALID_ARGUMENT);
 
     // For now the entire message must fit within a single buffer.
-    VerifyOrReturnError(aBuffer->Next() == NULL, INET_ERROR_MESSAGE_TOO_LONG);
+    VerifyOrReturnError(aBuffer->Next() == NULL, CHIP_ERROR_MESSAGE_TOO_LONG);
 
     ReturnErrorOnFailure(GetConnection(aPktInfo));
 
@@ -1232,10 +1230,10 @@
     // If there is a current message pending and the state of the network connection change (e.g switch to a
     // different network) the connection will enter a nw_connection_state_failed state and the completion handler
     // will never be called. In such cases a signal is sent from the connection state change handler to release
-    // the semaphore. In this case the INET_ERROR will not update with the result of the completion handler.
+    // the semaphore. In this case the CHIP_ERROR will not update with the result of the completion handler.
     // To make sure caller knows that sending a message has failed the following code consider there is an error
     // _unless_ the completion handler says otherwise.
-    __block INET_ERROR res = INET_ERROR_UNEXPECTED_EVENT;
+    __block CHIP_ERROR res = CHIP_ERROR_UNEXPECTED_EVENT;
     nw_connection_send(mConnection, content, NW_CONNECTION_DEFAULT_MESSAGE_CONTEXT, true, ^(nw_error_t error) {
         if (error)
         {
@@ -1243,7 +1241,7 @@
         }
         else
         {
-            res = INET_NO_ERROR;
+            res = CHIP_NO_ERROR;
         }
         dispatch_semaphore_signal(mSendSemaphore);
     });
@@ -1270,7 +1268,7 @@
                     errno                          = nw_error_get_error_code(receive_error);
                     if (!(error_domain == nw_error_domain_posix && errno == ECANCELED))
                     {
-                        INET_ERROR error = chip::System::MapErrorPOSIX(errno);
+                        CHIP_ERROR error = chip::System::MapErrorPOSIX(errno);
                         IPPacketInfo packetInfo;
                         GetPacketInfo(aConnection, packetInfo);
                         dispatch_async(mDispatchQueue, ^{
@@ -1316,7 +1314,7 @@
     aPacketInfo.DestPort    = nw_endpoint_get_port(dest_endpoint);
 }
 
-INET_ERROR IPEndPointBasis::GetEndPoint(nw_endpoint_t & aEndPoint, const IPAddressType aAddressType, const IPAddress & aAddress,
+CHIP_ERROR IPEndPointBasis::GetEndPoint(nw_endpoint_t & aEndPoint, const IPAddressType aAddressType, const IPAddress & aAddress,
                                         uint16_t aPort)
 {
     char addrStr[INET6_ADDRSTRLEN];
@@ -1337,14 +1335,14 @@
     snprintf(portStr, sizeof(portStr), "%u", aPort);
 
     aEndPoint = nw_endpoint_create_host(addrStr, portStr);
-    VerifyOrReturnError(aEndPoint != NULL, INET_ERROR_BAD_ARGS);
+    VerifyOrReturnError(aEndPoint != NULL, CHIP_ERROR_INVALID_ARGUMENT);
 
-    return INET_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
-INET_ERROR IPEndPointBasis::GetConnection(const IPPacketInfo * aPktInfo)
+CHIP_ERROR IPEndPointBasis::GetConnection(const IPPacketInfo * aPktInfo)
 {
-    VerifyOrReturnError(mParameters != NULL, INET_ERROR_INCORRECT_STATE);
+    VerifyOrReturnError(mParameters != NULL, CHIP_ERROR_INCORRECT_STATE);
 
     nw_endpoint_t endpoint     = NULL;
     nw_connection_t connection = NULL;
@@ -1356,7 +1354,7 @@
         const IPAddress remote_address = IPAddress::FromSockAddr(*nw_endpoint_get_address(remote_endpoint));
         const uint16_t remote_port     = nw_endpoint_get_port(remote_endpoint);
         const bool isDifferentEndPoint = aPktInfo->DestPort != remote_port || aPktInfo->DestAddress != remote_address;
-        VerifyOrReturnError(isDifferentEndPoint, INET_NO_ERROR);
+        VerifyOrReturnError(isDifferentEndPoint, CHIP_NO_ERROR);
 
         ReturnErrorOnFailure(ReleaseConnection());
     }
@@ -1366,29 +1364,29 @@
     connection = nw_connection_create(endpoint, mParameters);
     nw_release(endpoint);
 
-    VerifyOrReturnError(connection != NULL, INET_ERROR_INCORRECT_STATE);
+    VerifyOrReturnError(connection != NULL, CHIP_ERROR_INCORRECT_STATE);
 
     return StartConnection(connection);
 }
 
-INET_ERROR IPEndPointBasis::StartListener()
+CHIP_ERROR IPEndPointBasis::StartListener()
 {
-    __block INET_ERROR res = INET_NO_ERROR;
+    __block CHIP_ERROR res = CHIP_NO_ERROR;
     nw_listener_t listener;
 
-    VerifyOrReturnError(mListener == NULL, INET_ERROR_INCORRECT_STATE);
-    VerifyOrReturnError(mListenerSemaphore == NULL, INET_ERROR_INCORRECT_STATE);
-    VerifyOrReturnError(mListenerQueue == NULL, INET_ERROR_INCORRECT_STATE);
+    VerifyOrReturnError(mListener == NULL, CHIP_ERROR_INCORRECT_STATE);
+    VerifyOrReturnError(mListenerSemaphore == NULL, CHIP_ERROR_INCORRECT_STATE);
+    VerifyOrReturnError(mListenerQueue == NULL, CHIP_ERROR_INCORRECT_STATE);
 
     listener = nw_listener_create(mParameters);
-    VerifyOrReturnError(listener != NULL, INET_ERROR_INCORRECT_STATE);
+    VerifyOrReturnError(listener != NULL, CHIP_ERROR_INCORRECT_STATE);
 
     mListenerSemaphore = dispatch_semaphore_create(0);
-    VerifyOrReturnError(mListenerSemaphore != NULL, INET_ERROR_NO_MEMORY);
+    VerifyOrReturnError(mListenerSemaphore != NULL, CHIP_ERROR_NO_MEMORY);
     dispatch_retain(mListenerSemaphore);
 
     mListenerQueue = dispatch_queue_create("inet_dispatch_listener", DISPATCH_QUEUE_CONCURRENT);
-    VerifyOrReturnError(mListenerQueue != NULL, INET_ERROR_NO_MEMORY);
+    VerifyOrReturnError(mListenerQueue != NULL, CHIP_ERROR_NO_MEMORY);
     dispatch_retain(mListenerQueue);
 
     nw_listener_set_queue(listener, mListenerQueue);
@@ -1404,7 +1402,7 @@
 
         case nw_listener_state_invalid:
             ChipLogDetail(Inet, "Listener: Invalid");
-            res = INET_ERROR_INCORRECT_STATE;
+            res = CHIP_ERROR_INCORRECT_STATE;
             nw_listener_cancel(listener);
             break;
 
@@ -1419,13 +1417,13 @@
 
         case nw_listener_state_ready:
             ChipLogDetail(Inet, "Listener: Ready");
-            res = INET_NO_ERROR;
+            res = CHIP_NO_ERROR;
             dispatch_semaphore_signal(mListenerSemaphore);
             break;
 
         case nw_listener_state_cancelled:
             ChipLogDetail(Inet, "Listener: Cancelled");
-            if (res == INET_NO_ERROR)
+            if (res == CHIP_NO_ERROR)
                 res = INET_ERROR_CONNECTION_ABORTED;
 
             dispatch_semaphore_signal(mListenerSemaphore);
@@ -1442,9 +1440,9 @@
     return res;
 }
 
-INET_ERROR IPEndPointBasis::StartConnection(nw_connection_t & aConnection)
+CHIP_ERROR IPEndPointBasis::StartConnection(nw_connection_t & aConnection)
 {
-    __block INET_ERROR res = INET_NO_ERROR;
+    __block CHIP_ERROR res = CHIP_NO_ERROR;
 
     nw_connection_set_queue(aConnection, mDispatchQueue);
 
@@ -1454,13 +1452,13 @@
 
         case nw_connection_state_invalid:
             ChipLogDetail(Inet, "Connection: Invalid");
-            res = INET_ERROR_INCORRECT_STATE;
+            res = CHIP_ERROR_INCORRECT_STATE;
             nw_connection_cancel(aConnection);
             break;
 
         case nw_connection_state_preparing:
             ChipLogDetail(Inet, "Connection: Preparing");
-            res = INET_ERROR_INCORRECT_STATE;
+            res = CHIP_ERROR_INCORRECT_STATE;
             break;
 
         case nw_connection_state_waiting:
@@ -1475,13 +1473,13 @@
 
         case nw_connection_state_ready:
             ChipLogDetail(Inet, "Connection: Ready");
-            res = INET_NO_ERROR;
+            res = CHIP_NO_ERROR;
             dispatch_semaphore_signal(mConnectionSemaphore);
             break;
 
         case nw_connection_state_cancelled:
             ChipLogDetail(Inet, "Connection: Cancelled");
-            if (res == INET_NO_ERROR)
+            if (res == CHIP_NO_ERROR)
                 res = INET_ERROR_CONNECTION_ABORTED;
 
             dispatch_semaphore_signal(mConnectionSemaphore);
@@ -1548,32 +1546,32 @@
     }
 }
 
-INET_ERROR IPEndPointBasis::ReleaseListener()
+CHIP_ERROR IPEndPointBasis::ReleaseListener()
 {
-    VerifyOrReturnError(mListener, INET_ERROR_INCORRECT_STATE);
-    VerifyOrReturnError(mDispatchQueue, INET_ERROR_INCORRECT_STATE);
-    VerifyOrReturnError(mConnectionSemaphore, INET_ERROR_INCORRECT_STATE);
+    VerifyOrReturnError(mListener, CHIP_ERROR_INCORRECT_STATE);
+    VerifyOrReturnError(mDispatchQueue, CHIP_ERROR_INCORRECT_STATE);
+    VerifyOrReturnError(mConnectionSemaphore, CHIP_ERROR_INCORRECT_STATE);
 
     nw_listener_cancel(mListener);
     dispatch_semaphore_wait(mListenerSemaphore, DISPATCH_TIME_FOREVER);
     nw_release(mListener);
     mListener = NULL;
 
-    return INET_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
-INET_ERROR IPEndPointBasis::ReleaseConnection()
+CHIP_ERROR IPEndPointBasis::ReleaseConnection()
 {
-    VerifyOrReturnError(mConnection, INET_ERROR_INCORRECT_STATE);
-    VerifyOrReturnError(mDispatchQueue, INET_ERROR_INCORRECT_STATE);
-    VerifyOrReturnError(mConnectionSemaphore, INET_ERROR_INCORRECT_STATE);
+    VerifyOrReturnError(mConnection, CHIP_ERROR_INCORRECT_STATE);
+    VerifyOrReturnError(mDispatchQueue, CHIP_ERROR_INCORRECT_STATE);
+    VerifyOrReturnError(mConnectionSemaphore, CHIP_ERROR_INCORRECT_STATE);
 
     nw_connection_cancel(mConnection);
     dispatch_semaphore_wait(mConnectionSemaphore, DISPATCH_TIME_FOREVER);
     nw_release(mConnection);
     mConnection = NULL;
 
-    return INET_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 #endif // CHIP_SYSTEM_CONFIG_USE_NETWORK_FRAMEWORK
diff --git a/src/inet/IPEndPointBasis.h b/src/inet/IPEndPointBasis.h
index 21c8a4f..91c54ab 100644
--- a/src/inet/IPEndPointBasis.h
+++ b/src/inet/IPEndPointBasis.h
@@ -104,11 +104,11 @@
      *  member to process reception error events on \c endPoint. The \c err
      *  argument provides specific detail about the type of the error.
      */
-    typedef void (*OnReceiveErrorFunct)(IPEndPointBasis * endPoint, INET_ERROR err, const IPPacketInfo * pktInfo);
+    typedef void (*OnReceiveErrorFunct)(IPEndPointBasis * endPoint, CHIP_ERROR err, const IPPacketInfo * pktInfo);
 
-    INET_ERROR SetMulticastLoopback(IPVersion aIPVersion, bool aLoopback);
-    INET_ERROR JoinMulticastGroup(InterfaceId aInterfaceId, const IPAddress & aAddress);
-    INET_ERROR LeaveMulticastGroup(InterfaceId aInterfaceId, const IPAddress & aAddress);
+    CHIP_ERROR SetMulticastLoopback(IPVersion aIPVersion, bool aLoopback);
+    CHIP_ERROR JoinMulticastGroup(InterfaceId aInterfaceId, const IPAddress & aAddress);
+    CHIP_ERROR LeaveMulticastGroup(InterfaceId aInterfaceId, const IPAddress & aAddress);
 
 protected:
     void Init(InetLayer * aInetLayer);
@@ -122,8 +122,8 @@
 #if CHIP_SYSTEM_CONFIG_USE_LWIP
 public:
     static struct netif * FindNetifFromInterfaceId(InterfaceId aInterfaceId);
-    static System::Error PostPacketBufferEvent(chip::System::Layer & aLayer, System::Object & aTarget, System::EventType aEventType,
-                                               System::PacketBufferHandle && aBuffer);
+    static CHIP_ERROR PostPacketBufferEvent(chip::System::Layer & aLayer, System::Object & aTarget, System::EventType aEventType,
+                                            System::PacketBufferHandle && aBuffer);
 
 protected:
     void HandleDataReceived(chip::System::PacketBufferHandle && aBuffer);
@@ -134,10 +134,10 @@
 #if CHIP_SYSTEM_CONFIG_USE_SOCKETS
     InterfaceId mBoundIntfId;
 
-    INET_ERROR Bind(IPAddressType aAddressType, const IPAddress & aAddress, uint16_t aPort, InterfaceId aInterfaceId);
-    INET_ERROR BindInterface(IPAddressType aAddressType, InterfaceId aInterfaceId);
-    INET_ERROR SendMsg(const IPPacketInfo * aPktInfo, chip::System::PacketBufferHandle && aBuffer, uint16_t aSendFlags);
-    INET_ERROR GetSocket(IPAddressType aAddressType, int aType, int aProtocol);
+    CHIP_ERROR Bind(IPAddressType aAddressType, const IPAddress & aAddress, uint16_t aPort, InterfaceId aInterfaceId);
+    CHIP_ERROR BindInterface(IPAddressType aAddressType, InterfaceId aInterfaceId);
+    CHIP_ERROR SendMsg(const IPPacketInfo * aPktInfo, chip::System::PacketBufferHandle && aBuffer, uint16_t aSendFlags);
+    CHIP_ERROR GetSocket(IPAddressType aAddressType, int aType, int aProtocol);
     void HandlePendingIO(uint16_t aPort);
 #endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS
 
@@ -151,17 +151,17 @@
     dispatch_queue_t mDispatchQueue;
     dispatch_semaphore_t mSendSemaphore;
 
-    INET_ERROR Bind(IPAddressType aAddressType, const IPAddress & aAddress, uint16_t aPort, const nw_parameters_t & aParameters);
-    INET_ERROR ConfigureProtocol(IPAddressType aAddressType, const nw_parameters_t & aParameters);
-    INET_ERROR SendMsg(const IPPacketInfo * aPktInfo, chip::System::PacketBufferHandle && aBuffer, uint16_t aSendFlags);
-    INET_ERROR StartListener();
-    INET_ERROR GetConnection(const IPPacketInfo * aPktInfo);
-    INET_ERROR GetEndPoint(nw_endpoint_t & aEndpoint, const IPAddressType aAddressType, const IPAddress & aAddress, uint16_t aPort);
-    INET_ERROR StartConnection(nw_connection_t & aConnection);
+    CHIP_ERROR Bind(IPAddressType aAddressType, const IPAddress & aAddress, uint16_t aPort, const nw_parameters_t & aParameters);
+    CHIP_ERROR ConfigureProtocol(IPAddressType aAddressType, const nw_parameters_t & aParameters);
+    CHIP_ERROR SendMsg(const IPPacketInfo * aPktInfo, chip::System::PacketBufferHandle && aBuffer, uint16_t aSendFlags);
+    CHIP_ERROR StartListener();
+    CHIP_ERROR GetConnection(const IPPacketInfo * aPktInfo);
+    CHIP_ERROR GetEndPoint(nw_endpoint_t & aEndpoint, const IPAddressType aAddressType, const IPAddress & aAddress, uint16_t aPort);
+    CHIP_ERROR StartConnection(nw_connection_t & aConnection);
     void GetPacketInfo(const nw_connection_t & aConnection, IPPacketInfo & aPacketInfo);
     void HandleDataReceived(const nw_connection_t & aConnection);
-    INET_ERROR ReleaseListener();
-    INET_ERROR ReleaseConnection();
+    CHIP_ERROR ReleaseListener();
+    CHIP_ERROR ReleaseConnection();
     void ReleaseAll();
 #endif // CHIP_SYSTEM_CONFIG_USE_NETWORK_FRAMEWORK
 
diff --git a/src/inet/InetConfig.h b/src/inet/InetConfig.h
index 1e0997f..8c96a81 100644
--- a/src/inet/InetConfig.h
+++ b/src/inet/InetConfig.h
@@ -88,35 +88,6 @@
 #endif // INET_CONFIG_MAX_IP_AND_UDP_HEADER_SIZE
 
 /**
- *  @def INET_CONFIG_ERROR_TYPE
- *
- *  @brief
- *    This defines the data type used to represent errors for the
- *    InetLayer subsystem.
- *
- *  @note
- *    By default, this parameter is a copy of CHIP_SYSTEM_CONFIG_ERROR_TYPE.
- *
- */
-#ifndef INET_CONFIG_ERROR_TYPE
-#define INET_CONFIG_ERROR_TYPE                              CHIP_SYSTEM_CONFIG_ERROR_TYPE
-#endif // !defined(INET_CONFIG_ERROR_TYPE)
-
-/**
- *  @def INET_CONFIG_NO_ERROR
- *
- *  @brief
- *    This defines the InetLayer error code for no error or success.
- *
- *  @note
- *    By default, this parameter is a copy of CHIP_SYSTEM_CONFIG_NO_ERROR.
- *
- */
-#ifndef INET_CONFIG_NO_ERROR
-#define INET_CONFIG_NO_ERROR                                CHIP_SYSTEM_CONFIG_NO_ERROR
-#endif // !defined(INET_CONFIG_NO_ERROR)
-
-/**
  *  @def INET_CONFIG_ERROR_MIN
  *
  *  @brief
@@ -139,15 +110,15 @@
 #endif // INET_CONFIG_ERROR_MAX
 
 /**
- *  @def _INET_CONFIG_ERROR
+ *  @def INET_CONFIG_ERROR
  *
  *  @brief
  *    This defines a mapping function for InetLayer errors that allows
  *    mapping such errors into a platform- or system-specific range.
  *
  */
-#ifndef _INET_CONFIG_ERROR
-#define _INET_CONFIG_ERROR(e)                               (INET_ERROR_MIN + (e))
+#ifndef INET_CONFIG_ERROR
+#define INET_CONFIG_ERROR(e)                                (INET_CONFIG_ERROR_MIN + (e))
 #endif // _INET_CONFIG_ERROR
 
 /**
diff --git a/src/inet/InetError.cpp b/src/inet/InetError.cpp
index 128f982..d94221e 100644
--- a/src/inet/InetError.cpp
+++ b/src/inet/InetError.cpp
@@ -55,11 +55,11 @@
  * @return false                    If the supplied error was not an Inet Layer error.
  *
  */
-bool FormatLayerError(char * buf, uint16_t bufSize, int32_t err)
+bool FormatLayerError(char * buf, uint16_t bufSize, CHIP_ERROR err)
 {
     const char * desc = nullptr;
 
-    if (err < INET_ERROR_MIN || err > INET_ERROR_MAX)
+    if (err < INET_CONFIG_ERROR_MIN || err > INET_CONFIG_ERROR_MAX)
     {
         return false;
     }
@@ -70,28 +70,28 @@
     case INET_ERROR_WRONG_ADDRESS_TYPE:
         desc = "Wrong address type";
         break;
-    case INET_ERROR_CONNECTION_ABORTED:
+    case CHIP_ERROR_CONNECTION_ABORTED:
         desc = "TCP connection aborted";
         break;
     case INET_ERROR_PEER_DISCONNECTED:
         desc = "Peer disconnected";
         break;
-    case INET_ERROR_INCORRECT_STATE:
+    case CHIP_ERROR_INCORRECT_STATE:
         desc = "Incorrect state";
         break;
-    case INET_ERROR_MESSAGE_TOO_LONG:
+    case CHIP_ERROR_MESSAGE_TOO_LONG:
         desc = "Message too long";
         break;
-    case INET_ERROR_NO_CONNECTION_HANDLER:
+    case CHIP_ERROR_NO_CONNECTION_HANDLER:
         desc = "No TCP connection handler";
         break;
-    case INET_ERROR_NO_MEMORY:
+    case CHIP_ERROR_NO_MEMORY:
         desc = "No memory";
         break;
-    case INET_ERROR_OUTBOUND_MESSAGE_TRUNCATED:
+    case CHIP_ERROR_OUTBOUND_MESSAGE_TOO_BIG:
         desc = "Outbound message truncated";
         break;
-    case INET_ERROR_INBOUND_MESSAGE_TOO_BIG:
+    case CHIP_ERROR_INBOUND_MESSAGE_TOO_BIG:
         desc = "Inbound message too big";
         break;
     case INET_ERROR_HOST_NOT_FOUND:
@@ -103,7 +103,7 @@
     case INET_ERROR_DNS_NO_RECOVERY:
         desc = "DNS no recovery";
         break;
-    case INET_ERROR_BAD_ARGS:
+    case CHIP_ERROR_INVALID_ARGUMENT:
         desc = "Bad arguments";
         break;
     case INET_ERROR_WRONG_PROTOCOL_TYPE:
@@ -112,7 +112,7 @@
     case INET_ERROR_UNKNOWN_INTERFACE:
         desc = "Unknown interface";
         break;
-    case INET_ERROR_NOT_IMPLEMENTED:
+    case CHIP_ERROR_NOT_IMPLEMENTED:
         desc = "Not implemented";
         break;
     case INET_ERROR_ADDRESS_NOT_FOUND:
@@ -124,16 +124,16 @@
     case INET_ERROR_INVALID_HOST_NAME:
         desc = "Invalid host name";
         break;
-    case INET_ERROR_NOT_SUPPORTED:
+    case CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE:
         desc = "Not supported";
         break;
-    case INET_ERROR_NO_ENDPOINTS:
+    case CHIP_ERROR_ENDPOINT_POOL_FULL:
         desc = "No more TCP endpoints";
         break;
     case INET_ERROR_IDLE_TIMEOUT:
         desc = "Idle timeout";
         break;
-    case INET_ERROR_UNEXPECTED_EVENT:
+    case CHIP_ERROR_UNEXPECTED_EVENT:
         desc = "Unexpected event";
         break;
     case INET_ERROR_INVALID_IPV6_PKT:
diff --git a/src/inet/InetError.h b/src/inet/InetError.h
index 9e6f1f7..13e67f2 100644
--- a/src/inet/InetError.h
+++ b/src/inet/InetError.h
@@ -37,58 +37,20 @@
 // clang-format off
 
 /**
- *  The basic type for all InetLayer errors.
- *
- *  This is defined to a platform- or system-specific type.
- *
- */
-typedef INET_CONFIG_ERROR_TYPE          INET_ERROR;
-
-/**
- *  @def INET_ERROR_MIN
- *
- *  @brief
- *    This defines the base or minimum InetLayer error number
- *    range. This value may be configured via #INET_CONFIG_ERROR_MIN.
- *
- */
-#define INET_ERROR_MIN                  INET_CONFIG_ERROR_MIN
-
-/**
- *  @def INET_ERROR_MAX
- *
- *  @brief
- *    This defines the top or maximum InetLayer error number
- *    range. This value may be configured via #INET_CONFIG_ERROR_MAX.
- *
- */
-#define INET_ERROR_MAX                  INET_CONFIG_ERROR_MAX
-
-/**
- *  @def _INET_ERROR(e)
+ *  @def CHIP_INET_ERROR(e)
  *
  *  @brief
  *    This defines a mapping function for InetLayer errors that allows
  *    mapping such errors into a platform- or system-specific
  *    range. This function may be configured via
- *    #_INET_CONFIG_ERROR(e).
+ *    #INET_CONFIG_ERROR(e).
  *
  *  @param[in]  e  The InetLayer error to map.
  *
  *  @return The mapped InetLayer error.
  *
  */
-#define _INET_ERROR(e)                  _INET_CONFIG_ERROR(e)
-
-/**
- *  @def INET_NO_ERROR
- *
- *  @brief
- *    This defines the InetLayer error code for success or no
- *    error. This value may be configured via #INET_CONFIG_NO_ERROR.
- *
- */
-#define INET_NO_ERROR                   INET_CONFIG_NO_ERROR
+#define CHIP_INET_ERROR(e)                                  INET_CONFIG_ERROR(e)
 
 /**
  *  @name Error Definitions
@@ -104,16 +66,9 @@
  *    the expected type or scope.
  *
  */
-#define INET_ERROR_WRONG_ADDRESS_TYPE                       _INET_ERROR(0)
+#define INET_ERROR_WRONG_ADDRESS_TYPE                       CHIP_INET_ERROR(0)
 
-/**
- *  @def INET_ERROR_CONNECTION_ABORTED
- *
- *  @brief
- *    A connection has been aborted.
- *
- */
-#define INET_ERROR_CONNECTION_ABORTED                       _INET_ERROR(1)
+// unused                                                   CHIP_INET_ERROR(1)
 
 /**
  *  @def INET_ERROR_PEER_DISCONNECTED
@@ -122,63 +77,14 @@
  *    A remote connection peer disconnected.
  *
  */
-#define INET_ERROR_PEER_DISCONNECTED                        _INET_ERROR(2)
+#define INET_ERROR_PEER_DISCONNECTED                        CHIP_INET_ERROR(2)
 
-/**
- *  @def INET_ERROR_INCORRECT_STATE
- *
- *  @brief
- *    An unexpected state was encountered.
- *
- */
-#define INET_ERROR_INCORRECT_STATE                          _INET_ERROR(3)
-
-/**
- *  @def INET_ERROR_MESSAGE_TOO_LONG
- *
- *  @brief
- *    A message is too long.
- *
- */
-#define INET_ERROR_MESSAGE_TOO_LONG                         _INET_ERROR(4)
-
-/**
- *  @def INET_ERROR_NO_CONNECTION_HANDLER
- *
- *  @brief
- *    No callback has been registered for handling an incoming TCP
- *    connection.
- *
- */
-#define INET_ERROR_NO_CONNECTION_HANDLER                    _INET_ERROR(5)
-
-/**
- *  @def INET_ERROR_NO_MEMORY
- *
- *  @brief
- *    A request for memory could not be fulfilled.
- *
- */
-#define INET_ERROR_NO_MEMORY                                _INET_ERROR(6)
-
-/**
- *  @def INET_ERROR_OUTBOUND_MESSAGE_TRUNCATED
- *
- *  @brief
- *    Fewer message bytes were sent than requested.
- *
- */
-#define INET_ERROR_OUTBOUND_MESSAGE_TRUNCATED               _INET_ERROR(7)
-
-/**
- *  @def INET_ERROR_INBOUND_MESSAGE_TOO_BIG
- *
- *  @brief
- *    More message data is pending than available buffer space
- *    available to copy it.
- *
- */
-#define INET_ERROR_INBOUND_MESSAGE_TOO_BIG                  _INET_ERROR(8)
+// unused                                                   CHIP_INET_ERROR(3)
+// unused                                                   CHIP_INET_ERROR(4)
+// unused                                                   CHIP_INET_ERROR(5)
+// unused                                                   CHIP_INET_ERROR(6)
+// unused                                                   CHIP_INET_ERROR(7)
+// unused                                                   CHIP_INET_ERROR(8)
 
 /**
  *  @def INET_ERROR_HOST_NOT_FOUND
@@ -187,7 +93,7 @@
  *    A requested host name could not be resolved to an address.
  *
  */
-#define INET_ERROR_HOST_NOT_FOUND                           _INET_ERROR(9)
+#define INET_ERROR_HOST_NOT_FOUND                           CHIP_INET_ERROR(9)
 
 /**
  *  @def INET_ERROR_DNS_TRY_AGAIN
@@ -197,7 +103,7 @@
  *    again later.
  *
  */
-#define INET_ERROR_DNS_TRY_AGAIN                            _INET_ERROR(10)
+#define INET_ERROR_DNS_TRY_AGAIN                            CHIP_INET_ERROR(10)
 
 /**
  *  @def INET_ERROR_DNS_NO_RECOVERY
@@ -206,16 +112,9 @@
  *    A name server returned an unrecoverable error.
  *
  */
-#define INET_ERROR_DNS_NO_RECOVERY                          _INET_ERROR(11)
+#define INET_ERROR_DNS_NO_RECOVERY                          CHIP_INET_ERROR(11)
 
-/**
- *  @def INET_ERROR_BAD_ARGS
- *
- *  @brief
- *    An invalid argument or arguments were supplied.
- *
- */
-#define INET_ERROR_BAD_ARGS                                 _INET_ERROR(12)
+// unused                                                   CHIP_INET_ERROR(12)
 
 /**
  *  @def INET_ERROR_WRONG_PROTOCOL_TYPE
@@ -224,7 +123,7 @@
  *    An incorrect or unexpected protocol type was encountered.
  *
  */
-#define INET_ERROR_WRONG_PROTOCOL_TYPE                      _INET_ERROR(13)
+#define INET_ERROR_WRONG_PROTOCOL_TYPE                      CHIP_INET_ERROR(13)
 
 /**
  *  @def INET_ERROR_UNKNOWN_INTERFACE
@@ -233,16 +132,9 @@
  *    An unknown interface identifier was encountered.
  *
  */
-#define INET_ERROR_UNKNOWN_INTERFACE                        _INET_ERROR(14)
+#define INET_ERROR_UNKNOWN_INTERFACE                        CHIP_INET_ERROR(14)
 
-/**
- *  @def INET_ERROR_NOT_IMPLEMENTED
- *
- *  @brief
- *    A requested function or feature is not implemented.
- *
- */
-#define INET_ERROR_NOT_IMPLEMENTED                          _INET_ERROR(15)
+// unused                                                   CHIP_INET_ERROR(15)
 
 /**
  *  @def INET_ERROR_ADDRESS_NOT_FOUND
@@ -251,7 +143,7 @@
  *    A requested address type, class, or scope cannot be found.
  *
  */
-#define INET_ERROR_ADDRESS_NOT_FOUND                        _INET_ERROR(16)
+#define INET_ERROR_ADDRESS_NOT_FOUND                        CHIP_INET_ERROR(16)
 
 /**
  *  @def INET_ERROR_HOST_NAME_TOO_LONG
@@ -260,7 +152,7 @@
  *    A requested host name is too long.
  *
  */
-#define INET_ERROR_HOST_NAME_TOO_LONG                       _INET_ERROR(17)
+#define INET_ERROR_HOST_NAME_TOO_LONG                       CHIP_INET_ERROR(17)
 
 /**
  *  @def INET_ERROR_INVALID_HOST_NAME
@@ -269,25 +161,10 @@
  *    A requested host name and port is invalid.
  *
  */
-#define INET_ERROR_INVALID_HOST_NAME                        _INET_ERROR(18)
+#define INET_ERROR_INVALID_HOST_NAME                        CHIP_INET_ERROR(18)
 
-/**
- *  @def INET_ERROR_NOT_SUPPORTED
- *
- *  @brief
- *    A requested function or feature is not supported.
- *
- */
-#define INET_ERROR_NOT_SUPPORTED                            _INET_ERROR(19)
-
-/**
- *  @def INET_ERROR_NO_ENDPOINTS
- *
- *  @brief
- *    No endpoint of the specified type is available.
- *
- */
-#define INET_ERROR_NO_ENDPOINTS                             _INET_ERROR(20)
+// unused                                                   CHIP_INET_ERROR(19)
+// unused                                                   CHIP_INET_ERROR(20)
 
 /**
  *  @def INET_ERROR_IDLE_TIMEOUT
@@ -296,16 +173,9 @@
  *    A TCP connection timed out due to inactivity.
  *
  */
-#define INET_ERROR_IDLE_TIMEOUT                             _INET_ERROR(21)
+#define INET_ERROR_IDLE_TIMEOUT                             CHIP_INET_ERROR(21)
 
-/**
- *  @def INET_ERROR_UNEXPECTED_EVENT
- *
- *  @brief
- *    An unexpected event occurred or was handled.
- *
- */
-#define INET_ERROR_UNEXPECTED_EVENT                         _INET_ERROR(22)
+// unused                                                   CHIP_INET_ERROR(22)
 
 /**
  *  @def INET_ERROR_INVALID_IPV6_PKT
@@ -314,7 +184,7 @@
  *    An IPv6 packet is invalid.
  *
  */
-#define INET_ERROR_INVALID_IPV6_PKT                         _INET_ERROR(23)
+#define INET_ERROR_INVALID_IPV6_PKT                         CHIP_INET_ERROR(23)
 
 /**
  *  @def INET_ERROR_INTERFACE_INIT_FAILURE
@@ -323,7 +193,7 @@
  *    Failure to initialize an interface.
  *
  */
-#define INET_ERROR_INTERFACE_INIT_FAILURE                   _INET_ERROR(24)
+#define INET_ERROR_INTERFACE_INIT_FAILURE                   CHIP_INET_ERROR(24)
 
 /**
  *  @def INET_ERROR_TCP_USER_TIMEOUT
@@ -333,7 +203,7 @@
  *    acknowledgment for transmitted packet.
  *
  */
-#define INET_ERROR_TCP_USER_TIMEOUT                         _INET_ERROR(25)
+#define INET_ERROR_TCP_USER_TIMEOUT                         CHIP_INET_ERROR(25)
 
 /**
  *  @def INET_ERROR_TCP_CONNECT_TIMEOUT
@@ -344,7 +214,7 @@
  *    of an error.
  *
  */
-#define INET_ERROR_TCP_CONNECT_TIMEOUT                      _INET_ERROR(26)
+#define INET_ERROR_TCP_CONNECT_TIMEOUT                      CHIP_INET_ERROR(26)
 
 /**
  *  @def INET_ERROR_INCOMPATIBLE_IP_ADDRESS_TYPE
@@ -354,7 +224,7 @@
  *    IP address type.
  *
  */
-#define INET_ERROR_INCOMPATIBLE_IP_ADDRESS_TYPE             _INET_ERROR(27)
+#define INET_ERROR_INCOMPATIBLE_IP_ADDRESS_TYPE             CHIP_INET_ERROR(27)
 
 //                        !!!!! IMPORTANT !!!!!
 //
@@ -366,13 +236,29 @@
  *  @}
  */
 
+// !!!!! IMPORTANT !!!!!
+// These definitions are present temporarily in order to reduce breakage for PRs in flight.
+// TODO: remove compatibility definitions
+#define INET_ERROR                              CHIP_ERROR
+#define INET_NO_ERROR                           CHIP_NO_ERROR
+#define INET_ERROR_BAD_ARGS                     CHIP_ERROR_INVALID_ARGUMENT
+#define INET_ERROR_INBOUND_MESSAGE_TOO_BIG      CHIP_ERROR_INBOUND_MESSAGE_TOO_BIG
+#define INET_ERROR_INCORRECT_STATE              CHIP_ERROR_INCORRECT_STATE
+#define INET_ERROR_MESSAGE_TOO_LONG             CHIP_ERROR_MESSAGE_TOO_LONG
+#define INET_ERROR_NO_CONNECTION_HANDLER        CHIP_ERROR_NO_CONNECTION_HANDLER
+#define INET_ERROR_NO_ENDPOINTS                 CHIP_ERROR_ENDPOINT_POOL_FULL
+#define INET_ERROR_NOT_IMPLEMENTED              CHIP_ERROR_NOT_IMPLEMENTED
+#define INET_ERROR_NOT_SUPPORTED                CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE
+#define INET_ERROR_NO_MEMORY                    CHIP_ERROR_NO_MEMORY
+#define INET_ERROR_CONNECTION_ABORTED           CHIP_ERROR_CONNECTION_ABORTED
+
 // clang-format on
 
 namespace chip {
 namespace Inet {
 
 extern void RegisterLayerErrorFormatter();
-extern bool FormatLayerError(char * buf, uint16_t bufSize, int32_t err);
+extern bool FormatLayerError(char * buf, uint16_t bufSize, CHIP_ERROR err);
 
 } // namespace Inet
 } // namespace chip
diff --git a/src/inet/InetInterface.cpp b/src/inet/InetInterface.cpp
index ffa1d11..acf962c 100644
--- a/src/inet/InetInterface.cpp
+++ b/src/inet/InetInterface.cpp
@@ -76,8 +76,8 @@
  * @param[in]   nameBuf     region of memory to write the interface name
  * @param[in]   nameBufSize size of the region denoted by \c nameBuf
  *
- * @retval  INET_NO_ERROR           successful result, interface name written
- * @retval  INET_ERROR_NO_MEMORY    name is too large to be written in buffer
+ * @retval  CHIP_NO_ERROR           successful result, interface name written
+ * @retval  CHIP_ERROR_NO_MEMORY    name is too large to be written in buffer
  * @retval  other                   another system or platform error
  *
  * @details
@@ -85,15 +85,15 @@
  *     at \c nameBuf. The name of the unspecified network interface is the empty
  *     string.
  */
-DLL_EXPORT INET_ERROR GetInterfaceName(InterfaceId intfId, char * nameBuf, size_t nameBufSize)
+DLL_EXPORT CHIP_ERROR GetInterfaceName(InterfaceId intfId, char * nameBuf, size_t nameBufSize)
 {
     if (intfId != INET_NULL_INTERFACEID)
     {
 #if CHIP_SYSTEM_CONFIG_USE_LWIP
         int status = snprintf(nameBuf, nameBufSize, "%c%c%d", intfId->name[0], intfId->name[1], intfId->num);
         if (status >= static_cast<int>(nameBufSize))
-            return INET_ERROR_NO_MEMORY;
-        return INET_NO_ERROR;
+            return CHIP_ERROR_NO_MEMORY;
+        return CHIP_NO_ERROR;
 #endif // CHIP_SYSTEM_CONFIG_USE_LWIP
 
 #if CHIP_SYSTEM_CONFIG_USE_SOCKETS && CHIP_SYSTEM_CONFIG_USE_BSD_IFADDRS
@@ -101,29 +101,29 @@
         if (if_indextoname(intfId, intfName) == nullptr)
             return chip::System::MapErrorPOSIX(errno);
         if (strlen(intfName) >= nameBufSize)
-            return INET_ERROR_NO_MEMORY;
+            return CHIP_ERROR_NO_MEMORY;
         strcpy(nameBuf, intfName);
-        return INET_NO_ERROR;
+        return CHIP_NO_ERROR;
 #endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS && CHIP_SYSTEM_CONFIG_USE_BSD_IFADDRS
 
 #if CHIP_SYSTEM_CONFIG_USE_ZEPHYR_NET_IF
         net_if * currentInterface = net_if_get_by_index(intfId);
         if (!currentInterface)
-            return INET_ERROR_INCORRECT_STATE;
+            return CHIP_ERROR_INCORRECT_STATE;
         const char * name = net_if_get_device(currentInterface)->name;
         if (strlen(name) >= nameBufSize)
-            return INET_ERROR_NO_MEMORY;
+            return CHIP_ERROR_NO_MEMORY;
         strcpy(nameBuf, name);
-        return INET_NO_ERROR;
+        return CHIP_NO_ERROR;
 
 #endif // CHIP_SYSTEM_CONFIG_USE_ZEPHYR_NET_IF
     }
 
     if (nameBufSize < 1)
-        return INET_ERROR_NO_MEMORY;
+        return CHIP_ERROR_NO_MEMORY;
 
     nameBuf[0] = 0;
-    return INET_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 /**
@@ -132,7 +132,7 @@
  * @param[in]   intfName    name of the network interface to find
  * @param[out]  intfId      indicator of the network interface to assign
  *
- * @retval  INET_NO_ERROR                 success, network interface indicated
+ * @retval  CHIP_NO_ERROR                 success, network interface indicated
  * @retval  INET_ERROR_UNKNOWN_INTERFACE  no network interface found
  * @retval  other                   another system or platform error
  *
@@ -140,10 +140,10 @@
  *     On LwIP, this function must be called with the LwIP stack lock acquired.
  *
  *     The \c intfId parameter is not updated unless the value returned is
- *     \c INET_NO_ERROR. It should be initialized with \c INET_NULL_INTERFACEID
+ *     \c CHIP_NO_ERROR. It should be initialized with \c INET_NULL_INTERFACEID
  *     before calling this function.
  */
-DLL_EXPORT INET_ERROR InterfaceNameToId(const char * intfName, InterfaceId & intfId)
+DLL_EXPORT CHIP_ERROR InterfaceNameToId(const char * intfName, InterfaceId & intfId)
 {
 #if CHIP_SYSTEM_CONFIG_USE_LWIP
     if (strlen(intfName) < 3)
@@ -162,7 +162,7 @@
         if (intf->name[0] == intfName[0] && intf->name[1] == intfName[1] && intf->num == (uint8_t) intfNum)
         {
             intfId = intf;
-            return INET_NO_ERROR;
+            return CHIP_NO_ERROR;
         }
     }
     intfId = INET_NULL_INTERFACEID;
@@ -173,7 +173,7 @@
     intfId = if_nametoindex(intfName);
     if (intfId == 0)
         return (errno == ENXIO) ? INET_ERROR_UNKNOWN_INTERFACE : chip::System::MapErrorPOSIX(errno);
-    return INET_NO_ERROR;
+    return CHIP_NO_ERROR;
 #endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS && CHIP_SYSTEM_CONFIG_USE_BSD_IFADDRS
 
 #if CHIP_SYSTEM_CONFIG_USE_ZEPHYR_NET_IF
@@ -185,7 +185,7 @@
         if (strcmp(net_if_get_device(currentInterface)->name, intfName) == 0)
         {
             intfId = currentId;
-            return INET_NO_ERROR;
+            return CHIP_NO_ERROR;
         }
     }
     return INET_ERROR_UNKNOWN_INTERFACE;
@@ -560,25 +560,25 @@
  * @param[in]   nameBuf     region of memory to write the interface name
  * @param[in]   nameBufSize size of the region denoted by \c nameBuf
  *
- * @retval  INET_NO_ERROR           successful result, interface name written
- * @retval  INET_ERROR_INCORRECT_STATE
+ * @retval  CHIP_NO_ERROR           successful result, interface name written
+ * @retval  CHIP_ERROR_INCORRECT_STATE
  *                                  iterator is positioned beyond the end of
  *                                  the list
- * @retval  INET_ERROR_NO_MEMORY    name is too large to be written in buffer
+ * @retval  CHIP_ERROR_NO_MEMORY    name is too large to be written in buffer
  * @retval  other                   another system or platform error
  *
  * @details
  *     Writes the name of the network interface as \c NUL terminated text string
  *     at \c nameBuf.
  */
-INET_ERROR InterfaceIterator::GetInterfaceName(char * nameBuf, size_t nameBufSize)
+CHIP_ERROR InterfaceIterator::GetInterfaceName(char * nameBuf, size_t nameBufSize)
 {
-    VerifyOrReturnError(HasCurrent(), INET_ERROR_INCORRECT_STATE);
+    VerifyOrReturnError(HasCurrent(), CHIP_ERROR_INCORRECT_STATE);
 
 #if CHIP_SYSTEM_CONFIG_USE_SOCKETS && CHIP_SYSTEM_CONFIG_USE_BSD_IFADDRS
-    VerifyOrReturnError(strlen(mIntfArray[mCurIntf].if_name) < nameBufSize, INET_ERROR_NO_MEMORY);
+    VerifyOrReturnError(strlen(mIntfArray[mCurIntf].if_name) < nameBufSize, CHIP_ERROR_NO_MEMORY);
     strncpy(nameBuf, mIntfArray[mCurIntf].if_name, nameBufSize);
-    return INET_NO_ERROR;
+    return CHIP_NO_ERROR;
 #endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS && CHIP_SYSTEM_CONFIG_USE_BSD_IFADDRS
 
 #if CHIP_SYSTEM_CONFIG_USE_ZEPHYR_NET_IF
@@ -589,7 +589,7 @@
     return ::chip::Inet::GetInterfaceName(mCurNetif, nameBuf, nameBufSize);
 #endif // CHIP_SYSTEM_CONFIG_USE_LWIP
 
-    return INET_ERROR_NOT_IMPLEMENTED;
+    return CHIP_ERROR_NOT_IMPLEMENTED;
 }
 
 /**
@@ -987,7 +987,7 @@
 }
 
 /**
- * @fn      INET_ERROR InterfaceAddressIterator::GetInterfaceName(char * nameBuf, size_t nameBufSize)
+ * @fn      CHIP_ERROR InterfaceAddressIterator::GetInterfaceName(char * nameBuf, size_t nameBufSize)
  *
  * @brief   Get the name of the network interface associated with the
  *          current interface address.
@@ -995,9 +995,9 @@
  * @param[in]   nameBuf     region of memory to write the interface name
  * @param[in]   nameBufSize size of the region denoted by \c nameBuf
  *
- * @retval  INET_NO_ERROR           successful result, interface name written
- * @retval  INET_ERROR_NO_MEMORY    name is too large to be written in buffer
- * @retval  INET_ERROR_INCORRECT_STATE
+ * @retval  CHIP_NO_ERROR           successful result, interface name written
+ * @retval  CHIP_ERROR_NO_MEMORY    name is too large to be written in buffer
+ * @retval  CHIP_ERROR_INCORRECT_STATE
  *                                  the iterator is not currently positioned on an
  *                                  interface address
  * @retval  other                   another system or platform error
@@ -1006,21 +1006,21 @@
  *     Writes the name of the network interface as \c NUL terminated text string
  *     at \c nameBuf.
  */
-INET_ERROR InterfaceAddressIterator::GetInterfaceName(char * nameBuf, size_t nameBufSize)
+CHIP_ERROR InterfaceAddressIterator::GetInterfaceName(char * nameBuf, size_t nameBufSize)
 {
-    VerifyOrReturnError(HasCurrent(), INET_ERROR_INCORRECT_STATE);
+    VerifyOrReturnError(HasCurrent(), CHIP_ERROR_INCORRECT_STATE);
 
 #if CHIP_SYSTEM_CONFIG_USE_SOCKETS && CHIP_SYSTEM_CONFIG_USE_BSD_IFADDRS
-    VerifyOrReturnError(strlen(mCurAddr->ifa_name) < nameBufSize, INET_ERROR_NO_MEMORY);
+    VerifyOrReturnError(strlen(mCurAddr->ifa_name) < nameBufSize, CHIP_ERROR_NO_MEMORY);
     strncpy(nameBuf, mCurAddr->ifa_name, nameBufSize);
-    return INET_NO_ERROR;
+    return CHIP_NO_ERROR;
 #endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS && CHIP_SYSTEM_CONFIG_USE_BSD_IFADDRS
 
 #if CHIP_SYSTEM_CONFIG_USE_LWIP || CHIP_SYSTEM_CONFIG_USE_ZEPHYR_NET_IF
     return mIntfIter.GetInterfaceName(nameBuf, nameBufSize);
 #endif // CHIP_SYSTEM_CONFIG_USE_LWIP || CHIP_SYSTEM_CONFIG_USE_ZEPHYR_NET_IF
 
-    return INET_ERROR_NOT_IMPLEMENTED;
+    return CHIP_ERROR_NOT_IMPLEMENTED;
 }
 
 /**
diff --git a/src/inet/InetInterface.h b/src/inet/InetInterface.h
index 6939049..acae87d 100644
--- a/src/inet/InetInterface.h
+++ b/src/inet/InetInterface.h
@@ -114,8 +114,8 @@
  */
 #define IsInterfaceIdPresent(intfId) ((intfId) != INET_NULL_INTERFACEID)
 
-extern INET_ERROR GetInterfaceName(InterfaceId intfId, char * nameBuf, size_t nameBufSize);
-extern INET_ERROR InterfaceNameToId(const char * intfName, InterfaceId & intfId);
+extern CHIP_ERROR GetInterfaceName(InterfaceId intfId, char * nameBuf, size_t nameBufSize);
+extern CHIP_ERROR InterfaceNameToId(const char * intfName, InterfaceId & intfId);
 extern uint8_t NetmaskToPrefixLength(const uint8_t * netmask, uint16_t netmaskLen);
 
 /**
@@ -149,7 +149,7 @@
     bool Next();
     InterfaceId GetInterface();
     InterfaceId GetInterfaceId();
-    INET_ERROR GetInterfaceName(char * nameBuf, size_t nameBufSize);
+    CHIP_ERROR GetInterfaceName(char * nameBuf, size_t nameBufSize);
     bool IsUp();
     bool SupportsMulticast();
     bool HasBroadcastAddress();
@@ -223,7 +223,7 @@
     void GetAddressWithPrefix(IPPrefix & addrWithPrefix);
     InterfaceId GetInterface();
     InterfaceId GetInterfaceId();
-    INET_ERROR GetInterfaceName(char * nameBuf, size_t nameBufSize);
+    CHIP_ERROR GetInterfaceName(char * nameBuf, size_t nameBufSize);
     bool IsUp();
     bool SupportsMulticast();
     bool HasBroadcastAddress();
diff --git a/src/inet/InetLayer.cpp b/src/inet/InetLayer.cpp
index 143a73d..43854f5 100644
--- a/src/inet/InetLayer.cpp
+++ b/src/inet/InetLayer.cpp
@@ -127,10 +127,10 @@
 
 #if CHIP_SYSTEM_CONFIG_NO_LOCKING
 
-INET_ERROR InetLayer::InitQueueLimiter(void)
+CHIP_ERROR InetLayer::InitQueueLimiter(void)
 {
     mDroppableEvents = 0;
-    return INET_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 bool InetLayer::CanEnqueueDroppableEvent(void)
@@ -153,7 +153,7 @@
 
 #elif CHIP_SYSTEM_CONFIG_FREERTOS_LOCKING
 
-INET_ERROR InetLayer::InitQueueLimiter(void)
+CHIP_ERROR InetLayer::InitQueueLimiter(void)
 {
     const unsigned portBASE_TYPE maximum = INET_CONFIG_MAX_DROPPABLE_EVENTS;
     const unsigned portBASE_TYPE initial = INET_CONFIG_MAX_DROPPABLE_EVENTS;
@@ -165,9 +165,9 @@
 #endif
 
     if (mDroppableEvents != NULL)
-        return INET_NO_ERROR;
+        return CHIP_NO_ERROR;
     else
-        return INET_ERROR_NO_MEMORY;
+        return CHIP_ERROR_NO_MEMORY;
 }
 
 bool InetLayer::CanEnqueueDroppableEvent(void)
@@ -186,13 +186,13 @@
 
 #else // !CHIP_SYSTEM_CONFIG_FREERTOS_LOCKING
 
-INET_ERROR InetLayer::InitQueueLimiter(void)
+CHIP_ERROR InetLayer::InitQueueLimiter(void)
 {
     if (sem_init(&mDroppableEvents, 0, INET_CONFIG_MAX_DROPPABLE_EVENTS) != 0)
     {
         return chip::System::MapErrorPOSIX(errno);
     }
-    return INET_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 bool InetLayer::CanEnqueueDroppableEvent(void)
@@ -241,24 +241,24 @@
  *                        back to the caller via any platform-specific hook
  *                        functions.
  *
- *  @retval   #INET_ERROR_INCORRECT_STATE        If the InetLayer is in an
+ *  @retval   #CHIP_ERROR_INCORRECT_STATE        If the InetLayer is in an
  *                                               incorrect state.
- *  @retval   #INET_ERROR_NO_MEMORY              If the InetLayer runs out
+ *  @retval   #CHIP_ERROR_NO_MEMORY              If the InetLayer runs out
  *                                               of resource for this
  *                                               request for a new timer.
  *  @retval   other Platform-specific errors indicating the reason for
  *            initialization failure.
- *  @retval   #INET_NO_ERROR                     On success.
+ *  @retval   #CHIP_NO_ERROR                     On success.
  *
  */
-INET_ERROR InetLayer::Init(chip::System::Layer & aSystemLayer, void * aContext)
+CHIP_ERROR InetLayer::Init(chip::System::Layer & aSystemLayer, void * aContext)
 {
-    INET_ERROR err = INET_NO_ERROR;
+    CHIP_ERROR err = CHIP_NO_ERROR;
 
     Inet::RegisterLayerErrorFormatter();
 
     if (State != kState_NotInitialized)
-        return INET_ERROR_INCORRECT_STATE;
+        return CHIP_ERROR_INCORRECT_STATE;
 
     // Platform-specific initialization may elect to set this data
     // member. Ensure it is set to a sane default value before
@@ -304,13 +304,13 @@
  *  Platform::InetLayer::DidShutdown hooks to effect clean-up of
  *  platform-specific customizations or data extensions to InetLayer.
  *
- *  @return #INET_NO_ERROR on success; otherwise, a specific error indicating
+ *  @return #CHIP_NO_ERROR on success; otherwise, a specific error indicating
  *          the reason for shutdown failure.
  *
  */
-INET_ERROR InetLayer::Shutdown()
+CHIP_ERROR InetLayer::Shutdown()
 {
-    INET_ERROR err;
+    CHIP_ERROR err;
 
     err = Platform::InetLayer::WillShutdown(this, mContext);
     SuccessOrExit(err);
@@ -434,21 +434,21 @@
  *
  *  @param[out]   llAddr  The link local IPv6 address for the link.
  *
- *  @retval    #INET_ERROR_NOT_IMPLEMENTED      If IPv6 is not supported.
- *  @retval    #INET_ERROR_BAD_ARGS             If the link local address
+ *  @retval    #CHIP_ERROR_NOT_IMPLEMENTED      If IPv6 is not supported.
+ *  @retval    #CHIP_ERROR_INVALID_ARGUMENT     If the link local address
  *                                              is NULL.
  *  @retval    #INET_ERROR_ADDRESS_NOT_FOUND    If the link does not have
  *                                              any address configured.
- *  @retval    #INET_NO_ERROR                   On success.
+ *  @retval    #CHIP_NO_ERROR                   On success.
  *
  */
-INET_ERROR InetLayer::GetLinkLocalAddr(InterfaceId link, IPAddress * llAddr)
+CHIP_ERROR InetLayer::GetLinkLocalAddr(InterfaceId link, IPAddress * llAddr)
 {
-    VerifyOrReturnError(llAddr != nullptr, INET_ERROR_BAD_ARGS);
+    VerifyOrReturnError(llAddr != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
 
 #if CHIP_SYSTEM_CONFIG_USE_LWIP
 #if !LWIP_IPV6
-    return INET_ERROR_NOT_IMPLEMENTED;
+    return CHIP_ERROR_NOT_IMPLEMENTED;
 #endif //! LWIP_IPV6
 
     for (struct netif * intf = netif_list; intf != NULL; intf = intf->next)
@@ -460,7 +460,7 @@
             if (ip6_addr_isvalid(netif_ip6_addr_state(intf, j)) && ip6_addr_islinklocal(netif_ip6_addr(intf, j)))
             {
                 (*llAddr) = IPAddress::FromIPv6(*netif_ip6_addr(intf, j));
-                return INET_NO_ERROR;
+                return CHIP_NO_ERROR;
             }
         }
         if (link != NULL)
@@ -507,7 +507,7 @@
     *llAddr = IPAddress::FromIPv6(*ip6_addr);
 #endif // CHIP_SYSTEM_CONFIG_USE_ZEPHYR_NET_IF
 
-    return INET_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 #if INET_CONFIG_ENABLE_RAW_ENDPOINT
@@ -526,31 +526,31 @@
  *                                 a return parameter upon completion of the object creation.
  *                                 *retEndPoint is NULL if creation fails.
  *
- *  @retval  #INET_ERROR_INCORRECT_STATE  If the InetLayer object is not initialized.
- *  @retval  #INET_ERROR_NO_ENDPOINTS     If the InetLayer RawEndPoint pool is full and no new
- *                                        endpoints can be created.
- *  @retval  #INET_NO_ERROR               On success.
+ *  @retval  #CHIP_ERROR_INCORRECT_STATE    If the InetLayer object is not initialized.
+ *  @retval  #CHIP_ERROR_ENDPOINT_POOL_FULL If the InetLayer RawEndPoint pool is full and no new
+ *                                          endpoints can be created.
+ *  @retval  #CHIP_NO_ERROR                 On success.
  *
  */
-INET_ERROR InetLayer::NewRawEndPoint(IPVersion ipVer, IPProtocol ipProto, RawEndPoint ** retEndPoint)
+CHIP_ERROR InetLayer::NewRawEndPoint(IPVersion ipVer, IPProtocol ipProto, RawEndPoint ** retEndPoint)
 {
     assertChipStackLockedByCurrentThread();
 
     *retEndPoint = nullptr;
 
-    VerifyOrReturnError(State == kState_Initialized, INET_ERROR_INCORRECT_STATE);
+    VerifyOrReturnError(State == kState_Initialized, CHIP_ERROR_INCORRECT_STATE);
 
     *retEndPoint = RawEndPoint::sPool.TryCreate(*mSystemLayer);
     if (*retEndPoint == nullptr)
     {
         ChipLogError(Inet, "%s endpoint pool FULL", "Raw");
-        return INET_ERROR_NO_ENDPOINTS;
+        return CHIP_ERROR_ENDPOINT_POOL_FULL;
     }
 
     (*retEndPoint)->Inet::RawEndPoint::Init(this, ipVer, ipProto);
     SYSTEM_STATS_INCREMENT(chip::System::Stats::kInetLayer_NumRawEps);
 
-    return INET_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 #endif // INET_CONFIG_ENABLE_RAW_ENDPOINT
 
@@ -566,31 +566,31 @@
  *                                 a return parameter upon completion of the object creation.
  *                                 *retEndPoint is NULL if creation fails.
  *
- *  @retval  #INET_ERROR_INCORRECT_STATE  If the InetLayer object is not initialized.
- *  @retval  #INET_ERROR_NO_ENDPOINTS     If the InetLayer TCPEndPoint pool is full and no new
- *                                        endpoints can be created.
- *  @retval  #INET_NO_ERROR               On success.
+ *  @retval  #CHIP_ERROR_INCORRECT_STATE    If the InetLayer object is not initialized.
+ *  @retval  #CHIP_ERROR_ENDPOINT_POOL_FULL If the InetLayer TCPEndPoint pool is full and no new
+ *                                          endpoints can be created.
+ *  @retval  #CHIP_NO_ERROR                 On success.
  *
  */
-INET_ERROR InetLayer::NewTCPEndPoint(TCPEndPoint ** retEndPoint)
+CHIP_ERROR InetLayer::NewTCPEndPoint(TCPEndPoint ** retEndPoint)
 {
     assertChipStackLockedByCurrentThread();
 
     *retEndPoint = nullptr;
 
-    VerifyOrReturnError(State == kState_Initialized, INET_ERROR_INCORRECT_STATE);
+    VerifyOrReturnError(State == kState_Initialized, CHIP_ERROR_INCORRECT_STATE);
 
     *retEndPoint = TCPEndPoint::sPool.TryCreate(*mSystemLayer);
     if (*retEndPoint == nullptr)
     {
         ChipLogError(Inet, "%s endpoint pool FULL", "TCP");
-        return INET_ERROR_NO_ENDPOINTS;
+        return CHIP_ERROR_ENDPOINT_POOL_FULL;
     }
 
     (*retEndPoint)->Init(this);
     SYSTEM_STATS_INCREMENT(chip::System::Stats::kInetLayer_NumTCPEps);
 
-    return INET_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 #endif // INET_CONFIG_ENABLE_TCP_ENDPOINT
 
@@ -606,31 +606,31 @@
  *                                 a return parameter upon completion of the object creation.
  *                                 *retEndPoint is NULL if creation fails.
  *
- *  @retval  #INET_ERROR_INCORRECT_STATE  If the InetLayer object is not initialized.
- *  @retval  #INET_ERROR_NO_ENDPOINTS     If the InetLayer UDPEndPoint pool is full and no new
- *                                        endpoints can be created.
- *  @retval  #INET_NO_ERROR               On success.
+ *  @retval  #CHIP_ERROR_INCORRECT_STATE    If the InetLayer object is not initialized.
+ *  @retval  #CHIP_ERROR_ENDPOINT_POOL_FULL If the InetLayer UDPEndPoint pool is full and no new
+ *                                          endpoints can be created.
+ *  @retval  #CHIP_NO_ERROR                 On success.
  *
  */
-INET_ERROR InetLayer::NewUDPEndPoint(UDPEndPoint ** retEndPoint)
+CHIP_ERROR InetLayer::NewUDPEndPoint(UDPEndPoint ** retEndPoint)
 {
     assertChipStackLockedByCurrentThread();
 
     *retEndPoint = nullptr;
 
-    VerifyOrReturnError(State == kState_Initialized, INET_ERROR_INCORRECT_STATE);
+    VerifyOrReturnError(State == kState_Initialized, CHIP_ERROR_INCORRECT_STATE);
 
     *retEndPoint = UDPEndPoint::sPool.TryCreate(*mSystemLayer);
     if (*retEndPoint == nullptr)
     {
         ChipLogError(Inet, "%s endpoint pool FULL", "UDP");
-        return INET_ERROR_NO_ENDPOINTS;
+        return CHIP_ERROR_ENDPOINT_POOL_FULL;
     }
 
     (*retEndPoint)->Init(this);
     SYSTEM_STATS_INCREMENT(chip::System::Stats::kInetLayer_NumUDPEps);
 
-    return INET_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 #endif // INET_CONFIG_ENABLE_UDP_ENDPOINT
 
@@ -656,9 +656,9 @@
  *  @param[in]  appState    A pointer to the application state to be passed to
  *                          onComplete when a DNS request is complete.
  *
- *  @retval #INET_NO_ERROR                   if a DNS request is handled
+ *  @retval #CHIP_NO_ERROR                   if a DNS request is handled
  *                                           successfully.
- *  @retval #INET_ERROR_NO_MEMORY            if the Inet layer resolver pool
+ *  @retval #CHIP_ERROR_NO_MEMORY            if the Inet layer resolver pool
  *                                           is full.
  *  @retval #INET_ERROR_HOST_NAME_TOO_LONG   if a requested host name is too
  *                                           long.
@@ -669,13 +669,13 @@
  *                                           try again later.
  *  @retval #INET_ERROR_DNS_NO_RECOVERY      if a name server returned an
  *                                           unrecoverable error.
- *  @retval #INET_ERROR_NOT_IMPLEMENTED      if DNS resolution is not enabled on
+ *  @retval #CHIP_ERROR_NOT_IMPLEMENTED      if DNS resolution is not enabled on
  *                                           the underlying platform.
  *  @retval other POSIX network or OS error returned by the underlying DNS
  *          resolver implementation.
  *
  */
-INET_ERROR InetLayer::ResolveHostAddress(const char * hostName, uint8_t maxAddrs, IPAddress * addrArray,
+CHIP_ERROR InetLayer::ResolveHostAddress(const char * hostName, uint8_t maxAddrs, IPAddress * addrArray,
                                          DNSResolveCompleteFunct onComplete, void * appState)
 {
     size_t hostNameLength = strlen(hostName);
@@ -705,9 +705,9 @@
  *  @param[in]  appState    A pointer to the application state to be passed to
  *                          onComplete when a DNS request is complete.
  *
- *  @retval #INET_NO_ERROR                   if a DNS request is handled
+ *  @retval #CHIP_NO_ERROR                   if a DNS request is handled
  *                                           successfully.
- *  @retval #INET_ERROR_NO_MEMORY            if the Inet layer resolver pool
+ *  @retval #CHIP_ERROR_NO_MEMORY            if the Inet layer resolver pool
  *                                           is full.
  *  @retval #INET_ERROR_HOST_NAME_TOO_LONG   if a requested host name is too
  *                                           long.
@@ -718,13 +718,13 @@
  *                                           try again later.
  *  @retval #INET_ERROR_DNS_NO_RECOVERY      if a name server returned an
  *                                           unrecoverable error.
- *  @retval #INET_ERROR_NOT_IMPLEMENTED      if DNS resolution is not enabled on
+ *  @retval #CHIP_ERROR_NOT_IMPLEMENTED      if DNS resolution is not enabled on
  *                                           the underlying platform.
  *  @retval other POSIX network or OS error returned by the underlying DNS
  *          resolver implementation.
  *
  */
-INET_ERROR InetLayer::ResolveHostAddress(const char * hostName, uint16_t hostNameLen, uint8_t maxAddrs, IPAddress * addrArray,
+CHIP_ERROR InetLayer::ResolveHostAddress(const char * hostName, uint16_t hostNameLen, uint8_t maxAddrs, IPAddress * addrArray,
                                          DNSResolveCompleteFunct onComplete, void * appState)
 {
     return ResolveHostAddress(hostName, hostNameLen, kDNSOption_Default, maxAddrs, addrArray, onComplete, appState);
@@ -760,9 +760,9 @@
  *  @param[in]  appState    A pointer to the application state to be passed to
  *                          onComplete when a DNS request is complete.
  *
- *  @retval #INET_NO_ERROR                   if a DNS request is handled
+ *  @retval #CHIP_NO_ERROR                   if a DNS request is handled
  *                                           successfully.
- *  @retval #INET_ERROR_NO_MEMORY            if the Inet layer resolver pool
+ *  @retval #CHIP_ERROR_NO_MEMORY            if the Inet layer resolver pool
  *                                           is full.
  *  @retval #INET_ERROR_HOST_NAME_TOO_LONG   if a requested host name is too
  *                                           long.
@@ -773,27 +773,27 @@
  *                                           try again later.
  *  @retval #INET_ERROR_DNS_NO_RECOVERY      if a name server returned an
  *                                           unrecoverable error.
- *  @retval #INET_ERROR_NOT_IMPLEMENTED      if DNS resolution is not enabled on
+ *  @retval #CHIP_ERROR_NOT_IMPLEMENTED      if DNS resolution is not enabled on
  *                                           the underlying platform.
  *  @retval other POSIX network or OS error returned by the underlying DNS
  *          resolver implementation.
  *
  */
-INET_ERROR InetLayer::ResolveHostAddress(const char * hostName, uint16_t hostNameLen, uint8_t options, uint8_t maxAddrs,
+CHIP_ERROR InetLayer::ResolveHostAddress(const char * hostName, uint16_t hostNameLen, uint8_t options, uint8_t maxAddrs,
                                          IPAddress * addrArray, DNSResolveCompleteFunct onComplete, void * appState)
 {
     assertChipStackLockedByCurrentThread();
 
-    INET_ERROR err         = INET_NO_ERROR;
+    CHIP_ERROR err         = CHIP_NO_ERROR;
     DNSResolver * resolver = nullptr;
 
-    VerifyOrExit(State == kState_Initialized, err = INET_ERROR_INCORRECT_STATE);
+    VerifyOrExit(State == kState_Initialized, err = CHIP_ERROR_INCORRECT_STATE);
 
-    INET_FAULT_INJECT(FaultInjection::kFault_DNSResolverNew, return INET_ERROR_NO_MEMORY);
+    INET_FAULT_INJECT(FaultInjection::kFault_DNSResolverNew, return CHIP_ERROR_NO_MEMORY);
 
     // Store context information and set the resolver state.
     VerifyOrExit(hostNameLen <= NL_DNS_HOSTNAME_MAX_LEN, err = INET_ERROR_HOST_NAME_TOO_LONG);
-    VerifyOrExit(maxAddrs > 0, err = INET_ERROR_NO_MEMORY);
+    VerifyOrExit(maxAddrs > 0, err = CHIP_ERROR_NO_MEMORY);
 
     resolver = DNSResolver::sPool.TryCreate(*mSystemLayer);
     if (resolver != nullptr)
@@ -803,7 +803,7 @@
     else
     {
         ChipLogError(Inet, "%s resolver pool FULL", "DNS");
-        ExitNow(err = INET_ERROR_NO_MEMORY);
+        ExitNow(err = CHIP_ERROR_NO_MEMORY);
     }
 
     // Short-circuit full address resolution if the supplied host name is a text-form
@@ -824,13 +824,13 @@
 
         if (onComplete)
         {
-            onComplete(appState, err, (err == INET_NO_ERROR) ? 1 : 0, addrArray);
+            onComplete(appState, err, (err == CHIP_NO_ERROR) ? 1 : 0, addrArray);
         }
 
         resolver->Release();
         resolver = nullptr;
 
-        ExitNow(err = INET_NO_ERROR);
+        ExitNow(err = CHIP_NO_ERROR);
     }
 
     // After this point, the resolver will be released by:
@@ -930,10 +930,10 @@
  *
  *  @param[out]   intfId    A reference to the InterfaceId object.
  *
- *  @return  #INET_NO_ERROR unconditionally.
+ *  @return  #CHIP_NO_ERROR unconditionally.
  *
  */
-INET_ERROR InetLayer::GetInterfaceFromAddr(const IPAddress & addr, InterfaceId & intfId)
+CHIP_ERROR InetLayer::GetInterfaceFromAddr(const IPAddress & addr, InterfaceId & intfId)
 {
     InterfaceAddressIterator addrIter;
 
@@ -943,13 +943,13 @@
         if (addr == curAddr)
         {
             intfId = addrIter.GetInterface();
-            return INET_NO_ERROR;
+            return CHIP_NO_ERROR;
         }
     }
 
     intfId = INET_NULL_INTERFACEID;
 
-    return INET_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 /**
@@ -986,7 +986,7 @@
 }
 
 #if INET_CONFIG_ENABLE_TCP_ENDPOINT && INET_TCP_IDLE_CHECK_INTERVAL > 0
-void InetLayer::HandleTCPInactivityTimer(chip::System::Layer * aSystemLayer, void * aAppState, chip::System::Error aError)
+void InetLayer::HandleTCPInactivityTimer(chip::System::Layer * aSystemLayer, void * aAppState, CHIP_ERROR aError)
 {
     InetLayer & lInetLayer = *reinterpret_cast<InetLayer *>(aAppState);
     bool lTimerRequired    = lInetLayer.IsIdleTimerRunning();
@@ -1022,19 +1022,18 @@
 #endif // INET_CONFIG_ENABLE_TCP_ENDPOINT && INET_TCP_IDLE_CHECK_INTERVAL > 0
 
 #if CHIP_SYSTEM_CONFIG_USE_LWIP
-chip::System::Error InetLayer::HandleInetLayerEvent(chip::System::Object & aTarget, chip::System::EventType aEventType,
-                                                    uintptr_t aArgument)
+CHIP_ERROR InetLayer::HandleInetLayerEvent(chip::System::Object & aTarget, chip::System::EventType aEventType, uintptr_t aArgument)
 {
     assertChipStackLockedByCurrentThread();
 
-    VerifyOrReturnError(INET_IsInetEvent(aEventType), CHIP_SYSTEM_ERROR_UNEXPECTED_EVENT);
+    VerifyOrReturnError(INET_IsInetEvent(aEventType), CHIP_ERROR_UNEXPECTED_EVENT);
 
     // Dispatch the event according to its type.
     switch (aEventType)
     {
 #if INET_CONFIG_ENABLE_TCP_ENDPOINT
     case kInetEvent_TCPConnectComplete:
-        static_cast<TCPEndPoint &>(aTarget).HandleConnectComplete(static_cast<INET_ERROR>(aArgument));
+        static_cast<TCPEndPoint &>(aTarget).HandleConnectComplete(static_cast<CHIP_ERROR>(aArgument));
         break;
 
     case kInetEvent_TCPConnectionReceived:
@@ -1051,7 +1050,7 @@
         break;
 
     case kInetEvent_TCPError:
-        static_cast<TCPEndPoint &>(aTarget).HandleError(static_cast<INET_ERROR>(aArgument));
+        static_cast<TCPEndPoint &>(aTarget).HandleError(static_cast<CHIP_ERROR>(aArgument));
         break;
 #endif // INET_CONFIG_ENABLE_TCP_ENDPOINT
 
@@ -1076,7 +1075,7 @@
 #endif // INET_CONFIG_ENABLE_DNS_RESOLVER
 
     default:
-        return CHIP_SYSTEM_ERROR_UNEXPECTED_EVENT;
+        return CHIP_ERROR_UNEXPECTED_EVENT;
     }
 
     // If the event was droppable, record the fact that it has been dequeued.
@@ -1088,7 +1087,7 @@
         lInetLayer.DroppableEventDequeued();
     }
 
-    return CHIP_SYSTEM_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 #endif // CHIP_SYSTEM_CONFIG_USE_LWIP
@@ -1125,17 +1124,17 @@
  * @param[in,out] aContext  Platform-specific context data passed to
  *                          the layer initialization method, \::Init.
  *
- * @return #INET_NO_ERROR on success; otherwise, a specific error indicating
+ * @return #CHIP_NO_ERROR on success; otherwise, a specific error indicating
  *         the reason for initialization failure. Returning non-successful
  *         status will abort initialization.
  *
  */
-DLL_EXPORT INET_ERROR WillInit(Inet::InetLayer * aLayer, void * aContext)
+DLL_EXPORT CHIP_ERROR WillInit(Inet::InetLayer * aLayer, void * aContext)
 {
     (void) aLayer;
     (void) aContext;
 
-    return INET_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 /**
@@ -1153,7 +1152,7 @@
  *                          InetLayer \::Init method.
  *
  */
-DLL_EXPORT void DidInit(Inet::InetLayer * aLayer, void * aContext, INET_ERROR anError)
+DLL_EXPORT void DidInit(Inet::InetLayer * aLayer, void * aContext, CHIP_ERROR anError)
 {
     (void) aLayer;
     (void) aContext;
@@ -1171,17 +1170,17 @@
  * @param[in,out] aContext  Platform-specific context data passed to
  *                          the layer initialization method, \::Init.
  *
- * @return #INET_NO_ERROR on success; otherwise, a specific error indicating
+ * @return #CHIP_NO_ERROR on success; otherwise, a specific error indicating
  *         the reason for shutdown failure. Returning non-successful
  *         status will abort shutdown.
  *
  */
-DLL_EXPORT INET_ERROR WillShutdown(Inet::InetLayer * aLayer, void * aContext)
+DLL_EXPORT CHIP_ERROR WillShutdown(Inet::InetLayer * aLayer, void * aContext)
 {
     (void) aLayer;
     (void) aContext;
 
-    return INET_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 /**
@@ -1199,7 +1198,7 @@
  *                          InetLayer \::Shutdown method.
  *
  */
-DLL_EXPORT void DidShutdown(Inet::InetLayer * aLayer, void * aContext, INET_ERROR anError)
+DLL_EXPORT void DidShutdown(Inet::InetLayer * aLayer, void * aContext, CHIP_ERROR anError)
 {
     (void) aLayer;
     (void) aContext;
diff --git a/src/inet/InetLayer.h b/src/inet/InetLayer.h
index 5762f44..18f61ef 100644
--- a/src/inet/InetLayer.h
+++ b/src/inet/InetLayer.h
@@ -116,11 +116,11 @@
 namespace Platform {
 namespace InetLayer {
 
-extern INET_ERROR WillInit(Inet::InetLayer * aLayer, void * aContext);
-extern void DidInit(Inet::InetLayer * aLayer, void * aContext, INET_ERROR anError);
+extern CHIP_ERROR WillInit(Inet::InetLayer * aLayer, void * aContext);
+extern void DidInit(Inet::InetLayer * aLayer, void * aContext, CHIP_ERROR anError);
 
-extern INET_ERROR WillShutdown(Inet::InetLayer * aLayer, void * aContext);
-extern void DidShutdown(Inet::InetLayer * aLayer, void * aContext, INET_ERROR anError);
+extern CHIP_ERROR WillShutdown(Inet::InetLayer * aLayer, void * aContext);
+extern void DidShutdown(Inet::InetLayer * aLayer, void * aContext, CHIP_ERROR anError);
 
 } // namespace InetLayer
 } // namespace Platform
@@ -180,25 +180,25 @@
 
     InetLayer();
 
-    INET_ERROR Init(chip::System::Layer & aSystemLayer, void * aContext);
+    CHIP_ERROR Init(chip::System::Layer & aSystemLayer, void * aContext);
 
     // Must be called before System::Layer::Shutdown(), since this holds a pointer to that.
-    INET_ERROR Shutdown();
+    CHIP_ERROR Shutdown();
 
     chip::System::Layer * SystemLayer() const;
 
     // End Points
 
 #if INET_CONFIG_ENABLE_RAW_ENDPOINT
-    INET_ERROR NewRawEndPoint(IPVersion ipVer, IPProtocol ipProto, RawEndPoint ** retEndPoint);
+    CHIP_ERROR NewRawEndPoint(IPVersion ipVer, IPProtocol ipProto, RawEndPoint ** retEndPoint);
 #endif // INET_CONFIG_ENABLE_RAW_ENDPOINT
 
 #if INET_CONFIG_ENABLE_TCP_ENDPOINT
-    INET_ERROR NewTCPEndPoint(TCPEndPoint ** retEndPoint);
+    CHIP_ERROR NewTCPEndPoint(TCPEndPoint ** retEndPoint);
 #endif // INET_CONFIG_ENABLE_TCP_ENDPOINT
 
 #if INET_CONFIG_ENABLE_UDP_ENDPOINT
-    INET_ERROR NewUDPEndPoint(UDPEndPoint ** retEndPoint);
+    CHIP_ERROR NewUDPEndPoint(UDPEndPoint ** retEndPoint);
 #endif // INET_CONFIG_ENABLE_UDP_ENDPOINT
 
     // DNS Resolution
@@ -207,19 +207,19 @@
 
     typedef DNSResolver::OnResolveCompleteFunct DNSResolveCompleteFunct;
 
-    INET_ERROR ResolveHostAddress(const char * hostName, uint16_t hostNameLen, uint8_t options, uint8_t maxAddrs,
+    CHIP_ERROR ResolveHostAddress(const char * hostName, uint16_t hostNameLen, uint8_t options, uint8_t maxAddrs,
                                   IPAddress * addrArray, DNSResolveCompleteFunct onComplete, void * appState);
-    INET_ERROR ResolveHostAddress(const char * hostName, uint16_t hostNameLen, uint8_t maxAddrs, IPAddress * addrArray,
+    CHIP_ERROR ResolveHostAddress(const char * hostName, uint16_t hostNameLen, uint8_t maxAddrs, IPAddress * addrArray,
                                   DNSResolveCompleteFunct onComplete, void * appState);
-    INET_ERROR ResolveHostAddress(const char * hostName, uint8_t maxAddrs, IPAddress * addrArray,
+    CHIP_ERROR ResolveHostAddress(const char * hostName, uint8_t maxAddrs, IPAddress * addrArray,
                                   DNSResolveCompleteFunct onComplete, void * appState);
     void CancelResolveHostAddress(DNSResolveCompleteFunct onComplete, void * appState);
 
 #endif // INET_CONFIG_ENABLE_DNS_RESOLVER
 
-    INET_ERROR GetInterfaceFromAddr(const IPAddress & addr, InterfaceId & intfId);
+    CHIP_ERROR GetInterfaceFromAddr(const IPAddress & addr, InterfaceId & intfId);
 
-    INET_ERROR GetLinkLocalAddr(InterfaceId link, IPAddress * llAddr);
+    CHIP_ERROR GetLinkLocalAddr(InterfaceId link, IPAddress * llAddr);
     bool MatchLocalIPv6Subnet(const IPAddress & addr);
 
     static void UpdateSnapshot(chip::System::Stats::Snapshot & aSnapshot);
@@ -228,8 +228,7 @@
     void SetPlatformData(void * aPlatformData);
 
 #if CHIP_SYSTEM_CONFIG_USE_LWIP
-    static chip::System::Error HandleInetLayerEvent(chip::System::Object & aTarget, chip::System::EventType aEventType,
-                                                    uintptr_t aArgument);
+    static CHIP_ERROR HandleInetLayerEvent(chip::System::Object & aTarget, chip::System::EventType aEventType, uintptr_t aArgument);
 
     static chip::System::LwIPEventHandlerDelegate sInetEventHandlerDelegate;
 
@@ -260,7 +259,7 @@
             false;
     }
 
-    INET_ERROR InitQueueLimiter(void);
+    CHIP_ERROR InitQueueLimiter(void);
     bool CanEnqueueDroppableEvent(void);
     void DroppableEventDequeued(void);
 
@@ -279,14 +278,14 @@
 
     inline static bool IsDroppableEvent(chip::System::EventType aType) { return false; }
 
-    inline INET_ERROR InitQueueLimiter(void) { return INET_NO_ERROR; }
+    inline CHIP_ERROR InitQueueLimiter(void) { return CHIP_NO_ERROR; }
     inline bool CanEnqueueDroppableEvent(void) { return true; }
     inline void DroppableEventDequeued(void) { return; }
 #endif // !INET_CONFIG_MAX_DROPPABLE_EVENTS
 #endif // CHIP_SYSTEM_CONFIG_USE_LWIP
 
 #if INET_CONFIG_ENABLE_TCP_ENDPOINT && INET_TCP_IDLE_CHECK_INTERVAL > 0
-    static void HandleTCPInactivityTimer(chip::System::Layer * aSystemLayer, void * aAppState, chip::System::Error aError);
+    static void HandleTCPInactivityTimer(chip::System::Layer * aSystemLayer, void * aAppState, CHIP_ERROR aError);
 #endif // INET_CONFIG_ENABLE_TCP_ENDPOINT && INET_TCP_IDLE_CHECK_INTERVAL > 0
 
 private:
@@ -301,11 +300,11 @@
 
 #endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS
 
-    friend INET_ERROR Platform::InetLayer::WillInit(Inet::InetLayer * aLayer, void * aContext);
-    friend void Platform::InetLayer::DidInit(Inet::InetLayer * aLayer, void * aContext, INET_ERROR anError);
+    friend CHIP_ERROR Platform::InetLayer::WillInit(Inet::InetLayer * aLayer, void * aContext);
+    friend void Platform::InetLayer::DidInit(Inet::InetLayer * aLayer, void * aContext, CHIP_ERROR anError);
 
-    friend INET_ERROR Platform::InetLayer::WillShutdown(Inet::InetLayer * aLayer, void * aContext);
-    friend void Platform::InetLayer::DidShutdown(Inet::InetLayer * aLayer, void * aContext, INET_ERROR anError);
+    friend CHIP_ERROR Platform::InetLayer::WillShutdown(Inet::InetLayer * aLayer, void * aContext);
+    friend void Platform::InetLayer::DidShutdown(Inet::InetLayer * aLayer, void * aContext, CHIP_ERROR anError);
 
     bool IsIdleTimerRunning();
 };
@@ -337,10 +336,10 @@
     void Clear();
 };
 
-extern INET_ERROR ParseHostAndPort(const char * aString, uint16_t aStringLen, const char *& aHost, uint16_t & aHostLen,
+extern CHIP_ERROR ParseHostAndPort(const char * aString, uint16_t aStringLen, const char *& aHost, uint16_t & aHostLen,
                                    uint16_t & aPort);
 
-extern INET_ERROR ParseHostPortAndInterface(const char * aString, uint16_t aStringLen, const char *& aHost, uint16_t & aHostLen,
+extern CHIP_ERROR ParseHostPortAndInterface(const char * aString, uint16_t aStringLen, const char *& aHost, uint16_t & aHostLen,
                                             uint16_t & aPort, const char *& aInterface, uint16_t & aInterfaceLen);
 
 } // namespace Inet
diff --git a/src/inet/InetUtils.cpp b/src/inet/InetUtils.cpp
index 02d7468..2de7c53 100644
--- a/src/inet/InetUtils.cpp
+++ b/src/inet/InetUtils.cpp
@@ -63,10 +63,10 @@
  *                                           malformed.
  *  @return  #INET_ERROR_HOST_NAME_TOO_LONG  If the host name exceeds 253
  *                                           characters.
- *  @return  #INET_NO_ERROR                  On success.
+ *  @return  #CHIP_NO_ERROR                  On success.
  *
  */
-DLL_EXPORT INET_ERROR ParseHostAndPort(const char * aString, uint16_t aStringLen, const char *& aHost, uint16_t & aHostLen,
+DLL_EXPORT CHIP_ERROR ParseHostAndPort(const char * aString, uint16_t aStringLen, const char *& aHost, uint16_t & aHostLen,
                                        uint16_t & aPort)
 {
     const char * end = aString + aStringLen;
@@ -149,7 +149,7 @@
     else
         aPort = 0;
 
-    return INET_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 /**
@@ -193,10 +193,10 @@
  *                                           malformed.
  *  @return  #INET_ERROR_HOST_NAME_TOO_LONG  If the host name exceeds 253
  *                                           characters.
- *  @return  #INET_NO_ERROR                  On success.
+ *  @return  #CHIP_NO_ERROR                  On success.
  *
  */
-DLL_EXPORT INET_ERROR ParseHostPortAndInterface(const char * aString, uint16_t aStringLen, const char *& aHost, uint16_t & aHostLen,
+DLL_EXPORT CHIP_ERROR ParseHostPortAndInterface(const char * aString, uint16_t aStringLen, const char *& aHost, uint16_t & aHostLen,
                                                 uint16_t & aPort, const char *& aInterface, uint16_t & aInterfaceLen)
 {
     const char * end = aString + aStringLen;
diff --git a/src/inet/RawEndPoint.cpp b/src/inet/RawEndPoint.cpp
index bb62415..16d461d 100644
--- a/src/inet/RawEndPoint.cpp
+++ b/src/inet/RawEndPoint.cpp
@@ -86,9 +86,9 @@
  *   udp_bind_netif(aUDP, intfId);
  *
  */
-static INET_ERROR LwIPBindInterface(struct raw_pcb * aRaw, InterfaceId intfId)
+static CHIP_ERROR LwIPBindInterface(struct raw_pcb * aRaw, InterfaceId intfId)
 {
-    INET_ERROR res = INET_NO_ERROR;
+    CHIP_ERROR res = CHIP_NO_ERROR;
 
 #if HAVE_LWIP_RAW_BIND_NETIF
     if (!IsInterfaceIdPresent(intfId))
@@ -127,9 +127,9 @@
  * @param[in]   addr        the IP address (must be an interface address)
  * @param[in]   intfId      an optional network interface indicator
  *
- * @retval  INET_NO_ERROR               success: endpoint bound to address
- * @retval  INET_ERROR_INCORRECT_STATE  endpoint has been bound previously
- * @retval  INET_NO_MEMORY              insufficient memory for endpoint
+ * @retval  CHIP_NO_ERROR               success: endpoint bound to address
+ * @retval  CHIP_ERROR_INCORRECT_STATE  endpoint has been bound previously
+ * @retval  CHIP_ERROR_NO_MEMORY        insufficient memory for endpoint
  *
  * @retval  INET_ERROR_UNKNOWN_INTERFACE
  *      On some platforms, the optionally specified interface is not
@@ -150,11 +150,11 @@
  *  On LwIP, this method must not be called with the LwIP stack lock
  *  already acquired.
  */
-INET_ERROR RawEndPoint::Bind(IPAddressType addrType, const IPAddress & addr, InterfaceId intfId)
+CHIP_ERROR RawEndPoint::Bind(IPAddressType addrType, const IPAddress & addr, InterfaceId intfId)
 {
     if (mState != kState_Ready && mState != kState_Bound)
     {
-        return INET_ERROR_INCORRECT_STATE;
+        return CHIP_ERROR_INCORRECT_STATE;
     }
 
     if ((addr != IPAddress::Any) && (addr.Type() != kIPAddressType_Any) && (addr.Type() != addrType))
@@ -168,10 +168,10 @@
     LOCK_TCPIP_CORE();
 
     // Make sure we have the appropriate type of PCB.
-    INET_ERROR res = GetPCB(addrType);
+    CHIP_ERROR res = GetPCB(addrType);
 
     // Bind the PCB to the specified address.
-    if (res == INET_NO_ERROR)
+    if (res == CHIP_NO_ERROR)
     {
 #if LWIP_VERSION_MAJOR > 1 || LWIP_VERSION_MINOR >= 5
         ip_addr_t ipAddr = addr.ToLwIPAddr();
@@ -198,7 +198,7 @@
 #endif // LWIP_VERSION_MAJOR <= 1 || LWIP_VERSION_MINOR >= 5
     }
 
-    if (res == INET_NO_ERROR)
+    if (res == CHIP_NO_ERROR)
     {
         res = LwIPBindInterface(mRaw, intfId);
     }
@@ -222,7 +222,7 @@
         unsigned long fd = static_cast<unsigned long>(mSocket.GetFD());
 
         mReadableSource = dispatch_source_create(DISPATCH_SOURCE_TYPE_READ, fd, 0, dispatchQueue);
-        ReturnErrorCodeIf(mReadableSource == nullptr, INET_ERROR_NO_MEMORY);
+        ReturnErrorCodeIf(mReadableSource == nullptr, CHIP_ERROR_NO_MEMORY);
 
         dispatch_source_set_event_handler(mReadableSource, ^{
             this->mSocket.SetPendingIO(System::SocketEventFlags::kRead);
@@ -238,7 +238,7 @@
 
     mState = kState_Bound;
 
-    return INET_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 /**
@@ -249,9 +249,9 @@
  * @param[in]   intfId  An InterfaceId to identify the scope of the address.
  * @param[in]   addr    An IPv6 link-local scope IPAddress object.
  *
- * @retval  INET_NO_ERROR               success: endpoint bound to address
- * @retval  INET_ERROR_INCORRECT_STATE  endpoint has been bound previously
- * @retval  INET_NO_MEMORY              insufficient memory for endpoint
+ * @retval  CHIP_NO_ERROR               success: endpoint bound to address
+ * @retval  CHIP_ERROR_INCORRECT_STATE  endpoint has been bound previously
+ * @retval  CHIP_ERROR_NO_MEMORY        insufficient memory for endpoint
  *
  * @retval  INET_ERROR_WRONG_PROTOCOL_TYPE
  *      \c addrType does not match \c IPVer.
@@ -269,9 +269,9 @@
  *  On LwIP, this method must not be called with the LwIP stack lock
  *  already acquired.
  */
-INET_ERROR RawEndPoint::BindIPv6LinkLocal(InterfaceId intfId, const IPAddress & addr)
+CHIP_ERROR RawEndPoint::BindIPv6LinkLocal(InterfaceId intfId, const IPAddress & addr)
 {
-    INET_ERROR res = INET_NO_ERROR;
+    CHIP_ERROR res = CHIP_NO_ERROR;
 
 #if CHIP_SYSTEM_CONFIG_USE_SOCKETS
     const int lIfIndex = static_cast<int>(intfId);
@@ -279,7 +279,7 @@
 
     if (mState != kState_Ready && mState != kState_Bound)
     {
-        res = INET_ERROR_INCORRECT_STATE;
+        res = CHIP_ERROR_INCORRECT_STATE;
         goto ret;
     }
 
@@ -298,7 +298,7 @@
     res = GetPCB(addr.Type());
 
     // Bind the PCB to the specified address.
-    if (res == INET_NO_ERROR)
+    if (res == CHIP_NO_ERROR)
     {
 #if LWIP_VERSION_MAJOR > 1
         ip_addr_t ipAddr = addr.ToLwIPAddr();
@@ -308,7 +308,7 @@
         res                 = chip::System::MapErrorLwIP(raw_bind_ip6(mRaw, &ipv6Addr));
 #endif // LWIP_VERSION_MAJOR <= 1
 
-        if (res != INET_NO_ERROR)
+        if (res != CHIP_NO_ERROR)
         {
             raw_remove(mRaw);
             mRaw              = NULL;
@@ -327,7 +327,7 @@
 
     // Make sure we have the appropriate type of socket.
     res = GetSocket(kIPAddressType_IPv6);
-    if (res != INET_NO_ERROR)
+    if (res != CHIP_NO_ERROR)
     {
         goto ret;
     }
@@ -358,7 +358,7 @@
 #endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS
 
 ret:
-    if (res == INET_NO_ERROR)
+    if (res == CHIP_NO_ERROR)
     {
         mState = kState_Bound;
     }
@@ -373,7 +373,7 @@
  * @param[in]  onReceiveError      The endpoint's receive error event handling function delegate.
  * @param[in]  appState            Application state pointer.
  *
- * @retval  INET_NO_ERROR   always returned.
+ * @retval  CHIP_NO_ERROR   always returned.
  *
  * @details
  *  If \c mState is already \c kState_Listening, then no operation is
@@ -384,17 +384,17 @@
  *  On LwIP, this method must not be called with the LwIP stack lock
  *  already acquired
  */
-INET_ERROR RawEndPoint::Listen(IPEndPointBasis::OnMessageReceivedFunct onMessageReceived,
+CHIP_ERROR RawEndPoint::Listen(IPEndPointBasis::OnMessageReceivedFunct onMessageReceived,
                                IPEndPointBasis::OnReceiveErrorFunct onReceiveError, void * appState)
 {
     if (mState == kState_Listening)
     {
-        return INET_NO_ERROR;
+        return CHIP_NO_ERROR;
     }
 
     if (mState != kState_Bound)
     {
-        return INET_ERROR_INCORRECT_STATE;
+        return CHIP_ERROR_INCORRECT_STATE;
     }
 
     OnMessageReceived = onMessageReceived;
@@ -428,7 +428,7 @@
     mSocket.RequestCallbackOnPendingRead();
 #endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS
 
-    return INET_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 /**
@@ -513,7 +513,7 @@
  *  A synonym for <tt>SendTo(addr, INET_NULL_INTERFACEID, msg,
  *  sendFlags)</tt>.
  */
-INET_ERROR RawEndPoint::SendTo(const IPAddress & addr, chip::System::PacketBufferHandle && msg, uint16_t sendFlags)
+CHIP_ERROR RawEndPoint::SendTo(const IPAddress & addr, chip::System::PacketBufferHandle && msg, uint16_t sendFlags)
 {
     return SendTo(addr, INET_NULL_INTERFACEID, std::move(msg), sendFlags);
 }
@@ -526,20 +526,20 @@
  * @param[in]   msg         the packet buffer containing the UDP message
  * @param[in]   sendFlags   optional transmit option flags
  *
- * @retval  INET_NO_ERROR
+ * @retval  CHIP_NO_ERROR
  *      success: \c msg is queued for transmit.
  *
- * @retval  INET_ERROR_NOT_SUPPORTED
+ * @retval  CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE
  *      the system does not support the requested operation.
  *
  * @retval  INET_ERROR_WRONG_ADDRESS_TYPE
  *      the destination address and the bound interface address do not
  *      have matching protocol versions or address type.
  *
- * @retval  INET_ERROR_MESSAGE_TOO_LONG
+ * @retval  CHIP_ERROR_MESSAGE_TOO_LONG
  *      \c msg does not contain the whole ICMP message.
  *
- * @retval  INET_ERROR_OUTBOUND_MESSAGE_TRUNCATED
+ * @retval  CHIP_ERROR_OUTBOUND_MESSAGE_TOO_BIG
  *      On some platforms, only a truncated portion of \c msg was queued
  *      for transmit.
  *
@@ -548,7 +548,7 @@
  * @details
  *      Send the ICMP message in \c msg to the destination given in \c addr.
  */
-INET_ERROR RawEndPoint::SendTo(const IPAddress & addr, InterfaceId intfId, chip::System::PacketBufferHandle && msg,
+CHIP_ERROR RawEndPoint::SendTo(const IPAddress & addr, InterfaceId intfId, chip::System::PacketBufferHandle && msg,
                                uint16_t sendFlags)
 {
     IPPacketInfo pktInfo;
@@ -565,20 +565,20 @@
  * @param[in]   msg         the packet buffer containing the UDP message
  * @param[in]   sendFlags   optional transmit option flags
  *
- * @retval  INET_NO_ERROR
+ * @retval  CHIP_NO_ERROR
  *      success: \c msg is queued for transmit.
  *
- * @retval  INET_ERROR_NOT_SUPPORTED
+ * @retval  CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE
  *      the system does not support the requested operation.
  *
  * @retval  INET_ERROR_WRONG_ADDRESS_TYPE
  *      the destination address and the bound interface address do not
  *      have matching protocol versions or address type.
  *
- * @retval  INET_ERROR_MESSAGE_TOO_LONG
+ * @retval  CHIP_ERROR_MESSAGE_TOO_LONG
  *      \c msg does not contain the whole ICMP message.
  *
- * @retval  INET_ERROR_OUTBOUND_MESSAGE_TRUNCATED
+ * @retval  CHIP_ERROR_OUTBOUND_MESSAGE_TOO_BIG
  *      On some platforms, only a truncated portion of \c msg was queued
  *      for transmit.
  *
@@ -587,13 +587,13 @@
  * @details
  *      Send the ICMP message \c msg using the destination information given in \c addr.
  */
-INET_ERROR RawEndPoint::SendMsg(const IPPacketInfo * pktInfo, chip::System::PacketBufferHandle && msg, uint16_t sendFlags)
+CHIP_ERROR RawEndPoint::SendMsg(const IPPacketInfo * pktInfo, chip::System::PacketBufferHandle && msg, uint16_t sendFlags)
 {
-    INET_ERROR res         = INET_NO_ERROR;
+    CHIP_ERROR res         = CHIP_NO_ERROR;
     const IPAddress & addr = pktInfo->DestAddress;
 
     INET_FAULT_INJECT(FaultInjection::kFault_Send, return INET_ERROR_UNKNOWN_INTERFACE;);
-    INET_FAULT_INJECT(FaultInjection::kFault_SendNonCritical, return INET_ERROR_NO_MEMORY;);
+    INET_FAULT_INJECT(FaultInjection::kFault_SendNonCritical, return CHIP_ERROR_NO_MEMORY;);
 
     // Do not allow sending an IPv4 address on an IPv6 end point and
     // vice versa.
@@ -673,8 +673,8 @@
  * @param[in]   numICMPTypes    length of array at \c aICMPTypes
  * @param[in]   aICMPTypes      the set of ICMPv6 type codes to filter.
  *
- * @retval  INET_NO_ERROR                   success: filter parameters set
- * @retval  INET_ERROR_NOT_IMPLEMENTED      system does not implement
+ * @retval  CHIP_NO_ERROR                   success: filter parameters set
+ * @retval  CHIP_ERROR_NOT_IMPLEMENTED      system does not implement
  * @retval  INET_ERROR_WRONG_ADDRESS_TYPE   endpoint not IPv6 type
  * @retval  INET_ERROR_WRONG_PROTOCOL_TYPE  endpoint not ICMP6 type
  *
@@ -684,18 +684,18 @@
  *  Apply the ICMPv6 filtering parameters for the codes in \c aICMPTypes to
  *  the underlying endpoint in the system networking stack.
  */
-INET_ERROR RawEndPoint::SetICMPFilter(uint8_t numICMPTypes, const uint8_t * aICMPTypes)
+CHIP_ERROR RawEndPoint::SetICMPFilter(uint8_t numICMPTypes, const uint8_t * aICMPTypes)
 {
 #if CHIP_SYSTEM_CONFIG_USE_SOCKETS
 #if !(HAVE_NETINET_ICMP6_H && HAVE_ICMP6_FILTER)
-    return INET_ERROR_NOT_IMPLEMENTED;
+    return CHIP_ERROR_NOT_IMPLEMENTED;
 #endif //!(HAVE_NETINET_ICMP6_H && HAVE_ICMP6_FILTER)
 #endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS
 
     VerifyOrReturnError(IPVer == kIPVersion_6, INET_ERROR_WRONG_ADDRESS_TYPE);
     VerifyOrReturnError(IPProto == kIPProtocol_ICMPv6, INET_ERROR_WRONG_PROTOCOL_TYPE);
     VerifyOrReturnError((numICMPTypes == 0 && aICMPTypes == nullptr) || (numICMPTypes != 0 && aICMPTypes != nullptr),
-                        INET_ERROR_BAD_ARGS);
+                        CHIP_ERROR_INVALID_ARGUMENT);
 
 #if CHIP_SYSTEM_CONFIG_USE_LWIP
     LOCK_TCPIP_CORE();
@@ -726,7 +726,7 @@
 #endif // HAVE_NETINET_ICMP6_H && HAVE_ICMP6_FILTER
 #endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS
 
-    return INET_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 /**
@@ -736,9 +736,9 @@
  *
  * @param[in]   intfId      indicator of the network interface.
  *
- * @retval  INET_NO_ERROR               success: endpoint bound to address
- * @retval  INET_NO_MEMORY              insufficient memory for endpoint
- * @retval  INET_ERROR_NOT_IMPLEMENTED  system implementation not complete.
+ * @retval  CHIP_NO_ERROR               success: endpoint bound to address
+ * @retval  CHIP_ERROR_NO_MEMORY        insufficient memory for endpoint
+ * @retval  CHIP_ERROR_NOT_IMPLEMENTED  system implementation not complete.
  *
  * @retval  INET_ERROR_UNKNOWN_INTERFACE
  *      On some platforms, the interface is not present.
@@ -751,7 +751,7 @@
  *  On LwIP, this method must not be called with the LwIP stack lock
  *  already acquired.
  */
-INET_ERROR RawEndPoint::BindInterface(IPAddressType addrType, InterfaceId intfId)
+CHIP_ERROR RawEndPoint::BindInterface(IPAddressType addrType, InterfaceId intfId)
 {
     // A lock is required because the LwIP thread may be referring to intf_filter,
     // while this code running in the Inet application is potentially modifying it.
@@ -759,16 +759,16 @@
 
     if (mState != kState_Ready && mState != kState_Bound)
     {
-        return INET_ERROR_INCORRECT_STATE;
+        return CHIP_ERROR_INCORRECT_STATE;
     }
 
 #if CHIP_SYSTEM_CONFIG_USE_LWIP
     LOCK_TCPIP_CORE();
 
     // Make sure we have the appropriate type of PCB.
-    INET_ERROR err = GetPCB(addrType);
+    CHIP_ERROR err = GetPCB(addrType);
 
-    if (err == INET_NO_ERROR)
+    if (err == CHIP_NO_ERROR)
     {
         err = LwIPBindInterface(mRaw, intfId);
     }
@@ -787,7 +787,7 @@
 
     mState = kState_Bound;
 
-    return INET_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 void RawEndPoint::Init(InetLayer * inetLayer, IPVersion ipVer, IPProtocol ipProto)
@@ -825,7 +825,7 @@
     IPEndPointBasis::HandleDataReceived(std::move(msg));
 }
 
-INET_ERROR RawEndPoint::GetPCB(IPAddressType addrType)
+CHIP_ERROR RawEndPoint::GetPCB(IPAddressType addrType)
 {
     // IMPORTANT: This method MUST be called with the LwIP stack LOCKED!
 
@@ -848,7 +848,7 @@
         if (mRaw == NULL)
         {
             ChipLogError(Inet, "raw_new_ip_type failed");
-            return INET_ERROR_NO_MEMORY;
+            return CHIP_ERROR_NO_MEMORY;
         }
 
         mLwIPEndPointType = kLwIPEndPointType_Raw;
@@ -896,7 +896,7 @@
         if (mRaw == NULL)
         {
             ChipLogError(Inet, "raw_new failed");
-            return INET_ERROR_NO_MEMORY;
+            return CHIP_ERROR_NO_MEMORY;
         }
 
         mLwIPEndPointType = kLwIPEndPointType_Raw;
@@ -916,7 +916,7 @@
     }
 #endif // LWIP_VERSION_MAJOR <= 1 || LWIP_VERSION_MINOR >= 5
 
-    return INET_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 /* This function is executed when a raw_pcb is listening and an IP datagram (v4 or v6) is received.
@@ -999,7 +999,7 @@
 #endif // CHIP_SYSTEM_CONFIG_USE_LWIP
 
 #if CHIP_SYSTEM_CONFIG_USE_SOCKETS
-INET_ERROR RawEndPoint::GetSocket(IPAddressType aAddressType)
+CHIP_ERROR RawEndPoint::GetSocket(IPAddressType aAddressType)
 {
     constexpr int lType = (SOCK_RAW | SOCK_FLAGS);
     int lProtocol;
diff --git a/src/inet/RawEndPoint.h b/src/inet/RawEndPoint.h
index 5897928..67992f3 100644
--- a/src/inet/RawEndPoint.h
+++ b/src/inet/RawEndPoint.h
@@ -74,16 +74,16 @@
      */
     IPProtocol IPProto; // This data member is read-only
 
-    INET_ERROR Bind(IPAddressType addrType, const IPAddress & addr, InterfaceId intfId = INET_NULL_INTERFACEID);
-    INET_ERROR BindIPv6LinkLocal(InterfaceId intfId, const IPAddress & addr);
-    INET_ERROR BindInterface(IPAddressType addrType, InterfaceId intfId);
+    CHIP_ERROR Bind(IPAddressType addrType, const IPAddress & addr, InterfaceId intfId = INET_NULL_INTERFACEID);
+    CHIP_ERROR BindIPv6LinkLocal(InterfaceId intfId, const IPAddress & addr);
+    CHIP_ERROR BindInterface(IPAddressType addrType, InterfaceId intfId);
     InterfaceId GetBoundInterface();
-    INET_ERROR Listen(IPEndPointBasis::OnMessageReceivedFunct onMessageReceived,
+    CHIP_ERROR Listen(IPEndPointBasis::OnMessageReceivedFunct onMessageReceived,
                       IPEndPointBasis::OnReceiveErrorFunct onReceiveError, void * appState = nullptr);
-    INET_ERROR SendTo(const IPAddress & addr, chip::System::PacketBufferHandle && msg, uint16_t sendFlags = 0);
-    INET_ERROR SendTo(const IPAddress & addr, InterfaceId intfId, chip::System::PacketBufferHandle && msg, uint16_t sendFlags = 0);
-    INET_ERROR SendMsg(const IPPacketInfo * pktInfo, chip::System::PacketBufferHandle && msg, uint16_t sendFlags = 0);
-    INET_ERROR SetICMPFilter(uint8_t numICMPTypes, const uint8_t * aICMPTypes);
+    CHIP_ERROR SendTo(const IPAddress & addr, chip::System::PacketBufferHandle && msg, uint16_t sendFlags = 0);
+    CHIP_ERROR SendTo(const IPAddress & addr, InterfaceId intfId, chip::System::PacketBufferHandle && msg, uint16_t sendFlags = 0);
+    CHIP_ERROR SendMsg(const IPPacketInfo * pktInfo, chip::System::PacketBufferHandle && msg, uint16_t sendFlags = 0);
+    CHIP_ERROR SetICMPFilter(uint8_t numICMPTypes, const uint8_t * aICMPTypes);
     void Close();
     void Free();
 
@@ -101,7 +101,7 @@
     const uint8_t * ICMPTypes;
 
     void HandleDataReceived(chip::System::PacketBufferHandle && msg);
-    INET_ERROR GetPCB(IPAddressType addrType);
+    CHIP_ERROR GetPCB(IPAddressType addrType);
 
 #if LWIP_VERSION_MAJOR > 1 || LWIP_VERSION_MINOR >= 5
     static u8_t LwIPReceiveRawMessage(void * arg, struct raw_pcb * pcb, struct pbuf * p, const ip_addr_t * addr);
@@ -111,7 +111,7 @@
 #endif // CHIP_SYSTEM_CONFIG_USE_LWIP
 
 #if CHIP_SYSTEM_CONFIG_USE_SOCKETS
-    INET_ERROR GetSocket(IPAddressType addrType);
+    CHIP_ERROR GetSocket(IPAddressType addrType);
     void HandlePendingIO();
     static void HandlePendingIO(System::WatchableSocket & socket);
 
diff --git a/src/inet/TCPEndPoint.cpp b/src/inet/TCPEndPoint.cpp
index 3004dfe..bad1675 100644
--- a/src/inet/TCPEndPoint.cpp
+++ b/src/inet/TCPEndPoint.cpp
@@ -111,12 +111,12 @@
 
 chip::System::ObjectPool<TCPEndPoint, INET_CONFIG_NUM_TCP_ENDPOINTS> TCPEndPoint::sPool;
 
-INET_ERROR TCPEndPoint::Bind(IPAddressType addrType, const IPAddress & addr, uint16_t port, bool reuseAddr)
+CHIP_ERROR TCPEndPoint::Bind(IPAddressType addrType, const IPAddress & addr, uint16_t port, bool reuseAddr)
 {
-    INET_ERROR res = INET_NO_ERROR;
+    CHIP_ERROR res = CHIP_NO_ERROR;
 
     if (State != kState_Ready)
-        return INET_ERROR_INCORRECT_STATE;
+        return CHIP_ERROR_INCORRECT_STATE;
 
     if (addr != IPAddress::Any && addr.Type() != kIPAddressType_Any && addr.Type() != addrType)
         return INET_ERROR_WRONG_ADDRESS_TYPE;
@@ -130,7 +130,7 @@
     res = GetPCB(addrType);
 
     // Bind the PCB to the specified address/port.
-    if (res == INET_NO_ERROR)
+    if (res == CHIP_NO_ERROR)
     {
         if (reuseAddr)
         {
@@ -187,7 +187,7 @@
 
     res = GetSocket(addrType);
 
-    if (res == INET_NO_ERROR && reuseAddr)
+    if (res == CHIP_NO_ERROR && reuseAddr)
     {
         int n = 1;
         setsockopt(mSocket.GetFD(), SOL_SOCKET, SO_REUSEADDR, &n, sizeof(n));
@@ -210,7 +210,7 @@
 #endif // defined(SO_REUSEPORT)
     }
 
-    if (res == INET_NO_ERROR)
+    if (res == CHIP_NO_ERROR)
     {
         if (addrType == kIPAddressType_IPv6)
         {
@@ -249,10 +249,10 @@
         unsigned long fd = static_cast<unsigned long>(mSocket.GetFD());
 
         mReadableSource = dispatch_source_create(DISPATCH_SOURCE_TYPE_READ, fd, 0, dispatchQueue);
-        ReturnErrorCodeIf(mReadableSource == nullptr, INET_ERROR_NO_MEMORY);
+        ReturnErrorCodeIf(mReadableSource == nullptr, CHIP_ERROR_NO_MEMORY);
 
         mWriteableSource = dispatch_source_create(DISPATCH_SOURCE_TYPE_WRITE, fd, 0, dispatchQueue);
-        ReturnErrorCodeIf(mWriteableSource == nullptr, INET_ERROR_NO_MEMORY);
+        ReturnErrorCodeIf(mWriteableSource == nullptr, CHIP_ERROR_NO_MEMORY);
 
         dispatch_source_set_event_handler(mReadableSource, ^{
             this->mSocket.SetPendingIO(System::SocketEventFlags::kRead);
@@ -270,7 +270,7 @@
 #endif // CHIP_SYSTEM_CONFIG_USE_DISPATCH
 #endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS
 
-    if (res == INET_NO_ERROR)
+    if (res == CHIP_NO_ERROR)
     {
         State = kState_Bound;
     }
@@ -278,12 +278,12 @@
     return res;
 }
 
-INET_ERROR TCPEndPoint::Listen(uint16_t backlog)
+CHIP_ERROR TCPEndPoint::Listen(uint16_t backlog)
 {
-    INET_ERROR res = INET_NO_ERROR;
+    CHIP_ERROR res = CHIP_NO_ERROR;
 
     if (State != kState_Bound)
-        return INET_ERROR_INCORRECT_STATE;
+        return CHIP_ERROR_INCORRECT_STATE;
 
 #if CHIP_SYSTEM_CONFIG_USE_LWIP
 
@@ -308,7 +308,7 @@
 
 #endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS
 
-    if (res == INET_NO_ERROR)
+    if (res == CHIP_NO_ERROR)
     {
         // Once Listening, bump the reference count.  The corresponding call to Release()
         // [or on LwIP, DeferredRelease()] will happen in DoClose().
@@ -319,12 +319,12 @@
     return res;
 }
 
-INET_ERROR TCPEndPoint::Connect(const IPAddress & addr, uint16_t port, InterfaceId intfId)
+CHIP_ERROR TCPEndPoint::Connect(const IPAddress & addr, uint16_t port, InterfaceId intfId)
 {
-    INET_ERROR res = INET_NO_ERROR;
+    CHIP_ERROR res = CHIP_NO_ERROR;
 
     if (State != kState_Ready && State != kState_Bound)
-        return INET_ERROR_INCORRECT_STATE;
+        return CHIP_ERROR_INCORRECT_STATE;
 
     IPAddressType addrType = addr.Type();
 
@@ -340,14 +340,14 @@
         InetLayer & lInetLayer = Layer();
 
         if (!addr.IsIPv6LinkLocal() || State == kState_Bound)
-            return INET_ERROR_NOT_IMPLEMENTED;
+            return CHIP_ERROR_NOT_IMPLEMENTED;
 
         res = lInetLayer.GetLinkLocalAddr(intfId, &intfLLAddr);
-        if (res != INET_NO_ERROR)
+        if (res != CHIP_NO_ERROR)
             return res;
 
         res = Bind(kIPAddressType_IPv6, intfLLAddr, 0, true);
-        if (res != INET_NO_ERROR)
+        if (res != CHIP_NO_ERROR)
             return res;
     }
 
@@ -356,7 +356,7 @@
 
     res = GetPCB(addrType);
 
-    if (res == INET_NO_ERROR)
+    if (res == CHIP_NO_ERROR)
     {
         tcp_arg(mTCP, this);
         tcp_err(mTCP, LwIPHandleError);
@@ -382,12 +382,12 @@
 #endif // LWIP_VERSION_MAJOR <= 1 || LWIP_VERSION_MINOR >= 5
 
         // Ensure that TCP timers are started
-        if (res == INET_NO_ERROR)
+        if (res == CHIP_NO_ERROR)
         {
             res = start_tcp_timers();
         }
 
-        if (res == INET_NO_ERROR)
+        if (res == CHIP_NO_ERROR)
         {
             State = kState_Connecting;
             Retain();
@@ -402,7 +402,7 @@
 #if CHIP_SYSTEM_CONFIG_USE_SOCKETS
 
     res = GetSocket(addrType);
-    if (res != INET_NO_ERROR)
+    if (res != CHIP_NO_ERROR)
         return res;
 
     if (intfId == INET_NULL_INTERFACEID)
@@ -426,7 +426,7 @@
             memset(&ifr, 0, sizeof(ifr));
 
             res = GetInterfaceName(intfId, ifr.ifr_name, sizeof(ifr.ifr_name));
-            if (res != INET_NO_ERROR)
+            if (res != CHIP_NO_ERROR)
                 return res;
 
             // Attempt to bind to the interface using SO_BINDTODEVICE which requires privileged access.
@@ -446,7 +446,7 @@
                 // The only way to do this is to bind the local to an address on the desired
                 // interface.
                 res = BindSrcAddrFromIntf(addrType, intfId);
-                if (res != INET_NO_ERROR)
+                if (res != CHIP_NO_ERROR)
                     return res;
             }
         }
@@ -519,7 +519,7 @@
         // Wait for ability to read on this endpoint.
         mSocket.RequestCallbackOnPendingRead();
         if (OnConnectComplete != nullptr)
-            OnConnectComplete(this, INET_NO_ERROR);
+            OnConnectComplete(this, CHIP_NO_ERROR);
     }
     else
     {
@@ -565,7 +565,7 @@
     lSystemLayer.CancelTimer(TCPConnectTimeoutHandler, this);
 }
 
-void TCPEndPoint::TCPConnectTimeoutHandler(chip::System::Layer * aSystemLayer, void * aAppState, chip::System::Error aError)
+void TCPEndPoint::TCPConnectTimeoutHandler(chip::System::Layer * aSystemLayer, void * aAppState, CHIP_ERROR aError)
 {
     TCPEndPoint * tcpEndPoint = reinterpret_cast<TCPEndPoint *>(aAppState);
 
@@ -576,12 +576,12 @@
     tcpEndPoint->DoClose(INET_ERROR_TCP_CONNECT_TIMEOUT, false);
 }
 
-INET_ERROR TCPEndPoint::GetPeerInfo(IPAddress * retAddr, uint16_t * retPort) const
+CHIP_ERROR TCPEndPoint::GetPeerInfo(IPAddress * retAddr, uint16_t * retPort) const
 {
-    INET_ERROR res = INET_NO_ERROR;
+    CHIP_ERROR res = CHIP_NO_ERROR;
 
     if (!IsConnected())
-        return INET_ERROR_INCORRECT_STATE;
+        return CHIP_ERROR_INCORRECT_STATE;
 
 #if CHIP_SYSTEM_CONFIG_USE_LWIP
 
@@ -603,7 +603,7 @@
 #endif // LWIP_VERSION_MAJOR <= 1 || LWIP_VERSION_MINOR >= 5
     }
     else
-        res = INET_ERROR_CONNECTION_ABORTED;
+        res = CHIP_ERROR_CONNECTION_ABORTED;
 
     // Unlock LwIP stack
     UNLOCK_TCPIP_CORE();
@@ -637,19 +637,19 @@
     }
 #endif // INET_CONFIG_ENABLE_IPV4
     else
-        return INET_ERROR_INCORRECT_STATE;
+        return CHIP_ERROR_INCORRECT_STATE;
 
 #endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS
 
     return res;
 }
 
-INET_ERROR TCPEndPoint::GetLocalInfo(IPAddress * retAddr, uint16_t * retPort)
+CHIP_ERROR TCPEndPoint::GetLocalInfo(IPAddress * retAddr, uint16_t * retPort)
 {
-    INET_ERROR res = INET_NO_ERROR;
+    CHIP_ERROR res = CHIP_NO_ERROR;
 
     if (!IsConnected())
-        return INET_ERROR_INCORRECT_STATE;
+        return CHIP_ERROR_INCORRECT_STATE;
 
 #if CHIP_SYSTEM_CONFIG_USE_LWIP
 
@@ -671,7 +671,7 @@
 #endif // LWIP_VERSION_MAJOR <= 1 || LWIP_VERSION_MINOR >= 5
     }
     else
-        res = INET_ERROR_CONNECTION_ABORTED;
+        res = CHIP_ERROR_CONNECTION_ABORTED;
 
     // Unlock LwIP stack
     UNLOCK_TCPIP_CORE();
@@ -708,24 +708,24 @@
     }
 #endif // INET_CONFIG_ENABLE_IPV4
     else
-        return INET_ERROR_INCORRECT_STATE;
+        return CHIP_ERROR_INCORRECT_STATE;
 
 #endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS
 
     return res;
 }
 
-INET_ERROR TCPEndPoint::GetInterfaceId(InterfaceId * retInterface)
+CHIP_ERROR TCPEndPoint::GetInterfaceId(InterfaceId * retInterface)
 {
     if (!IsConnected())
-        return INET_ERROR_INCORRECT_STATE;
+        return CHIP_ERROR_INCORRECT_STATE;
 
 #if CHIP_SYSTEM_CONFIG_USE_LWIP
     // TODO: Does netif_get_by_index(mTCP->netif_idx) do the right thing?  I
     // can't quite tell whether LwIP supports a specific interface id for TCP at
     // all.  For now just claim no particular interface id.
     *retInterface = INET_NULL_INTERFACEID;
-    return INET_NO_ERROR;
+    return CHIP_NO_ERROR;
 #endif // CHIP_SYSTEM_CONFIG_USE_LWIP
 
 #if CHIP_SYSTEM_CONFIG_USE_SOCKETS
@@ -757,7 +757,7 @@
             // TODO: Is there still a meaningful interface id in this case?
             *retInterface = INET_NULL_INTERFACEID;
         }
-        return INET_NO_ERROR;
+        return CHIP_NO_ERROR;
     }
 
 #if INET_CONFIG_ENABLE_IPV4
@@ -768,21 +768,21 @@
     }
 #endif // INET_CONFIG_ENABLE_IPV4
 
-    return INET_ERROR_INCORRECT_STATE;
+    return CHIP_ERROR_INCORRECT_STATE;
 
 #endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS
 
     *retInterface = INET_NULL_INTERFACEID;
-    return INET_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
-INET_ERROR TCPEndPoint::Send(System::PacketBufferHandle && data, bool push)
+CHIP_ERROR TCPEndPoint::Send(System::PacketBufferHandle && data, bool push)
 {
-    INET_ERROR res = INET_NO_ERROR;
+    CHIP_ERROR res = CHIP_NO_ERROR;
 
     if (State != kState_Connected && State != kState_ReceiveShutdown)
     {
-        return INET_ERROR_INCORRECT_STATE;
+        return CHIP_ERROR_INCORRECT_STATE;
     }
 
     if (mSendQueue.IsNull())
@@ -844,12 +844,12 @@
  *
  */
 
-INET_ERROR TCPEndPoint::EnableNoDelay()
+CHIP_ERROR TCPEndPoint::EnableNoDelay()
 {
-    INET_ERROR res = INET_NO_ERROR;
+    CHIP_ERROR res = CHIP_NO_ERROR;
 
     if (!IsConnected())
-        return INET_ERROR_INCORRECT_STATE;
+        return CHIP_ERROR_INCORRECT_STATE;
 
 #if CHIP_SYSTEM_CONFIG_USE_LWIP
     // Lock LwIP stack
@@ -858,7 +858,7 @@
     if (mTCP != NULL)
         tcp_nagle_disable(mTCP);
     else
-        res = INET_ERROR_CONNECTION_ABORTED;
+        res = CHIP_ERROR_CONNECTION_ABORTED;
 
     // Unlock LwIP stack
     UNLOCK_TCPIP_CORE();
@@ -882,12 +882,12 @@
     return res;
 }
 
-INET_ERROR TCPEndPoint::EnableKeepAlive(uint16_t interval, uint16_t timeoutCount)
+CHIP_ERROR TCPEndPoint::EnableKeepAlive(uint16_t interval, uint16_t timeoutCount)
 {
-    INET_ERROR res = INET_NO_ERROR;
+    CHIP_ERROR res = CHIP_NO_ERROR;
 
     if (!IsConnected())
-        return INET_ERROR_INCORRECT_STATE;
+        return CHIP_ERROR_INCORRECT_STATE;
 
 #if CHIP_SYSTEM_CONFIG_USE_LWIP
 
@@ -911,14 +911,14 @@
         ip_set_option(mTCP, SOF_KEEPALIVE);
     }
     else
-        res = INET_ERROR_CONNECTION_ABORTED;
+        res = CHIP_ERROR_CONNECTION_ABORTED;
 
     // Unlock LwIP stack
     UNLOCK_TCPIP_CORE();
 
 #else // LWIP_TCP_KEEPALIVE
 
-    res = INET_ERROR_NOT_IMPLEMENTED;
+    res = CHIP_ERROR_NOT_IMPLEMENTED;
 
 #endif // LWIP_TCP_KEEPALIVE
 
@@ -966,12 +966,12 @@
  *    This method does nothing if keepalives have not been enabled on the endpoint.
  */
 
-INET_ERROR TCPEndPoint::DisableKeepAlive()
+CHIP_ERROR TCPEndPoint::DisableKeepAlive()
 {
-    INET_ERROR res = INET_NO_ERROR;
+    CHIP_ERROR res = CHIP_NO_ERROR;
 
     if (!IsConnected())
-        return INET_ERROR_INCORRECT_STATE;
+        return CHIP_ERROR_INCORRECT_STATE;
 
 #if CHIP_SYSTEM_CONFIG_USE_LWIP
 
@@ -986,14 +986,14 @@
         ip_reset_option(mTCP, SOF_KEEPALIVE);
     }
     else
-        res = INET_ERROR_CONNECTION_ABORTED;
+        res = CHIP_ERROR_CONNECTION_ABORTED;
 
     // Unlock LwIP stack
     UNLOCK_TCPIP_CORE();
 
 #else // LWIP_TCP_KEEPALIVE
 
-    res = INET_ERROR_NOT_IMPLEMENTED;
+    res = CHIP_ERROR_NOT_IMPLEMENTED;
 
 #endif // LWIP_TCP_KEEPALIVE
 
@@ -1034,13 +1034,13 @@
  *    This method can be called multiple times to adjust the keepalive interval or timeout
  *    count.
  */
-INET_ERROR TCPEndPoint::SetUserTimeout(uint32_t userTimeoutMillis)
+CHIP_ERROR TCPEndPoint::SetUserTimeout(uint32_t userTimeoutMillis)
 {
-    INET_ERROR res = INET_NO_ERROR;
+    CHIP_ERROR res = CHIP_NO_ERROR;
 
     if (!IsConnected())
     {
-        return INET_ERROR_INCORRECT_STATE;
+        return CHIP_ERROR_INCORRECT_STATE;
     }
 
 #if INET_CONFIG_OVERRIDE_SYSTEM_TCP_USER_TIMEOUT
@@ -1059,13 +1059,13 @@
     if (setsockopt(mSocket.GetFD(), TCP_SOCKOPT_LEVEL, TCP_USER_TIMEOUT, &val, sizeof(val)) != 0)
         return chip::System::MapErrorPOSIX(errno);
 #else  // TCP_USER_TIMEOUT
-    res = INET_ERROR_NOT_IMPLEMENTED;
+    res = CHIP_ERROR_NOT_IMPLEMENTED;
 #endif // defined(TCP_USER_TIMEOUT)
 
 #endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS
 
 #if CHIP_SYSTEM_CONFIG_USE_LWIP
-    res = INET_ERROR_NOT_IMPLEMENTED;
+    res = CHIP_ERROR_NOT_IMPLEMENTED;
 #endif // CHIP_SYSTEM_CONFIG_USE_LWIP
 
 #endif // !INET_CONFIG_OVERRIDE_SYSTEM_TCP_USER_TIMEOUT
@@ -1073,12 +1073,12 @@
     return res;
 }
 
-INET_ERROR TCPEndPoint::AckReceive(uint16_t len)
+CHIP_ERROR TCPEndPoint::AckReceive(uint16_t len)
 {
-    INET_ERROR res = INET_NO_ERROR;
+    CHIP_ERROR res = CHIP_NO_ERROR;
 
     if (!IsConnected())
-        return INET_ERROR_INCORRECT_STATE;
+        return CHIP_ERROR_INCORRECT_STATE;
 
 #if CHIP_SYSTEM_CONFIG_USE_LWIP
 
@@ -1088,7 +1088,7 @@
     if (mTCP != NULL)
         tcp_recved(mTCP, len);
     else
-        res = INET_ERROR_CONNECTION_ABORTED;
+        res = CHIP_ERROR_CONNECTION_ABORTED;
 
     // Unlock LwIP stack
     UNLOCK_TCPIP_CORE();
@@ -1104,14 +1104,14 @@
     return res;
 }
 
-INET_ERROR TCPEndPoint::SetReceivedDataForTesting(System::PacketBufferHandle && data)
+CHIP_ERROR TCPEndPoint::SetReceivedDataForTesting(System::PacketBufferHandle && data)
 {
     if (!IsConnected())
-        return INET_ERROR_INCORRECT_STATE;
+        return CHIP_ERROR_INCORRECT_STATE;
 
     mRcvQueue = std::move(data);
 
-    return INET_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 uint32_t TCPEndPoint::PendingSendLength()
@@ -1128,12 +1128,12 @@
     return 0;
 }
 
-INET_ERROR TCPEndPoint::Shutdown()
+CHIP_ERROR TCPEndPoint::Shutdown()
 {
-    INET_ERROR err = INET_NO_ERROR;
+    CHIP_ERROR err = CHIP_NO_ERROR;
 
     if (!IsConnected())
-        return INET_ERROR_INCORRECT_STATE;
+        return CHIP_ERROR_INCORRECT_STATE;
 
     // If fully connected, enter the SendShutdown state.
     if (State == kState_Connected)
@@ -1149,7 +1149,7 @@
     return err;
 }
 
-INET_ERROR TCPEndPoint::Close()
+CHIP_ERROR TCPEndPoint::Close()
 {
     // Clear the receive queue.
     mRcvQueue = nullptr;
@@ -1160,7 +1160,7 @@
     OnConnectComplete  = nullptr;
 
     // Perform a graceful close.
-    return DoClose(INET_NO_ERROR, true);
+    return DoClose(CHIP_NO_ERROR, true);
 }
 
 void TCPEndPoint::Abort()
@@ -1170,12 +1170,12 @@
     OnPeerClose        = nullptr;
     OnConnectComplete  = nullptr;
 
-    DoClose(INET_ERROR_CONNECTION_ABORTED, true);
+    DoClose(CHIP_ERROR_CONNECTION_ABORTED, true);
 }
 
 void TCPEndPoint::Free()
 {
-    INET_ERROR err;
+    CHIP_ERROR err;
 
     // Ensure no callbacks to the app after this point.
     OnAcceptError        = nullptr;
@@ -1188,7 +1188,7 @@
 
     // Ensure the end point is Closed or Closing.
     err = Close();
-    if (err != INET_NO_ERROR)
+    if (err != CHIP_NO_ERROR)
         Abort();
 
     // Release the Retain() that happened when the end point was allocated
@@ -1257,9 +1257,9 @@
 #endif // CHIP_SYSTEM_CONFIG_USE_LWIP
 }
 
-INET_ERROR TCPEndPoint::DriveSending()
+CHIP_ERROR TCPEndPoint::DriveSending()
 {
-    INET_ERROR err = INET_NO_ERROR;
+    CHIP_ERROR err = CHIP_NO_ERROR;
 
 #if CHIP_SYSTEM_CONFIG_USE_LWIP
 
@@ -1334,7 +1334,7 @@
             // Call LwIP to send the queued data.
             INET_FAULT_INJECT(FaultInjection::kFault_Send, err = chip::System::MapErrorLwIP(ERR_RTE));
 
-            if (err == INET_NO_ERROR)
+            if (err == CHIP_NO_ERROR)
             {
                 lwipErr = tcp_output(mTCP);
 
@@ -1343,7 +1343,7 @@
             }
         }
 
-        if (err == INET_NO_ERROR)
+        if (err == CHIP_NO_ERROR)
         {
             // If in the SendShutdown state and the unsent queue is now empty, shutdown the PCB for sending.
             if (State == kState_SendShutdown && (RemainingToSend() == 0))
@@ -1356,7 +1356,7 @@
     }
 
     else
-        err = INET_ERROR_CONNECTION_ABORTED;
+        err = CHIP_ERROR_CONNECTION_ABORTED;
 
     // Unlock LwIP stack
     UNLOCK_TCPIP_CORE();
@@ -1393,7 +1393,7 @@
 
         if (lenSentRaw < 0 || lenSentRaw > bufLen)
         {
-            err = INET_ERROR_INCORRECT_STATE;
+            err = CHIP_ERROR_INCORRECT_STATE;
             break;
         }
 
@@ -1432,7 +1432,7 @@
         bool isProgressing = false;
 
         err = CheckConnectionProgress(isProgressing);
-        if (err != INET_NO_ERROR)
+        if (err != CHIP_NO_ERROR)
         {
             break;
         }
@@ -1457,7 +1457,7 @@
             break;
     }
 
-    if (err == INET_NO_ERROR)
+    if (err == CHIP_NO_ERROR)
     {
         // If we're in the SendShutdown state and the send queue is now empty, shutdown writing on the socket.
         if (State == kState_SendShutdown && mSendQueue.IsNull())
@@ -1469,7 +1469,7 @@
 
 #endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS
 
-    if (err != INET_NO_ERROR)
+    if (err != CHIP_NO_ERROR)
         DoClose(err, false);
 
     CHIP_SYSTEM_FAULT_INJECT_ASYNC_EVENT();
@@ -1486,8 +1486,8 @@
         // Acknowledgement is done after handling the buffers to allow the
         // application processing to throttle flow.
         uint16_t ackLength = mRcvQueue->TotalLength();
-        INET_ERROR err     = OnDataReceived(this, std::move(mRcvQueue));
-        if (err != INET_NO_ERROR)
+        CHIP_ERROR err     = OnDataReceived(this, std::move(mRcvQueue));
+        if (err != CHIP_NO_ERROR)
         {
             DoClose(err, false);
             return;
@@ -1498,13 +1498,13 @@
     // If the connection is closing, and the receive queue is now empty, call DoClose() to complete
     // the process of closing the connection.
     if (State == kState_Closing && mRcvQueue.IsNull())
-        DoClose(INET_NO_ERROR, false);
+        DoClose(CHIP_NO_ERROR, false);
 }
 
-void TCPEndPoint::HandleConnectComplete(INET_ERROR err)
+void TCPEndPoint::HandleConnectComplete(CHIP_ERROR err)
 {
     // If the connect succeeded enter the Connected state and call the app's callback.
-    if (err == INET_NO_ERROR)
+    if (err == CHIP_NO_ERROR)
     {
         // Stop the TCP Connect timer in case it is still running.
         StopConnectTimer();
@@ -1521,7 +1521,7 @@
 #endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS
 
         if (OnConnectComplete != nullptr)
-            OnConnectComplete(this, INET_NO_ERROR);
+            OnConnectComplete(this, CHIP_NO_ERROR);
     }
 
     // Otherwise, close the connection with an error.
@@ -1529,7 +1529,7 @@
         DoClose(err, false);
 }
 
-INET_ERROR TCPEndPoint::DoClose(INET_ERROR err, bool suppressCallback)
+CHIP_ERROR TCPEndPoint::DoClose(CHIP_ERROR err, bool suppressCallback)
 {
     int oldState = State;
 
@@ -1542,7 +1542,7 @@
     // AND there is data waiting to be processed on either the send or receive queues
     // ... THEN enter the Closing state, allowing the queued data to drain,
     // ... OTHERWISE go straight to the Closed state.
-    if (IsConnected() && err == INET_NO_ERROR && (!mSendQueue.IsNull() || !mRcvQueue.IsNull()))
+    if (IsConnected() && err == CHIP_NO_ERROR && (!mSendQueue.IsNull() || !mRcvQueue.IsNull()))
         State = kState_Closing;
     else
         State = kState_Closed;
@@ -1553,7 +1553,7 @@
 
     // If not making a state transition, return immediately.
     if (State == oldState)
-        return INET_NO_ERROR;
+        return CHIP_NO_ERROR;
 
 #if CHIP_SYSTEM_CONFIG_USE_LWIP
 
@@ -1589,7 +1589,7 @@
 
                 // If the endpoint is being closed without error, THEN call tcp_close() to close the underlying
                 // TCP connection gracefully, preserving any in-transit send data.
-                if (err == INET_NO_ERROR)
+                if (err == CHIP_NO_ERROR)
                 {
                     tcp_close(mTCP);
                 }
@@ -1635,7 +1635,7 @@
         if (State == kState_Closed || (State == kState_Closing && mSendQueue.IsNull()))
         {
             // If aborting the connection, ensure we send a TCP RST.
-            if (IsConnected(oldState) && err != INET_NO_ERROR)
+            if (IsConnected(oldState) && err != CHIP_NO_ERROR)
             {
                 lingerStruct.l_onoff  = 1;
                 lingerStruct.l_linger = 0;
@@ -1644,7 +1644,7 @@
                     ChipLogError(Inet, "SO_LINGER: %d", errno);
             }
 
-            if (mSocket.Close() != 0 && err == INET_NO_ERROR)
+            if (mSocket.Close() != 0 && err == CHIP_NO_ERROR)
                 err = chip::System::MapErrorPOSIX(errno);
         }
     }
@@ -1718,7 +1718,7 @@
 }
 
 #if INET_CONFIG_OVERRIDE_SYSTEM_TCP_USER_TIMEOUT
-void TCPEndPoint::TCPUserTimeoutHandler(chip::System::Layer * aSystemLayer, void * aAppState, chip::System::Error aError)
+void TCPEndPoint::TCPUserTimeoutHandler(chip::System::Layer * aSystemLayer, void * aAppState, CHIP_ERROR aError)
 {
     TCPEndPoint * tcpEndPoint = reinterpret_cast<TCPEndPoint *>(aAppState);
 
@@ -1728,7 +1728,7 @@
     tcpEndPoint->mUserTimeoutTimerRunning = false;
 
 #if CHIP_SYSTEM_CONFIG_USE_SOCKETS
-    INET_ERROR err     = INET_NO_ERROR;
+    CHIP_ERROR err     = CHIP_NO_ERROR;
     bool isProgressing = false;
     err                = tcpEndPoint->CheckConnectionProgress(isProgressing);
     SuccessOrExit(err);
@@ -1780,7 +1780,7 @@
 
 exit:
 
-    if (err != INET_NO_ERROR)
+    if (err != CHIP_NO_ERROR)
     {
         // Close the connection as the TCP UserTimeout has expired
 
@@ -1916,7 +1916,7 @@
     return startOfUnsent;
 }
 
-INET_ERROR TCPEndPoint::GetPCB(IPAddressType addrType)
+CHIP_ERROR TCPEndPoint::GetPCB(IPAddressType addrType)
 {
     // IMMPORTANT: This method MUST be called with the LwIP stack LOCKED!
 
@@ -1941,7 +1941,7 @@
 
         if (mTCP == NULL)
         {
-            return INET_ERROR_NO_MEMORY;
+            return CHIP_ERROR_NO_MEMORY;
         }
         else
         {
@@ -1981,7 +1981,7 @@
             return INET_ERROR_WRONG_ADDRESS_TYPE;
         if (mTCP == NULL)
         {
-            return INET_ERROR_NO_MEMORY;
+            return CHIP_ERROR_NO_MEMORY;
         }
         else
         {
@@ -2000,7 +2000,7 @@
     }
 #endif // LWIP_VERSION_MAJOR <= 1 || LWIP_VERSION_MINOR >= 5
 
-    return INET_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 void TCPEndPoint::HandleDataSent(uint16_t lenSent)
@@ -2012,13 +2012,13 @@
         if (lenSent > mUnackedLength)
         {
             ChipLogError(Inet, "Got more ACKed bytes (%d) than were pending (%d)", (int) lenSent, (int) mUnackedLength);
-            DoClose(INET_ERROR_UNEXPECTED_EVENT, false);
+            DoClose(CHIP_ERROR_UNEXPECTED_EVENT, false);
             return;
         }
         else if (mSendQueue.IsNull())
         {
             ChipLogError(Inet, "Got ACK for %d bytes but data backing gone", (int) lenSent);
-            DoClose(INET_ERROR_UNEXPECTED_EVENT, false);
+            DoClose(CHIP_ERROR_UNEXPECTED_EVENT, false);
             return;
         }
 
@@ -2066,7 +2066,7 @@
 
         // If in the closing state and the send queue is now empty, attempt to transition to closed.
         if ((State == kState_Closing) && (RemainingToSend() == 0))
-            DoClose(INET_NO_ERROR, false);
+            DoClose(CHIP_NO_ERROR, false);
     }
 }
 
@@ -2119,7 +2119,7 @@
 
 void TCPEndPoint::HandleIncomingConnection(TCPEndPoint * conEP)
 {
-    INET_ERROR err = INET_NO_ERROR;
+    CHIP_ERROR err = CHIP_NO_ERROR;
     IPAddress peerAddr;
     uint16_t peerPort;
 
@@ -2127,14 +2127,14 @@
     {
         // If there's no callback available, fail with an error.
         if (OnConnectionReceived == NULL)
-            err = INET_ERROR_NO_CONNECTION_HANDLER;
+            err = CHIP_ERROR_NO_CONNECTION_HANDLER;
 
         // Extract the peer's address information.
-        if (err == INET_NO_ERROR)
+        if (err == CHIP_NO_ERROR)
             err = conEP->GetPeerInfo(&peerAddr, &peerPort);
 
         // If successful, call the app's callback function.
-        if (err == INET_NO_ERROR)
+        if (err == CHIP_NO_ERROR)
             OnConnectionReceived(this, conEP, peerAddr, peerPort);
 
         // Otherwise clean up and call the app's error callback.
@@ -2142,14 +2142,14 @@
             OnAcceptError(this, err);
     }
     else
-        err = INET_ERROR_INCORRECT_STATE;
+        err = CHIP_ERROR_INCORRECT_STATE;
 
     // If something failed above, abort and free the connection end point.
-    if (err != INET_NO_ERROR)
+    if (err != CHIP_NO_ERROR)
         conEP->Free();
 }
 
-void TCPEndPoint::HandleError(INET_ERROR err)
+void TCPEndPoint::HandleError(CHIP_ERROR err)
 {
     if (State == kState_Listening)
     {
@@ -2166,7 +2166,7 @@
 
     if (arg != NULL)
     {
-        INET_ERROR conErr;
+        CHIP_ERROR conErr;
         TCPEndPoint * ep                   = static_cast<TCPEndPoint *>(arg);
         chip::System::Layer & lSystemLayer = ep->SystemLayer();
 
@@ -2179,7 +2179,7 @@
 
         // Post callback to HandleConnectComplete.
         conErr = chip::System::MapErrorLwIP(lwipErr);
-        if (lSystemLayer.PostEvent(*ep, kInetEvent_TCPConnectComplete, (uintptr_t) conErr) != INET_NO_ERROR)
+        if (lSystemLayer.PostEvent(*ep, kInetEvent_TCPConnectComplete, (uintptr_t) conErr) != CHIP_NO_ERROR)
             res = ERR_ABRT;
     }
     else
@@ -2193,7 +2193,7 @@
 
 err_t TCPEndPoint::LwIPHandleIncomingConnection(void * arg, struct tcp_pcb * tpcb, err_t lwipErr)
 {
-    INET_ERROR err = chip::System::MapErrorLwIP(lwipErr);
+    CHIP_ERROR err = chip::System::MapErrorLwIP(lwipErr);
 
     if (arg != NULL)
     {
@@ -2211,7 +2211,7 @@
         // function returns, LwIP is free to begin calling callbacks on the new PCB. For that to work we need
         // to have an end point associated with the PCB.
         //
-        if (err == INET_NO_ERROR)
+        if (err == CHIP_NO_ERROR)
         {
             InetLayer & lInetLayer = listenEP->Layer();
 
@@ -2219,13 +2219,13 @@
         }
 
         // Ensure that TCP timers have been started
-        if (err == INET_NO_ERROR)
+        if (err == CHIP_NO_ERROR)
         {
             err = start_tcp_timers();
         }
 
         // If successful in allocating an end point...
-        if (err == INET_NO_ERROR)
+        if (err == CHIP_NO_ERROR)
         {
             // Put the new end point into the Connected state.
             conEP->State             = kState_Connected;
@@ -2240,9 +2240,9 @@
             tcp_err(tpcb, LwIPHandleError);
 
             // Post a callback to the HandleConnectionReceived() function, passing it the new end point.
-            if (lSystemLayer.PostEvent(*listenEP, kInetEvent_TCPConnectionReceived, (uintptr_t) conEP) != INET_NO_ERROR)
+            if (lSystemLayer.PostEvent(*listenEP, kInetEvent_TCPConnectionReceived, (uintptr_t) conEP) != CHIP_NO_ERROR)
             {
-                err = INET_ERROR_CONNECTION_ABORTED;
+                err = CHIP_ERROR_CONNECTION_ABORTED;
                 conEP->Release(); // for the Retain() above
                 conEP->Release(); // for the Retain() in NewTCPEndPoint()
             }
@@ -2253,9 +2253,9 @@
             lSystemLayer.PostEvent(*listenEP, kInetEvent_TCPError, (uintptr_t) err);
     }
     else
-        err = INET_ERROR_CONNECTION_ABORTED;
+        err = CHIP_ERROR_CONNECTION_ABORTED;
 
-    if (err != INET_NO_ERROR && tpcb != NULL)
+    if (err != CHIP_NO_ERROR && tpcb != NULL)
     {
         tcp_abort(tpcb);
         return ERR_ABRT;
@@ -2276,7 +2276,7 @@
         chip::System::Layer & lSystemLayer = ep->SystemLayer();
 
         // Post callback to HandleDataReceived.
-        if (lSystemLayer.PostEvent(*ep, kInetEvent_TCPDataReceived, (uintptr_t) p) != INET_NO_ERROR)
+        if (lSystemLayer.PostEvent(*ep, kInetEvent_TCPDataReceived, (uintptr_t) p) != CHIP_NO_ERROR)
             res = ERR_ABRT;
     }
     else
@@ -2298,7 +2298,7 @@
         chip::System::Layer & lSystemLayer = ep->SystemLayer();
 
         // Post callback to HandleDataReceived.
-        if (lSystemLayer.PostEvent(*ep, kInetEvent_TCPDataSent, (uintptr_t) len) != INET_NO_ERROR)
+        if (lSystemLayer.PostEvent(*ep, kInetEvent_TCPDataSent, (uintptr_t) len) != CHIP_NO_ERROR)
             res = ERR_ABRT;
     }
     else
@@ -2326,7 +2326,7 @@
         ep->mLwIPEndPointType = kLwIPEndPointType_Unknown;
 
         // Post callback to HandleError.
-        INET_ERROR err = chip::System::MapErrorLwIP(lwipErr);
+        CHIP_ERROR err = chip::System::MapErrorLwIP(lwipErr);
         lSystemLayer.PostEvent(*ep, kInetEvent_TCPError, (uintptr_t) err);
     }
 }
@@ -2335,14 +2335,14 @@
 
 #if CHIP_SYSTEM_CONFIG_USE_SOCKETS
 
-INET_ERROR TCPEndPoint::BindSrcAddrFromIntf(IPAddressType addrType, InterfaceId intfId)
+CHIP_ERROR TCPEndPoint::BindSrcAddrFromIntf(IPAddressType addrType, InterfaceId intfId)
 {
     // If we are trying to make a TCP connection over a 'specified target interface',
     // then we bind the TCPEndPoint to an IP address on that target interface
     // and use that address as the source address for that connection. This is
     // done in the event that directly binding the connection to the target
     // interface is not allowed due to insufficient privileges.
-    VerifyOrReturnError(State != kState_Bound, INET_ERROR_NOT_SUPPORTED);
+    VerifyOrReturnError(State != kState_Bound, CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE);
 
     bool ipAddrFound = false;
     for (InterfaceAddressIterator addrIter; addrIter.HasCurrent(); addrIter.Next())
@@ -2384,12 +2384,12 @@
         }
     }
 
-    VerifyOrReturnError(ipAddrFound, INET_ERROR_NOT_SUPPORTED);
+    VerifyOrReturnError(ipAddrFound, CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE);
 
-    return INET_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
-INET_ERROR TCPEndPoint::GetSocket(IPAddressType addrType)
+CHIP_ERROR TCPEndPoint::GetSocket(IPAddressType addrType)
 {
     if (!mSocket.HasFD())
     {
@@ -2432,9 +2432,9 @@
 #endif // defined(SO_NOSIGPIPE)
     }
     else if (mAddrType != addrType)
-        return INET_ERROR_INCORRECT_STATE;
+        return CHIP_ERROR_INCORRECT_STATE;
 
-    return INET_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 // static
@@ -2469,7 +2469,7 @@
             socklen_t optLen = sizeof(osConRes);
             if (getsockopt(mSocket.GetFD(), SOL_SOCKET, SO_ERROR, &osConRes, &optLen) != 0)
                 osConRes = errno;
-            INET_ERROR conRes = chip::System::MapErrorPOSIX(osConRes);
+            CHIP_ERROR conRes = chip::System::MapErrorPOSIX(osConRes);
 
             // Process the connection result.
             HandleConnectComplete(conRes);
@@ -2518,7 +2518,7 @@
 
     if (rcvBuf.IsNull())
     {
-        DoClose(INET_ERROR_NO_MEMORY, false);
+        DoClose(CHIP_ERROR_NO_MEMORY, false);
         return;
     }
 
@@ -2526,11 +2526,11 @@
     ssize_t rcvLen = recv(mSocket.GetFD(), rcvBuf->Start() + rcvBuf->DataLength(), rcvBuf->AvailableDataLength(), 0);
 
 #if INET_CONFIG_OVERRIDE_SYSTEM_TCP_USER_TIMEOUT
-    INET_ERROR err;
+    CHIP_ERROR err;
     bool isProgressing = false;
 
     err = CheckConnectionProgress(isProgressing);
-    if (err != INET_NO_ERROR)
+    if (err != CHIP_NO_ERROR)
     {
         DoClose(err, false);
 
@@ -2629,7 +2629,7 @@
 
 void TCPEndPoint::HandleIncomingConnection()
 {
-    INET_ERROR err      = INET_NO_ERROR;
+    CHIP_ERROR err      = CHIP_NO_ERROR;
     TCPEndPoint * conEP = nullptr;
     IPAddress peerAddr;
     uint16_t peerPort;
@@ -2649,11 +2649,11 @@
         err = chip::System::MapErrorPOSIX(errno);
 
     // If there's no callback available, fail with an error.
-    if (err == INET_NO_ERROR && OnConnectionReceived == nullptr)
-        err = INET_ERROR_NO_CONNECTION_HANDLER;
+    if (err == CHIP_NO_ERROR && OnConnectionReceived == nullptr)
+        err = CHIP_ERROR_NO_CONNECTION_HANDLER;
 
     // Extract the peer's address information.
-    if (err == INET_NO_ERROR)
+    if (err == CHIP_NO_ERROR)
     {
         if (sa.any.sa_family == AF_INET6)
         {
@@ -2668,11 +2668,11 @@
         }
 #endif // INET_CONFIG_ENABLE_IPV4
         else
-            err = INET_ERROR_INCORRECT_STATE;
+            err = CHIP_ERROR_INCORRECT_STATE;
     }
 
     // Attempt to allocate an end point object.
-    if (err == INET_NO_ERROR)
+    if (err == CHIP_NO_ERROR)
     {
         InetLayer & lInetLayer = Layer();
 
@@ -2680,7 +2680,7 @@
     }
 
     // If all went well...
-    if (err == INET_NO_ERROR)
+    if (err == CHIP_NO_ERROR)
     {
         // Put the new end point into the Connected state.
         conEP->mSocket.Attach(conSocket);
@@ -2721,7 +2721,7 @@
  *  This function probes the TCP output queue and checks if data is successfully
  *  being transferred to the other end.
  */
-INET_ERROR TCPEndPoint::CheckConnectionProgress(bool & isProgressing)
+CHIP_ERROR TCPEndPoint::CheckConnectionProgress(bool & isProgressing)
 {
     int currPendingBytesRaw = 0;
     uint32_t currPendingBytes; // Will be initialized once we know it's safe.
@@ -2735,7 +2735,7 @@
 
     if (!CanCastTo<uint32_t>(currPendingBytesRaw))
     {
-        return INET_ERROR_INCORRECT_STATE;
+        return CHIP_ERROR_INCORRECT_STATE;
     }
 
     currPendingBytes = static_cast<uint32_t>(currPendingBytesRaw);
@@ -2760,7 +2760,7 @@
 
     mLastTCPKernelSendQueueLen = currPendingBytes;
 
-    return INET_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 #endif // INET_CONFIG_OVERRIDE_SYSTEM_TCP_USER_TIMEOUT
 
diff --git a/src/inet/TCPEndPoint.h b/src/inet/TCPEndPoint.h
index c53d2c2..2f42d6b 100644
--- a/src/inet/TCPEndPoint.h
+++ b/src/inet/TCPEndPoint.h
@@ -99,9 +99,9 @@
      * @param[in]   port        the TCP port
      * @param[in]   reuseAddr   option to share binding with other endpoints
      *
-     * @retval  INET_NO_ERROR               success: endpoint bound to address
-     * @retval  INET_ERROR_INCORRECT_STATE  endpoint has been bound previously
-     * @retval  INET_NO_MEMORY              insufficient memory for endpoint
+     * @retval  CHIP_NO_ERROR               success: endpoint bound to address
+     * @retval  CHIP_ERROR_INCORRECT_STATE  endpoint has been bound previously
+     * @retval  CHIP_ERROR_NO_MEMORY        insufficient memory for endpoint
      *
      * @retval  INET_ERROR_WRONG_PROTOCOL_TYPE
      *      \c addrType does not match \c IPVer.
@@ -118,15 +118,15 @@
      *  On LwIP, this method must not be called with the LwIP stack lock
      *  already acquired.
      */
-    INET_ERROR Bind(IPAddressType addrType, const IPAddress & addr, uint16_t port, bool reuseAddr = false);
+    CHIP_ERROR Bind(IPAddressType addrType, const IPAddress & addr, uint16_t port, bool reuseAddr = false);
 
     /**
      * @brief   Prepare the endpoint to receive TCP messages.
      *
      * @param[in]   backlog     maximum depth of connection acceptance queue
      *
-     * @retval  INET_NO_ERROR   success: endpoint ready to receive messages.
-     * @retval  INET_ERROR_INCORRECT_STATE  endpoint is already listening.
+     * @retval  CHIP_NO_ERROR   success: endpoint ready to receive messages.
+     * @retval  CHIP_ERROR_INCORRECT_STATE  endpoint is already listening.
      *
      * @details
      *  If \c State is already \c kState_Listening, then no operation is
@@ -140,7 +140,7 @@
      *  On LwIP systems, this method must not be called with the LwIP stack
      *  lock already acquired
      */
-    INET_ERROR Listen(uint16_t backlog);
+    CHIP_ERROR Listen(uint16_t backlog);
 
     /**
      * @brief   Initiate a TCP connection.
@@ -149,8 +149,8 @@
      * @param[in]   port        the destination TCP port
      * @param[in]   intfId      an optional network interface indicator
      *
-     * @retval  INET_NO_ERROR       success: \c msg is queued for transmit.
-     * @retval  INET_ERROR_NOT_IMPLEMENTED  system implementation not complete.
+     * @retval  CHIP_NO_ERROR       success: \c msg is queued for transmit.
+     * @retval  CHIP_ERROR_NOT_IMPLEMENTED  system implementation not complete.
      *
      * @retval  INET_ERROR_WRONG_ADDRESS_TYPE
      *      the destination address and the bound interface address do not
@@ -164,7 +164,7 @@
      *      destination \c addr (with \c intfId used as the scope
      *      identifier for IPv6 link-local destinations) and \c port.
      */
-    INET_ERROR Connect(const IPAddress & addr, uint16_t port, InterfaceId intfId = INET_NULL_INTERFACEID);
+    CHIP_ERROR Connect(const IPAddress & addr, uint16_t port, InterfaceId intfId = INET_NULL_INTERFACEID);
 
     /**
      * @brief   Extract IP address and TCP port of remote endpoint.
@@ -172,14 +172,14 @@
      * @param[out]  retAddr     IP address of remote endpoint.
      * @param[out]  retPort     TCP port of remote endpoint.
      *
-     * @retval  INET_NO_ERROR           success: address and port extracted.
-     * @retval  INET_ERROR_INCORRECT_STATE  TCP connection not established.
-     * @retval  INET_ERROR_CONNECTION_ABORTED   TCP connection no longer open.
+     * @retval  CHIP_NO_ERROR           success: address and port extracted.
+     * @retval  CHIP_ERROR_INCORRECT_STATE  TCP connection not established.
+     * @retval  CHIP_ERROR_CONNECTION_ABORTED   TCP connection no longer open.
      *
      * @details
      *  Do not use \c NULL pointer values for either argument.
      */
-    INET_ERROR GetPeerInfo(IPAddress * retAddr, uint16_t * retPort) const;
+    CHIP_ERROR GetPeerInfo(IPAddress * retAddr, uint16_t * retPort) const;
 
     /**
      * @brief   Extract IP address and TCP port of local endpoint.
@@ -187,25 +187,25 @@
      * @param[out]  retAddr     IP address of local endpoint.
      * @param[out]  retPort     TCP port of local endpoint.
      *
-     * @retval  INET_NO_ERROR           success: address and port extracted.
-     * @retval  INET_ERROR_INCORRECT_STATE  TCP connection not established.
-     * @retval  INET_ERROR_CONNECTION_ABORTED   TCP connection no longer open.
+     * @retval  CHIP_NO_ERROR           success: address and port extracted.
+     * @retval  CHIP_ERROR_INCORRECT_STATE  TCP connection not established.
+     * @retval  CHIP_ERROR_CONNECTION_ABORTED   TCP connection no longer open.
      *
      * @details
      *  Do not use \c NULL pointer values for either argument.
      */
-    INET_ERROR GetLocalInfo(IPAddress * retAddr, uint16_t * retPort);
+    CHIP_ERROR GetLocalInfo(IPAddress * retAddr, uint16_t * retPort);
 
     /**
      * @brief   Extract the interface id of the TCP endpoint.
      *
      * @param[out]  retInterface  The interface id.
      *
-     * @retval  INET_NO_ERROR           success: address and port extracted.
-     * @retval  INET_ERROR_INCORRECT_STATE  TCP connection not established.
-     * @retval  INET_ERROR_CONNECTION_ABORTED   TCP connection no longer open.
+     * @retval  CHIP_NO_ERROR           success: address and port extracted.
+     * @retval  CHIP_ERROR_INCORRECT_STATE  TCP connection not established.
+     * @retval  CHIP_ERROR_CONNECTION_ABORTED   TCP connection no longer open.
      */
-    INET_ERROR GetInterfaceId(InterfaceId * retInterface);
+    CHIP_ERROR GetInterfaceId(InterfaceId * retInterface);
 
     /**
      * @brief   Send message text on TCP connection.
@@ -213,10 +213,10 @@
      * @param[out]  data    Message text to send.
      * @param[out]  push    If \c true, then send immediately, otherwise queue.
      *
-     * @retval  INET_NO_ERROR           success: address and port extracted.
-     * @retval  INET_ERROR_INCORRECT_STATE  TCP connection not established.
+     * @retval  CHIP_NO_ERROR           success: address and port extracted.
+     * @retval  CHIP_ERROR_INCORRECT_STATE  TCP connection not established.
      */
-    INET_ERROR Send(chip::System::PacketBufferHandle && data, bool push = true);
+    CHIP_ERROR Send(chip::System::PacketBufferHandle && data, bool push = true);
 
     /**
      * @brief   Disable reception.
@@ -239,7 +239,7 @@
     /**
      *  @brief EnableNoDelay
      */
-    INET_ERROR EnableNoDelay();
+    CHIP_ERROR EnableNoDelay();
 
     /**
      * @brief
@@ -254,10 +254,10 @@
      *    The maximum number of unacknowledged probes before the connection will be deemed
      *    to have failed.
      *
-     * @retval  INET_NO_ERROR           success: address and port extracted.
-     * @retval  INET_ERROR_INCORRECT_STATE  TCP connection not established.
-     * @retval  INET_ERROR_CONNECTION_ABORTED   TCP connection no longer open.
-     * @retval  INET_ERROR_NOT_IMPLEMENTED  system implementation not complete.
+     * @retval  CHIP_NO_ERROR           success: address and port extracted.
+     * @retval  CHIP_ERROR_INCORRECT_STATE  TCP connection not established.
+     * @retval  CHIP_ERROR_CONNECTION_ABORTED   TCP connection no longer open.
+     * @retval  CHIP_ERROR_NOT_IMPLEMENTED  system implementation not complete.
      *
      * @retval  other                   another system or platform error
      *
@@ -275,27 +275,27 @@
      *
      *  See RFC 1122, section 4.2.3.6 for specification details.
      */
-    INET_ERROR EnableKeepAlive(uint16_t interval, uint16_t timeoutCount);
+    CHIP_ERROR EnableKeepAlive(uint16_t interval, uint16_t timeoutCount);
 
     /**
      * @brief   Disable the TCP "keep-alive" option.
      *
-     * @retval  INET_NO_ERROR           success: address and port extracted.
-     * @retval  INET_ERROR_INCORRECT_STATE  TCP connection not established.
-     * @retval  INET_ERROR_CONNECTION_ABORTED   TCP connection no longer open.
-     * @retval  INET_ERROR_NOT_IMPLEMENTED  system implementation not complete.
+     * @retval  CHIP_NO_ERROR           success: address and port extracted.
+     * @retval  CHIP_ERROR_INCORRECT_STATE  TCP connection not established.
+     * @retval  CHIP_ERROR_CONNECTION_ABORTED   TCP connection no longer open.
+     * @retval  CHIP_ERROR_NOT_IMPLEMENTED  system implementation not complete.
      *
      * @retval  other                   another system or platform error
      */
-    INET_ERROR DisableKeepAlive();
+    CHIP_ERROR DisableKeepAlive();
 
     /**
      * @brief   Set the TCP TCP_USER_TIMEOUT socket option.
      *
      * @param[in]   userTimeoutMillis    Tcp user timeout value in milliseconds.
      *
-     * @retval  INET_NO_ERROR           success: address and port extracted.
-     * @retval  INET_ERROR_NOT_IMPLEMENTED  system implementation not complete.
+     * @retval  CHIP_NO_ERROR           success: address and port extracted.
+     * @retval  CHIP_ERROR_NOT_IMPLEMENTED  system implementation not complete.
      *
      * @retval  other                   another system or platform error
      *
@@ -307,37 +307,37 @@
      *  TCP will to use the system default.
      *  See RFC 5482, for further details.
      */
-    INET_ERROR SetUserTimeout(uint32_t userTimeoutMillis);
+    CHIP_ERROR SetUserTimeout(uint32_t userTimeoutMillis);
 
     /**
      * @brief   Acknowledge receipt of message text.
      *
      * @param[in]   len     number of bytes to acknowledge.
      *
-     * @retval  INET_NO_ERROR           success: reception acknowledged.
-     * @retval  INET_ERROR_INCORRECT_STATE  TCP connection not established.
-     * @retval  INET_ERROR_CONNECTION_ABORTED   TCP connection no longer open.
+     * @retval  CHIP_NO_ERROR           success: reception acknowledged.
+     * @retval  CHIP_ERROR_INCORRECT_STATE  TCP connection not established.
+     * @retval  CHIP_ERROR_CONNECTION_ABORTED   TCP connection no longer open.
      *
      * @details
      *  Use this method to acknowledge reception of all or part of the data
      *  received. The operational semantics are undefined if \c len is larger
      *  than the total outstanding unacknowledged received data.
      */
-    INET_ERROR AckReceive(uint16_t len);
+    CHIP_ERROR AckReceive(uint16_t len);
 
     /**
      * @brief   Set the receive queue, for testing.
      *
      * @param[out]  data    Message text to push.
      *
-     * @retval  INET_NO_ERROR           success: reception acknowledged.
-     * @retval  INET_ERROR_INCORRECT_STATE  TCP connection not established.
+     * @retval  CHIP_NO_ERROR           success: reception acknowledged.
+     * @retval  CHIP_ERROR_INCORRECT_STATE  TCP connection not established.
      *
      * @details
      *  This method may only be called by data reception event handlers to
      *  put data on the receive queue for unit test purposes.
      */
-    INET_ERROR SetReceivedDataForTesting(chip::System::PacketBufferHandle && data);
+    CHIP_ERROR SetReceivedDataForTesting(chip::System::PacketBufferHandle && data);
 
     /**
      * @brief   Extract the length of the data awaiting first transmit.
@@ -357,23 +357,23 @@
     /**
      * @brief   Initiate TCP half close, in other words, finished with sending.
      *
-     * @retval  INET_NO_ERROR           success: address and port extracted.
-     * @retval  INET_ERROR_INCORRECT_STATE  TCP connection not established.
+     * @retval  CHIP_NO_ERROR           success: address and port extracted.
+     * @retval  CHIP_ERROR_INCORRECT_STATE  TCP connection not established.
      *
      * @retval  other                   another system or platform error
      */
-    INET_ERROR Shutdown();
+    CHIP_ERROR Shutdown();
 
     /**
      * @brief   Initiate TCP full close, in other words, finished with both send and
      *  receive.
      *
-     * @retval  INET_NO_ERROR           success: address and port extracted.
-     * @retval  INET_ERROR_INCORRECT_STATE  TCP connection not established.
+     * @retval  CHIP_NO_ERROR           success: address and port extracted.
+     * @retval  CHIP_ERROR_INCORRECT_STATE  TCP connection not established.
      *
      * @retval  other                   another system or platform error
      */
-    INET_ERROR Close();
+    CHIP_ERROR Close();
 
     /**
      * @brief   Abortively close the endpoint, in other words, send RST packets.
@@ -428,14 +428,14 @@
      * @brief   Type of connection establishment event handling function.
      *
      * @param[in]   endPoint    The TCP endpoint associated with the event.
-     * @param[in]   err         \c INET_NO_ERROR if success, else another code.
+     * @param[in]   err         \c CHIP_NO_ERROR if success, else another code.
      *
      * @details
      *  Provide a function of this type to the \c OnConnectComplete delegate
      *  member to process connection establishment events on \c endPoint. The
      *  \c err argument distinguishes successful connections from failures.
      */
-    typedef void (*OnConnectCompleteFunct)(TCPEndPoint * endPoint, INET_ERROR err);
+    typedef void (*OnConnectCompleteFunct)(TCPEndPoint * endPoint, CHIP_ERROR err);
 
     /**
      * The endpoint's connection establishment event handling function
@@ -449,7 +449,7 @@
      * @param[in]   endPoint        The TCP endpoint associated with the event.
      * @param[in]   data            The data received.
      *
-     * @retval      INET_NO_ERROR   If the received data can be handled by higher layers.
+     * @retval      CHIP_NO_ERROR   If the received data can be handled by higher layers.
      * @retval      other           If the received data can not be used, and higher layers will not see it.
      *
      * @details
@@ -460,7 +460,7 @@
      *  If this function returns an error, the connection will be closed, since higher layers
      *  are not able to process the data for a better response.
      */
-    typedef INET_ERROR (*OnDataReceivedFunct)(TCPEndPoint * endPoint, chip::System::PacketBufferHandle && data);
+    typedef CHIP_ERROR (*OnDataReceivedFunct)(TCPEndPoint * endPoint, chip::System::PacketBufferHandle && data);
 
     /**
      * The endpoint's message text reception event handling function delegate.
@@ -491,14 +491,14 @@
      * @brief   Type of connection establishment event handling function.
      *
      * @param[in]   endPoint    The TCP endpoint associated with the event.
-     * @param[in]   err         \c INET_NO_ERROR if success, else another code.
+     * @param[in]   err         \c CHIP_NO_ERROR if success, else another code.
      *
      * @details
      *  Provide a function of this type to the \c OnConnectionClosed delegate
      *  member to process connection termination events on \c endPoint. The
      *  \c err argument distinguishes successful terminations from failures.
      */
-    typedef void (*OnConnectionClosedFunct)(TCPEndPoint * endPoint, INET_ERROR err);
+    typedef void (*OnConnectionClosedFunct)(TCPEndPoint * endPoint, CHIP_ERROR err);
 
     /** The endpoint's close event handling function delegate. */
     OnConnectionClosedFunct OnConnectionClosed;
@@ -548,7 +548,7 @@
      *  member to process connection acceptance error events on \c endPoint. The
      *  \c err argument provides specific detail about the type of the error.
      */
-    typedef void (*OnAcceptErrorFunct)(TCPEndPoint * endPoint, INET_ERROR err);
+    typedef void (*OnAcceptErrorFunct)(TCPEndPoint * endPoint, CHIP_ERROR err);
 
     /**
      * The endpoint's connection acceptance event handling function delegate.
@@ -612,7 +612,7 @@
 
     bool mUserTimeoutTimerRunning; // Indicates whether the TCP UserTimeout timer has been started.
 
-    static void TCPUserTimeoutHandler(chip::System::Layer * aSystemLayer, void * aAppState, chip::System::Error aError);
+    static void TCPUserTimeoutHandler(chip::System::Layer * aSystemLayer, void * aAppState, CHIP_ERROR aError);
 
     void StartTCPUserTimeoutTimer();
 
@@ -632,7 +632,7 @@
 
     uint32_t mLastTCPKernelSendQueueLen; // This is the measured size(in bytes) of the kernel TCP send queue
                                          // at the end of the last user timeout window.
-    INET_ERROR CheckConnectionProgress(bool & IsProgressing);
+    CHIP_ERROR CheckConnectionProgress(bool & IsProgressing);
 #endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS
 
 #endif // INET_CONFIG_OVERRIDE_SYSTEM_TCP_USER_TIMEOUT
@@ -642,14 +642,14 @@
     ~TCPEndPoint();                   // not defined
 
     void Init(InetLayer * inetLayer);
-    INET_ERROR DriveSending();
+    CHIP_ERROR DriveSending();
     void DriveReceiving();
-    void HandleConnectComplete(INET_ERROR err);
-    void HandleAcceptError(INET_ERROR err);
-    INET_ERROR DoClose(INET_ERROR err, bool suppressCallback);
+    void HandleConnectComplete(CHIP_ERROR err);
+    void HandleAcceptError(CHIP_ERROR err);
+    CHIP_ERROR DoClose(CHIP_ERROR err, bool suppressCallback);
     static bool IsConnected(int state);
 
-    static void TCPConnectTimeoutHandler(chip::System::Layer * aSystemLayer, void * aAppState, chip::System::Error aError);
+    static void TCPConnectTimeoutHandler(chip::System::Layer * aSystemLayer, void * aAppState, CHIP_ERROR aError);
 
     void StartConnectTimerIfSet();
     void StopConnectTimer();
@@ -672,11 +672,11 @@
 
     uint16_t RemainingToSend();
     BufferOffset FindStartOfUnsent();
-    INET_ERROR GetPCB(IPAddressType addrType);
+    CHIP_ERROR GetPCB(IPAddressType addrType);
     void HandleDataSent(uint16_t len);
     void HandleDataReceived(chip::System::PacketBufferHandle && buf);
     void HandleIncomingConnection(TCPEndPoint * pcb);
-    void HandleError(INET_ERROR err);
+    void HandleError(CHIP_ERROR err);
 
     static err_t LwIPHandleConnectComplete(void * arg, struct tcp_pcb * tpcb, err_t lwipErr);
     static err_t LwIPHandleIncomingConnection(void * arg, struct tcp_pcb * tcpConPCB, err_t lwipErr);
@@ -687,11 +687,11 @@
 #endif // CHIP_SYSTEM_CONFIG_USE_LWIP
 
 #if CHIP_SYSTEM_CONFIG_USE_SOCKETS
-    INET_ERROR GetSocket(IPAddressType addrType);
+    CHIP_ERROR GetSocket(IPAddressType addrType);
     void HandlePendingIO();
     void ReceiveData();
     void HandleIncomingConnection();
-    INET_ERROR BindSrcAddrFromIntf(IPAddressType addrType, InterfaceId intfId);
+    CHIP_ERROR BindSrcAddrFromIntf(IPAddressType addrType, InterfaceId intfId);
     static void HandlePendingIO(System::WatchableSocket & socket);
 
 #if CHIP_SYSTEM_CONFIG_USE_DISPATCH
diff --git a/src/inet/UDPEndPoint.cpp b/src/inet/UDPEndPoint.cpp
index 0af8042..df06a51 100644
--- a/src/inet/UDPEndPoint.cpp
+++ b/src/inet/UDPEndPoint.cpp
@@ -87,9 +87,9 @@
  *   udp_bind_netif(aUDP, intfId);
  *
  */
-static INET_ERROR LwIPBindInterface(struct udp_pcb * aUDP, InterfaceId intfId)
+static CHIP_ERROR LwIPBindInterface(struct udp_pcb * aUDP, InterfaceId intfId)
 {
-    INET_ERROR res = INET_NO_ERROR;
+    CHIP_ERROR res = CHIP_NO_ERROR;
 
 #if HAVE_LWIP_UDP_BIND_NETIF
     if (!IsInterfaceIdPresent(intfId))
@@ -129,9 +129,9 @@
  * @param[in]   port        the UDP port
  * @param[in]   intfId      an optional network interface indicator
  *
- * @retval  INET_NO_ERROR               success: endpoint bound to address
- * @retval  INET_ERROR_INCORRECT_STATE  endpoint has been bound previously
- * @retval  INET_NO_MEMORY              insufficient memory for endpoint
+ * @retval  CHIP_NO_ERROR               success: endpoint bound to address
+ * @retval  CHIP_ERROR_INCORRECT_STATE  endpoint has been bound previously
+ * @retval  CHIP_ERROR_NO_MEMORY        insufficient memory for endpoint
  *
  * @retval  INET_ERROR_UNKNOWN_INTERFACE
  *      On some platforms, the optionally specified interface is not
@@ -152,11 +152,11 @@
  *  On LwIP, this method must not be called with the LwIP stack lock
  *  already acquired.
  */
-INET_ERROR UDPEndPoint::Bind(IPAddressType addrType, const IPAddress & addr, uint16_t port, InterfaceId intfId)
+CHIP_ERROR UDPEndPoint::Bind(IPAddressType addrType, const IPAddress & addr, uint16_t port, InterfaceId intfId)
 {
     if (mState != kState_Ready && mState != kState_Bound)
     {
-        return INET_ERROR_INCORRECT_STATE;
+        return CHIP_ERROR_INCORRECT_STATE;
     }
 
     if ((addr != IPAddress::Any) && (addr.Type() != kIPAddressType_Any) && (addr.Type() != addrType))
@@ -170,10 +170,10 @@
     LOCK_TCPIP_CORE();
 
     // Make sure we have the appropriate type of PCB.
-    INET_ERROR res = GetPCB(addrType);
+    CHIP_ERROR res = GetPCB(addrType);
 
     // Bind the PCB to the specified address/port.
-    if (res == INET_NO_ERROR)
+    if (res == CHIP_NO_ERROR)
     {
 #if LWIP_VERSION_MAJOR > 1 || LWIP_VERSION_MINOR >= 5
         ip_addr_t ipAddr = addr.ToLwIPAddr();
@@ -200,7 +200,7 @@
 #endif // LWIP_VERSION_MAJOR <= 1 || LWIP_VERSION_MINOR >= 5
     }
 
-    if (res == INET_NO_ERROR)
+    if (res == CHIP_NO_ERROR)
     {
         res = LwIPBindInterface(mUDP, intfId);
     }
@@ -252,7 +252,7 @@
         unsigned long fd = static_cast<unsigned long>(mSocket.GetFD());
 
         mReadableSource = dispatch_source_create(DISPATCH_SOURCE_TYPE_READ, fd, 0, dispatchQueue);
-        ReturnErrorCodeIf(mReadableSource == nullptr, INET_ERROR_NO_MEMORY);
+        ReturnErrorCodeIf(mReadableSource == nullptr, CHIP_ERROR_NO_MEMORY);
 
         dispatch_source_set_event_handler(mReadableSource, ^{
             this->mSocket.SetPendingIO(System::SocketEventFlags::kRead);
@@ -271,7 +271,7 @@
 
     if (intfId != INET_NULL_INTERFACEID)
     {
-        return INET_ERROR_NOT_IMPLEMENTED;
+        return CHIP_ERROR_NOT_IMPLEMENTED;
     }
 
     configure_tls = NW_PARAMETERS_DISABLE_PROTOCOL;
@@ -285,7 +285,7 @@
 
     mState = kState_Bound;
 
-    return INET_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 /**
@@ -295,8 +295,8 @@
  * @param[in]  onReceiveError      The endpoint's receive error event handling function delegate.
  * @param[in]  appState            Application state pointer.
  *
- * @retval  INET_NO_ERROR   success: endpoint ready to receive messages.
- * @retval  INET_ERROR_INCORRECT_STATE  endpoint is already listening.
+ * @retval  CHIP_NO_ERROR   success: endpoint ready to receive messages.
+ * @retval  CHIP_ERROR_INCORRECT_STATE  endpoint is already listening.
  *
  * @details
  *  If \c State is already \c kState_Listening, then no operation is
@@ -307,16 +307,16 @@
  *  On LwIP, this method must not be called with the LwIP stack lock
  *  already acquired
  */
-INET_ERROR UDPEndPoint::Listen(OnMessageReceivedFunct onMessageReceived, OnReceiveErrorFunct onReceiveError, void * appState)
+CHIP_ERROR UDPEndPoint::Listen(OnMessageReceivedFunct onMessageReceived, OnReceiveErrorFunct onReceiveError, void * appState)
 {
     if (mState == kState_Listening)
     {
-        return INET_NO_ERROR;
+        return CHIP_NO_ERROR;
     }
 
     if (mState != kState_Bound)
     {
-        return INET_ERROR_INCORRECT_STATE;
+        return CHIP_ERROR_INCORRECT_STATE;
     }
 
     OnMessageReceived = onMessageReceived;
@@ -354,7 +354,7 @@
     mSocket.RequestCallbackOnPendingRead();
 #endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS
 
-    return INET_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 /**
@@ -442,7 +442,7 @@
 /**
  *  A synonym for <tt>SendTo(addr, port, INET_NULL_INTERFACEID, msg, sendFlags)</tt>.
  */
-INET_ERROR UDPEndPoint::SendTo(const IPAddress & addr, uint16_t port, chip::System::PacketBufferHandle && msg, uint16_t sendFlags)
+CHIP_ERROR UDPEndPoint::SendTo(const IPAddress & addr, uint16_t port, chip::System::PacketBufferHandle && msg, uint16_t sendFlags)
 {
     return SendTo(addr, port, INET_NULL_INTERFACEID, std::move(msg), sendFlags);
 }
@@ -456,19 +456,19 @@
  * @param[in]   msg         the packet buffer containing the UDP message
  * @param[in]   sendFlags   optional transmit option flags
  *
- * @retval  INET_NO_ERROR       success: \c msg is queued for transmit.
+ * @retval  CHIP_NO_ERROR       success: \c msg is queued for transmit.
  *
- * @retval  INET_ERROR_NOT_SUPPORTED
+ * @retval  CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE
  *      the system does not support the requested operation.
  *
  * @retval  INET_ERROR_WRONG_ADDRESS_TYPE
  *      the destination address and the bound interface address do not
  *      have matching protocol versions or address type.
  *
- * @retval  INET_ERROR_MESSAGE_TOO_LONG
+ * @retval  CHIP_ERROR_MESSAGE_TOO_LONG
  *      \c msg does not contain the whole UDP message.
  *
- * @retval  INET_ERROR_OUTBOUND_MESSAGE_TRUNCATED
+ * @retval  CHIP_ERROR_OUTBOUND_MESSAGE_TOO_BIG
  *      On some platforms, only a truncated portion of \c msg was queued
  *      for transmit.
  *
@@ -481,7 +481,7 @@
  *      identifier for IPv6 link-local destinations) and \c port with the
  *      transmit option flags encoded in \c sendFlags.
  */
-INET_ERROR UDPEndPoint::SendTo(const IPAddress & addr, uint16_t port, InterfaceId intfId, chip::System::PacketBufferHandle && msg,
+CHIP_ERROR UDPEndPoint::SendTo(const IPAddress & addr, uint16_t port, InterfaceId intfId, chip::System::PacketBufferHandle && msg,
                                uint16_t sendFlags)
 {
     IPPacketInfo pktInfo;
@@ -499,20 +499,20 @@
  * @param[in]   msg         a packet buffer containing the UDP message
  * @param[in]   sendFlags   optional transmit option flags
  *
- * @retval  INET_NO_ERROR
+ * @retval  CHIP_NO_ERROR
  *      success: \c msg is queued for transmit.
  *
- * @retval  INET_ERROR_NOT_SUPPORTED
+ * @retval  CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE
  *      the system does not support the requested operation.
  *
  * @retval  INET_ERROR_WRONG_ADDRESS_TYPE
  *      the destination address and the bound interface address do not
  *      have matching protocol versions or address type.
  *
- * @retval  INET_ERROR_MESSAGE_TOO_LONG
+ * @retval  CHIP_ERROR_MESSAGE_TOO_LONG
  *      \c msg does not contain the whole UDP message.
  *
- * @retval  INET_ERROR_OUTBOUND_MESSAGE_TRUNCATED
+ * @retval  CHIP_ERROR_OUTBOUND_MESSAGE_TOO_BIG
  *      On some platforms, only a truncated portion of \c msg was queued
  *      for transmit.
  *
@@ -525,13 +525,13 @@
  *      over the specified interface.  If \c pktInfo contains a source address, the
  *      given address will be used as the source of the UDP message.
  */
-INET_ERROR UDPEndPoint::SendMsg(const IPPacketInfo * pktInfo, System::PacketBufferHandle && msg, uint16_t sendFlags)
+CHIP_ERROR UDPEndPoint::SendMsg(const IPPacketInfo * pktInfo, System::PacketBufferHandle && msg, uint16_t sendFlags)
 {
-    INET_ERROR res             = INET_NO_ERROR;
+    CHIP_ERROR res             = CHIP_NO_ERROR;
     const IPAddress & destAddr = pktInfo->DestAddress;
 
     INET_FAULT_INJECT(FaultInjection::kFault_Send, return INET_ERROR_UNKNOWN_INTERFACE;);
-    INET_FAULT_INJECT(FaultInjection::kFault_SendNonCritical, return INET_ERROR_NO_MEMORY;);
+    INET_FAULT_INJECT(FaultInjection::kFault_SendNonCritical, return CHIP_ERROR_NO_MEMORY;);
 
 #if CHIP_SYSTEM_CONFIG_USE_LWIP
 
@@ -543,7 +543,7 @@
         // msg into a fresh object in this case, and queues that for transmission, leaving
         // the original msg available after return.
         msg = msg.CloneData();
-        VerifyOrExit(!msg.IsNull(), res = INET_ERROR_NO_MEMORY);
+        VerifyOrExit(!msg.IsNull(), res = CHIP_ERROR_NO_MEMORY);
     }
 
     // Lock LwIP stack
@@ -668,9 +668,9 @@
  *
  * @param[in]   intfId      indicator of the network interface.
  *
- * @retval  INET_NO_ERROR               success: endpoint bound to address
- * @retval  INET_NO_MEMORY              insufficient memory for endpoint
- * @retval  INET_ERROR_NOT_IMPLEMENTED  system implementation not complete.
+ * @retval  CHIP_NO_ERROR               success: endpoint bound to address
+ * @retval  CHIP_ERROR_NO_MEMORY        insufficient memory for endpoint
+ * @retval  CHIP_ERROR_NOT_IMPLEMENTED  system implementation not complete.
  *
  * @retval  INET_ERROR_UNKNOWN_INTERFACE
  *      On some platforms, the interface is not present.
@@ -683,11 +683,11 @@
  *  On LwIP, this method must not be called with the LwIP stack lock
  *  already acquired.
  */
-INET_ERROR UDPEndPoint::BindInterface(IPAddressType addrType, InterfaceId intfId)
+CHIP_ERROR UDPEndPoint::BindInterface(IPAddressType addrType, InterfaceId intfId)
 {
     if (mState != kState_Ready && mState != kState_Bound)
     {
-        return INET_ERROR_INCORRECT_STATE;
+        return CHIP_ERROR_INCORRECT_STATE;
     }
 
 #if CHIP_SYSTEM_CONFIG_USE_LWIP
@@ -698,9 +698,9 @@
     LOCK_TCPIP_CORE();
 
     // Make sure we have the appropriate type of PCB.
-    INET_ERROR err = GetPCB(addrType);
+    CHIP_ERROR err = GetPCB(addrType);
 
-    if (err == INET_NO_ERROR)
+    if (err == CHIP_NO_ERROR)
     {
         err = LwIPBindInterface(mUDP, intfId);
     }
@@ -723,7 +723,7 @@
 
     mState = kState_Bound;
 
-    return INET_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 void UDPEndPoint::Init(InetLayer * inetLayer)
@@ -778,7 +778,7 @@
     IPEndPointBasis::HandleDataReceived(std::move(msg));
 }
 
-INET_ERROR UDPEndPoint::GetPCB(IPAddressType addrType)
+CHIP_ERROR UDPEndPoint::GetPCB(IPAddressType addrType)
 {
     // IMPORTANT: This method MUST be called with the LwIP stack LOCKED!
 
@@ -813,7 +813,7 @@
         if (mUDP == NULL)
         {
             ChipLogError(Inet, "Unable to allocate UDP PCB");
-            return INET_ERROR_NO_MEMORY;
+            return CHIP_ERROR_NO_MEMORY;
         }
 
         // Allow multiple bindings to the same port.
@@ -852,7 +852,7 @@
         VerifyOrReturnError(addrType == pcbAddrType, INET_ERROR_WRONG_ADDRESS_TYPE);
     }
 
-    return INET_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 #if LWIP_VERSION_MAJOR > 1 || LWIP_VERSION_MINOR >= 5
@@ -898,7 +898,7 @@
 #endif // CHIP_SYSTEM_CONFIG_USE_LWIP
 
 #if CHIP_SYSTEM_CONFIG_USE_SOCKETS
-INET_ERROR UDPEndPoint::GetSocket(IPAddressType aAddressType)
+CHIP_ERROR UDPEndPoint::GetSocket(IPAddressType aAddressType)
 {
     constexpr int lType     = (SOCK_DGRAM | SOCK_FLAGS);
     constexpr int lProtocol = 0;
diff --git a/src/inet/UDPEndPoint.h b/src/inet/UDPEndPoint.h
index 5747deb..b2549a1 100644
--- a/src/inet/UDPEndPoint.h
+++ b/src/inet/UDPEndPoint.h
@@ -56,15 +56,15 @@
     friend class InetLayer;
 
 public:
-    INET_ERROR Bind(IPAddressType addrType, const IPAddress & addr, uint16_t port, InterfaceId intfId = INET_NULL_INTERFACEID);
-    INET_ERROR BindInterface(IPAddressType addrType, InterfaceId intfId);
+    CHIP_ERROR Bind(IPAddressType addrType, const IPAddress & addr, uint16_t port, InterfaceId intfId = INET_NULL_INTERFACEID);
+    CHIP_ERROR BindInterface(IPAddressType addrType, InterfaceId intfId);
     InterfaceId GetBoundInterface();
     uint16_t GetBoundPort();
-    INET_ERROR Listen(OnMessageReceivedFunct onMessageReceived, OnReceiveErrorFunct onReceiveError, void * appState = nullptr);
-    INET_ERROR SendTo(const IPAddress & addr, uint16_t port, chip::System::PacketBufferHandle && msg, uint16_t sendFlags = 0);
-    INET_ERROR SendTo(const IPAddress & addr, uint16_t port, InterfaceId intfId, chip::System::PacketBufferHandle && msg,
+    CHIP_ERROR Listen(OnMessageReceivedFunct onMessageReceived, OnReceiveErrorFunct onReceiveError, void * appState = nullptr);
+    CHIP_ERROR SendTo(const IPAddress & addr, uint16_t port, chip::System::PacketBufferHandle && msg, uint16_t sendFlags = 0);
+    CHIP_ERROR SendTo(const IPAddress & addr, uint16_t port, InterfaceId intfId, chip::System::PacketBufferHandle && msg,
                       uint16_t sendFlags = 0);
-    INET_ERROR SendMsg(const IPPacketInfo * pktInfo, chip::System::PacketBufferHandle && msg, uint16_t sendFlags = 0);
+    CHIP_ERROR SendMsg(const IPPacketInfo * pktInfo, chip::System::PacketBufferHandle && msg, uint16_t sendFlags = 0);
     void Close();
     void Free();
 
@@ -79,7 +79,7 @@
 
 #if CHIP_SYSTEM_CONFIG_USE_LWIP
     void HandleDataReceived(chip::System::PacketBufferHandle && msg);
-    INET_ERROR GetPCB(IPAddressType addrType4);
+    CHIP_ERROR GetPCB(IPAddressType addrType4);
 #if LWIP_VERSION_MAJOR > 1 || LWIP_VERSION_MINOR >= 5
     static void LwIPReceiveUDPMessage(void * arg, struct udp_pcb * pcb, struct pbuf * p, const ip_addr_t * addr, u16_t port);
 #else  // LWIP_VERSION_MAJOR <= 1 && LWIP_VERSION_MINOR < 5
@@ -90,7 +90,7 @@
 #if CHIP_SYSTEM_CONFIG_USE_SOCKETS
     uint16_t mBoundPort;
 
-    INET_ERROR GetSocket(IPAddressType addrType);
+    CHIP_ERROR GetSocket(IPAddressType addrType);
     void HandlePendingIO();
     static void HandlePendingIO(System::WatchableSocket & socket);
 
diff --git a/src/inet/tests/TestInetCommon.h b/src/inet/tests/TestInetCommon.h
index 7bd68f0..958a451 100644
--- a/src/inet/tests/TestInetCommon.h
+++ b/src/inet/tests/TestInetCommon.h
@@ -60,7 +60,7 @@
 void InitTestInetCommon();
 void InitSystemLayer();
 void ShutdownSystemLayer();
-void InetFailError(int32_t err, const char * msg);
+void InetFailError(CHIP_ERROR err, const char * msg);
 
 void InitNetwork();
 void ServiceEvents(struct ::timeval & aSleepTime);
diff --git a/src/inet/tests/TestInetCommonPosix.cpp b/src/inet/tests/TestInetCommonPosix.cpp
index 95dd561..5c2d178 100644
--- a/src/inet/tests/TestInetCommonPosix.cpp
+++ b/src/inet/tests/TestInetCommonPosix.cpp
@@ -117,9 +117,9 @@
 char gDefaultTapDeviceName[32];
 bool gDone = false;
 
-void InetFailError(int32_t err, const char * msg)
+void InetFailError(CHIP_ERROR err, const char * msg)
 {
-    if (err != INET_NO_ERROR)
+    if (err != CHIP_NO_ERROR)
     {
         fprintf(stderr, "%s: %s\n", msg, ErrorStr(err));
         exit(-1);
diff --git a/src/inet/tests/TestInetEndPoint.cpp b/src/inet/tests/TestInetEndPoint.cpp
index adde861..4547b50 100644
--- a/src/inet/tests/TestInetEndPoint.cpp
+++ b/src/inet/tests/TestInetEndPoint.cpp
@@ -59,7 +59,7 @@
 
 bool callbackHandlerCalled = false;
 
-void HandleDNSResolveComplete(void * appState, INET_ERROR err, uint8_t addrCount, IPAddress * addrArray)
+void HandleDNSResolveComplete(void * appState, CHIP_ERROR err, uint8_t addrCount, IPAddress * addrArray)
 {
     callbackHandlerCalled = true;
 
@@ -73,7 +73,7 @@
         printf("    DNS name resolution return no addresses\n");
 }
 
-void HandleTimer(Layer * aLayer, void * aAppState, Error aError)
+void HandleTimer(Layer * aLayer, void * aAppState, CHIP_ERROR aError)
 {
     printf("    timer handler\n");
 }
@@ -90,7 +90,7 @@
 #if INET_CONFIG_ENABLE_TCP_ENDPOINT
     TCPEndPoint * testTCPEP = nullptr;
 #endif // INET_CONFIG_ENABLE_TCP_ENDPOINT
-    INET_ERROR err = INET_NO_ERROR;
+    CHIP_ERROR err = CHIP_NO_ERROR;
 #if INET_CONFIG_ENABLE_DNS_RESOLVER
     IPAddress testDestAddr = IPAddress::Any;
     char testHostName[20]  = "www.nest.com";
@@ -98,25 +98,25 @@
 
 #if INET_CONFIG_ENABLE_RAW_ENDPOINT
     err = gInet.NewRawEndPoint(kIPVersion_6, kIPProtocol_ICMPv6, &testRawEP);
-    NL_TEST_ASSERT(inSuite, err == INET_ERROR_INCORRECT_STATE);
+    NL_TEST_ASSERT(inSuite, err == CHIP_ERROR_INCORRECT_STATE);
 #endif // INET_CONFIG_ENABLE_RAW_ENDPOINT
 
 #if INET_CONFIG_ENABLE_UDP_ENDPOINT
     err = gInet.NewUDPEndPoint(&testUDPEP);
-    NL_TEST_ASSERT(inSuite, err == INET_ERROR_INCORRECT_STATE);
+    NL_TEST_ASSERT(inSuite, err == CHIP_ERROR_INCORRECT_STATE);
 #endif // INET_CONFIG_ENABLE_UDP_ENDPOINT
 
 #if INET_CONFIG_ENABLE_TCP_ENDPOINT
     err = gInet.NewTCPEndPoint(&testTCPEP);
-    NL_TEST_ASSERT(inSuite, err == INET_ERROR_INCORRECT_STATE);
+    NL_TEST_ASSERT(inSuite, err == CHIP_ERROR_INCORRECT_STATE);
 #endif // INET_CONFIG_ENABLE_TCP_ENDPOINT
 
     err = gSystemLayer.StartTimer(10, HandleTimer, nullptr);
-    NL_TEST_ASSERT(inSuite, err == CHIP_SYSTEM_ERROR_UNEXPECTED_STATE);
+    NL_TEST_ASSERT(inSuite, err == CHIP_ERROR_INCORRECT_STATE);
 
 #if INET_CONFIG_ENABLE_DNS_RESOLVER
     err = gInet.ResolveHostAddress(testHostName, 1, &testDestAddr, HandleDNSResolveComplete, nullptr);
-    NL_TEST_ASSERT(inSuite, err == INET_ERROR_INCORRECT_STATE);
+    NL_TEST_ASSERT(inSuite, err == CHIP_ERROR_INCORRECT_STATE);
 #endif // INET_CONFIG_ENABLE_DNS_RESOLVER
 
     // then init network
@@ -134,7 +134,7 @@
     char testHostName4[260];
     struct timeval sleepTime;
     IPAddress testDestAddr[1] = { IPAddress::Any };
-    INET_ERROR err;
+    CHIP_ERROR err;
 
     sleepTime.tv_sec  = 0;
     sleepTime.tv_usec = 10000;
@@ -144,9 +144,9 @@
 
     callbackHandlerCalled = false;
     err = gInet.ResolveHostAddress(testHostName1, 1, testDestAddr, HandleDNSResolveComplete, &callbackHandlerCalled);
-    NL_TEST_ASSERT(inSuite, err == INET_NO_ERROR);
+    NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR);
 
-    if (err == INET_NO_ERROR)
+    if (err == CHIP_NO_ERROR)
     {
         while (!callbackHandlerCalled)
         {
@@ -156,9 +156,9 @@
 
     callbackHandlerCalled = false;
     err = gInet.ResolveHostAddress(testHostName2, 1, testDestAddr, HandleDNSResolveComplete, &callbackHandlerCalled);
-    NL_TEST_ASSERT(inSuite, err == INET_NO_ERROR);
+    NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR);
 
-    if (err == INET_NO_ERROR)
+    if (err == CHIP_NO_ERROR)
     {
         while (!callbackHandlerCalled)
         {
@@ -168,9 +168,9 @@
 
     callbackHandlerCalled = false;
     err = gInet.ResolveHostAddress(testHostName3, 1, testDestAddr, HandleDNSResolveComplete, &callbackHandlerCalled);
-    NL_TEST_ASSERT(inSuite, err == INET_NO_ERROR);
+    NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR);
 
-    if (err == INET_NO_ERROR)
+    if (err == CHIP_NO_ERROR)
     {
         while (!callbackHandlerCalled)
         {
@@ -179,7 +179,7 @@
     }
 
     err = gInet.ResolveHostAddress(testHostName2, 0, testDestAddr, HandleDNSResolveComplete, &callbackHandlerCalled);
-    NL_TEST_ASSERT(inSuite, err == INET_ERROR_NO_MEMORY);
+    NL_TEST_ASSERT(inSuite, err == CHIP_ERROR_NO_MEMORY);
 
     err = gInet.ResolveHostAddress(testHostName4, 1, testDestAddr, HandleDNSResolveComplete, &callbackHandlerCalled);
     NL_TEST_ASSERT(inSuite, err == INET_ERROR_HOST_NAME_TOO_LONG);
@@ -197,12 +197,12 @@
     const char * host;
     const char * intf;
     uint16_t port, hostlen, intflen;
-    INET_ERROR err;
+    CHIP_ERROR err;
 
     for (char * correctHostName : correctHostNames)
     {
         err = ParseHostPortAndInterface(correctHostName, uint16_t(strlen(correctHostName)), host, hostlen, port, intf, intflen);
-        NL_TEST_ASSERT(inSuite, err == INET_NO_ERROR);
+        NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR);
     }
     for (char * invalidHostName : invalidHostNames)
     {
@@ -213,7 +213,7 @@
 
 static void TestInetError(nlTestSuite * inSuite, void * inContext)
 {
-    INET_ERROR err = INET_NO_ERROR;
+    CHIP_ERROR err = CHIP_NO_ERROR;
 
     err = MapErrorPOSIX(EPERM);
     NL_TEST_ASSERT(inSuite, DescribeErrorPOSIX(err));
@@ -228,22 +228,22 @@
     InterfaceId intId;
     IPAddress addr;
     IPPrefix addrWithPrefix;
-    INET_ERROR err;
+    CHIP_ERROR err;
 
     err = InterfaceNameToId("0", intId);
-    NL_TEST_ASSERT(inSuite, err != INET_NO_ERROR);
+    NL_TEST_ASSERT(inSuite, err != CHIP_NO_ERROR);
 
     err = GetInterfaceName(INET_NULL_INTERFACEID, intName, 0);
-    NL_TEST_ASSERT(inSuite, err == INET_ERROR_NO_MEMORY);
+    NL_TEST_ASSERT(inSuite, err == CHIP_ERROR_NO_MEMORY);
 
     err = GetInterfaceName(INET_NULL_INTERFACEID, intName, sizeof(intName));
-    NL_TEST_ASSERT(inSuite, err == INET_NO_ERROR && intName[0] == '\0');
+    NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR && intName[0] == '\0');
 
     err = gInet.GetInterfaceFromAddr(addr, intId);
     NL_TEST_ASSERT(inSuite, intId == INET_NULL_INTERFACEID);
 
     err = gInet.GetLinkLocalAddr(intId, nullptr);
-    NL_TEST_ASSERT(inSuite, err == INET_ERROR_BAD_ARGS);
+    NL_TEST_ASSERT(inSuite, err == CHIP_ERROR_INVALID_ARGUMENT);
 
     printf("    Interfaces:\n");
     for (; intIterator.HasCurrent(); intIterator.Next())
@@ -252,7 +252,7 @@
         NL_TEST_ASSERT(inSuite, intId != INET_NULL_INTERFACEID);
         memset(intName, 42, sizeof(intName));
         err = intIterator.GetInterfaceName(intName, sizeof(intName));
-        NL_TEST_ASSERT(inSuite, err == INET_NO_ERROR);
+        NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR);
         printf("     interface id: 0x%" PRIxPTR ", interface name: %s, interface state: %s, %s multicast, %s broadcast addr\n",
 #if CHIP_SYSTEM_CONFIG_USE_LWIP
                reinterpret_cast<uintptr_t>(intId),
@@ -267,7 +267,7 @@
     }
     NL_TEST_ASSERT(inSuite, !intIterator.Next());
     NL_TEST_ASSERT(inSuite, intIterator.GetInterface() == INET_NULL_INTERFACEID);
-    NL_TEST_ASSERT(inSuite, intIterator.GetInterfaceName(intName, sizeof(intName)) == INET_ERROR_INCORRECT_STATE);
+    NL_TEST_ASSERT(inSuite, intIterator.GetInterfaceName(intName, sizeof(intName)) == CHIP_ERROR_INCORRECT_STATE);
     NL_TEST_ASSERT(inSuite, !intIterator.SupportsMulticast());
     NL_TEST_ASSERT(inSuite, !intIterator.HasBroadcastAddress());
 
@@ -282,7 +282,7 @@
         NL_TEST_ASSERT(inSuite, intId != INET_NULL_INTERFACEID);
         memset(intName, 42, sizeof(intName));
         err = addrIterator.GetInterfaceName(intName, sizeof(intName));
-        NL_TEST_ASSERT(inSuite, err == INET_NO_ERROR);
+        NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR);
         NL_TEST_ASSERT(inSuite, intName[0] != '\0' && memchr(intName, '\0', sizeof(intName)) != nullptr);
         printf("     %s/%d, interface id: 0x%" PRIxPTR
                ", interface name: %s, interface state: %s, %s multicast, %s broadcast addr\n",
@@ -299,14 +299,14 @@
     addrIterator.GetAddressWithPrefix(addrWithPrefix);
     NL_TEST_ASSERT(inSuite, addrWithPrefix.IsZero());
     NL_TEST_ASSERT(inSuite, addrIterator.GetInterface() == INET_NULL_INTERFACEID);
-    NL_TEST_ASSERT(inSuite, addrIterator.GetInterfaceName(intName, sizeof(intName)) == INET_ERROR_INCORRECT_STATE);
+    NL_TEST_ASSERT(inSuite, addrIterator.GetInterfaceName(intName, sizeof(intName)) == CHIP_ERROR_INCORRECT_STATE);
     NL_TEST_ASSERT(inSuite, !addrIterator.SupportsMulticast());
     NL_TEST_ASSERT(inSuite, !addrIterator.HasBroadcastAddress());
 }
 
 static void TestInetEndPointInternal(nlTestSuite * inSuite, void * inContext)
 {
-    INET_ERROR err;
+    CHIP_ERROR err;
     IPAddress addr_any = IPAddress::Any;
     IPAddress addr;
 #if INET_CONFIG_ENABLE_IPV4
@@ -327,23 +327,23 @@
 
     // init all the EndPoints
     err = gInet.NewRawEndPoint(kIPVersion_6, kIPProtocol_ICMPv6, &testRaw6EP);
-    NL_TEST_ASSERT(inSuite, err == INET_NO_ERROR);
+    NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR);
 
 #if INET_CONFIG_ENABLE_IPV4
     err = gInet.NewRawEndPoint(kIPVersion_4, kIPProtocol_ICMPv4, &testRaw4EP);
-    NL_TEST_ASSERT(inSuite, err == INET_NO_ERROR);
+    NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR);
 #endif // INET_CONFIG_ENABLE_IPV4
 
     err = gInet.NewUDPEndPoint(&testUDPEP);
-    NL_TEST_ASSERT(inSuite, err == INET_NO_ERROR);
+    NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR);
 
     err = gInet.NewTCPEndPoint(&testTCPEP1);
-    NL_TEST_ASSERT(inSuite, err == INET_NO_ERROR);
+    NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR);
 
     err = gInet.GetLinkLocalAddr(INET_NULL_INTERFACEID, &addr);
-    NL_TEST_ASSERT(inSuite, err == INET_NO_ERROR);
+    NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR);
     err = gInet.GetInterfaceFromAddr(addr, intId);
-    NL_TEST_ASSERT(inSuite, err == INET_NO_ERROR);
+    NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR);
 
     // RawEndPoint special cases to cover the error branch
     uint8_t ICMP6Types[2] = { 128, 129 };
@@ -361,40 +361,40 @@
     NL_TEST_ASSERT(inSuite, err == INET_ERROR_WRONG_ADDRESS_TYPE);
 #endif // INET_CONFIG_ENABLE_IPV4
     err = testRaw6EP->BindInterface(kIPAddressType_Unknown, INET_NULL_INTERFACEID);
-    NL_TEST_ASSERT(inSuite, err != INET_NO_ERROR);
+    NL_TEST_ASSERT(inSuite, err != CHIP_NO_ERROR);
 
     // A bind should succeed with appropriate permissions but will
     // otherwise fail.
 
     err = testRaw6EP->BindIPv6LinkLocal(intId, addr);
-    NL_TEST_ASSERT(inSuite, (err == INET_NO_ERROR) || (err == System::MapErrorPOSIX(EPERM)));
+    NL_TEST_ASSERT(inSuite, (err == CHIP_NO_ERROR) || (err == System::MapErrorPOSIX(EPERM)));
 
-    didBind = (err == INET_NO_ERROR);
+    didBind = (err == CHIP_NO_ERROR);
 
     // Listen after bind should succeed if the prior bind succeeded.
 
     err = testRaw6EP->Listen(nullptr /*OnMessageReceived*/, nullptr /*OnReceiveError*/);
-    NL_TEST_ASSERT(inSuite, (didBind && (err == INET_NO_ERROR)) || (!didBind && (err == INET_ERROR_INCORRECT_STATE)));
+    NL_TEST_ASSERT(inSuite, (didBind && (err == CHIP_NO_ERROR)) || (!didBind && (err == CHIP_ERROR_INCORRECT_STATE)));
 
-    didListen = (err == INET_NO_ERROR);
+    didListen = (err == CHIP_NO_ERROR);
 
     // If the first listen succeeded, then the second listen should be successful.
 
     err = testRaw6EP->Listen(nullptr /*OnMessageReceived*/, nullptr /*OnReceiveError*/);
-    NL_TEST_ASSERT(inSuite, (didBind && didListen && (err == INET_NO_ERROR)) || (!didBind && (err == INET_ERROR_INCORRECT_STATE)));
+    NL_TEST_ASSERT(inSuite, (didBind && didListen && (err == CHIP_NO_ERROR)) || (!didBind && (err == CHIP_ERROR_INCORRECT_STATE)));
 
-    didListen = (err == INET_NO_ERROR);
+    didListen = (err == CHIP_NO_ERROR);
 
     // A bind-after-listen should result in an incorrect state error;
     // otherwise, it will fail with a permissions error.
 
     err = testRaw6EP->Bind(kIPAddressType_IPv6, addr);
     NL_TEST_ASSERT(inSuite,
-                   (didListen && (err == INET_ERROR_INCORRECT_STATE)) || (!didListen && (err == System::MapErrorPOSIX(EPERM))));
+                   (didListen && (err == CHIP_ERROR_INCORRECT_STATE)) || (!didListen && (err == System::MapErrorPOSIX(EPERM))));
 
     // error SetICMPFilter case
     err = testRaw6EP->SetICMPFilter(0, ICMP6Types);
-    NL_TEST_ASSERT(inSuite, err == INET_ERROR_BAD_ARGS);
+    NL_TEST_ASSERT(inSuite, err == CHIP_ERROR_INVALID_ARGUMENT);
 
 #if INET_CONFIG_ENABLE_IPV4
     // We should never be able to send an IPv4-addressed message on an
@@ -413,7 +413,7 @@
 
     // UdpEndPoint special cases to cover the error branch
     err = testUDPEP->Listen(nullptr /*OnMessageReceived*/, nullptr /*OnReceiveError*/);
-    NL_TEST_ASSERT(inSuite, err == INET_ERROR_INCORRECT_STATE);
+    NL_TEST_ASSERT(inSuite, err == CHIP_ERROR_INCORRECT_STATE);
     err = testUDPEP->Bind(kIPAddressType_Unknown, addr_any, 3000);
     NL_TEST_ASSERT(inSuite, err == INET_ERROR_WRONG_ADDRESS_TYPE);
     err = testUDPEP->Bind(kIPAddressType_Unknown, addr, 3000);
@@ -431,16 +431,16 @@
     err = testUDPEP->Listen(nullptr /*OnMessageReceived*/, nullptr /*OnReceiveError*/);
     err = testUDPEP->Listen(nullptr /*OnMessageReceived*/, nullptr /*OnReceiveError*/);
     err = testUDPEP->Bind(kIPAddressType_IPv6, addr, 3000, intId);
-    NL_TEST_ASSERT(inSuite, err == INET_ERROR_INCORRECT_STATE);
+    NL_TEST_ASSERT(inSuite, err == CHIP_ERROR_INCORRECT_STATE);
     err = testUDPEP->BindInterface(kIPAddressType_IPv6, intId);
-    NL_TEST_ASSERT(inSuite, err == INET_ERROR_INCORRECT_STATE);
+    NL_TEST_ASSERT(inSuite, err == CHIP_ERROR_INCORRECT_STATE);
     testUDPEP->Free();
 
     err = gInet.NewUDPEndPoint(&testUDPEP);
-    NL_TEST_ASSERT(inSuite, err == INET_NO_ERROR);
+    NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR);
 #if INET_CONFIG_ENABLE_IPV4
     err = testUDPEP->Bind(kIPAddressType_IPv4, addr_v4, 3000, intId);
-    NL_TEST_ASSERT(inSuite, err != INET_NO_ERROR);
+    NL_TEST_ASSERT(inSuite, err != CHIP_NO_ERROR);
     buf = PacketBufferHandle::New(PacketBuffer::kMaxSize);
     err = testUDPEP->SendTo(addr_v4, 3000, std::move(buf));
     testUDPEP->Free();
@@ -448,21 +448,21 @@
 
     // TcpEndPoint special cases to cover the error branch
     err = testTCPEP1->GetPeerInfo(nullptr, nullptr);
-    NL_TEST_ASSERT(inSuite, err == INET_ERROR_INCORRECT_STATE);
+    NL_TEST_ASSERT(inSuite, err == CHIP_ERROR_INCORRECT_STATE);
     buf = PacketBufferHandle::New(PacketBuffer::kMaxSize);
     err = testTCPEP1->Send(std::move(buf), false);
-    NL_TEST_ASSERT(inSuite, err == INET_ERROR_INCORRECT_STATE);
+    NL_TEST_ASSERT(inSuite, err == CHIP_ERROR_INCORRECT_STATE);
     err = testTCPEP1->EnableKeepAlive(10, 100);
-    NL_TEST_ASSERT(inSuite, err == INET_ERROR_INCORRECT_STATE);
+    NL_TEST_ASSERT(inSuite, err == CHIP_ERROR_INCORRECT_STATE);
     err = testTCPEP1->DisableKeepAlive();
-    NL_TEST_ASSERT(inSuite, err == INET_ERROR_INCORRECT_STATE);
+    NL_TEST_ASSERT(inSuite, err == CHIP_ERROR_INCORRECT_STATE);
     err = testTCPEP1->AckReceive(10);
-    NL_TEST_ASSERT(inSuite, err == INET_ERROR_INCORRECT_STATE);
+    NL_TEST_ASSERT(inSuite, err == CHIP_ERROR_INCORRECT_STATE);
     NL_TEST_ASSERT(inSuite, !testTCPEP1->PendingReceiveLength());
     err = testTCPEP1->Listen(4);
-    NL_TEST_ASSERT(inSuite, err == INET_ERROR_INCORRECT_STATE);
+    NL_TEST_ASSERT(inSuite, err == CHIP_ERROR_INCORRECT_STATE);
     err = testTCPEP1->GetLocalInfo(nullptr, nullptr);
-    NL_TEST_ASSERT(inSuite, err == INET_ERROR_INCORRECT_STATE);
+    NL_TEST_ASSERT(inSuite, err == CHIP_ERROR_INCORRECT_STATE);
 
     err = testTCPEP1->Bind(kIPAddressType_Unknown, addr_any, 3000, true);
     NL_TEST_ASSERT(inSuite, err == INET_ERROR_WRONG_ADDRESS_TYPE);
@@ -475,11 +475,11 @@
 
     err = testTCPEP1->Bind(kIPAddressType_IPv6, addr_any, 3000, true);
     err = testTCPEP1->Bind(kIPAddressType_IPv6, addr_any, 3000, true);
-    NL_TEST_ASSERT(inSuite, err == INET_ERROR_INCORRECT_STATE);
+    NL_TEST_ASSERT(inSuite, err == CHIP_ERROR_INCORRECT_STATE);
     err = testTCPEP1->Listen(4);
 #if INET_CONFIG_ENABLE_IPV4
     err = testTCPEP1->Connect(addr_v4, 4000, intId);
-    NL_TEST_ASSERT(inSuite, err == INET_ERROR_INCORRECT_STATE);
+    NL_TEST_ASSERT(inSuite, err == CHIP_ERROR_INCORRECT_STATE);
 #endif // INET_CONFIG_ENABLE_IPV4
 
     testTCPEP1->Shutdown();
@@ -491,31 +491,31 @@
     RawEndPoint * testRawEP = nullptr;
     UDPEndPoint * testUDPEP = nullptr;
     TCPEndPoint * testTCPEP = nullptr;
-    INET_ERROR err;
+    CHIP_ERROR err;
     char numTimersTest[CHIP_SYSTEM_CONFIG_NUM_TIMERS + 1];
 
     for (int i = 0; i < INET_CONFIG_NUM_RAW_ENDPOINTS + 1; i++)
         err = gInet.NewRawEndPoint(kIPVersion_6, kIPProtocol_ICMPv6, &testRawEP);
-    NL_TEST_ASSERT(inSuite, err == INET_ERROR_NO_ENDPOINTS);
+    NL_TEST_ASSERT(inSuite, err == CHIP_ERROR_ENDPOINT_POOL_FULL);
 
     for (int i = 0; i < INET_CONFIG_NUM_UDP_ENDPOINTS + 1; i++)
         err = gInet.NewUDPEndPoint(&testUDPEP);
-    NL_TEST_ASSERT(inSuite, err == INET_ERROR_NO_ENDPOINTS);
+    NL_TEST_ASSERT(inSuite, err == CHIP_ERROR_ENDPOINT_POOL_FULL);
 
     for (int i = 0; i < INET_CONFIG_NUM_TCP_ENDPOINTS + 1; i++)
         err = gInet.NewTCPEndPoint(&testTCPEP);
-    NL_TEST_ASSERT(inSuite, err == INET_ERROR_NO_ENDPOINTS);
+    NL_TEST_ASSERT(inSuite, err == CHIP_ERROR_ENDPOINT_POOL_FULL);
 
     // Verify same aComplete and aAppState args do not exhaust timer pool
     for (int i = 0; i < CHIP_SYSTEM_CONFIG_NUM_TIMERS + 1; i++)
     {
         err = gSystemLayer.StartTimer(10, HandleTimer, nullptr);
-        NL_TEST_ASSERT(inSuite, err == CHIP_SYSTEM_NO_ERROR);
+        NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR);
     }
 
     for (int i = 0; i < CHIP_SYSTEM_CONFIG_NUM_TIMERS + 1; i++)
         err = gSystemLayer.StartTimer(10, HandleTimer, &numTimersTest[i]);
-    NL_TEST_ASSERT(inSuite, err == CHIP_SYSTEM_ERROR_NO_MEMORY);
+    NL_TEST_ASSERT(inSuite, err == CHIP_ERROR_NO_MEMORY);
 
     ShutdownNetwork();
     ShutdownSystemLayer();
diff --git a/src/inet/tests/TestInetErrorStr.cpp b/src/inet/tests/TestInetErrorStr.cpp
index fa95072..ff3dd20 100644
--- a/src/inet/tests/TestInetErrorStr.cpp
+++ b/src/inet/tests/TestInetErrorStr.cpp
@@ -51,28 +51,16 @@
 static int32_t sContext[] =
 {
     INET_ERROR_WRONG_ADDRESS_TYPE,
-    INET_ERROR_CONNECTION_ABORTED,
     INET_ERROR_PEER_DISCONNECTED,
-    INET_ERROR_INCORRECT_STATE,
-    INET_ERROR_MESSAGE_TOO_LONG,
-    INET_ERROR_NO_CONNECTION_HANDLER,
-    INET_ERROR_NO_MEMORY,
-    INET_ERROR_OUTBOUND_MESSAGE_TRUNCATED,
-    INET_ERROR_INBOUND_MESSAGE_TOO_BIG,
     INET_ERROR_HOST_NOT_FOUND,
     INET_ERROR_DNS_TRY_AGAIN,
     INET_ERROR_DNS_NO_RECOVERY,
-    INET_ERROR_BAD_ARGS,
     INET_ERROR_WRONG_PROTOCOL_TYPE,
     INET_ERROR_UNKNOWN_INTERFACE,
-    INET_ERROR_NOT_IMPLEMENTED,
     INET_ERROR_ADDRESS_NOT_FOUND,
     INET_ERROR_HOST_NAME_TOO_LONG,
     INET_ERROR_INVALID_HOST_NAME,
-    INET_ERROR_NOT_SUPPORTED,
-    INET_ERROR_NO_ENDPOINTS,
     INET_ERROR_IDLE_TIMEOUT,
-    INET_ERROR_UNEXPECTED_EVENT,
     INET_ERROR_INVALID_IPV6_PKT,
     INET_ERROR_INTERFACE_INIT_FAILURE,
     INET_ERROR_TCP_USER_TIMEOUT,
diff --git a/src/inet/tests/TestInetLayer.cpp b/src/inet/tests/TestInetLayer.cpp
index 1317ec5..d26b72d 100644
--- a/src/inet/tests/TestInetLayer.cpp
+++ b/src/inet/tests/TestInetLayer.cpp
@@ -236,7 +236,7 @@
 int main(int argc, char * argv[])
 {
     bool lSuccessful = true;
-    INET_ERROR lStatus;
+    CHIP_ERROR lStatus;
 
     InitTestInetCommon();
 
@@ -269,7 +269,7 @@
     if (gInterfaceName != nullptr)
     {
         lStatus = InterfaceNameToId(gInterfaceName, gInterfaceId);
-        if (lStatus != INET_NO_ERROR)
+        if (lStatus != CHIP_NO_ERROR)
         {
             PrintArgError("%s: unknown network interface %s\n", kToolName, gInterfaceName);
             lSuccessful = false;
@@ -522,11 +522,11 @@
 
 // TCP Endpoint Callbacks
 
-void HandleTCPConnectionComplete(TCPEndPoint * aEndPoint, INET_ERROR aError)
+void HandleTCPConnectionComplete(TCPEndPoint * aEndPoint, CHIP_ERROR aError)
 {
-    INET_ERROR lStatus;
+    CHIP_ERROR lStatus;
 
-    if (aError == INET_NO_ERROR)
+    if (aError == CHIP_NO_ERROR)
     {
         IPAddress lPeerAddress;
         uint16_t lPeerPort;
@@ -564,9 +564,9 @@
     }
 }
 
-static void HandleTCPConnectionClosed(TCPEndPoint * aEndPoint, INET_ERROR aError)
+static void HandleTCPConnectionClosed(TCPEndPoint * aEndPoint, CHIP_ERROR aError)
 {
-    if (aError == INET_NO_ERROR)
+    if (aError == CHIP_NO_ERROR)
     {
         printf("TCP connection closed\n");
     }
@@ -587,7 +587,7 @@
 
 static void HandleTCPDataSent(TCPEndPoint * aEndPoint, uint16_t len) {}
 
-static INET_ERROR HandleTCPDataReceived(TCPEndPoint * aEndPoint, PacketBufferHandle && aBuffer)
+static CHIP_ERROR HandleTCPDataReceived(TCPEndPoint * aEndPoint, PacketBufferHandle && aBuffer)
 {
     const uint32_t lFirstValueReceived = sTestState.mStats.mReceive.mActual;
     const uint8_t lFirstValue          = uint8_t(lFirstValueReceived);
@@ -596,13 +596,13 @@
     uint16_t lPeerPort;
     char lPeerAddressBuffer[INET6_ADDRSTRLEN];
     bool lCheckPassed;
-    INET_ERROR lStatus = INET_NO_ERROR;
+    CHIP_ERROR lStatus = CHIP_NO_ERROR;
 
     // Check that we did not lose information in our narrowing cast.
-    VerifyOrExit(lFirstValue == lFirstValueReceived, lStatus = INET_ERROR_UNEXPECTED_EVENT);
+    VerifyOrExit(lFirstValue == lFirstValueReceived, lStatus = CHIP_ERROR_UNEXPECTED_EVENT);
 
-    VerifyOrExit(aEndPoint != nullptr, lStatus = INET_ERROR_BAD_ARGS);
-    VerifyOrExit(!aBuffer.IsNull(), lStatus = INET_ERROR_BAD_ARGS);
+    VerifyOrExit(aEndPoint != nullptr, lStatus = CHIP_ERROR_INVALID_ARGUMENT);
+    VerifyOrExit(!aBuffer.IsNull(), lStatus = CHIP_ERROR_INVALID_ARGUMENT);
 
     if (aEndPoint->State != TCPEndPoint::kState_Connected)
     {
@@ -620,20 +620,20 @@
            static_cast<size_t>(aBuffer->DataLength()));
 
     lCheckPassed = HandleDataReceived(aBuffer, lCheckBuffer, lFirstValue);
-    VerifyOrExit(lCheckPassed == true, lStatus = INET_ERROR_UNEXPECTED_EVENT);
+    VerifyOrExit(lCheckPassed == true, lStatus = CHIP_ERROR_UNEXPECTED_EVENT);
 
     lStatus = aEndPoint->AckReceive(aBuffer->TotalLength());
     INET_FAIL_ERROR(lStatus, "TCPEndPoint::AckReceive failed");
 
 exit:
-    if (lStatus != INET_NO_ERROR)
+    if (lStatus != CHIP_NO_ERROR)
     {
         SetStatusFailed(sTestState.mStatus);
     }
     return lStatus;
 }
 
-static void HandleTCPAcceptError(TCPEndPoint * aEndPoint, INET_ERROR aError)
+static void HandleTCPAcceptError(TCPEndPoint * aEndPoint, CHIP_ERROR aError)
 {
     printf("TCP accept error: %s\n", ErrorStr(aError));
 
@@ -703,7 +703,7 @@
     }
 }
 
-static void HandleRawReceiveError(IPEndPointBasis * aEndPoint, INET_ERROR aError, const IPPacketInfo * aPacketInfo)
+static void HandleRawReceiveError(IPEndPointBasis * aEndPoint, CHIP_ERROR aError, const IPPacketInfo * aPacketInfo)
 {
     Common::HandleRawReceiveError(aEndPoint, aError, aPacketInfo);
 
@@ -732,7 +732,7 @@
     }
 }
 
-static void HandleUDPReceiveError(IPEndPointBasis * aEndPoint, INET_ERROR aError, const IPPacketInfo * aPacketInfo)
+static void HandleUDPReceiveError(IPEndPointBasis * aEndPoint, CHIP_ERROR aError, const IPPacketInfo * aPacketInfo)
 {
     Common::HandleUDPReceiveError(aEndPoint, aError, aPacketInfo);
 
@@ -774,9 +774,9 @@
     return (lStatus);
 }
 
-static INET_ERROR PrepareTransportForSend()
+static CHIP_ERROR PrepareTransportForSend()
 {
-    INET_ERROR lStatus = INET_NO_ERROR;
+    CHIP_ERROR lStatus = CHIP_NO_ERROR;
 
     if (gOptFlags & kOptFlagUseTCPIP)
     {
@@ -798,7 +798,7 @@
     return (lStatus);
 }
 
-static INET_ERROR DriveSendForDestination(const IPAddress & aAddress, uint16_t aSize)
+static CHIP_ERROR DriveSendForDestination(const IPAddress & aAddress, uint16_t aSize)
 {
     PacketBufferHandle lBuffer;
 
@@ -812,13 +812,13 @@
         if ((gOptFlags & kOptFlagUseIPv6) == (kOptFlagUseIPv6))
         {
             lBuffer = Common::MakeICMPv6DataBuffer(aSize);
-            VerifyOrReturnError(!lBuffer.IsNull(), INET_ERROR_NO_MEMORY);
+            VerifyOrReturnError(!lBuffer.IsNull(), CHIP_ERROR_NO_MEMORY);
         }
 #if INET_CONFIG_ENABLE_IPV4
         else if ((gOptFlags & kOptFlagUseIPv4) == (kOptFlagUseIPv4))
         {
             lBuffer = Common::MakeICMPv4DataBuffer(aSize);
-            VerifyOrReturnError(!lBuffer.IsNull(), INET_ERROR_NO_MEMORY);
+            VerifyOrReturnError(!lBuffer.IsNull(), CHIP_ERROR_NO_MEMORY);
         }
 #endif // INET_CONFIG_ENABLE_IPV4
 
@@ -834,14 +834,14 @@
             // patterned from zero to aSize - 1.
 
             lBuffer = Common::MakeDataBuffer(aSize, lFirstValue);
-            VerifyOrReturnError(!lBuffer.IsNull(), INET_ERROR_NO_MEMORY);
+            VerifyOrReturnError(!lBuffer.IsNull(), CHIP_ERROR_NO_MEMORY);
 
             ReturnErrorOnFailure(sUDPIPEndPoint->SendTo(aAddress, kUDPPort, std::move(lBuffer)));
         }
         else if ((gOptFlags & kOptFlagUseTCPIP) == kOptFlagUseTCPIP)
         {
             const uint32_t lFirstValue = sTestState.mStats.mTransmit.mActual;
-            VerifyOrReturnError(lFirstValue < 256u, INET_ERROR_UNEXPECTED_EVENT);
+            VerifyOrReturnError(lFirstValue < 256u, CHIP_ERROR_UNEXPECTED_EVENT);
 
             // For TCP, we'll send one byte stream of
             // sTestState.mStats.mTransmit.mExpected in n aSize or
@@ -849,18 +849,18 @@
             // sTestState.mStats.mTransmit.mExpected - 1.
 
             lBuffer = Common::MakeDataBuffer(aSize, uint8_t(lFirstValue));
-            VerifyOrReturnError(!lBuffer.IsNull(), INET_ERROR_NO_MEMORY);
+            VerifyOrReturnError(!lBuffer.IsNull(), CHIP_ERROR_NO_MEMORY);
 
             ReturnErrorOnFailure(sTCPIPEndPoint->Send(std::move(lBuffer)));
         }
     }
 
-    return INET_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 void DriveSend()
 {
-    INET_ERROR lStatus = INET_NO_ERROR;
+    CHIP_ERROR lStatus = CHIP_NO_ERROR;
 
     if (!Common::IsSender())
         goto exit;
@@ -897,7 +897,7 @@
     }
 
 exit:
-    if (lStatus != INET_NO_ERROR)
+    if (lStatus != CHIP_NO_ERROR)
     {
         SetStatusFailed(sTestState.mStatus);
     }
@@ -909,7 +909,7 @@
     IPProtocol lIPProtocol       = kIPProtocol_ICMPv6;
     IPVersion lIPVersion         = kIPVersion_6;
     IPAddress lAddress           = chip::Inet::IPAddress::Any;
-    INET_ERROR lStatus;
+    CHIP_ERROR lStatus;
 
     if (!gNetworkOptions.LocalIPv6Addr.empty())
         lAddress = gNetworkOptions.LocalIPv6Addr[0];
@@ -1011,7 +1011,7 @@
 
 static void CleanupTest()
 {
-    INET_ERROR lStatus;
+    CHIP_ERROR lStatus;
 
     gSendIntervalExpired = false;
     gSystemLayer.CancelTimer(Common::HandleSendTimerComplete, nullptr);
diff --git a/src/inet/tests/TestInetLayerCommon.cpp b/src/inet/tests/TestInetLayerCommon.cpp
index 13300ae..b908f9b 100644
--- a/src/inet/tests/TestInetLayerCommon.cpp
+++ b/src/inet/tests/TestInetLayerCommon.cpp
@@ -340,7 +340,7 @@
 
 // Timer Callback Handler
 
-void HandleSendTimerComplete(System::Layer * aSystemLayer, void * aAppState, System::Error aError)
+void HandleSendTimerComplete(System::Layer * aSystemLayer, void * aAppState, CHIP_ERROR aError)
 {
     INET_FAIL_ERROR(aError, "Send timer completed with error");
 
@@ -364,7 +364,7 @@
            static_cast<size_t>(aBuffer->DataLength()));
 }
 
-void HandleRawReceiveError(const IPEndPointBasis * aEndPoint, const INET_ERROR & aError, const IPPacketInfo * aPacketInfo)
+void HandleRawReceiveError(const IPEndPointBasis * aEndPoint, const CHIP_ERROR & aError, const IPPacketInfo * aPacketInfo)
 {
     char lAddressBuffer[INET6_ADDRSTRLEN];
 
@@ -395,7 +395,7 @@
            lDestinationAddressBuffer, aPacketInfo->DestPort, static_cast<size_t>(aBuffer->DataLength()));
 }
 
-void HandleUDPReceiveError(const IPEndPointBasis * aEndPoint, const INET_ERROR & aError, const IPPacketInfo * aPacketInfo)
+void HandleUDPReceiveError(const IPEndPointBasis * aEndPoint, const CHIP_ERROR & aError, const IPPacketInfo * aPacketInfo)
 {
     char lAddressBuffer[INET6_ADDRSTRLEN];
     uint16_t lSourcePort;
diff --git a/src/inet/tests/TestInetLayerCommon.hpp b/src/inet/tests/TestInetLayerCommon.hpp
index b59e2e9..59c5cc0 100644
--- a/src/inet/tests/TestInetLayerCommon.hpp
+++ b/src/inet/tests/TestInetLayerCommon.hpp
@@ -145,14 +145,14 @@
 
 // Timer Callback Handler
 
-extern void HandleSendTimerComplete(chip::System::Layer * aSystemLayer, void * aAppState, chip::System::Error aError);
+extern void HandleSendTimerComplete(chip::System::Layer * aSystemLayer, void * aAppState, CHIP_ERROR aError);
 
 // Raw Endpoint Callback Handlers
 
 extern void HandleRawMessageReceived(const chip::Inet::IPEndPointBasis * aEndPoint,
                                      const chip::System::PacketBufferHandle & aBuffer,
                                      const chip::Inet::IPPacketInfo * aPacketInfo);
-extern void HandleRawReceiveError(const chip::Inet::IPEndPointBasis * aEndPoint, const INET_ERROR & aError,
+extern void HandleRawReceiveError(const chip::Inet::IPEndPointBasis * aEndPoint, const CHIP_ERROR & aError,
                                   const chip::Inet::IPPacketInfo * aPacketInfo);
 
 // UDP Endpoint Callback Handlers
@@ -160,7 +160,7 @@
 extern void HandleUDPMessageReceived(const chip::Inet::IPEndPointBasis * aEndPoint,
                                      const chip::System::PacketBufferHandle & aBuffer,
                                      const chip::Inet::IPPacketInfo * aPacketInfo);
-extern void HandleUDPReceiveError(const chip::Inet::IPEndPointBasis * aEndPoint, const INET_ERROR & aError,
+extern void HandleUDPReceiveError(const chip::Inet::IPEndPointBasis * aEndPoint, const CHIP_ERROR & aError,
                                   const chip::Inet::IPPacketInfo * aPacketInfo);
 
 } // namespace Common
diff --git a/src/inet/tests/TestInetLayerDNS.cpp b/src/inet/tests/TestInetLayerDNS.cpp
index 281d7a2..4691e34 100644
--- a/src/inet/tests/TestInetLayerDNS.cpp
+++ b/src/inet/tests/TestInetLayerDNS.cpp
@@ -66,7 +66,7 @@
     const char * hostName;
     uint8_t dnsOptions;
     uint8_t maxResults;
-    INET_ERROR expectErr;
+    CHIP_ERROR expectErr;
     bool expectIPv4Addrs;
     bool expectIPv6Addrs;
 };
@@ -81,7 +81,7 @@
 
 static void RunTestCase(nlTestSuite * testSuite, const DNSResolutionTestCase & testCase);
 static void StartTestCase(DNSResolutionTestContext & testContext);
-static void HandleResolutionComplete(void * appState, INET_ERROR err, uint8_t addrCount, IPAddress * addrArray);
+static void HandleResolutionComplete(void * appState, CHIP_ERROR err, uint8_t addrCount, IPAddress * addrArray);
 static void ServiceNetworkUntilDone(uint32_t timeoutMS);
 static void HandleSIGUSR1(int sig);
 
@@ -100,7 +100,7 @@
             "ipv4.google.com",
             kDNSOption_Default,
             kMaxResults,
-            INET_NO_ERROR,
+            CHIP_NO_ERROR,
             true,
             false
         }
@@ -113,7 +113,7 @@
             "ipv6.google.com",
             kDNSOption_Default,
             kMaxResults,
-            INET_NO_ERROR,
+            CHIP_NO_ERROR,
             false,
             true
         }
@@ -126,7 +126,7 @@
             "google.com",
             kDNSOption_Default,
             kMaxResults,
-            INET_NO_ERROR,
+            CHIP_NO_ERROR,
             true,
             true
         }
@@ -151,7 +151,7 @@
             "google.com",
             kDNSOption_AddrFamily_IPv4Only,
             kMaxResults,
-            INET_NO_ERROR,
+            CHIP_NO_ERROR,
             true,
             false
         }
@@ -165,7 +165,7 @@
             "google.com",
             kDNSOption_AddrFamily_IPv6Only,
             kMaxResults,
-            INET_NO_ERROR,
+            CHIP_NO_ERROR,
             false,
             true
         }
@@ -179,7 +179,7 @@
             "google.com",
             kDNSOption_AddrFamily_IPv4Preferred,
             kMaxResults,
-            INET_NO_ERROR,
+            CHIP_NO_ERROR,
             true,
             true
         }
@@ -193,7 +193,7 @@
             "google.com",
             kDNSOption_AddrFamily_IPv6Preferred,
             kMaxResults,
-            INET_NO_ERROR,
+            CHIP_NO_ERROR,
             true,
             true
         }
@@ -218,7 +218,7 @@
             "google.com",
             kDNSOption_AddrFamily_IPv4Only,
             2,
-            INET_NO_ERROR,
+            CHIP_NO_ERROR,
             true,
             false
         }
@@ -232,7 +232,7 @@
             "google.com",
             kDNSOption_AddrFamily_IPv6Only,
             2,
-            INET_NO_ERROR,
+            CHIP_NO_ERROR,
             false,
             true
         }
@@ -247,7 +247,7 @@
             "google.com",
             kDNSOption_AddrFamily_IPv4Preferred,
             2,
-            INET_NO_ERROR,
+            CHIP_NO_ERROR,
             true,
             true
         }
@@ -262,7 +262,7 @@
             "google.com",
             kDNSOption_AddrFamily_IPv6Preferred,
             2,
-            INET_NO_ERROR,
+            CHIP_NO_ERROR,
             true,
             true
         }
@@ -357,7 +357,7 @@
             "216.58.194.174",
             kDNSOption_AddrFamily_Any,
             1,
-            INET_NO_ERROR,
+            CHIP_NO_ERROR,
             true,
             false
         }
@@ -369,7 +369,7 @@
             "2607:f8b0:4005:804::200e",
             kDNSOption_AddrFamily_Any,
             1,
-            INET_NO_ERROR,
+            CHIP_NO_ERROR,
             false,
             true
         }
@@ -407,7 +407,7 @@
 static void TestDNSResolution_Cancel(nlTestSuite * testSuite, void * inContext)
 {
     DNSResolutionTestContext testContext{
-        testSuite, DNSResolutionTestCase{ "www.google.com", kDNSOption_Default, kMaxResults, INET_NO_ERROR, true, false }
+        testSuite, DNSResolutionTestCase{ "www.google.com", kDNSOption_Default, kMaxResults, CHIP_NO_ERROR, true, false }
     };
 
     // Start DNS resolution.
@@ -444,7 +444,7 @@
                 "www.nest.com",
                 kDNSOption_Default,
                 kMaxResults,
-                INET_NO_ERROR,
+                CHIP_NO_ERROR,
                 true,
                 false
             }
@@ -456,7 +456,7 @@
                 "10.0.0.1",
                 kDNSOption_Default,
                 kMaxResults,
-                INET_NO_ERROR,
+                CHIP_NO_ERROR,
                 true,
                 false
             }
@@ -468,7 +468,7 @@
                 "www.google.com",
                 kDNSOption_Default,
                 kMaxResults,
-                INET_NO_ERROR,
+                CHIP_NO_ERROR,
                 true,
                 true
             }
@@ -480,7 +480,7 @@
                 "pool.ntp.org",
                 kDNSOption_Default,
                 kMaxResults,
-                INET_NO_ERROR,
+                CHIP_NO_ERROR,
                 true,
                 false
             }
@@ -523,7 +523,7 @@
 
 static void StartTestCase(DNSResolutionTestContext & testContext)
 {
-    INET_ERROR err                   = INET_NO_ERROR;
+    CHIP_ERROR err                   = CHIP_NO_ERROR;
     DNSResolutionTestCase & testCase = testContext.testCase;
     nlTestSuite * testSuite          = testContext.testSuite;
 
@@ -534,7 +534,7 @@
     err = gInet.ResolveHostAddress(testCase.hostName, strlen(testCase.hostName), testCase.dnsOptions, testCase.maxResults,
                                    testContext.resultsBuf, HandleResolutionComplete, &testContext);
 
-    if (err != INET_NO_ERROR)
+    if (err != CHIP_NO_ERROR)
     {
         printf("ResolveHostAddress failed for %s: %s\n", testCase.hostName, ::chip::ErrorStr(err));
 
@@ -552,13 +552,13 @@
     }
 }
 
-static void HandleResolutionComplete(void * appState, INET_ERROR err, uint8_t addrCount, IPAddress * addrArray)
+static void HandleResolutionComplete(void * appState, CHIP_ERROR err, uint8_t addrCount, IPAddress * addrArray)
 {
     DNSResolutionTestContext & testContext = *static_cast<DNSResolutionTestContext *>(appState);
     DNSResolutionTestCase & testCase       = testContext.testCase;
     nlTestSuite * testSuite                = testContext.testSuite;
 
-    if (err == INET_NO_ERROR)
+    if (err == CHIP_NO_ERROR)
     {
         printf("DNS resolution complete for %s: %" PRIu8 " result%s returned\n", testCase.hostName, addrCount,
                (addrCount != 1) ? "s" : "");
@@ -577,7 +577,7 @@
     // Verify the expected result.
     NL_TEST_ASSERT(testSuite, err == testCase.expectErr);
 
-    if (err == INET_NO_ERROR)
+    if (err == CHIP_NO_ERROR)
     {
         // Make sure the number of addresses is within the max expected.
         NL_TEST_ASSERT(testSuite, addrCount <= testCase.maxResults);
diff --git a/src/inet/tests/TestInetLayerMulticast.cpp b/src/inet/tests/TestInetLayerMulticast.cpp
index fa40b95..ef458af 100644
--- a/src/inet/tests/TestInetLayerMulticast.cpp
+++ b/src/inet/tests/TestInetLayerMulticast.cpp
@@ -263,7 +263,7 @@
 int main(int argc, char * argv[])
 {
     bool lSuccessful = true;
-    INET_ERROR lStatus;
+    CHIP_ERROR lStatus;
 
     InitTestInetCommon();
 
@@ -296,7 +296,7 @@
     if (gInterfaceName != nullptr)
     {
         lStatus = InterfaceNameToId(gInterfaceName, gInterfaceId);
-        if (lStatus != INET_NO_ERROR)
+        if (lStatus != CHIP_NO_ERROR)
         {
             PrintArgError("%s: unknown network interface %s\n", kToolName, gInterfaceName);
             lSuccessful = false;
@@ -665,7 +665,7 @@
     }
 }
 
-static void HandleRawReceiveError(IPEndPointBasis * aEndPoint, INET_ERROR aError, const IPPacketInfo * aPacketInfo)
+static void HandleRawReceiveError(IPEndPointBasis * aEndPoint, CHIP_ERROR aError, const IPPacketInfo * aPacketInfo)
 {
     Common::HandleRawReceiveError(aEndPoint, aError, aPacketInfo);
 
@@ -694,7 +694,7 @@
     }
 }
 
-static void HandleUDPReceiveError(IPEndPointBasis * aEndPoint, INET_ERROR aError, const IPPacketInfo * aPacketInfo)
+static void HandleUDPReceiveError(IPEndPointBasis * aEndPoint, CHIP_ERROR aError, const IPPacketInfo * aPacketInfo)
 {
     Common::HandleUDPReceiveError(aEndPoint, aError, aPacketInfo);
 
@@ -717,14 +717,14 @@
     return (lStatus);
 }
 
-static INET_ERROR PrepareTransportForSend()
+static CHIP_ERROR PrepareTransportForSend()
 {
-    INET_ERROR lStatus = INET_NO_ERROR;
+    CHIP_ERROR lStatus = CHIP_NO_ERROR;
 
     return (lStatus);
 }
 
-static INET_ERROR DriveSendForDestination(const IPAddress & aAddress, uint16_t aSize)
+static CHIP_ERROR DriveSendForDestination(const IPAddress & aAddress, uint16_t aSize)
 {
     PacketBufferHandle lBuffer;
 
@@ -738,13 +738,13 @@
         if ((gOptFlags & kOptFlagUseIPv6) == (kOptFlagUseIPv6))
         {
             lBuffer = Common::MakeICMPv6DataBuffer(aSize);
-            VerifyOrReturnError(!lBuffer.IsNull(), INET_ERROR_NO_MEMORY);
+            VerifyOrReturnError(!lBuffer.IsNull(), CHIP_ERROR_NO_MEMORY);
         }
 #if INET_CONFIG_ENABLE_IPV4
         else if ((gOptFlags & kOptFlagUseIPv4) == (kOptFlagUseIPv4))
         {
             lBuffer = Common::MakeICMPv4DataBuffer(aSize);
-            VerifyOrReturnError(!lBuffer.IsNull(), INET_ERROR_NO_MEMORY);
+            VerifyOrReturnError(!lBuffer.IsNull(), CHIP_ERROR_NO_MEMORY);
         }
 #endif // INET_CONFIG_ENABLE_IPV4
 
@@ -759,15 +759,15 @@
         // patterned from zero to aSize - 1.
 
         lBuffer = Common::MakeDataBuffer(aSize, lFirstValue);
-        VerifyOrReturnError(!lBuffer.IsNull(), INET_ERROR_NO_MEMORY);
+        VerifyOrReturnError(!lBuffer.IsNull(), CHIP_ERROR_NO_MEMORY);
 
         return sUDPIPEndPoint->SendTo(aAddress, kUDPPort, std::move(lBuffer));
     }
 
-    return INET_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
-static INET_ERROR DriveSendForGroup(GroupAddress & aGroupAddress)
+static CHIP_ERROR DriveSendForGroup(GroupAddress & aGroupAddress)
 {
     if (aGroupAddress.mStats.mTransmit.mActual < aGroupAddress.mStats.mTransmit.mExpected)
     {
@@ -779,11 +779,11 @@
                aGroupAddress.mStats.mTransmit.mExpected, aGroupAddress.mGroup);
     }
 
-    return INET_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 template <size_t tCapacity>
-static INET_ERROR DriveSendForGroups(GroupAddresses<tCapacity> & aGroupAddresses)
+static CHIP_ERROR DriveSendForGroups(GroupAddresses<tCapacity> & aGroupAddresses)
 {
     // Iterate over each multicast group for which this node is a
     // member and send a packet.
@@ -792,12 +792,12 @@
         ReturnErrorOnFailure(DriveSendForGroup(aGroupAddresses.mAddresses[i]));
     }
 
-    return INET_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 void DriveSend()
 {
-    INET_ERROR lStatus = INET_NO_ERROR;
+    CHIP_ERROR lStatus = CHIP_NO_ERROR;
 
     if (!Common::IsSender())
         goto exit;
@@ -820,7 +820,7 @@
     }
 
 exit:
-    if (lStatus != INET_NO_ERROR)
+    if (lStatus != CHIP_NO_ERROR)
     {
         SetStatusFailed(sTestState.mStatus);
     }
@@ -834,7 +834,7 @@
     IPAddress lAddress           = IPAddress::Any;
     IPEndPointBasis * lEndPoint  = nullptr;
     const bool lUseLoopback      = ((gOptFlags & kOptFlagNoLoopback) == 0);
-    INET_ERROR lStatus;
+    CHIP_ERROR lStatus;
 
 #if INET_CONFIG_ENABLE_IPV4
     if (gOptFlags & kOptFlagUseIPv4)
@@ -943,7 +943,7 @@
 static void CleanupTest()
 {
     IPEndPointBasis * lEndPoint = nullptr;
-    INET_ERROR lStatus;
+    CHIP_ERROR lStatus;
 
     gSendIntervalExpired = false;
     gSystemLayer.CancelTimer(Common::HandleSendTimerComplete, nullptr);
diff --git a/src/lib/asn1/ASN1.h b/src/lib/asn1/ASN1.h
index e6193b5..03564bf 100644
--- a/src/lib/asn1/ASN1.h
+++ b/src/lib/asn1/ASN1.h
@@ -112,19 +112,19 @@
     bool IsIndefiniteLen(void) const { return IndefiniteLen; };
     bool IsEndOfContents(void) const { return EndOfContents; };
 
-    ASN1_ERROR Next(void);
-    ASN1_ERROR EnterConstructedType(void);
-    ASN1_ERROR ExitConstructedType(void);
-    ASN1_ERROR GetConstructedType(const uint8_t *& val, uint32_t & valLen);
-    ASN1_ERROR EnterEncapsulatedType(void);
-    ASN1_ERROR ExitEncapsulatedType(void);
+    CHIP_ERROR Next(void);
+    CHIP_ERROR EnterConstructedType(void);
+    CHIP_ERROR ExitConstructedType(void);
+    CHIP_ERROR GetConstructedType(const uint8_t *& val, uint32_t & valLen);
+    CHIP_ERROR EnterEncapsulatedType(void);
+    CHIP_ERROR ExitEncapsulatedType(void);
     bool IsContained(void) const;
-    ASN1_ERROR GetInteger(int64_t & val);
-    ASN1_ERROR GetBoolean(bool & val);
-    ASN1_ERROR GetObjectId(OID & oid);
-    ASN1_ERROR GetUTCTime(ASN1UniversalTime & outTime);
-    ASN1_ERROR GetGeneralizedTime(ASN1UniversalTime & outTime);
-    ASN1_ERROR GetBitString(uint32_t & outVal);
+    CHIP_ERROR GetInteger(int64_t & val);
+    CHIP_ERROR GetBoolean(bool & val);
+    CHIP_ERROR GetObjectId(OID & oid);
+    CHIP_ERROR GetUTCTime(ASN1UniversalTime & outTime);
+    CHIP_ERROR GetGeneralizedTime(ASN1UniversalTime & outTime);
+    CHIP_ERROR GetBitString(uint32_t & outVal);
 
 private:
     static constexpr size_t kMaxContextDepth = kMaxConstructedAndEncapsulatedTypesDepth;
@@ -154,10 +154,10 @@
     ASN1ParseContext mSavedContexts[kMaxContextDepth];
     uint32_t mNumSavedContexts;
 
-    ASN1_ERROR DecodeHead(void);
+    CHIP_ERROR DecodeHead(void);
     void ResetElementState(void);
-    ASN1_ERROR EnterContainer(uint32_t offset);
-    ASN1_ERROR ExitContainer(void);
+    CHIP_ERROR EnterContainer(uint32_t offset);
+    CHIP_ERROR ExitContainer(void);
 };
 
 class DLL_EXPORT ASN1Writer
@@ -165,29 +165,29 @@
 public:
     void Init(uint8_t * buf, uint32_t maxLen);
     void InitNullWriter(void);
-    ASN1_ERROR Finalize(void);
+    CHIP_ERROR Finalize(void);
     uint16_t GetLengthWritten(void) const;
 
-    ASN1_ERROR PutInteger(int64_t val);
-    ASN1_ERROR PutBoolean(bool val);
-    ASN1_ERROR PutObjectId(const uint8_t * val, uint16_t valLen);
-    ASN1_ERROR PutObjectId(OID oid);
-    ASN1_ERROR PutString(uint32_t tag, const char * val, uint16_t valLen);
-    ASN1_ERROR PutOctetString(const uint8_t * val, uint16_t valLen);
-    ASN1_ERROR PutOctetString(uint8_t cls, uint32_t tag, const uint8_t * val, uint16_t valLen);
-    ASN1_ERROR PutOctetString(uint8_t cls, uint32_t tag, chip::TLV::TLVReader & val);
-    ASN1_ERROR PutBitString(uint32_t val);
-    ASN1_ERROR PutBitString(uint8_t unusedBits, const uint8_t * val, uint16_t valLen);
-    ASN1_ERROR PutBitString(uint8_t unusedBits, chip::TLV::TLVReader & val);
-    ASN1_ERROR PutTime(const ASN1UniversalTime & val);
-    ASN1_ERROR PutNull(void);
-    ASN1_ERROR PutConstructedType(const uint8_t * val, uint16_t valLen);
-    ASN1_ERROR StartConstructedType(uint8_t cls, uint32_t tag);
-    ASN1_ERROR EndConstructedType(void);
-    ASN1_ERROR StartEncapsulatedType(uint8_t cls, uint32_t tag, bool bitStringEncoding);
-    ASN1_ERROR EndEncapsulatedType(void);
-    ASN1_ERROR PutValue(uint8_t cls, uint32_t tag, bool isConstructed, const uint8_t * val, uint16_t valLen);
-    ASN1_ERROR PutValue(uint8_t cls, uint32_t tag, bool isConstructed, chip::TLV::TLVReader & val);
+    CHIP_ERROR PutInteger(int64_t val);
+    CHIP_ERROR PutBoolean(bool val);
+    CHIP_ERROR PutObjectId(const uint8_t * val, uint16_t valLen);
+    CHIP_ERROR PutObjectId(OID oid);
+    CHIP_ERROR PutString(uint32_t tag, const char * val, uint16_t valLen);
+    CHIP_ERROR PutOctetString(const uint8_t * val, uint16_t valLen);
+    CHIP_ERROR PutOctetString(uint8_t cls, uint32_t tag, const uint8_t * val, uint16_t valLen);
+    CHIP_ERROR PutOctetString(uint8_t cls, uint32_t tag, chip::TLV::TLVReader & val);
+    CHIP_ERROR PutBitString(uint32_t val);
+    CHIP_ERROR PutBitString(uint8_t unusedBits, const uint8_t * val, uint16_t valLen);
+    CHIP_ERROR PutBitString(uint8_t unusedBits, chip::TLV::TLVReader & val);
+    CHIP_ERROR PutTime(const ASN1UniversalTime & val);
+    CHIP_ERROR PutNull(void);
+    CHIP_ERROR PutConstructedType(const uint8_t * val, uint16_t valLen);
+    CHIP_ERROR StartConstructedType(uint8_t cls, uint32_t tag);
+    CHIP_ERROR EndConstructedType(void);
+    CHIP_ERROR StartEncapsulatedType(uint8_t cls, uint32_t tag, bool bitStringEncoding);
+    CHIP_ERROR EndEncapsulatedType(void);
+    CHIP_ERROR PutValue(uint8_t cls, uint32_t tag, bool isConstructed, const uint8_t * val, uint16_t valLen);
+    CHIP_ERROR PutValue(uint8_t cls, uint32_t tag, bool isConstructed, chip::TLV::TLVReader & val);
 
 private:
     static constexpr size_t kMaxDeferredLengthDepth = kMaxConstructedAndEncapsulatedTypesDepth;
@@ -198,8 +198,8 @@
     uint8_t * mDeferredLengthLocations[kMaxDeferredLengthDepth];
     uint8_t mDeferredLengthCount;
 
-    ASN1_ERROR EncodeHead(uint8_t cls, uint32_t tag, bool isConstructed, int32_t len);
-    ASN1_ERROR WriteDeferredLength(void);
+    CHIP_ERROR EncodeHead(uint8_t cls, uint32_t tag, bool isConstructed, int32_t len);
+    CHIP_ERROR WriteDeferredLength(void);
     static uint8_t BytesForLength(int32_t len);
     static void EncodeLength(uint8_t * buf, uint8_t bytesForLen, int32_t lenToEncode);
 };
@@ -211,7 +211,7 @@
 
 const char * GetOIDName(OID oid);
 
-ASN1_ERROR DumpASN1(ASN1Reader & reader, const char * prefix, const char * indent);
+CHIP_ERROR DumpASN1(ASN1Reader & reader, const char * prefix, const char * indent);
 
 inline OID GetOID(OIDCategory category, uint8_t id)
 {
diff --git a/src/lib/asn1/ASN1Config.h b/src/lib/asn1/ASN1Config.h
index 3c40f8c..7cfbf85 100644
--- a/src/lib/asn1/ASN1Config.h
+++ b/src/lib/asn1/ASN1Config.h
@@ -31,31 +31,6 @@
 // clang-format off
 
 /**
- *  @def ASN1_CONFIG_ERROR_TYPE
- *
- *  @brief
- *    This defines the data type used to represent errors for the ASN1
- *    subsystem.
- *
- */
-#ifndef ASN1_CONFIG_ERROR_TYPE
-#include <stdint.h>
-
-#define ASN1_CONFIG_ERROR_TYPE                              int32_t
-#endif // ASN1_CONFIG_ERROR_TYPE
-
-/**
- *  @def ASN1_CONFIG_NO_ERROR
- *
- *  @brief
- *    This defines the ASN1 error code for no error or success.
- *
- */
-#ifndef ASN1_CONFIG_NO_ERROR
-#define ASN1_CONFIG_NO_ERROR                                0
-#endif // ASN1_CONFIG_NO_ERROR
-
-/**
  *  @def ASN1_CONFIG_ERROR_MIN
  *
  *  @brief
@@ -78,15 +53,15 @@
 #endif // ASN1_CONFIG_ERROR_MAX
 
 /**
- *  @def _ASN1_CONFIG_ERROR
+ *  @def ASN1_CONFIG_ERROR
  *
  *  @brief
  *    This defines a mapping function for ASN1 errors that allows
  *    mapping such errors into a platform- or system-specific range.
  *
  */
-#ifndef _ASN1_CONFIG_ERROR
-#define _ASN1_CONFIG_ERROR(e)                               (ASN1_ERROR_MIN + (e))
-#endif // _ASN1_CONFIG_ERROR
+#ifndef ASN1_CONFIG_ERROR
+#define ASN1_CONFIG_ERROR(e)                               (ASN1_ERROR_MIN + (e))
+#endif // ASN1_CONFIG_ERROR
 
 // clang-format on
diff --git a/src/lib/asn1/ASN1Error.h b/src/lib/asn1/ASN1Error.h
index 1a5af95..1ee65de 100644
--- a/src/lib/asn1/ASN1Error.h
+++ b/src/lib/asn1/ASN1Error.h
@@ -31,22 +31,14 @@
 
 #include "ASN1Config.h"
 
+#include <core/CHIPError.h>
+
 namespace chip {
 namespace ASN1 {
 
 // clang-format off
 
 /**
- *  @def ASN1_NO_ERROR
- *
- *  @brief
- *    This defines the InetLayer error code for success or no
- *    error. This value may be configured via #ASN1_CONFIG_NO_ERROR.
- *
- */
-#define ASN1_NO_ERROR                   ASN1_CONFIG_NO_ERROR
-
-/**
  *  @def ASN1_ERROR_MIN
  *
  *  @brief
@@ -67,28 +59,20 @@
 #define ASN1_ERROR_MAX                  ASN1_CONFIG_ERROR_MAX
 
 /**
- *  @def _ASN1_ERROR(e)
+ *  @def CHIP_ASN1_ERROR(e)
  *
  *  @brief
  *    This defines a mapping function for ASN1 errors that allows
  *    mapping such errors into a platform- or system-specific
  *    range. This function may be configured via
- *    #_ASN1_CONFIG_ERROR(e).
+ *    #ASN1_CONFIG_ERROR(e).
  *
  *  @param[in]  e  The ASN1 error to map.
  *
  *  @return The mapped ASN1 error.
  *
  */
-#define _ASN1_ERROR(e)                  _ASN1_CONFIG_ERROR(e)
-
-/**
- *  The basic type for all ASN1 subsystem errors.
- *
- *  This is defined to a platform- or system-specific type.
- *
- */
-typedef ASN1_CONFIG_ERROR_TYPE ASN1_ERROR;
+#define CHIP_ASN1_ERROR(e)              ASN1_CONFIG_ERROR(e)
 
 
 /**
@@ -104,7 +88,7 @@
  *    An end of ASN1 container or stream condition occurred.
  *
  */
-#define ASN1_END                        _ASN1_ERROR(0)
+#define ASN1_END                        CHIP_ASN1_ERROR(0)
 
 /**
  *  @def ASN1_ERROR_UNDERRUN
@@ -113,7 +97,7 @@
  *    The ASN.1 encoding ended prematurely.
  *
  */
-#define ASN1_ERROR_UNDERRUN             _ASN1_ERROR(1)
+#define ASN1_ERROR_UNDERRUN             CHIP_ASN1_ERROR(1)
 
 /**
  *  @def ASN1_ERROR_OVERFLOW
@@ -122,7 +106,7 @@
  *    The encoding exceeds the available space required to write it.
  *
  */
-#define ASN1_ERROR_OVERFLOW             _ASN1_ERROR(2)
+#define ASN1_ERROR_OVERFLOW             CHIP_ASN1_ERROR(2)
 
 /**
  *  @def ASN1_ERROR_INVALID_STATE
@@ -131,7 +115,7 @@
  *    An unexpected or invalid state was encountered.
  *
  */
-#define ASN1_ERROR_INVALID_STATE        _ASN1_ERROR(3)
+#define ASN1_ERROR_INVALID_STATE        CHIP_ASN1_ERROR(3)
 
 /**
  *  @def ASN1_ERROR_MAX_DEPTH_EXCEEDED
@@ -140,7 +124,7 @@
  *    The maximum number of container reading contexts was exceeded.
  *
  */
-#define ASN1_ERROR_MAX_DEPTH_EXCEEDED   _ASN1_ERROR(4)
+#define ASN1_ERROR_MAX_DEPTH_EXCEEDED   CHIP_ASN1_ERROR(4)
 
 /**
  *  @def ASN1_ERROR_INVALID_ENCODING
@@ -149,7 +133,7 @@
  *    The ASN.1 encoding is invalid.
  *
  */
-#define ASN1_ERROR_INVALID_ENCODING     _ASN1_ERROR(5)
+#define ASN1_ERROR_INVALID_ENCODING     CHIP_ASN1_ERROR(5)
 
 /**
  *  @def ASN1_ERROR_UNSUPPORTED_ENCODING
@@ -158,7 +142,7 @@
  *    An unsupported encoding was requested or encountered.
  *
  */
-#define ASN1_ERROR_UNSUPPORTED_ENCODING _ASN1_ERROR(6)
+#define ASN1_ERROR_UNSUPPORTED_ENCODING CHIP_ASN1_ERROR(6)
 
 /**
  *  @def ASN1_ERROR_TAG_OVERFLOW
@@ -168,7 +152,7 @@
  *    for it.
  *
  */
-#define ASN1_ERROR_TAG_OVERFLOW         _ASN1_ERROR(7)
+#define ASN1_ERROR_TAG_OVERFLOW         CHIP_ASN1_ERROR(7)
 
 /**
  *  @def ASN1_ERROR_LENGTH_OVERFLOW
@@ -178,7 +162,7 @@
  *    required for it.
  *
  */
-#define ASN1_ERROR_LENGTH_OVERFLOW      _ASN1_ERROR(8)
+#define ASN1_ERROR_LENGTH_OVERFLOW      CHIP_ASN1_ERROR(8)
 
 /**
  *  @def ASN1_ERROR_VALUE_OVERFLOW
@@ -188,7 +172,7 @@
  *    required for it.
  *
  */
-#define ASN1_ERROR_VALUE_OVERFLOW       _ASN1_ERROR(9)
+#define ASN1_ERROR_VALUE_OVERFLOW       CHIP_ASN1_ERROR(9)
 
 /**
  *  @def ASN1_ERROR_UNKNOWN_OBJECT_ID
@@ -198,7 +182,7 @@
  *    supported object identifiers.
  *
  */
-#define ASN1_ERROR_UNKNOWN_OBJECT_ID    _ASN1_ERROR(10)
+#define ASN1_ERROR_UNKNOWN_OBJECT_ID    CHIP_ASN1_ERROR(10)
 
 //                        !!!!! IMPORTANT !!!!!
 //
@@ -210,6 +194,12 @@
  *  @}
  */
 
+// !!!!! IMPORTANT !!!!!
+// These definitions are present temporarily in order to reduce breakage for PRs in flight.
+// TODO: remove compatibility definitions
+#define ASN1_ERROR                              CHIP_ERROR
+#define ASN1_NO_ERROR                           CHIP_NO_ERROR
+
 // clang-format on
 
 bool FormatASN1Error(char * buf, uint16_t bufSize, int32_t err);
diff --git a/src/lib/asn1/ASN1Macros.h b/src/lib/asn1/ASN1Macros.h
index 6f4de82..795c90f 100644
--- a/src/lib/asn1/ASN1Macros.h
+++ b/src/lib/asn1/ASN1Macros.h
@@ -75,10 +75,10 @@
 
 #define ASN1_EXIT_CONSTRUCTED                                                                                                      \
     ASN1_ERR = ASN1_READER.Next();                                                                                                 \
-    if (ASN1_ERR == ASN1_NO_ERROR)                                                                                                 \
+    if (ASN1_ERR == CHIP_NO_ERROR)                                                                                                 \
         ASN1_ERR = ASN1_ERROR_INVALID_ENCODING;                                                                                    \
     else if (ASN1_ERR == ASN1_END)                                                                                                 \
-        ASN1_ERR = ASN1_NO_ERROR;                                                                                                  \
+        ASN1_ERR = CHIP_NO_ERROR;                                                                                                  \
     SuccessOrExit(ASN1_ERR);                                                                                                       \
                                                                                                                                    \
     ASN1_ERR = ASN1_READER.ExitConstructedType();                                                                                  \
@@ -119,10 +119,10 @@
 
 #define ASN1_EXIT_ENCAPSULATED                                                                                                     \
     ASN1_ERR = ASN1_READER.Next();                                                                                                 \
-    if (ASN1_ERR == ASN1_NO_ERROR)                                                                                                 \
+    if (ASN1_ERR == CHIP_NO_ERROR)                                                                                                 \
         ASN1_ERR = ASN1_ERROR_INVALID_ENCODING;                                                                                    \
     else if (ASN1_ERR == ASN1_END)                                                                                                 \
-        ASN1_ERR = ASN1_NO_ERROR;                                                                                                  \
+        ASN1_ERR = CHIP_NO_ERROR;                                                                                                  \
     SuccessOrExit(ASN1_ERR);                                                                                                       \
                                                                                                                                    \
     ASN1_ERR = ASN1_READER.ExitEncapsulatedType();                                                                                 \
diff --git a/src/lib/asn1/ASN1OID.cpp b/src/lib/asn1/ASN1OID.cpp
index e60a3c2..7040ef2 100644
--- a/src/lib/asn1/ASN1OID.cpp
+++ b/src/lib/asn1/ASN1OID.cpp
@@ -84,7 +84,7 @@
     return "Unknown";
 }
 
-ASN1_ERROR ASN1Reader::GetObjectId(OID & oid)
+CHIP_ERROR ASN1Reader::GetObjectId(OID & oid)
 {
     if (Value == nullptr)
         return ASN1_ERROR_INVALID_STATE;
@@ -93,10 +93,10 @@
     if (mElemStart + mHeadLen + ValueLen > mContainerEnd)
         return ASN1_ERROR_UNDERRUN;
     oid = ParseObjectID(Value, ValueLen);
-    return ASN1_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
-ASN1_ERROR ASN1Writer::PutObjectId(OID oid)
+CHIP_ERROR ASN1Writer::PutObjectId(OID oid)
 {
     const uint8_t * encodedOID;
     uint16_t encodedOIDLen;
diff --git a/src/lib/asn1/ASN1Reader.cpp b/src/lib/asn1/ASN1Reader.cpp
index 96d1aa9..ed6e204 100644
--- a/src/lib/asn1/ASN1Reader.cpp
+++ b/src/lib/asn1/ASN1Reader.cpp
@@ -44,7 +44,7 @@
     mNumSavedContexts = 0;
 }
 
-ASN1_ERROR ASN1Reader::Next()
+CHIP_ERROR ASN1Reader::Next()
 {
     if (EndOfContents)
         return ASN1_END;
@@ -64,7 +64,7 @@
     return DecodeHead();
 }
 
-ASN1_ERROR ASN1Reader::EnterConstructedType()
+CHIP_ERROR ASN1Reader::EnterConstructedType()
 {
     if (!Constructed)
         return ASN1_ERROR_INVALID_STATE;
@@ -72,12 +72,12 @@
     return EnterContainer(0);
 }
 
-ASN1_ERROR ASN1Reader::ExitConstructedType()
+CHIP_ERROR ASN1Reader::ExitConstructedType()
 {
     return ExitContainer();
 }
 
-ASN1_ERROR ASN1Reader::GetConstructedType(const uint8_t *& val, uint32_t & valLen)
+CHIP_ERROR ASN1Reader::GetConstructedType(const uint8_t *& val, uint32_t & valLen)
 {
     if (!Constructed)
         return ASN1_ERROR_INVALID_STATE;
@@ -85,9 +85,9 @@
     val    = mElemStart;
     valLen = mHeadLen + ValueLen;
 
-    return ASN1_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
-ASN1_ERROR ASN1Reader::EnterEncapsulatedType()
+CHIP_ERROR ASN1Reader::EnterEncapsulatedType()
 {
     if (Class != kASN1TagClass_Universal || (Tag != kASN1UniversalTag_OctetString && Tag != kASN1UniversalTag_BitString))
         return ASN1_ERROR_INVALID_STATE;
@@ -98,12 +98,12 @@
     return EnterContainer((Tag == kASN1UniversalTag_BitString) ? 1 : 0);
 }
 
-ASN1_ERROR ASN1Reader::ExitEncapsulatedType()
+CHIP_ERROR ASN1Reader::ExitEncapsulatedType()
 {
     return ExitContainer();
 }
 
-ASN1_ERROR ASN1Reader::EnterContainer(uint32_t offset)
+CHIP_ERROR ASN1Reader::EnterContainer(uint32_t offset)
 {
     if (mNumSavedContexts == kMaxContextDepth)
         return ASN1_ERROR_MAX_DEPTH_EXCEEDED;
@@ -121,10 +121,10 @@
 
     ResetElementState();
 
-    return ASN1_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
-ASN1_ERROR ASN1Reader::ExitContainer()
+CHIP_ERROR ASN1Reader::ExitContainer()
 {
     if (mNumSavedContexts == 0)
         return ASN1_ERROR_INVALID_STATE;
@@ -142,7 +142,7 @@
 
     ResetElementState();
 
-    return ASN1_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 bool ASN1Reader::IsContained() const
@@ -150,7 +150,7 @@
     return mNumSavedContexts > 0;
 }
 
-ASN1_ERROR ASN1Reader::GetInteger(int64_t & val)
+CHIP_ERROR ASN1Reader::GetInteger(int64_t & val)
 {
     if (Value == nullptr)
         return ASN1_ERROR_INVALID_STATE;
@@ -164,10 +164,10 @@
     val               = ((*p & 0x80) == 0) ? 0 : -1;
     for (uint32_t i = ValueLen; i > 0; i--, p++)
         val = (val << 8) | *p;
-    return ASN1_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
-ASN1_ERROR ASN1Reader::GetBoolean(bool & val)
+CHIP_ERROR ASN1Reader::GetBoolean(bool & val)
 {
     if (Value == nullptr)
         return ASN1_ERROR_INVALID_STATE;
@@ -181,10 +181,10 @@
         val = true;
     else
         return ASN1_ERROR_INVALID_ENCODING;
-    return ASN1_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
-ASN1_ERROR ASN1Reader::GetUTCTime(ASN1UniversalTime & outTime)
+CHIP_ERROR ASN1Reader::GetUTCTime(ASN1UniversalTime & outTime)
 {
     // Supported Encoding: YYMMDDHHMMSSZ
 
@@ -214,10 +214,10 @@
     else
         outTime.Year += 2000;
 
-    return ASN1_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
-ASN1_ERROR ASN1Reader::GetGeneralizedTime(ASN1UniversalTime & outTime)
+CHIP_ERROR ASN1Reader::GetGeneralizedTime(ASN1UniversalTime & outTime)
 {
     // Supported Encoding: YYYYMMDDHHMMSSZ
 
@@ -242,7 +242,7 @@
     outTime.Minute = (Value[10] - '0') * 10 + (Value[11] - '0');
     outTime.Second = (Value[12] - '0') * 10 + (Value[13] - '0');
 
-    return ASN1_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 static uint8_t ReverseBits(uint8_t v)
@@ -256,7 +256,7 @@
     return v;
 }
 
-ASN1_ERROR ASN1Reader::GetBitString(uint32_t & outVal)
+CHIP_ERROR ASN1Reader::GetBitString(uint32_t & outVal)
 {
     // NOTE: only supports DER encoding.
 
@@ -279,10 +279,10 @@
             outVal |= (ReverseBits(Value[i]) << shift);
     }
 
-    return ASN1_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
-ASN1_ERROR ASN1Reader::DecodeHead()
+CHIP_ERROR ASN1Reader::DecodeHead()
 {
     const uint8_t * p = mElemStart;
 
@@ -345,7 +345,7 @@
 
     Value = p;
 
-    return ASN1_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 void ASN1Reader::ResetElementState()
@@ -360,9 +360,9 @@
     mHeadLen      = 0;
 }
 
-ASN1_ERROR DumpASN1(ASN1Reader & asn1Parser, const char * prefix, const char * indent)
+CHIP_ERROR DumpASN1(ASN1Reader & asn1Parser, const char * prefix, const char * indent)
 {
-    ASN1_ERROR err = ASN1_NO_ERROR;
+    CHIP_ERROR err = CHIP_NO_ERROR;
 
     if (indent == nullptr)
         indent = "  ";
@@ -371,14 +371,14 @@
     while (true)
     {
         err = asn1Parser.Next();
-        if (err != ASN1_NO_ERROR)
+        if (err != CHIP_NO_ERROR)
         {
             if (err == ASN1_END)
             {
                 if (asn1Parser.IsContained())
                 {
                     err = asn1Parser.ExitConstructedType();
-                    if (err != ASN1_NO_ERROR)
+                    if (err != CHIP_NO_ERROR)
                     {
                         printf("ASN1Reader::ExitConstructedType() failed: %ld\n", (long) err);
                         return err;
@@ -475,7 +475,7 @@
         if (asn1Parser.IsConstructed())
         {
             err = asn1Parser.EnterConstructedType();
-            if (err != ASN1_NO_ERROR)
+            if (err != CHIP_NO_ERROR)
             {
                 printf("ASN1Reader::EnterConstructedType() failed: %ld\n", (long) err);
                 return err;
diff --git a/src/lib/asn1/ASN1Writer.cpp b/src/lib/asn1/ASN1Writer.cpp
index 75f421b..b9c7f8f 100644
--- a/src/lib/asn1/ASN1Writer.cpp
+++ b/src/lib/asn1/ASN1Writer.cpp
@@ -68,10 +68,10 @@
     mDeferredLengthCount = 0;
 }
 
-ASN1_ERROR ASN1Writer::Finalize()
+CHIP_ERROR ASN1Writer::Finalize()
 {
     // TODO: This method is not required and can be deprecated.
-    return ASN1_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 uint16_t ASN1Writer::GetLengthWritten() const
@@ -79,7 +79,7 @@
     return (mBuf != nullptr) ? mWritePoint - mBuf : 0;
 }
 
-ASN1_ERROR ASN1Writer::PutInteger(int64_t val)
+CHIP_ERROR ASN1Writer::PutInteger(int64_t val)
 {
     uint8_t encodedVal[8];
     uint8_t valStart, valLen;
@@ -99,39 +99,39 @@
     return PutValue(kASN1TagClass_Universal, kASN1UniversalTag_Integer, false, encodedVal + valStart, valLen);
 }
 
-ASN1_ERROR ASN1Writer::PutBoolean(bool val)
+CHIP_ERROR ASN1Writer::PutBoolean(bool val)
 {
     // Do nothing for a null writer.
-    VerifyOrReturnError(mBuf != nullptr, ASN1_NO_ERROR);
+    VerifyOrReturnError(mBuf != nullptr, CHIP_NO_ERROR);
 
     ReturnErrorOnFailure(EncodeHead(kASN1TagClass_Universal, kASN1UniversalTag_Boolean, false, 1));
 
     *mWritePoint++ = (val) ? 0xFF : 0;
 
-    return ASN1_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
-ASN1_ERROR ASN1Writer::PutObjectId(const uint8_t * val, uint16_t valLen)
+CHIP_ERROR ASN1Writer::PutObjectId(const uint8_t * val, uint16_t valLen)
 {
     return PutValue(kASN1TagClass_Universal, kASN1UniversalTag_ObjectId, false, val, valLen);
 }
 
-ASN1_ERROR ASN1Writer::PutString(uint32_t tag, const char * val, uint16_t valLen)
+CHIP_ERROR ASN1Writer::PutString(uint32_t tag, const char * val, uint16_t valLen)
 {
     return PutValue(kASN1TagClass_Universal, tag, false, (const uint8_t *) val, valLen);
 }
 
-ASN1_ERROR ASN1Writer::PutOctetString(const uint8_t * val, uint16_t valLen)
+CHIP_ERROR ASN1Writer::PutOctetString(const uint8_t * val, uint16_t valLen)
 {
     return PutValue(kASN1TagClass_Universal, kASN1UniversalTag_OctetString, false, val, valLen);
 }
 
-ASN1_ERROR ASN1Writer::PutOctetString(uint8_t cls, uint32_t tag, const uint8_t * val, uint16_t valLen)
+CHIP_ERROR ASN1Writer::PutOctetString(uint8_t cls, uint32_t tag, const uint8_t * val, uint16_t valLen)
 {
     return PutValue(cls, tag, false, val, valLen);
 }
 
-ASN1_ERROR ASN1Writer::PutOctetString(uint8_t cls, uint32_t tag, chip::TLV::TLVReader & val)
+CHIP_ERROR ASN1Writer::PutOctetString(uint8_t cls, uint32_t tag, chip::TLV::TLVReader & val)
 {
     return PutValue(cls, tag, false, val);
 }
@@ -176,12 +176,12 @@
     return highestBit;
 }
 
-ASN1_ERROR ASN1Writer::PutBitString(uint32_t val)
+CHIP_ERROR ASN1Writer::PutBitString(uint32_t val)
 {
     uint8_t len;
 
     // Do nothing for a null writer.
-    VerifyOrReturnError(mBuf != nullptr, ASN1_NO_ERROR);
+    VerifyOrReturnError(mBuf != nullptr, CHIP_NO_ERROR);
 
     if (val == 0)
         len = 1;
@@ -223,13 +223,13 @@
 
     mWritePoint += len;
 
-    return ASN1_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
-ASN1_ERROR ASN1Writer::PutBitString(uint8_t unusedBitCount, const uint8_t * encodedBits, uint16_t encodedBitsLen)
+CHIP_ERROR ASN1Writer::PutBitString(uint8_t unusedBitCount, const uint8_t * encodedBits, uint16_t encodedBitsLen)
 {
     // Do nothing for a null writer.
-    VerifyOrReturnError(mBuf != nullptr, ASN1_NO_ERROR);
+    VerifyOrReturnError(mBuf != nullptr, CHIP_NO_ERROR);
 
     ReturnErrorOnFailure(EncodeHead(kASN1TagClass_Universal, kASN1UniversalTag_BitString, false, encodedBitsLen + 1));
 
@@ -238,15 +238,15 @@
     memcpy(mWritePoint, encodedBits, encodedBitsLen);
     mWritePoint += encodedBitsLen;
 
-    return ASN1_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
-ASN1_ERROR ASN1Writer::PutBitString(uint8_t unusedBitCount, chip::TLV::TLVReader & encodedBits)
+CHIP_ERROR ASN1Writer::PutBitString(uint8_t unusedBitCount, chip::TLV::TLVReader & encodedBits)
 {
     uint32_t encodedBitsLen;
 
     // Do nothing for a null writer.
-    VerifyOrReturnError(mBuf != nullptr, ASN1_NO_ERROR);
+    VerifyOrReturnError(mBuf != nullptr, CHIP_NO_ERROR);
 
     encodedBitsLen = encodedBits.GetLength();
 
@@ -257,7 +257,7 @@
     encodedBits.GetBytes(mWritePoint, encodedBitsLen);
     mWritePoint += encodedBitsLen;
 
-    return ASN1_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 static void itoa2(uint32_t val, uint8_t * buf)
@@ -267,7 +267,7 @@
     buf[0] = '0' + (val % 10);
 }
 
-ASN1_ERROR ASN1Writer::PutTime(const ASN1UniversalTime & val)
+CHIP_ERROR ASN1Writer::PutTime(const ASN1UniversalTime & val)
 {
     uint8_t buf[15];
 
@@ -291,36 +291,36 @@
         return PutValue(kASN1TagClass_Universal, kASN1UniversalTag_UTCTime, false, buf + 2, 13);
 }
 
-ASN1_ERROR ASN1Writer::PutNull()
+CHIP_ERROR ASN1Writer::PutNull()
 {
     return EncodeHead(kASN1TagClass_Universal, kASN1UniversalTag_Null, false, 0);
 }
 
-ASN1_ERROR ASN1Writer::PutConstructedType(const uint8_t * val, uint16_t valLen)
+CHIP_ERROR ASN1Writer::PutConstructedType(const uint8_t * val, uint16_t valLen)
 {
     // Do nothing for a null writer.
-    VerifyOrReturnError(mBuf != nullptr, ASN1_NO_ERROR);
+    VerifyOrReturnError(mBuf != nullptr, CHIP_NO_ERROR);
 
     memcpy(mWritePoint, val, valLen);
     mWritePoint += valLen;
 
-    return ASN1_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
-ASN1_ERROR ASN1Writer::StartConstructedType(uint8_t cls, uint32_t tag)
+CHIP_ERROR ASN1Writer::StartConstructedType(uint8_t cls, uint32_t tag)
 {
     return EncodeHead(cls, tag, true, kUnknownLength);
 }
 
-ASN1_ERROR ASN1Writer::EndConstructedType()
+CHIP_ERROR ASN1Writer::EndConstructedType()
 {
     return WriteDeferredLength();
 }
 
-ASN1_ERROR ASN1Writer::StartEncapsulatedType(uint8_t cls, uint32_t tag, bool bitStringEncoding)
+CHIP_ERROR ASN1Writer::StartEncapsulatedType(uint8_t cls, uint32_t tag, bool bitStringEncoding)
 {
     // Do nothing for a null writer.
-    VerifyOrReturnError(mBuf != nullptr, ASN1_NO_ERROR);
+    VerifyOrReturnError(mBuf != nullptr, CHIP_NO_ERROR);
 
     ReturnErrorOnFailure(EncodeHead(cls, tag, false, kUnknownLength));
 
@@ -333,33 +333,33 @@
         *mWritePoint++ = 0;
     }
 
-    return ASN1_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
-ASN1_ERROR ASN1Writer::EndEncapsulatedType()
+CHIP_ERROR ASN1Writer::EndEncapsulatedType()
 {
     return WriteDeferredLength();
 }
 
-ASN1_ERROR ASN1Writer::PutValue(uint8_t cls, uint32_t tag, bool isConstructed, const uint8_t * val, uint16_t valLen)
+CHIP_ERROR ASN1Writer::PutValue(uint8_t cls, uint32_t tag, bool isConstructed, const uint8_t * val, uint16_t valLen)
 {
     // Do nothing for a null writer.
-    VerifyOrReturnError(mBuf != nullptr, ASN1_NO_ERROR);
+    VerifyOrReturnError(mBuf != nullptr, CHIP_NO_ERROR);
 
     ReturnErrorOnFailure(EncodeHead(cls, tag, isConstructed, valLen));
 
     memcpy(mWritePoint, val, valLen);
     mWritePoint += valLen;
 
-    return ASN1_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
-ASN1_ERROR ASN1Writer::PutValue(uint8_t cls, uint32_t tag, bool isConstructed, chip::TLV::TLVReader & val)
+CHIP_ERROR ASN1Writer::PutValue(uint8_t cls, uint32_t tag, bool isConstructed, chip::TLV::TLVReader & val)
 {
     uint32_t valLen;
 
     // Do nothing for a null writer.
-    VerifyOrReturnError(mBuf != nullptr, ASN1_NO_ERROR);
+    VerifyOrReturnError(mBuf != nullptr, CHIP_NO_ERROR);
 
     valLen = val.GetLength();
 
@@ -368,16 +368,16 @@
     val.GetBytes(mWritePoint, valLen);
     mWritePoint += valLen;
 
-    return ASN1_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
-ASN1_ERROR ASN1Writer::EncodeHead(uint8_t cls, uint32_t tag, bool isConstructed, int32_t len)
+CHIP_ERROR ASN1Writer::EncodeHead(uint8_t cls, uint32_t tag, bool isConstructed, int32_t len)
 {
     uint8_t bytesForLen;
     uint32_t totalLen;
 
     // Do nothing for a null writer.
-    VerifyOrReturnError(mBuf != nullptr, ASN1_NO_ERROR);
+    VerifyOrReturnError(mBuf != nullptr, CHIP_NO_ERROR);
 
     // Only tags <= 31 supported. The implication of this is that encoded tags are exactly 1 byte long.
     VerifyOrReturnError(tag <= 0x1F, ASN1_ERROR_UNSUPPORTED_ENCODING);
@@ -418,13 +418,13 @@
 
     mWritePoint += bytesForLen;
 
-    return ASN1_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
-ASN1_ERROR ASN1Writer::WriteDeferredLength()
+CHIP_ERROR ASN1Writer::WriteDeferredLength()
 {
     // Do nothing for a null writer.
-    VerifyOrReturnError(mBuf != nullptr, ASN1_NO_ERROR);
+    VerifyOrReturnError(mBuf != nullptr, CHIP_NO_ERROR);
 
     VerifyOrReturnError(mDeferredLengthCount > 0, ASN1_ERROR_INVALID_STATE);
 
@@ -456,7 +456,7 @@
 
     mDeferredLengthCount--;
 
-    return ASN1_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 /**
diff --git a/src/lib/asn1/tests/TestASN1.cpp b/src/lib/asn1/tests/TestASN1.cpp
index 9d98d61..379d80c 100644
--- a/src/lib/asn1/tests/TestASN1.cpp
+++ b/src/lib/asn1/tests/TestASN1.cpp
@@ -90,9 +90,9 @@
     0x65, 0x6E, 0x65, 0x64, 0x69, 0x67, 0x04, 0x0D, 0x30, 0x0B, 0x06, 0x03, 0x55, 0x04, 0x03, 0x03, 0x04, 0x00, 0x02, 0x01, 0x2A
 };
 
-static ASN1_ERROR EncodeASN1TestData(ASN1Writer & writer)
+static CHIP_ERROR EncodeASN1TestData(ASN1Writer & writer)
 {
-    ASN1_ERROR err = ASN1_NO_ERROR;
+    CHIP_ERROR err = CHIP_NO_ERROR;
 
     ASN1_START_SEQUENCE
     {
@@ -155,7 +155,7 @@
 
 static void TestASN1_Encode(nlTestSuite * inSuite, void * inContext)
 {
-    ASN1_ERROR err;
+    CHIP_ERROR err;
     uint8_t buf[2048];
     ASN1Writer writer;
     uint16_t encodedLen;
@@ -163,10 +163,10 @@
     writer.Init(buf, sizeof(buf));
 
     err = EncodeASN1TestData(writer);
-    NL_TEST_ASSERT(inSuite, err == ASN1_NO_ERROR);
+    NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR);
 
     err = writer.Finalize();
-    NL_TEST_ASSERT(inSuite, err == ASN1_NO_ERROR);
+    NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR);
 
     encodedLen = writer.GetLengthWritten();
     NL_TEST_ASSERT(inSuite, encodedLen == sizeof(TestASN1_EncodedData));
@@ -186,7 +186,7 @@
 
 static void TestASN1_Decode(nlTestSuite * inSuite, void * inContext)
 {
-    ASN1_ERROR err = ASN1_NO_ERROR;
+    CHIP_ERROR err = CHIP_NO_ERROR;
     ASN1Reader reader;
     bool boolVal;
     uint32_t bitStringVal;
@@ -285,22 +285,22 @@
     ASN1_EXIT_SEQUENCE;
 
 exit:
-    NL_TEST_ASSERT(inSuite, err == ASN1_NO_ERROR);
+    NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR);
 }
 
 static void TestASN1_NullWriter(nlTestSuite * inSuite, void * inContext)
 {
-    ASN1_ERROR err;
+    CHIP_ERROR err;
     ASN1Writer writer;
     uint16_t encodedLen;
 
     writer.InitNullWriter();
 
     err = EncodeASN1TestData(writer);
-    NL_TEST_ASSERT(inSuite, err == ASN1_NO_ERROR);
+    NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR);
 
     err = writer.Finalize();
-    NL_TEST_ASSERT(inSuite, err == ASN1_NO_ERROR);
+    NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR);
 
     encodedLen = writer.GetLengthWritten();
     NL_TEST_ASSERT(inSuite, encodedLen == 0);
@@ -308,7 +308,7 @@
 
 static void TestASN1_ObjectID(nlTestSuite * inSuite, void * inContext)
 {
-    ASN1_ERROR err;
+    CHIP_ERROR err;
     uint8_t buf[2048];
     ASN1Writer writer;
     ASN1Reader reader;
@@ -328,7 +328,7 @@
     ASN1_END_SEQUENCE;
 
     err = writer.Finalize();
-    NL_TEST_ASSERT(inSuite, err == ASN1_NO_ERROR);
+    NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR);
 
     encodedLen = writer.GetLengthWritten();
     NL_TEST_ASSERT(inSuite, encodedLen > 0);
@@ -370,7 +370,7 @@
     ASN1_EXIT_SEQUENCE;
 
 exit:
-    NL_TEST_ASSERT(inSuite, err == ASN1_NO_ERROR);
+    NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR);
 }
 
 /**
diff --git a/src/lib/core/CHIPConfig.h b/src/lib/core/CHIPConfig.h
index 387bc4b..2c166d4 100644
--- a/src/lib/core/CHIPConfig.h
+++ b/src/lib/core/CHIPConfig.h
@@ -53,7 +53,7 @@
  *
  * An application or module that incorporates chip can define a project configuration
  * file to override standard chip configuration with application-specific values.
- * The chipProjectConfig.h file is typically located outside the Openchip source tree,
+ * The chipProjectConfig.h file is typically located outside the CHIP source tree,
  * alongside the source code for the application.
  */
 #ifdef CHIP_PROJECT_CONFIG_INCLUDE
@@ -64,8 +64,8 @@
  *
  * A platform configuration file contains overrides to standard chip configuration
  * that are specific to the platform or OS on which chip is running.  It is typically
- * provided as apart of an adaptation layer that adapts Openchip to the target
- * environment.  This adaptation layer may be included in the Openchip source tree
+ * provided as apart of an adaptation layer that adapts CHIP to the target
+ * environment.  This adaptation layer may be included in the CHIP source tree
  * itself or implemented externally.
  */
 #ifdef CHIP_PLATFORM_CONFIG_INCLUDE
@@ -73,6 +73,7 @@
 #endif
 
 // Profile-specific Configuration Headers
+
 /**
  *  @def CHIP_CONFIG_ERROR_TYPE
  *
@@ -81,55 +82,46 @@
  *
  */
 #ifndef CHIP_CONFIG_ERROR_TYPE
+#include <inttypes.h>
 #include <stdint.h>
 
 #define CHIP_CONFIG_ERROR_TYPE int32_t
+#define CHIP_CONFIG_ERROR_FORMAT PRId32
 #endif // CHIP_CONFIG_ERROR_TYPE
 
 /**
- *  @def CHIP_CONFIG_NO_ERROR
- *
- *  @brief
- *    This defines the chip error code for no error or success.
- *
- */
-#ifndef CHIP_CONFIG_NO_ERROR
-#define CHIP_CONFIG_NO_ERROR 0
-#endif // CHIP_CONFIG_NO_ERROR
-
-/**
- *  @def CHIP_CONFIG_ERROR_MIN
+ *  @def CHIP_CONFIG_CORE_ERROR_MIN
  *
  *  @brief
  *    This defines the base or minimum chip error number range.
  *
  */
-#ifndef CHIP_CONFIG_ERROR_MIN
-#define CHIP_CONFIG_ERROR_MIN 4000
-#endif // CHIP_CONFIG_ERROR_MIN
+#ifndef CHIP_CONFIG_CORE_ERROR_MIN
+#define CHIP_CONFIG_CORE_ERROR_MIN 4000
+#endif // CHIP_CONFIG_CORE_ERROR_MIN
 
 /**
- *  @def CHIP_CONFIG_ERROR_MAX
+ *  @def CHIP_CONFIG_CORE_ERROR_MAX
  *
  *  @brief
  *    This defines the top or maximum chip error number range.
  *
  */
-#ifndef CHIP_CONFIG_ERROR_MAX
-#define CHIP_CONFIG_ERROR_MAX 4999
-#endif // CHIP_CONFIG_ERROR_MAX
+#ifndef CHIP_CONFIG_CORE_ERROR_MAX
+#define CHIP_CONFIG_CORE_ERROR_MAX 4999
+#endif // CHIP_CONFIG_CORE_ERROR_MAX
 
 /**
- *  @def _CHIP_CONFIG_ERROR
+ *  @def CHIP_CONFIG_CORE_ERROR
  *
  *  @brief
  *    This defines a mapping function for chip errors that allows
  *    mapping such errors into a platform- or system-specific manner.
  *
  */
-#ifndef _CHIP_CONFIG_ERROR
-#define _CHIP_CONFIG_ERROR(e) (CHIP_ERROR_MIN + (e))
-#endif // _CHIP_CONFIG_ERROR
+#ifndef CHIP_CONFIG_CORE_ERROR
+#define CHIP_CONFIG_CORE_ERROR(e) (CHIP_CONFIG_CORE_ERROR_MIN + (e))
+#endif // CHIP_CONFIG_CORE_ERROR
 
 /**
  *  @def CHIP_CONFIG_USE_OPENSSL_ECC
diff --git a/src/lib/core/CHIPError.cpp b/src/lib/core/CHIPError.cpp
index ca77b50..cad220a 100644
--- a/src/lib/core/CHIPError.cpp
+++ b/src/lib/core/CHIPError.cpp
@@ -50,11 +50,11 @@
  * @return false                    If the supplied error was not a CHIP error.
  *
  */
-bool FormatCHIPError(char * buf, uint16_t bufSize, int32_t err)
+bool FormatCHIPError(char * buf, uint16_t bufSize, CHIP_ERROR err)
 {
     const char * desc = nullptr;
 
-    if (err < CHIP_ERROR_MIN || err > CHIP_ERROR_MAX)
+    if (err < CHIP_CONFIG_CORE_ERROR_MIN || err > CHIP_CONFIG_CORE_ERROR_MAX)
     {
         return false;
     }
@@ -92,6 +92,9 @@
     case CHIP_ERROR_TOO_MANY_PEER_NODES:
         desc = "Too many peer nodes";
         break;
+    case CHIP_ERROR_SENTINEL:
+        desc = "Internal sentinel";
+        break;
     case CHIP_ERROR_NO_MEMORY:
         desc = "No memory";
         break;
@@ -618,6 +621,30 @@
     case CHIP_ERROR_PEER_NODE_NOT_FOUND:
         desc = "Unable to find the peer node";
         break;
+    case CHIP_ERROR_HSM:
+        desc = "Hardware security module";
+        break;
+    case CHIP_ERROR_INTERMEDIATE_CA_NOT_REQUIRED:
+        desc = "Intermediate CA not required";
+        break;
+    case CHIP_ERROR_REAL_TIME_NOT_SYNCED:
+        desc = "Real time not synchronized";
+        break;
+    case CHIP_ERROR_UNEXPECTED_EVENT:
+        desc = "Unexpected event";
+        break;
+    case CHIP_ERROR_ENDPOINT_POOL_FULL:
+        desc = "Endpoint pool full";
+        break;
+    case CHIP_ERROR_INBOUND_MESSAGE_TOO_BIG:
+        desc = "Inbound message too big";
+        break;
+    case CHIP_ERROR_OUTBOUND_MESSAGE_TOO_BIG:
+        desc = "Outbound message too big";
+        break;
+    case CHIP_ERROR_DUPLICATE_MESSAGE_RECEIVED:
+        desc = "Duplicate message received";
+        break;
     }
 #endif // !CHIP_CONFIG_SHORT_ERROR_STR
 
diff --git a/src/lib/core/CHIPError.h b/src/lib/core/CHIPError.h
index 849cfb1..6f50a7e 100644
--- a/src/lib/core/CHIPError.h
+++ b/src/lib/core/CHIPError.h
@@ -32,55 +32,12 @@
 #pragma once
 
 #include <core/CHIPConfig.h>
+
+#include <stdint.h>
+
 // clang-format off
 
 /**
- *  @def CHIP_NO_ERROR
- *
- *  @brief
- *    This defines the CHIP error code for success or no error.
- *    This value may be configured via #CHIP_CONFIG_NO_ERROR."
- *
- */
-#define CHIP_NO_ERROR                                          CHIP_CONFIG_NO_ERROR
-
-/**
- *  @def CHIP_ERROR_MIN
- *
- *  @brief
- *    This defines the bottom or minimum CHIP error number range.
- *    This value may be configured via #CHIP_CONFIG_ERROR_MIN.
- *
- */
-#define CHIP_ERROR_MIN                                         CHIP_CONFIG_ERROR_MIN
-
-/**
- *  @def CHIP_ERROR_MAX
- *
- *  @brief
- *    This defines the top or maximum CHIP error number range.
- *    This value may be configured via #CHIP_CONFIG_ERROR_MAX.
- *
- */
-#define CHIP_ERROR_MAX                                         CHIP_CONFIG_ERROR_MAX
-
-/**
- *  @def _CHIP_ERROR(e)
- *
- *  @brief
- *    This defines a mapping function for CHIP errors that allows
- *    mapping such errors into a platform- or system-specific range.
- *    This function may be configured via #_CHIP_CONFIG_ERROR(e).
- *
- *  @param[in] e       The CHIP error to map.
- *
- *  @return    The mapped CHIP error.
- *
- *
- */
-#define _CHIP_ERROR(e)                                         _CHIP_CONFIG_ERROR(e)
-
-/**
  *  The basic type for all CHIP errors.
  *
  *  @brief
@@ -89,6 +46,31 @@
  */
 typedef CHIP_CONFIG_ERROR_TYPE CHIP_ERROR;
 
+#define CHIP_ERROR_FORMAT   CHIP_CONFIG_ERROR_FORMAT
+
+/**
+ *  @def CHIP_NO_ERROR
+ *
+ *  @brief
+ *    This defines the CHIP error code for success or no error.
+ *
+ */
+#define CHIP_NO_ERROR                                          0
+
+/**
+ *  @def CHIP_CORE_ERROR(e)
+ *
+ *  @brief
+ *    This defines a mapping function for CHIP errors that allows
+ *    mapping such errors into a platform- or system-specific range.
+ *    This function may be configured via #CHIP_CONFIG_CORE_ERROR(e).
+ *
+ *  @param[in] e       The CHIP error to map.
+ *
+ *  @return    The mapped CHIP error.
+ */
+#define CHIP_CORE_ERROR(e)                                     CHIP_CONFIG_CORE_ERROR(e)
+
 /**
  *  @name Error Definitions
  *
@@ -103,7 +85,7 @@
  *    connections exist.
  *
  */
-#define CHIP_ERROR_TOO_MANY_CONNECTIONS                        _CHIP_ERROR(0)
+#define CHIP_ERROR_TOO_MANY_CONNECTIONS                        CHIP_CORE_ERROR(0)
 
 /**
  *  @def CHIP_ERROR_SENDING_BLOCKED
@@ -112,7 +94,7 @@
  *    A message exceeds the sent limit.
  *
  */
-#define CHIP_ERROR_SENDING_BLOCKED                             _CHIP_ERROR(1)
+#define CHIP_ERROR_SENDING_BLOCKED                             CHIP_CORE_ERROR(1)
 
 /**
  *  @def CHIP_ERROR_CONNECTION_ABORTED
@@ -121,7 +103,7 @@
  *    A connection has been aborted.
  *
  */
-#define CHIP_ERROR_CONNECTION_ABORTED                          _CHIP_ERROR(2)
+#define CHIP_ERROR_CONNECTION_ABORTED                          CHIP_CORE_ERROR(2)
 
 /**
  *  @def CHIP_ERROR_INCORRECT_STATE
@@ -130,7 +112,7 @@
  *    An unexpected state was encountered.
  *
  */
-#define CHIP_ERROR_INCORRECT_STATE                             _CHIP_ERROR(3)
+#define CHIP_ERROR_INCORRECT_STATE                             CHIP_CORE_ERROR(3)
 
 /**
  *  @def CHIP_ERROR_MESSAGE_TOO_LONG
@@ -139,7 +121,7 @@
  *    A message is too long.
  *
  */
-#define CHIP_ERROR_MESSAGE_TOO_LONG                            _CHIP_ERROR(4)
+#define CHIP_ERROR_MESSAGE_TOO_LONG                            CHIP_CORE_ERROR(4)
 
 /**
  *  @def CHIP_ERROR_UNSUPPORTED_EXCHANGE_VERSION
@@ -148,7 +130,7 @@
  *    An exchange version is not supported.
  *
  */
-#define CHIP_ERROR_UNSUPPORTED_EXCHANGE_VERSION                _CHIP_ERROR(5)
+#define CHIP_ERROR_UNSUPPORTED_EXCHANGE_VERSION                CHIP_CORE_ERROR(5)
 
 /**
  *  @def CHIP_ERROR_TOO_MANY_UNSOLICITED_MESSAGE_HANDLERS
@@ -158,7 +140,7 @@
  *    unsolicited message handler pool is full.
  *
  */
-#define CHIP_ERROR_TOO_MANY_UNSOLICITED_MESSAGE_HANDLERS       _CHIP_ERROR(6)
+#define CHIP_ERROR_TOO_MANY_UNSOLICITED_MESSAGE_HANDLERS       CHIP_CORE_ERROR(6)
 
 /**
  *  @def CHIP_ERROR_NO_UNSOLICITED_MESSAGE_HANDLER
@@ -168,7 +150,7 @@
  *    the target handler was not found in the unsolicited message handler pool.
  *
  */
-#define CHIP_ERROR_NO_UNSOLICITED_MESSAGE_HANDLER              _CHIP_ERROR(7)
+#define CHIP_ERROR_NO_UNSOLICITED_MESSAGE_HANDLER              CHIP_CORE_ERROR(7)
 
 /**
  *  @def CHIP_ERROR_NO_CONNECTION_HANDLER
@@ -177,7 +159,7 @@
  *    No callback has been registered for handling a connection.
  *
  */
-#define CHIP_ERROR_NO_CONNECTION_HANDLER                       _CHIP_ERROR(8)
+#define CHIP_ERROR_NO_CONNECTION_HANDLER                       CHIP_CORE_ERROR(8)
 
 /**
  *  @def CHIP_ERROR_TOO_MANY_PEER_NODES
@@ -186,7 +168,16 @@
  *    The number of peer nodes exceeds the maximum limit of a local node.
  *
  */
-#define CHIP_ERROR_TOO_MANY_PEER_NODES                         _CHIP_ERROR(9)
+#define CHIP_ERROR_TOO_MANY_PEER_NODES                         CHIP_CORE_ERROR(9)
+
+/**
+ *  @def CHIP_ERROR_SENTINEL
+ *
+ *  @brief
+ *    For use locally to mark conditions such as value found or end of iteration.
+ *
+ */
+#define CHIP_ERROR_SENTINEL                                    CHIP_CORE_ERROR(10)
 
 /**
  *  @def CHIP_ERROR_NO_MEMORY
@@ -195,7 +186,7 @@
  *    The attempt to allocate a buffer or object failed due to a lack of memory.
  *
  */
-#define CHIP_ERROR_NO_MEMORY                                   _CHIP_ERROR(11)
+#define CHIP_ERROR_NO_MEMORY                                   CHIP_CORE_ERROR(11)
 
 /**
  *  @def CHIP_ERROR_NO_MESSAGE_HANDLER
@@ -204,7 +195,7 @@
  *    No callback has been registered for handling a message.
  *
  */
-#define CHIP_ERROR_NO_MESSAGE_HANDLER                          _CHIP_ERROR(12)
+#define CHIP_ERROR_NO_MESSAGE_HANDLER                          CHIP_CORE_ERROR(12)
 
 /**
  *  @def CHIP_ERROR_MESSAGE_INCOMPLETE
@@ -213,7 +204,7 @@
  *    A message is incomplete.
  *
  */
-#define CHIP_ERROR_MESSAGE_INCOMPLETE                          _CHIP_ERROR(13)
+#define CHIP_ERROR_MESSAGE_INCOMPLETE                          CHIP_CORE_ERROR(13)
 
 /**
  *  @def CHIP_ERROR_DATA_NOT_ALIGNED
@@ -222,7 +213,7 @@
  *    The data is not aligned.
  *
  */
-#define CHIP_ERROR_DATA_NOT_ALIGNED                            _CHIP_ERROR(14)
+#define CHIP_ERROR_DATA_NOT_ALIGNED                            CHIP_CORE_ERROR(14)
 
 /**
  *  @def CHIP_ERROR_UNKNOWN_KEY_TYPE
@@ -231,7 +222,7 @@
  *    The encryption key type is unknown.
  *
  */
-#define CHIP_ERROR_UNKNOWN_KEY_TYPE                            _CHIP_ERROR(15)
+#define CHIP_ERROR_UNKNOWN_KEY_TYPE                            CHIP_CORE_ERROR(15)
 
 /**
  *  @def CHIP_ERROR_KEY_NOT_FOUND
@@ -240,7 +231,7 @@
  *    The encryption key is not found.
  *
  */
-#define CHIP_ERROR_KEY_NOT_FOUND                               _CHIP_ERROR(16)
+#define CHIP_ERROR_KEY_NOT_FOUND                               CHIP_CORE_ERROR(16)
 
 /**
  *  @def CHIP_ERROR_WRONG_ENCRYPTION_TYPE
@@ -249,7 +240,7 @@
  *    The encryption type is incorrect for the specified key.
  *
  */
-#define CHIP_ERROR_WRONG_ENCRYPTION_TYPE                       _CHIP_ERROR(17)
+#define CHIP_ERROR_WRONG_ENCRYPTION_TYPE                       CHIP_CORE_ERROR(17)
 
 /**
  *  @def CHIP_ERROR_TOO_MANY_KEYS
@@ -259,7 +250,7 @@
  *    exceeds the maximum limit.
  *
  */
-#define CHIP_ERROR_TOO_MANY_KEYS                               _CHIP_ERROR(18)
+#define CHIP_ERROR_TOO_MANY_KEYS                               CHIP_CORE_ERROR(18)
 
 /**
  *  @def CHIP_ERROR_INTEGRITY_CHECK_FAILED
@@ -269,7 +260,7 @@
  *    check.
  *
  */
-#define CHIP_ERROR_INTEGRITY_CHECK_FAILED                      _CHIP_ERROR(19)
+#define CHIP_ERROR_INTEGRITY_CHECK_FAILED                      CHIP_CORE_ERROR(19)
 
 /**
  *  @def CHIP_ERROR_INVALID_SIGNATURE
@@ -278,7 +269,7 @@
  *    Invalid signature.
  *
  */
-#define CHIP_ERROR_INVALID_SIGNATURE                           _CHIP_ERROR(20)
+#define CHIP_ERROR_INVALID_SIGNATURE                           CHIP_CORE_ERROR(20)
 
 /**
  *  @def CHIP_ERROR_UNSUPPORTED_MESSAGE_VERSION
@@ -287,7 +278,7 @@
  *    A message version is unsupported.
  *
  */
-#define CHIP_ERROR_UNSUPPORTED_MESSAGE_VERSION                 _CHIP_ERROR(21)
+#define CHIP_ERROR_UNSUPPORTED_MESSAGE_VERSION                 CHIP_CORE_ERROR(21)
 
 /**
  *  @def CHIP_ERROR_UNSUPPORTED_ENCRYPTION_TYPE
@@ -296,7 +287,7 @@
  *    An encryption type is unsupported.
  *
  */
-#define CHIP_ERROR_UNSUPPORTED_ENCRYPTION_TYPE                 _CHIP_ERROR(22)
+#define CHIP_ERROR_UNSUPPORTED_ENCRYPTION_TYPE                 CHIP_CORE_ERROR(22)
 
 /**
  *  @def CHIP_ERROR_UNSUPPORTED_SIGNATURE_TYPE
@@ -305,7 +296,7 @@
  *    A signature type is unsupported.
  *
  */
-#define CHIP_ERROR_UNSUPPORTED_SIGNATURE_TYPE                  _CHIP_ERROR(23)
+#define CHIP_ERROR_UNSUPPORTED_SIGNATURE_TYPE                  CHIP_CORE_ERROR(23)
 
 /**
  *  @def CHIP_ERROR_INVALID_MESSAGE_LENGTH
@@ -314,7 +305,7 @@
  *    A message length is invalid.
  *
  */
-#define CHIP_ERROR_INVALID_MESSAGE_LENGTH                      _CHIP_ERROR(24)
+#define CHIP_ERROR_INVALID_MESSAGE_LENGTH                      CHIP_CORE_ERROR(24)
 
 /**
  *  @def CHIP_ERROR_BUFFER_TOO_SMALL
@@ -323,7 +314,7 @@
  *    A buffer is too small.
  *
  */
-#define CHIP_ERROR_BUFFER_TOO_SMALL                            _CHIP_ERROR(25)
+#define CHIP_ERROR_BUFFER_TOO_SMALL                            CHIP_CORE_ERROR(25)
 
 /**
  *  @def CHIP_ERROR_DUPLICATE_KEY_ID
@@ -332,7 +323,7 @@
  *    A key id is duplicate.
  *
  */
-#define CHIP_ERROR_DUPLICATE_KEY_ID                            _CHIP_ERROR(26)
+#define CHIP_ERROR_DUPLICATE_KEY_ID                            CHIP_CORE_ERROR(26)
 
 /**
  *  @def CHIP_ERROR_WRONG_KEY_TYPE
@@ -341,7 +332,7 @@
  *    A key type does not match the expected key type.
  *
  */
-#define CHIP_ERROR_WRONG_KEY_TYPE                              _CHIP_ERROR(27)
+#define CHIP_ERROR_WRONG_KEY_TYPE                              CHIP_CORE_ERROR(27)
 
 /**
  *  @def CHIP_ERROR_WELL_UNINITIALIZED
@@ -350,7 +341,7 @@
  *    A requested object is uninitialized.
  *
  */
-#define CHIP_ERROR_WELL_UNINITIALIZED                          _CHIP_ERROR(28)
+#define CHIP_ERROR_WELL_UNINITIALIZED                          CHIP_CORE_ERROR(28)
 
 /**
  *  @def CHIP_ERROR_WELL_EMPTY
@@ -359,7 +350,7 @@
  *    A requested object is empty.
  *
  */
-#define CHIP_ERROR_WELL_EMPTY                                  _CHIP_ERROR(29)
+#define CHIP_ERROR_WELL_EMPTY                                  CHIP_CORE_ERROR(29)
 
 /**
  *  @def CHIP_ERROR_INVALID_STRING_LENGTH
@@ -368,7 +359,7 @@
  *    A string length is invalid.
  *
  */
-#define CHIP_ERROR_INVALID_STRING_LENGTH                       _CHIP_ERROR(30)
+#define CHIP_ERROR_INVALID_STRING_LENGTH                       CHIP_CORE_ERROR(30)
 
 /**
  *  @def CHIP_ERROR_INVALID_LIST_LENGTH
@@ -377,7 +368,7 @@
  *    A list length is invalid.
  *
  */
-#define CHIP_ERROR_INVALID_LIST_LENGTH                         _CHIP_ERROR(31)
+#define CHIP_ERROR_INVALID_LIST_LENGTH                         CHIP_CORE_ERROR(31)
 
 /**
  *  @def CHIP_ERROR_INVALID_INTEGRITY_TYPE
@@ -386,7 +377,7 @@
  *    An integrity type is invalid.
  *
  */
-#define CHIP_ERROR_INVALID_INTEGRITY_TYPE                      _CHIP_ERROR(32)
+#define CHIP_ERROR_INVALID_INTEGRITY_TYPE                      CHIP_CORE_ERROR(32)
 
 /**
  *  @def CHIP_END_OF_TLV
@@ -396,7 +387,8 @@
  *    or the end of a TLV container element has been reached.
  *
  */
-#define CHIP_END_OF_TLV                                        _CHIP_ERROR(33)
+#define CHIP_ERROR_END_OF_TLV                                  CHIP_CORE_ERROR(33)
+#define CHIP_END_OF_TLV CHIP_ERROR_END_OF_TLV
 
 /**
  *  @def CHIP_ERROR_TLV_UNDERRUN
@@ -405,7 +397,7 @@
  *    The TLV encoding ended prematurely.
  *
  */
-#define CHIP_ERROR_TLV_UNDERRUN                                _CHIP_ERROR(34)
+#define CHIP_ERROR_TLV_UNDERRUN                                CHIP_CORE_ERROR(34)
 
 /**
  *  @def CHIP_ERROR_INVALID_TLV_ELEMENT
@@ -414,7 +406,7 @@
  *    A TLV element is invalid.
  *
  */
-#define CHIP_ERROR_INVALID_TLV_ELEMENT                         _CHIP_ERROR(35)
+#define CHIP_ERROR_INVALID_TLV_ELEMENT                         CHIP_CORE_ERROR(35)
 
 /**
  *  @def CHIP_ERROR_INVALID_TLV_TAG
@@ -423,7 +415,7 @@
  *    A TLV tag is invalid.
  *
  */
-#define CHIP_ERROR_INVALID_TLV_TAG                             _CHIP_ERROR(36)
+#define CHIP_ERROR_INVALID_TLV_TAG                             CHIP_CORE_ERROR(36)
 
 /**
  *  @def CHIP_ERROR_UNKNOWN_IMPLICIT_TLV_TAG
@@ -433,7 +425,7 @@
  *    but an implicit profile id has not been defined.
  *
  */
-#define CHIP_ERROR_UNKNOWN_IMPLICIT_TLV_TAG                    _CHIP_ERROR(37)
+#define CHIP_ERROR_UNKNOWN_IMPLICIT_TLV_TAG                    CHIP_CORE_ERROR(37)
 
 /**
  *  @def CHIP_ERROR_WRONG_TLV_TYPE
@@ -442,7 +434,7 @@
  *    A TLV type is wrong.
  *
  */
-#define CHIP_ERROR_WRONG_TLV_TYPE                              _CHIP_ERROR(38)
+#define CHIP_ERROR_WRONG_TLV_TYPE                              CHIP_CORE_ERROR(38)
 
 /**
  *  @def CHIP_ERROR_TLV_CONTAINER_OPEN
@@ -451,7 +443,7 @@
  *    A TLV container is unexpectedly open.
  *
  */
-#define CHIP_ERROR_TLV_CONTAINER_OPEN                          _CHIP_ERROR(39)
+#define CHIP_ERROR_TLV_CONTAINER_OPEN                          CHIP_CORE_ERROR(39)
 
 /**
  *  @def CHIP_ERROR_INVALID_TRANSFER_MODE
@@ -460,7 +452,7 @@
  *    A transfer mode is invalid.
  *
  */
-#define CHIP_ERROR_INVALID_TRANSFER_MODE                       _CHIP_ERROR(40)
+#define CHIP_ERROR_INVALID_TRANSFER_MODE                       CHIP_CORE_ERROR(40)
 
 /**
  *  @def CHIP_ERROR_INVALID_PROFILE_ID
@@ -469,7 +461,7 @@
  *    A profile id is invalid.
  *
  */
-#define CHIP_ERROR_INVALID_PROFILE_ID                          _CHIP_ERROR(41)
+#define CHIP_ERROR_INVALID_PROFILE_ID                          CHIP_CORE_ERROR(41)
 
 /**
  *  @def CHIP_ERROR_INVALID_MESSAGE_TYPE
@@ -478,7 +470,7 @@
  *    A message type is invalid.
  *
  */
-#define CHIP_ERROR_INVALID_MESSAGE_TYPE                        _CHIP_ERROR(42)
+#define CHIP_ERROR_INVALID_MESSAGE_TYPE                        CHIP_CORE_ERROR(42)
 
 /**
  *  @def CHIP_ERROR_UNEXPECTED_TLV_ELEMENT
@@ -487,7 +479,7 @@
  *    An unexpected TLV element was encountered.
  *
  */
-#define CHIP_ERROR_UNEXPECTED_TLV_ELEMENT                      _CHIP_ERROR(43)
+#define CHIP_ERROR_UNEXPECTED_TLV_ELEMENT                      CHIP_CORE_ERROR(43)
 
 /**
  *  @def CHIP_ERROR_STATUS_REPORT_RECEIVED
@@ -496,7 +488,7 @@
  *    A status report is received from a peer node.
  *
  */
-#define CHIP_ERROR_STATUS_REPORT_RECEIVED                      _CHIP_ERROR(44)
+#define CHIP_ERROR_STATUS_REPORT_RECEIVED                      CHIP_CORE_ERROR(44)
 
 /**
  *  @def CHIP_ERROR_NOT_IMPLEMENTED
@@ -505,7 +497,7 @@
  *    A requested function or feature is not implemented.
  *
  */
-#define CHIP_ERROR_NOT_IMPLEMENTED                             _CHIP_ERROR(45)
+#define CHIP_ERROR_NOT_IMPLEMENTED                             CHIP_CORE_ERROR(45)
 
 /**
  *  @def CHIP_ERROR_INVALID_ADDRESS
@@ -514,7 +506,7 @@
  *    An address is invalid.
  *
  */
-#define CHIP_ERROR_INVALID_ADDRESS                             _CHIP_ERROR(46)
+#define CHIP_ERROR_INVALID_ADDRESS                             CHIP_CORE_ERROR(46)
 
 /**
  *  @def CHIP_ERROR_INVALID_ARGUMENT
@@ -523,7 +515,7 @@
  *    An argument is invalid.
  *
  */
-#define CHIP_ERROR_INVALID_ARGUMENT                            _CHIP_ERROR(47)
+#define CHIP_ERROR_INVALID_ARGUMENT                            CHIP_CORE_ERROR(47)
 
 /**
  *  @def CHIP_ERROR_INVALID_PATH_LIST
@@ -532,7 +524,7 @@
  *    A TLV path list is invalid.
  *
  */
-#define CHIP_ERROR_INVALID_PATH_LIST                           _CHIP_ERROR(48)
+#define CHIP_ERROR_INVALID_PATH_LIST                           CHIP_CORE_ERROR(48)
 
 /**
  *  @def CHIP_ERROR_INVALID_DATA_LIST
@@ -541,7 +533,7 @@
  *    A TLV data list is invalid.
  *
  */
-#define CHIP_ERROR_INVALID_DATA_LIST                           _CHIP_ERROR(49)
+#define CHIP_ERROR_INVALID_DATA_LIST                           CHIP_CORE_ERROR(49)
 
 /**
  *  @def CHIP_ERROR_TIMEOUT
@@ -550,7 +542,7 @@
  *    A request timed out.
  *
  */
-#define CHIP_ERROR_TIMEOUT                                     _CHIP_ERROR(50)
+#define CHIP_ERROR_TIMEOUT                                     CHIP_CORE_ERROR(50)
 
 /**
  *  @def CHIP_ERROR_INVALID_DEVICE_DESCRIPTOR
@@ -559,7 +551,7 @@
  *    A device descriptor is invalid.
  *
  */
-#define CHIP_ERROR_INVALID_DEVICE_DESCRIPTOR                   _CHIP_ERROR(51)
+#define CHIP_ERROR_INVALID_DEVICE_DESCRIPTOR                   CHIP_CORE_ERROR(51)
 
 /**
  *  @def CHIP_ERROR_UNSUPPORTED_DEVICE_DESCRIPTOR_VERSION
@@ -568,7 +560,7 @@
  *    A device descriptor version is unsupported.
  *
  */
-#define CHIP_ERROR_UNSUPPORTED_DEVICE_DESCRIPTOR_VERSION       _CHIP_ERROR(52)
+#define CHIP_ERROR_UNSUPPORTED_DEVICE_DESCRIPTOR_VERSION       CHIP_CORE_ERROR(52)
 
 /**
  *  @def CHIP_END_OF_INPUT
@@ -577,7 +569,8 @@
  *    An input ended.
  *
  */
-#define CHIP_END_OF_INPUT                                      _CHIP_ERROR(53)
+#define CHIP_ERROR_END_OF_INPUT                                CHIP_CORE_ERROR(53)
+#define CHIP_END_OF_INPUT CHIP_ERROR_END_OF_INPUT
 
 /**
  *  @def CHIP_ERROR_RATE_LIMIT_EXCEEDED
@@ -586,7 +579,7 @@
  *    A rate limit is exceeded.
  *
  */
-#define CHIP_ERROR_RATE_LIMIT_EXCEEDED                         _CHIP_ERROR(54)
+#define CHIP_ERROR_RATE_LIMIT_EXCEEDED                         CHIP_CORE_ERROR(54)
 
 /**
  *  @def CHIP_ERROR_SECURITY_MANAGER_BUSY
@@ -595,7 +588,7 @@
  *    A security manager is busy.
  *
  */
-#define CHIP_ERROR_SECURITY_MANAGER_BUSY                       _CHIP_ERROR(55)
+#define CHIP_ERROR_SECURITY_MANAGER_BUSY                       CHIP_CORE_ERROR(55)
 
 /**
  *  @def CHIP_ERROR_INVALID_PASE_PARAMETER
@@ -604,7 +597,7 @@
  *    A PASE parameter is invalid.
  *
  */
-#define CHIP_ERROR_INVALID_PASE_PARAMETER                      _CHIP_ERROR(56)
+#define CHIP_ERROR_INVALID_PASE_PARAMETER                      CHIP_CORE_ERROR(56)
 
 /**
  *  @def CHIP_ERROR_PASE_SUPPORTS_ONLY_CONFIG1
@@ -613,7 +606,7 @@
  *    PASE supports only config1.
  *
  */
-#define CHIP_ERROR_PASE_SUPPORTS_ONLY_CONFIG1                  _CHIP_ERROR(57)
+#define CHIP_ERROR_PASE_SUPPORTS_ONLY_CONFIG1                  CHIP_CORE_ERROR(57)
 
 /**
  *  @def CHIP_ERROR_KEY_CONFIRMATION_FAILED
@@ -622,7 +615,7 @@
  *    A key confirmation failed.
  *
  */
-#define CHIP_ERROR_KEY_CONFIRMATION_FAILED                     _CHIP_ERROR(58)
+#define CHIP_ERROR_KEY_CONFIRMATION_FAILED                     CHIP_CORE_ERROR(58)
 
 /**
  *  @def CHIP_ERROR_INVALID_USE_OF_SESSION_KEY
@@ -631,7 +624,7 @@
  *    A use of session key is invalid.
  *
  */
-#define CHIP_ERROR_INVALID_USE_OF_SESSION_KEY                  _CHIP_ERROR(59)
+#define CHIP_ERROR_INVALID_USE_OF_SESSION_KEY                  CHIP_CORE_ERROR(59)
 
 /**
  *  @def CHIP_ERROR_CONNECTION_CLOSED_UNEXPECTEDLY
@@ -640,7 +633,7 @@
  *    A connection is closed unexpectedly.
  *
  */
-#define CHIP_ERROR_CONNECTION_CLOSED_UNEXPECTEDLY              _CHIP_ERROR(60)
+#define CHIP_ERROR_CONNECTION_CLOSED_UNEXPECTEDLY              CHIP_CORE_ERROR(60)
 
 /**
  *  @def CHIP_ERROR_MISSING_TLV_ELEMENT
@@ -649,7 +642,7 @@
  *    A TLV element is missing.
  *
  */
-#define CHIP_ERROR_MISSING_TLV_ELEMENT                         _CHIP_ERROR(61)
+#define CHIP_ERROR_MISSING_TLV_ELEMENT                         CHIP_CORE_ERROR(61)
 
 /**
  *  @def CHIP_ERROR_RANDOM_DATA_UNAVAILABLE
@@ -658,7 +651,7 @@
  *    Secure random data is not available.
  *
  */
-#define CHIP_ERROR_RANDOM_DATA_UNAVAILABLE                     _CHIP_ERROR(62)
+#define CHIP_ERROR_RANDOM_DATA_UNAVAILABLE                     CHIP_CORE_ERROR(62)
 
 /**
  *  @def CHIP_ERROR_UNSUPPORTED_HOST_PORT_ELEMENT
@@ -667,7 +660,7 @@
  *    A type in host/port list is unsupported.
  *
  */
-#define CHIP_ERROR_UNSUPPORTED_HOST_PORT_ELEMENT               _CHIP_ERROR(63)
+#define CHIP_ERROR_UNSUPPORTED_HOST_PORT_ELEMENT               CHIP_CORE_ERROR(63)
 
 /**
  *  @def CHIP_ERROR_INVALID_HOST_SUFFIX_INDEX
@@ -676,7 +669,7 @@
  *    A suffix index in host/port list is invalid.
  *
  */
-#define CHIP_ERROR_INVALID_HOST_SUFFIX_INDEX                   _CHIP_ERROR(64)
+#define CHIP_ERROR_INVALID_HOST_SUFFIX_INDEX                   CHIP_CORE_ERROR(64)
 
 /**
  *  @def CHIP_ERROR_HOST_PORT_LIST_EMPTY
@@ -685,7 +678,7 @@
  *    A host/port list is empty.
  *
  */
-#define CHIP_ERROR_HOST_PORT_LIST_EMPTY                        _CHIP_ERROR(65)
+#define CHIP_ERROR_HOST_PORT_LIST_EMPTY                        CHIP_CORE_ERROR(65)
 
 /**
  *  @def CHIP_ERROR_UNSUPPORTED_AUTH_MODE
@@ -694,7 +687,7 @@
  *    An authentication mode is unsupported.
  *
  */
-#define CHIP_ERROR_UNSUPPORTED_AUTH_MODE                       _CHIP_ERROR(66)
+#define CHIP_ERROR_UNSUPPORTED_AUTH_MODE                       CHIP_CORE_ERROR(66)
 
 /**
  *  @def CHIP_ERROR_INVALID_SERVICE_EP
@@ -703,7 +696,7 @@
  *    A service endpoint is invalid.
  *
  */
-#define CHIP_ERROR_INVALID_SERVICE_EP                          _CHIP_ERROR(67)
+#define CHIP_ERROR_INVALID_SERVICE_EP                          CHIP_CORE_ERROR(67)
 
 /**
  *  @def CHIP_ERROR_INVALID_DIRECTORY_ENTRY_TYPE
@@ -712,7 +705,7 @@
  *    A directory entry type is unknown.
  *
  */
-#define CHIP_ERROR_INVALID_DIRECTORY_ENTRY_TYPE                _CHIP_ERROR(68)
+#define CHIP_ERROR_INVALID_DIRECTORY_ENTRY_TYPE                CHIP_CORE_ERROR(68)
 
 /**
  *  @def CHIP_ERROR_FORCED_RESET
@@ -721,7 +714,7 @@
  *    A service manager is forced to reset.
  *
  */
-#define CHIP_ERROR_FORCED_RESET                                _CHIP_ERROR(69)
+#define CHIP_ERROR_FORCED_RESET                                CHIP_CORE_ERROR(69)
 
 /**
  *  @def CHIP_ERROR_NO_ENDPOINT
@@ -730,7 +723,7 @@
  *    No endpoint is available.
  *
  */
-#define CHIP_ERROR_NO_ENDPOINT                                 _CHIP_ERROR(70)
+#define CHIP_ERROR_NO_ENDPOINT                                 CHIP_CORE_ERROR(70)
 
 /**
  *  @def CHIP_ERROR_INVALID_DESTINATION_NODE_ID
@@ -739,7 +732,7 @@
  *    A destination node id is invalid.
  *
  */
-#define CHIP_ERROR_INVALID_DESTINATION_NODE_ID                 _CHIP_ERROR(71)
+#define CHIP_ERROR_INVALID_DESTINATION_NODE_ID                 CHIP_CORE_ERROR(71)
 
 /**
  *  @def CHIP_ERROR_NOT_CONNECTED
@@ -749,7 +742,7 @@
  *    connected.
  *
  */
-#define CHIP_ERROR_NOT_CONNECTED                               _CHIP_ERROR(72)
+#define CHIP_ERROR_NOT_CONNECTED                               CHIP_CORE_ERROR(72)
 
 /**
  *  @def CHIP_ERROR_NO_SW_UPDATE_AVAILABLE
@@ -758,7 +751,7 @@
  *    No software update is available.
  *
  */
-#define CHIP_ERROR_NO_SW_UPDATE_AVAILABLE                      _CHIP_ERROR(73)
+#define CHIP_ERROR_NO_SW_UPDATE_AVAILABLE                      CHIP_CORE_ERROR(73)
 
 /**
  *  @def CHIP_ERROR_CA_CERT_NOT_FOUND
@@ -767,7 +760,7 @@
  *    CA certificate is not found.
  *
  */
-#define CHIP_ERROR_CA_CERT_NOT_FOUND                           _CHIP_ERROR(74)
+#define CHIP_ERROR_CA_CERT_NOT_FOUND                           CHIP_CORE_ERROR(74)
 
 /**
  *  @def CHIP_ERROR_CERT_PATH_LEN_CONSTRAINT_EXCEEDED
@@ -776,7 +769,7 @@
  *    A certificate path length exceeds the constraint.
  *
  */
-#define CHIP_ERROR_CERT_PATH_LEN_CONSTRAINT_EXCEEDED           _CHIP_ERROR(75)
+#define CHIP_ERROR_CERT_PATH_LEN_CONSTRAINT_EXCEEDED           CHIP_CORE_ERROR(75)
 
 /**
  *  @def CHIP_ERROR_CERT_PATH_TOO_LONG
@@ -785,7 +778,7 @@
  *    A certificate path is too long.
  *
  */
-#define CHIP_ERROR_CERT_PATH_TOO_LONG                          _CHIP_ERROR(76)
+#define CHIP_ERROR_CERT_PATH_TOO_LONG                          CHIP_CORE_ERROR(76)
 
 /**
  *  @def CHIP_ERROR_CERT_USAGE_NOT_ALLOWED
@@ -794,7 +787,7 @@
  *    A requested certificate usage is not allowed.
  *
  */
-#define CHIP_ERROR_CERT_USAGE_NOT_ALLOWED                      _CHIP_ERROR(77)
+#define CHIP_ERROR_CERT_USAGE_NOT_ALLOWED                      CHIP_CORE_ERROR(77)
 
 /**
  *  @def CHIP_ERROR_CERT_EXPIRED
@@ -803,7 +796,7 @@
  *    A certificate expired.
  *
  */
-#define CHIP_ERROR_CERT_EXPIRED                                _CHIP_ERROR(78)
+#define CHIP_ERROR_CERT_EXPIRED                                CHIP_CORE_ERROR(78)
 
 /**
  *  @def CHIP_ERROR_CERT_NOT_VALID_YET
@@ -812,7 +805,7 @@
  *    A certificate is not valid yet.
  *
  */
-#define CHIP_ERROR_CERT_NOT_VALID_YET                          _CHIP_ERROR(79)
+#define CHIP_ERROR_CERT_NOT_VALID_YET                          CHIP_CORE_ERROR(79)
 
 /**
  *  @def CHIP_ERROR_UNSUPPORTED_CERT_FORMAT
@@ -821,7 +814,7 @@
  *    A certificate format is unsupported.
  *
  */
-#define CHIP_ERROR_UNSUPPORTED_CERT_FORMAT                     _CHIP_ERROR(80)
+#define CHIP_ERROR_UNSUPPORTED_CERT_FORMAT                     CHIP_CORE_ERROR(80)
 
 /**
  *  @def CHIP_ERROR_UNSUPPORTED_ELLIPTIC_CURVE
@@ -830,7 +823,7 @@
  *    An elliptic curve is unsupported.
  *
  */
-#define CHIP_ERROR_UNSUPPORTED_ELLIPTIC_CURVE                  _CHIP_ERROR(81)
+#define CHIP_ERROR_UNSUPPORTED_ELLIPTIC_CURVE                  CHIP_CORE_ERROR(81)
 
 /**
  *  @def CHIP_CERT_NOT_USED
@@ -839,7 +832,8 @@
  *    A certificate was not used during the chain validation.
  *
  */
-#define CHIP_CERT_NOT_USED                                     _CHIP_ERROR(82)
+#define CHIP_ERROR_CERT_NOT_USED                               CHIP_CORE_ERROR(82)
+#define CHIP_CERT_NOT_USED CHIP_ERROR_CERT_NOT_USED
 
 /**
  *  @def CHIP_ERROR_CERT_NOT_FOUND
@@ -848,7 +842,7 @@
  *    A certificate is not found.
  *
  */
-#define CHIP_ERROR_CERT_NOT_FOUND                              _CHIP_ERROR(83)
+#define CHIP_ERROR_CERT_NOT_FOUND                              CHIP_CORE_ERROR(83)
 
 /**
  *  @def CHIP_ERROR_INVALID_CASE_PARAMETER
@@ -857,7 +851,7 @@
  *    A CASE parameter is invalid.
  *
  */
-#define CHIP_ERROR_INVALID_CASE_PARAMETER                      _CHIP_ERROR(84)
+#define CHIP_ERROR_INVALID_CASE_PARAMETER                      CHIP_CORE_ERROR(84)
 
 /**
  *  @def CHIP_ERROR_UNSUPPORTED_CASE_CONFIGURATION
@@ -866,7 +860,7 @@
  *    A CASE configuration is unsupported.
  *
  */
-#define CHIP_ERROR_UNSUPPORTED_CASE_CONFIGURATION              _CHIP_ERROR(85)
+#define CHIP_ERROR_UNSUPPORTED_CASE_CONFIGURATION              CHIP_CORE_ERROR(85)
 
 /**
  *  @def CHIP_ERROR_CERT_LOAD_FAILED
@@ -875,7 +869,7 @@
  *    A certificate load failed.
  *
  */
-#define CHIP_ERROR_CERT_LOAD_FAILED                             _CHIP_ERROR(86)
+#define CHIP_ERROR_CERT_LOAD_FAILED                            CHIP_CORE_ERROR(86)
 
 /**
  *  @def CHIP_ERROR_CERT_NOT_TRUSTED
@@ -884,7 +878,7 @@
  *    A certificate is not trusted.
  *
  */
-#define CHIP_ERROR_CERT_NOT_TRUSTED                            _CHIP_ERROR(87)
+#define CHIP_ERROR_CERT_NOT_TRUSTED                            CHIP_CORE_ERROR(87)
 
 /**
  *  @def CHIP_ERROR_INVALID_ACCESS_TOKEN
@@ -893,7 +887,7 @@
  *    An access token is invalid.
  *
  */
-#define CHIP_ERROR_INVALID_ACCESS_TOKEN                        _CHIP_ERROR(88)
+#define CHIP_ERROR_INVALID_ACCESS_TOKEN                        CHIP_CORE_ERROR(88)
 
 /**
  *  @def CHIP_ERROR_WRONG_CERT_SUBJECT
@@ -902,7 +896,7 @@
  *    A certificate subject is wrong.
  *
  */
-#define CHIP_ERROR_WRONG_CERT_SUBJECT                          _CHIP_ERROR(89)
+#define CHIP_ERROR_WRONG_CERT_SUBJECT                          CHIP_CORE_ERROR(89)
 
 // deprecated alias
 #define CHIP_ERROR_WRONG_CERTIFICATE_SUBJECT CHIP_ERROR_WRONG_CERT_SUBJECT
@@ -914,7 +908,7 @@
  *    A provisioning bundle is invalid.
  *
  */
-#define CHIP_ERROR_INVALID_PROVISIONING_BUNDLE                 _CHIP_ERROR(90)
+#define CHIP_ERROR_INVALID_PROVISIONING_BUNDLE                 CHIP_CORE_ERROR(90)
 
 /**
  *  @def CHIP_ERROR_PROVISIONING_BUNDLE_DECRYPTION_ERROR
@@ -923,7 +917,7 @@
  *    A provision bundle encountered a decryption error.
  *
  */
-#define CHIP_ERROR_PROVISIONING_BUNDLE_DECRYPTION_ERROR        _CHIP_ERROR(91)
+#define CHIP_ERROR_PROVISIONING_BUNDLE_DECRYPTION_ERROR        CHIP_CORE_ERROR(91)
 
 /**
  *  @def CHIP_ERROR_WRONG_NODE_ID
@@ -932,7 +926,7 @@
  *    A node id is wrong.
  *
  */
-#define CHIP_ERROR_WRONG_NODE_ID                               _CHIP_ERROR(92)
+#define CHIP_ERROR_WRONG_NODE_ID                               CHIP_CORE_ERROR(92)
 
 /**
  *  @def CHIP_ERROR_CONN_ACCEPTED_ON_WRONG_PORT
@@ -941,7 +935,7 @@
  *    A connection is accepted on a wrong port.
  *
  */
-#define CHIP_ERROR_CONN_ACCEPTED_ON_WRONG_PORT                 _CHIP_ERROR(93)
+#define CHIP_ERROR_CONN_ACCEPTED_ON_WRONG_PORT                 CHIP_CORE_ERROR(93)
 
 /**
  *  @def CHIP_ERROR_CALLBACK_REPLACED
@@ -950,7 +944,7 @@
  *    An application callback has been replaced.
  *
  */
-#define CHIP_ERROR_CALLBACK_REPLACED                           _CHIP_ERROR(94)
+#define CHIP_ERROR_CALLBACK_REPLACED                           CHIP_CORE_ERROR(94)
 
 /**
  *  @def CHIP_ERROR_NO_CASE_AUTH_DELEGATE
@@ -959,7 +953,7 @@
  *    No CASE authentication delegate is set.
  *
  */
-#define CHIP_ERROR_NO_CASE_AUTH_DELEGATE                       _CHIP_ERROR(95)
+#define CHIP_ERROR_NO_CASE_AUTH_DELEGATE                       CHIP_CORE_ERROR(95)
 
 /**
  *  @def CHIP_ERROR_DEVICE_LOCATE_TIMEOUT
@@ -968,7 +962,7 @@
  *    The attempt to locate device timed out.
  *
  */
-#define CHIP_ERROR_DEVICE_LOCATE_TIMEOUT                       _CHIP_ERROR(96)
+#define CHIP_ERROR_DEVICE_LOCATE_TIMEOUT                       CHIP_CORE_ERROR(96)
 
 /**
  *  @def CHIP_ERROR_DEVICE_CONNECT_TIMEOUT
@@ -977,7 +971,7 @@
  *    The attempt to connect device timed out.
  *
  */
-#define CHIP_ERROR_DEVICE_CONNECT_TIMEOUT                      _CHIP_ERROR(97)
+#define CHIP_ERROR_DEVICE_CONNECT_TIMEOUT                      CHIP_CORE_ERROR(97)
 
 /**
  *  @def CHIP_ERROR_DEVICE_AUTH_TIMEOUT
@@ -986,7 +980,7 @@
  *    The attempt to authenticate device timed out.
  *
  */
-#define CHIP_ERROR_DEVICE_AUTH_TIMEOUT                         _CHIP_ERROR(98)
+#define CHIP_ERROR_DEVICE_AUTH_TIMEOUT                         CHIP_CORE_ERROR(98)
 
 /**
  *  @def CHIP_ERROR_MESSAGE_NOT_ACKNOWLEDGED
@@ -995,7 +989,7 @@
  *    A message is not acknowledged after max retries.
  *
  */
-#define CHIP_ERROR_MESSAGE_NOT_ACKNOWLEDGED                    _CHIP_ERROR(99)
+#define CHIP_ERROR_MESSAGE_NOT_ACKNOWLEDGED                    CHIP_CORE_ERROR(99)
 
 /**
  *  @def CHIP_ERROR_RETRANS_TABLE_FULL
@@ -1004,7 +998,7 @@
  *    A retransmission table is already full.
  *
  */
-#define CHIP_ERROR_RETRANS_TABLE_FULL                          _CHIP_ERROR(100)
+#define CHIP_ERROR_RETRANS_TABLE_FULL                          CHIP_CORE_ERROR(100)
 
 /**
  *  @def CHIP_ERROR_INVALID_ACK_ID
@@ -1013,7 +1007,7 @@
  *    An acknowledgment id is invalid.
  *
  */
-#define CHIP_ERROR_INVALID_ACK_ID                              _CHIP_ERROR(101)
+#define CHIP_ERROR_INVALID_ACK_ID                              CHIP_CORE_ERROR(101)
 
 /**
  *  @def CHIP_ERROR_SEND_THROTTLED
@@ -1022,7 +1016,7 @@
  *    A send is throttled.
  *
  */
-#define CHIP_ERROR_SEND_THROTTLED                              _CHIP_ERROR(102)
+#define CHIP_ERROR_SEND_THROTTLED                              CHIP_CORE_ERROR(102)
 
 /**
  *  @def CHIP_ERROR_WRONG_MSG_VERSION_FOR_EXCHANGE
@@ -1031,7 +1025,7 @@
  *    A message version is not supported by the current exchange context.
  *
  */
-#define CHIP_ERROR_WRONG_MSG_VERSION_FOR_EXCHANGE              _CHIP_ERROR(103)
+#define CHIP_ERROR_WRONG_MSG_VERSION_FOR_EXCHANGE              CHIP_CORE_ERROR(103)
 
 /**
  *  @def CHIP_ERROR_TRANSACTION_CANCELED
@@ -1040,7 +1034,7 @@
  *    A transaction is cancelled.
  *
  */
-#define CHIP_ERROR_TRANSACTION_CANCELED                        _CHIP_ERROR(104)
+#define CHIP_ERROR_TRANSACTION_CANCELED                        CHIP_CORE_ERROR(104)
 
 /**
  *  @def CHIP_ERROR_LISTENER_ALREADY_STARTED
@@ -1049,7 +1043,7 @@
  *    A listener has already started.
  *
  */
-#define CHIP_ERROR_LISTENER_ALREADY_STARTED                    _CHIP_ERROR(105)
+#define CHIP_ERROR_LISTENER_ALREADY_STARTED                    CHIP_CORE_ERROR(105)
 
 /**
  *  @def CHIP_ERROR_LISTENER_ALREADY_STOPPED
@@ -1058,7 +1052,7 @@
  *    A listener has already stopped.
  *
  */
-#define CHIP_ERROR_LISTENER_ALREADY_STOPPED                    _CHIP_ERROR(106)
+#define CHIP_ERROR_LISTENER_ALREADY_STOPPED                    CHIP_CORE_ERROR(106)
 
 /**
  *  @def CHIP_ERROR_UNKNOWN_TOPIC
@@ -1067,7 +1061,7 @@
  *    A topic ID was unknown to the recipient.
  *
  */
-#define CHIP_ERROR_UNKNOWN_TOPIC                               _CHIP_ERROR(107)
+#define CHIP_ERROR_UNKNOWN_TOPIC                               CHIP_CORE_ERROR(107)
 
 /**
  *  @def CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE
@@ -1076,7 +1070,7 @@
  *    A CHIP feature is unsupported.
  *
  */
-#define CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE                   _CHIP_ERROR(108)
+#define CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE                    CHIP_CORE_ERROR(108)
 
 /**
  *  @def CHIP_ERROR_PASE_RECONFIGURE_REQUIRED
@@ -1085,7 +1079,7 @@
  *    PASE is required to reconfigure.
  *
  */
-#define CHIP_ERROR_PASE_RECONFIGURE_REQUIRED                   _CHIP_ERROR(109)
+#define CHIP_ERROR_PASE_RECONFIGURE_REQUIRED                   CHIP_CORE_ERROR(109)
 
 /**
  *  @def CHIP_ERROR_INVALID_PASE_CONFIGURATION
@@ -1094,7 +1088,7 @@
  *    A PASE configuration is invalid.
  *
  */
-#define CHIP_ERROR_INVALID_PASE_CONFIGURATION                  _CHIP_ERROR(110)
+#define CHIP_ERROR_INVALID_PASE_CONFIGURATION                  CHIP_CORE_ERROR(110)
 
 /**
  *  @def CHIP_ERROR_NO_COMMON_PASE_CONFIGURATIONS
@@ -1103,7 +1097,7 @@
  *    No PASE configuration is in common.
  *
  */
-#define CHIP_ERROR_NO_COMMON_PASE_CONFIGURATIONS               _CHIP_ERROR(111)
+#define CHIP_ERROR_NO_COMMON_PASE_CONFIGURATIONS               CHIP_CORE_ERROR(111)
 
 /**
  *  @def CHIP_ERROR_UNSOLICITED_MSG_NO_ORIGINATOR
@@ -1112,7 +1106,7 @@
  *    An unsolicited message with the originator bit clear.
  *
  */
-#define CHIP_ERROR_UNSOLICITED_MSG_NO_ORIGINATOR               _CHIP_ERROR(112)
+#define CHIP_ERROR_UNSOLICITED_MSG_NO_ORIGINATOR               CHIP_CORE_ERROR(112)
 
 /**
  *  @def CHIP_ERROR_INVALID_FABRIC_ID
@@ -1121,7 +1115,11 @@
  *    A fabric id is invalid.
  *
  */
-#define CHIP_ERROR_INVALID_FABRIC_ID                           _CHIP_ERROR(113)
+#define CHIP_ERROR_INVALID_FABRIC_ID                           CHIP_CORE_ERROR(113)
+
+// unused                                                      CHIP_CORE_ERROR(114)
+// unused                                                      CHIP_CORE_ERROR(115)
+// unused                                                      CHIP_CORE_ERROR(116)
 
 /**
  *  @def CHIP_ERROR_DRBG_ENTROPY_SOURCE_FAILED
@@ -1130,7 +1128,7 @@
  *    DRBG entropy source failed to generate entropy data.
  *
  */
-#define CHIP_ERROR_DRBG_ENTROPY_SOURCE_FAILED                  _CHIP_ERROR(117)
+#define CHIP_ERROR_DRBG_ENTROPY_SOURCE_FAILED                  CHIP_CORE_ERROR(117)
 
 /**
  *  @def CHIP_ERROR_TLV_TAG_NOT_FOUND
@@ -1139,7 +1137,7 @@
  *    A specified TLV tag was not found.
  *
  */
-#define CHIP_ERROR_TLV_TAG_NOT_FOUND                           _CHIP_ERROR(118)
+#define CHIP_ERROR_TLV_TAG_NOT_FOUND                           CHIP_CORE_ERROR(118)
 
 /**
  *  @def CHIP_ERROR_INVALID_TOKENPAIRINGBUNDLE
@@ -1148,7 +1146,7 @@
  *    A token pairing bundle is invalid.
  *
  */
-#define CHIP_ERROR_INVALID_TOKENPAIRINGBUNDLE                  _CHIP_ERROR(119)
+#define CHIP_ERROR_INVALID_TOKENPAIRINGBUNDLE                  CHIP_CORE_ERROR(119)
 
 /**
  *  @def CHIP_ERROR_UNSUPPORTED_TOKENPAIRINGBUNDLE_VERSION
@@ -1157,7 +1155,7 @@
  *    A token pairing bundle is invalid.
  *
  */
-#define CHIP_ERROR_UNSUPPORTED_TOKENPAIRINGBUNDLE_VERSION      _CHIP_ERROR(120)
+#define CHIP_ERROR_UNSUPPORTED_TOKENPAIRINGBUNDLE_VERSION      CHIP_CORE_ERROR(120)
 
 /**
  *  @def CHIP_ERROR_NO_TAKE_AUTH_DELEGATE
@@ -1166,7 +1164,7 @@
  *    No TAKE authentication delegate is set.
  *
  */
-#define CHIP_ERROR_NO_TAKE_AUTH_DELEGATE                       _CHIP_ERROR(121)
+#define CHIP_ERROR_NO_TAKE_AUTH_DELEGATE                       CHIP_CORE_ERROR(121)
 
 /**
  *  @def CHIP_ERROR_TAKE_RECONFIGURE_REQUIRED
@@ -1175,7 +1173,7 @@
  *    TAKE requires a reconfigure.
  *
  */
-#define CHIP_ERROR_TAKE_RECONFIGURE_REQUIRED                   _CHIP_ERROR(122)
+#define CHIP_ERROR_TAKE_RECONFIGURE_REQUIRED                   CHIP_CORE_ERROR(122)
 
 /**
  *  @def CHIP_ERROR_TAKE_REAUTH_POSSIBLE
@@ -1184,7 +1182,7 @@
  *    TAKE can do a reauthentication.
  *
  */
-#define CHIP_ERROR_TAKE_REAUTH_POSSIBLE                        _CHIP_ERROR(123)
+#define CHIP_ERROR_TAKE_REAUTH_POSSIBLE                        CHIP_CORE_ERROR(123)
 
 /**
  *  @def CHIP_ERROR_INVALID_TAKE_PARAMETER
@@ -1193,7 +1191,7 @@
  *    Received an invalid TAKE paramter.
  *
  */
-#define CHIP_ERROR_INVALID_TAKE_PARAMETER                      _CHIP_ERROR(124)
+#define CHIP_ERROR_INVALID_TAKE_PARAMETER                      CHIP_CORE_ERROR(124)
 
 /**
  *  @def CHIP_ERROR_UNSUPPORTED_TAKE_CONFIGURATION
@@ -1202,7 +1200,7 @@
  *    This configuration is not supported by TAKE.
  *
  */
-#define CHIP_ERROR_UNSUPPORTED_TAKE_CONFIGURATION              _CHIP_ERROR(125)
+#define CHIP_ERROR_UNSUPPORTED_TAKE_CONFIGURATION              CHIP_CORE_ERROR(125)
 
 /**
  *  @def CHIP_ERROR_TAKE_TOKEN_IDENTIFICATION_FAILED
@@ -1211,7 +1209,7 @@
  *    The TAKE Token Identification failed.
  *
  */
-#define CHIP_ERROR_TAKE_TOKEN_IDENTIFICATION_FAILED            _CHIP_ERROR(126)
+#define CHIP_ERROR_TAKE_TOKEN_IDENTIFICATION_FAILED            CHIP_CORE_ERROR(126)
 
 /**
  *  @def CHIP_ERROR_KEY_NOT_FOUND_FROM_PEER
@@ -1220,7 +1218,7 @@
  *    The encryption key is not found error received from a peer node.
  *
  */
-#define CHIP_ERROR_KEY_NOT_FOUND_FROM_PEER                     _CHIP_ERROR(127)
+#define CHIP_ERROR_KEY_NOT_FOUND_FROM_PEER                     CHIP_CORE_ERROR(127)
 
 /**
  *  @def CHIP_ERROR_WRONG_ENCRYPTION_TYPE_FROM_PEER
@@ -1229,7 +1227,7 @@
  *    The wrong encryption type error received from a peer node.
  *
  */
-#define CHIP_ERROR_WRONG_ENCRYPTION_TYPE_FROM_PEER             _CHIP_ERROR(128)
+#define CHIP_ERROR_WRONG_ENCRYPTION_TYPE_FROM_PEER             CHIP_CORE_ERROR(128)
 
 /**
  *  @def CHIP_ERROR_UNKNOWN_KEY_TYPE_FROM_PEER
@@ -1238,7 +1236,7 @@
  *    The unknown key type error received from a peer node.
  *
  */
-#define CHIP_ERROR_UNKNOWN_KEY_TYPE_FROM_PEER                  _CHIP_ERROR(129)
+#define CHIP_ERROR_UNKNOWN_KEY_TYPE_FROM_PEER                  CHIP_CORE_ERROR(129)
 
 /**
  *  @def CHIP_ERROR_INVALID_USE_OF_SESSION_KEY_FROM_PEER
@@ -1247,7 +1245,7 @@
  *    The invalid use of session key error received from a peer node.
  *
  */
-#define CHIP_ERROR_INVALID_USE_OF_SESSION_KEY_FROM_PEER        _CHIP_ERROR(130)
+#define CHIP_ERROR_INVALID_USE_OF_SESSION_KEY_FROM_PEER        CHIP_CORE_ERROR(130)
 
 /**
  *  @def CHIP_ERROR_UNSUPPORTED_ENCRYPTION_TYPE_FROM_PEER
@@ -1256,7 +1254,7 @@
  *    An unsupported encryption type error received from a peer node.
  *
  */
-#define CHIP_ERROR_UNSUPPORTED_ENCRYPTION_TYPE_FROM_PEER       _CHIP_ERROR(131)
+#define CHIP_ERROR_UNSUPPORTED_ENCRYPTION_TYPE_FROM_PEER       CHIP_CORE_ERROR(131)
 
 /**
  *  @def CHIP_ERROR_INTERNAL_KEY_ERROR_FROM_PEER
@@ -1265,7 +1263,7 @@
  *    The internal key error received from a peer node.
  *
  */
-#define CHIP_ERROR_INTERNAL_KEY_ERROR_FROM_PEER                _CHIP_ERROR(132)
+#define CHIP_ERROR_INTERNAL_KEY_ERROR_FROM_PEER                CHIP_CORE_ERROR(132)
 
 /**
  *  @def CHIP_ERROR_INVALID_KEY_ID
@@ -1274,7 +1272,7 @@
  *    A key id is invalid.
  *
  */
-#define CHIP_ERROR_INVALID_KEY_ID                              _CHIP_ERROR(133)
+#define CHIP_ERROR_INVALID_KEY_ID                              CHIP_CORE_ERROR(133)
 
 /**
  *  @def CHIP_ERROR_INVALID_TIME
@@ -1283,7 +1281,7 @@
  *    Time has invalid value.
  *
  */
-#define CHIP_ERROR_INVALID_TIME                                _CHIP_ERROR(134)
+#define CHIP_ERROR_INVALID_TIME                                CHIP_CORE_ERROR(134)
 
 /**
  *  @def CHIP_ERROR_LOCKING_FAILURE
@@ -1292,7 +1290,7 @@
  *    Failure to acquire or release an OS provided mutex.
  *
  */
-#define CHIP_ERROR_LOCKING_FAILURE                             _CHIP_ERROR(135)
+#define CHIP_ERROR_LOCKING_FAILURE                             CHIP_CORE_ERROR(135)
 
 /**
  *  @def CHIP_ERROR_UNSUPPORTED_PASSCODE_CONFIG
@@ -1301,7 +1299,7 @@
  *    A passcode encryption configuration is unsupported.
  *
  */
-#define CHIP_ERROR_UNSUPPORTED_PASSCODE_CONFIG                 _CHIP_ERROR(136)
+#define CHIP_ERROR_UNSUPPORTED_PASSCODE_CONFIG                 CHIP_CORE_ERROR(136)
 
 /**
  *  @def CHIP_ERROR_PASSCODE_AUTHENTICATION_FAILED
@@ -1310,7 +1308,7 @@
  *    The CHIP passcode authentication failed.
  *
  */
-#define CHIP_ERROR_PASSCODE_AUTHENTICATION_FAILED              _CHIP_ERROR(137)
+#define CHIP_ERROR_PASSCODE_AUTHENTICATION_FAILED              CHIP_CORE_ERROR(137)
 
 /**
  *  @def CHIP_ERROR_PASSCODE_FINGERPRINT_FAILED
@@ -1319,7 +1317,7 @@
  *    The CHIP passcode fingerprint failed.
  *
  */
-#define CHIP_ERROR_PASSCODE_FINGERPRINT_FAILED                 _CHIP_ERROR(138)
+#define CHIP_ERROR_PASSCODE_FINGERPRINT_FAILED                 CHIP_CORE_ERROR(138)
 
 /**
  *  @def CHIP_ERROR_SERIALIZATION_ELEMENT_NULL
@@ -1328,7 +1326,7 @@
  *      The element of the struct is null.
  *
  */
-#define CHIP_ERROR_SERIALIZATION_ELEMENT_NULL                  _CHIP_ERROR(139)
+#define CHIP_ERROR_SERIALIZATION_ELEMENT_NULL                  CHIP_CORE_ERROR(139)
 
 /**
  *  @def CHIP_ERROR_WRONG_CERT_SIGNATURE_ALGORITHM
@@ -1337,7 +1335,7 @@
  *    The certificate was not signed using the required signature algorithm.
  *
  */
-#define CHIP_ERROR_WRONG_CERT_SIGNATURE_ALGORITHM              _CHIP_ERROR(140)
+#define CHIP_ERROR_WRONG_CERT_SIGNATURE_ALGORITHM              CHIP_CORE_ERROR(140)
 
 /**
  *  @def CHIP_ERROR_WRONG_CHIP_SIGNATURE_ALGORITHM
@@ -1346,7 +1344,7 @@
  *    The CHIP signature was not signed using the required signature algorithm.
  *
  */
-#define CHIP_ERROR_WRONG_CHIP_SIGNATURE_ALGORITHM             _CHIP_ERROR(141)
+#define CHIP_ERROR_WRONG_CHIP_SIGNATURE_ALGORITHM              CHIP_CORE_ERROR(141)
 
 /**
  *  @def CHIP_ERROR_SCHEMA_MISMATCH
@@ -1355,7 +1353,7 @@
  *    A mismatch in schema was encountered.
  *
  */
-#define CHIP_ERROR_SCHEMA_MISMATCH                            _CHIP_ERROR(142)
+#define CHIP_ERROR_SCHEMA_MISMATCH                             CHIP_CORE_ERROR(142)
 
 /**
  *  @def CHIP_ERROR_INVALID_INTEGER_VALUE
@@ -1364,7 +1362,7 @@
  *    An integer does not have the kind of value we expect.
  *
  */
-#define CHIP_ERROR_INVALID_INTEGER_VALUE                       _CHIP_ERROR(143)
+#define CHIP_ERROR_INVALID_INTEGER_VALUE                       CHIP_CORE_ERROR(143)
 
 /**
  *  @def CHIP_ERROR_CASE_RECONFIG_REQUIRED
@@ -1373,7 +1371,7 @@
  *    CASE is required to reconfigure.
  *
  */
-#define CHIP_ERROR_CASE_RECONFIG_REQUIRED                      _CHIP_ERROR(144)
+#define CHIP_ERROR_CASE_RECONFIG_REQUIRED                      CHIP_CORE_ERROR(144)
 
 /**
  *  @def CHIP_ERROR_TOO_MANY_CASE_RECONFIGURATIONS
@@ -1382,7 +1380,7 @@
  *    Too many CASE reconfigurations were received.
  *
  */
-#define CHIP_ERROR_TOO_MANY_CASE_RECONFIGURATIONS              _CHIP_ERROR(145)
+#define CHIP_ERROR_TOO_MANY_CASE_RECONFIGURATIONS              CHIP_CORE_ERROR(145)
 
 /**
  *  @def CHIP_ERROR_BAD_REQUEST
@@ -1391,7 +1389,7 @@
  *    The request cannot be processed or fulfilled
  *
  */
-#define CHIP_ERROR_BAD_REQUEST                                 _CHIP_ERROR(146)
+#define CHIP_ERROR_BAD_REQUEST                                 CHIP_CORE_ERROR(146)
 
 /**
  *  @def CHIP_ERROR_INVALID_MESSAGE_FLAG
@@ -1400,7 +1398,7 @@
  *    One or more message flags have invalid value.
  *
  */
-#define CHIP_ERROR_INVALID_MESSAGE_FLAG                        _CHIP_ERROR(147)
+#define CHIP_ERROR_INVALID_MESSAGE_FLAG                        CHIP_CORE_ERROR(147)
 
 /**
  *  @def CHIP_ERROR_KEY_EXPORT_RECONFIGURE_REQUIRED
@@ -1409,7 +1407,7 @@
  *    Key export protocol required to reconfigure.
  *
  */
-#define CHIP_ERROR_KEY_EXPORT_RECONFIGURE_REQUIRED             _CHIP_ERROR(148)
+#define CHIP_ERROR_KEY_EXPORT_RECONFIGURE_REQUIRED             CHIP_CORE_ERROR(148)
 
 /**
  *  @def CHIP_ERROR_INVALID_KEY_EXPORT_CONFIGURATION
@@ -1418,7 +1416,7 @@
  *    A key export protocol configuration is invalid.
  *
  */
-#define CHIP_ERROR_INVALID_KEY_EXPORT_CONFIGURATION            _CHIP_ERROR(149)
+#define CHIP_ERROR_INVALID_KEY_EXPORT_CONFIGURATION            CHIP_CORE_ERROR(149)
 
 /**
  *  @def CHIP_ERROR_NO_COMMON_KEY_EXPORT_CONFIGURATIONS
@@ -1427,7 +1425,7 @@
  *    No key export protocol configuration is in common.
  *
  */
-#define CHIP_ERROR_NO_COMMON_KEY_EXPORT_CONFIGURATIONS         _CHIP_ERROR(150)
+#define CHIP_ERROR_NO_COMMON_KEY_EXPORT_CONFIGURATIONS         CHIP_CORE_ERROR(150)
 
 /**
  *  @def CHIP_ERROR_NO_KEY_EXPORT_DELEGATE
@@ -1436,7 +1434,7 @@
  *    No key export delegate is set.
  *
  */
-#define CHIP_ERROR_NO_KEY_EXPORT_DELEGATE                      _CHIP_ERROR(151)
+#define CHIP_ERROR_NO_KEY_EXPORT_DELEGATE                      CHIP_CORE_ERROR(151)
 
 /**
  *  @def CHIP_ERROR_UNAUTHORIZED_KEY_EXPORT_REQUEST
@@ -1445,7 +1443,7 @@
  *    Unauthorized key export request.
  *
  */
-#define CHIP_ERROR_UNAUTHORIZED_KEY_EXPORT_REQUEST             _CHIP_ERROR(152)
+#define CHIP_ERROR_UNAUTHORIZED_KEY_EXPORT_REQUEST             CHIP_CORE_ERROR(152)
 
 /**
  *  @def CHIP_ERROR_UNAUTHORIZED_KEY_EXPORT_RESPONSE
@@ -1454,7 +1452,7 @@
  *    Unauthorized key export response.
  *
  */
-#define CHIP_ERROR_UNAUTHORIZED_KEY_EXPORT_RESPONSE            _CHIP_ERROR(153)
+#define CHIP_ERROR_UNAUTHORIZED_KEY_EXPORT_RESPONSE            CHIP_CORE_ERROR(153)
 
 /**
  *  @def CHIP_ERROR_EXPORTED_KEY_AUTHENTICATION_FAILED
@@ -1463,7 +1461,7 @@
  *    The CHIP exported encrypted key authentication failed.
  *
  */
-#define CHIP_ERROR_EXPORTED_KEY_AUTHENTICATION_FAILED          _CHIP_ERROR(154)
+#define CHIP_ERROR_EXPORTED_KEY_AUTHENTICATION_FAILED          CHIP_CORE_ERROR(154)
 
 /**
  *  @def CHIP_ERROR_TOO_MANY_SHARED_SESSION_END_NODES
@@ -1473,7 +1471,7 @@
  *    the maximum limit.
  *
  */
-#define CHIP_ERROR_TOO_MANY_SHARED_SESSION_END_NODES           _CHIP_ERROR(155)
+#define CHIP_ERROR_TOO_MANY_SHARED_SESSION_END_NODES           CHIP_CORE_ERROR(155)
 
 /**
  * @def CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_DATA_ELEMENT
@@ -1482,7 +1480,7 @@
  *   The Attribute DataElement is malformed: it either does not contain
  *   the required elements
  */
-#define CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_DATA_ELEMENT         _CHIP_ERROR(156)
+#define CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_DATA_ELEMENT         CHIP_CORE_ERROR(156)
 
 /**
  * @def CHIP_ERROR_WRONG_CERT_TYPE
@@ -1490,7 +1488,7 @@
  * @brief
  *   The presented certificate was of the wrong type.
  */
-#define CHIP_ERROR_WRONG_CERT_TYPE                             _CHIP_ERROR(157)
+#define CHIP_ERROR_WRONG_CERT_TYPE                             CHIP_CORE_ERROR(157)
 
 /**
  * @def CHIP_ERROR_DEFAULT_EVENT_HANDLER_NOT_CALLED
@@ -1499,7 +1497,7 @@
  *   The application's event handler failed to call the default event handler function
  *   when presented with an unknown event.
  */
-#define CHIP_ERROR_DEFAULT_EVENT_HANDLER_NOT_CALLED            _CHIP_ERROR(158)
+#define CHIP_ERROR_DEFAULT_EVENT_HANDLER_NOT_CALLED            CHIP_CORE_ERROR(158)
 
 /**
  *  @def CHIP_ERROR_PERSISTED_STORAGE_FAILED
@@ -1508,7 +1506,7 @@
  *    Persisted storage memory read/write failure.
  *
  */
-#define CHIP_ERROR_PERSISTED_STORAGE_FAILED                    _CHIP_ERROR(159)
+#define CHIP_ERROR_PERSISTED_STORAGE_FAILED                    CHIP_CORE_ERROR(159)
 
 /**
  *  @def CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND
@@ -1517,7 +1515,7 @@
  *    The specific value is not found in the persisted storage.
  *
  */
-#define CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND           _CHIP_ERROR(160)
+#define CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND           CHIP_CORE_ERROR(160)
 
 /**
  *  @def CHIP_ERROR_PROFILE_STRING_CONTEXT_ALREADY_REGISTERED
@@ -1526,7 +1524,7 @@
  *    The specified profile string support context is already registered.
  *
  */
-#define CHIP_ERROR_PROFILE_STRING_CONTEXT_ALREADY_REGISTERED   _CHIP_ERROR(161)
+#define CHIP_ERROR_PROFILE_STRING_CONTEXT_ALREADY_REGISTERED   CHIP_CORE_ERROR(161)
 
 /**
  *  @def CHIP_ERROR_PROFILE_STRING_CONTEXT_NOT_REGISTERED
@@ -1535,7 +1533,7 @@
  *    The specified profile string support context is not registered.
  *
  */
-#define CHIP_ERROR_PROFILE_STRING_CONTEXT_NOT_REGISTERED       _CHIP_ERROR(162)
+#define CHIP_ERROR_PROFILE_STRING_CONTEXT_NOT_REGISTERED       CHIP_CORE_ERROR(162)
 
 /**
  *  @def CHIP_ERROR_INCOMPATIBLE_SCHEMA_VERSION
@@ -1543,7 +1541,7 @@
  *  @brief
  *    Encountered a mismatch in compatibility w.r.t to IDL schema version
  */
-#define CHIP_ERROR_INCOMPATIBLE_SCHEMA_VERSION                 _CHIP_ERROR(163)
+#define CHIP_ERROR_INCOMPATIBLE_SCHEMA_VERSION                 CHIP_CORE_ERROR(163)
 
 /**
  *  @def CHIP_ERROR_MISMATCH_UPDATE_REQUIRED_VERSION
@@ -1551,8 +1549,7 @@
  *  @brief
  *    Encountered a mismatch between update required version and current version
  */
-#define CHIP_ERROR_MISMATCH_UPDATE_REQUIRED_VERSION            _CHIP_ERROR(164)
-
+#define CHIP_ERROR_MISMATCH_UPDATE_REQUIRED_VERSION            CHIP_CORE_ERROR(164)
 
 /**
  *  @def CHIP_ERROR_ACCESS_DENIED
@@ -1560,7 +1557,7 @@
  *  @brief
  *    The CHIP message is not granted access for further processing.
  */
-#define CHIP_ERROR_ACCESS_DENIED                               _CHIP_ERROR(165)
+#define CHIP_ERROR_ACCESS_DENIED                               CHIP_CORE_ERROR(165)
 
 /**
  *  @def CHIP_ERROR_UNKNOWN_RESOURCE_ID
@@ -1569,7 +1566,7 @@
  *    Unknown resource ID
  *
  */
-#define CHIP_ERROR_UNKNOWN_RESOURCE_ID                         _CHIP_ERROR(166)
+#define CHIP_ERROR_UNKNOWN_RESOURCE_ID                         CHIP_CORE_ERROR(166)
 
 /**
  * @def CHIP_ERROR_VERSION_MISMATCH
@@ -1579,7 +1576,7 @@
  *   because the local changes are based on an obsolete version of the
  *   data.
  */
-#define CHIP_ERROR_VERSION_MISMATCH                            _CHIP_ERROR(167)
+#define CHIP_ERROR_VERSION_MISMATCH                            CHIP_CORE_ERROR(167)
 
 /**
  *  @def CHIP_ERROR_UNSUPPORTED_THREAD_NETWORK_CREATE
@@ -1590,7 +1587,7 @@
  *    together with CHIP Fabric using CrateFabric() message.
  *
  */
-#define CHIP_ERROR_UNSUPPORTED_THREAD_NETWORK_CREATE           _CHIP_ERROR(168)
+#define CHIP_ERROR_UNSUPPORTED_THREAD_NETWORK_CREATE           CHIP_CORE_ERROR(168)
 
 /**
  *  @def CHIP_ERROR_INCONSISTENT_CONDITIONALITY
@@ -1601,7 +1598,7 @@
  *    same Trait Instance.
  *
  */
-#define CHIP_ERROR_INCONSISTENT_CONDITIONALITY                 _CHIP_ERROR(169)
+#define CHIP_ERROR_INCONSISTENT_CONDITIONALITY                 CHIP_CORE_ERROR(169)
 
 /**
  *  @def CHIP_ERROR_LOCAL_DATA_INCONSISTENT
@@ -1611,7 +1608,7 @@
  *    Trait Instance and cannot support the operation requested.
  *
  */
-#define CHIP_ERROR_LOCAL_DATA_INCONSISTENT                     _CHIP_ERROR(170)
+#define CHIP_ERROR_LOCAL_DATA_INCONSISTENT                     CHIP_CORE_ERROR(170)
 
 /**
  * @def CHIP_EVENT_ID_FOUND
@@ -1619,7 +1616,8 @@
  * @brief
  *   Event ID matching the criteria was found
  */
-#define CHIP_EVENT_ID_FOUND                                    _CHIP_ERROR(171)
+#define CHIP_ERROR_EVENT_ID_FOUND                              CHIP_CORE_ERROR(171)
+#define CHIP_EVENT_ID_FOUND CHIP_ERROR_EVENT_ID_FOUND
 
 /**
  * @def CHIP_ERROR_INTERNAL
@@ -1627,7 +1625,7 @@
  * @brief
  *   Internal error
  */
-#define CHIP_ERROR_INTERNAL                                    _CHIP_ERROR(172)
+#define CHIP_ERROR_INTERNAL                                    CHIP_CORE_ERROR(172)
 
 /**
  * @def CHIP_ERROR_OPEN_FAILED
@@ -1635,7 +1633,7 @@
  * @brief
  *   Open file failed
  */
-#define CHIP_ERROR_OPEN_FAILED                                 _CHIP_ERROR(173)
+#define CHIP_ERROR_OPEN_FAILED                                 CHIP_CORE_ERROR(173)
 
 /**
  * @def CHIP_ERROR_READ_FAILED
@@ -1643,7 +1641,7 @@
  * @brief
  *   Read from file failed
  */
-#define CHIP_ERROR_READ_FAILED                                 _CHIP_ERROR(174)
+#define CHIP_ERROR_READ_FAILED                                 CHIP_CORE_ERROR(174)
 
 /**
  * @def CHIP_ERROR_WRITE_FAILED
@@ -1651,7 +1649,7 @@
  * @brief
  *   Write to file failed
  */
-#define CHIP_ERROR_WRITE_FAILED                                _CHIP_ERROR(175)
+#define CHIP_ERROR_WRITE_FAILED                                CHIP_CORE_ERROR(175)
 
 /**
  * @def CHIP_ERROR_DECODE_FAILED
@@ -1659,8 +1657,7 @@
  * @brief
  *   Decoding failed
  */
-#define CHIP_ERROR_DECODE_FAILED                               _CHIP_ERROR(176)
-
+#define CHIP_ERROR_DECODE_FAILED                               CHIP_CORE_ERROR(176)
 
 /**
  *  @def CHIP_ERROR_SESSION_KEY_SUSPENDED
@@ -1669,7 +1666,7 @@
  *    Use of the identified session key is suspended.
  *
  */
-#define CHIP_ERROR_SESSION_KEY_SUSPENDED                       _CHIP_ERROR(177)
+#define CHIP_ERROR_SESSION_KEY_SUSPENDED                       CHIP_CORE_ERROR(177)
 
 /**
  *  @def CHIP_ERROR_UNSUPPORTED_WIRELESS_REGULATORY_DOMAIN
@@ -1678,7 +1675,7 @@
  *    The specified wireless regulatory domain is unsupported.
  *
  */
-#define CHIP_ERROR_UNSUPPORTED_WIRELESS_REGULATORY_DOMAIN      _CHIP_ERROR(178)
+#define CHIP_ERROR_UNSUPPORTED_WIRELESS_REGULATORY_DOMAIN      CHIP_CORE_ERROR(178)
 
 /**
  *  @def CHIP_ERROR_UNSUPPORTED_WIRELESS_OPERATING_LOCATION
@@ -1687,7 +1684,7 @@
  *    The specified wireless operating location is unsupported.
  *
  */
-#define CHIP_ERROR_UNSUPPORTED_WIRELESS_OPERATING_LOCATION     _CHIP_ERROR(179)
+#define CHIP_ERROR_UNSUPPORTED_WIRELESS_OPERATING_LOCATION     CHIP_CORE_ERROR(179)
 
 /**
  *  @def CHIP_ERROR_MDNS_COLLISSION
@@ -1696,7 +1693,7 @@
  *    The registered service name has collision on the LAN.
  *
  */
-#define CHIP_ERROR_MDNS_COLLISSION _CHIP_ERROR(180)
+#define CHIP_ERROR_MDNS_COLLISSION                             CHIP_CORE_ERROR(180)
 
 /**
  * @def CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH
@@ -1705,7 +1702,7 @@
  *   The Attribute path is malformed: it either does not contain
  *   the required path
  */
-#define CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH                      _CHIP_ERROR(181)
+#define CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH                 CHIP_CORE_ERROR(181)
 
 /**
  * @def CHIP_ERROR_IM_MALFORMED_EVENT_PATH
@@ -1714,7 +1711,7 @@
  *   The Attribute Path is malformed: it either does not contain
  *   the required elements
  */
-#define CHIP_ERROR_IM_MALFORMED_EVENT_PATH                         _CHIP_ERROR(182)
+#define CHIP_ERROR_IM_MALFORMED_EVENT_PATH                     CHIP_CORE_ERROR(182)
 
 /**
  * @def CHIP_ERROR_IM_MALFORMED_COMMAND_PATH
@@ -1723,7 +1720,7 @@
  *   The Attribute DataElement is malformed: it either does not contain
  *   the required elements
  */
-#define CHIP_ERROR_IM_MALFORMED_COMMAND_PATH                     _CHIP_ERROR(183)
+#define CHIP_ERROR_IM_MALFORMED_COMMAND_PATH                   CHIP_CORE_ERROR(183)
 
 /**
  * @def CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_STATUS_ELEMENT
@@ -1732,7 +1729,7 @@
  *   The Attribute DataElement is malformed: it either does not contain
  *   the required elements
  */
-#define CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_STATUS_ELEMENT                      _CHIP_ERROR(184)
+#define CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_STATUS_ELEMENT       CHIP_CORE_ERROR(184)
 
 /**
  * @def CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT
@@ -1741,7 +1738,7 @@
  *   The Attribute DataElement is malformed: it either does not contain
  *   the required elements
  */
-#define CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT                      _CHIP_ERROR(185)
+#define CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT           CHIP_CORE_ERROR(185)
 
 /**
  * @def CHIP_ERROR_IM_MALFORMED_EVENT_DATA_ELEMENT
@@ -1750,7 +1747,7 @@
  *   The Event DataElement is malformed: it either does not contain
  *   the required elements
  */
-#define CHIP_ERROR_IM_MALFORMED_EVENT_DATA_ELEMENT                       _CHIP_ERROR(186)
+#define CHIP_ERROR_IM_MALFORMED_EVENT_DATA_ELEMENT             CHIP_CORE_ERROR(186)
 
 /**
  * @def CHIP_ERROR_IM_MALFORMED_STATUS_CODE
@@ -1759,7 +1756,7 @@
  *   The Attribute DataElement is malformed: it either does not contain
  *   the required elements
  */
-#define CHIP_ERROR_IM_MALFORMED_STATUS_CODE                      _CHIP_ERROR(187)
+#define CHIP_ERROR_IM_MALFORMED_STATUS_CODE                    CHIP_CORE_ERROR(187)
 
 /**
  * @def CHIP_ERROR_PEER_NODE_NOT_FOUND
@@ -1767,7 +1764,7 @@
  * @brief
  *   Unable to find the peer node
  */
-#define CHIP_ERROR_PEER_NODE_NOT_FOUND                           _CHIP_ERROR(188)
+#define CHIP_ERROR_PEER_NODE_NOT_FOUND                         CHIP_CORE_ERROR(188)
 
 /**
  * @def CHIP_ERROR_HSM
@@ -1775,7 +1772,7 @@
  * @brief
  *   Error in Hardware security module. Used for software fallback option.
  */
-#define CHIP_ERROR_HSM                      					_CHIP_ERROR(189)
+#define CHIP_ERROR_HSM                                         CHIP_CORE_ERROR(189)
 
 /**
  * @def CHIP_ERROR_INTERMEDIATE_CA_NOT_REQUIRED
@@ -1783,7 +1780,50 @@
  * @brief
  *   The commissioner doesn't require an intermediate CA to sign the operational certificates.
  */
-#define CHIP_ERROR_INTERMEDIATE_CA_NOT_REQUIRED                      _CHIP_ERROR(190)
+#define CHIP_ERROR_INTERMEDIATE_CA_NOT_REQUIRED                CHIP_CORE_ERROR(190)
+
+/**
+ *  @def CHIP_ERROR_REAL_TIME_NOT_SYNCED
+ *
+ *  @brief
+ *      The system's real time clock is not synchronized to an accurate time source.
+ */
+#define CHIP_ERROR_REAL_TIME_NOT_SYNCED                        CHIP_CORE_ERROR(191)
+
+/**
+ *  @def CHIP_ERROR_UNEXPECTED_EVENT
+ *
+ *  @brief
+ *      An unexpected event was encountered.
+ */
+#define CHIP_ERROR_UNEXPECTED_EVENT                            CHIP_CORE_ERROR(192)
+
+/**
+ *  @def CHIP_ERROR_ENDPOINT_POOL_FULL
+ *
+ *  @brief
+ *    No endpoint pool entry is available.
+ *
+ */
+#define CHIP_ERROR_ENDPOINT_POOL_FULL                          CHIP_CORE_ERROR(193)
+
+/**
+ *  @def CHIP_ERROR_INBOUND_MESSAGE_TOO_BIG
+ *
+ *  @brief
+ *    More inbound message data is pending than available buffer space available to copy it.
+ *
+ */
+#define CHIP_ERROR_INBOUND_MESSAGE_TOO_BIG                     CHIP_CORE_ERROR(194)
+
+/**
+ *  @def CHIP_ERROR_OUTBOUND_MESSAGE_TOO_BIG
+ *
+ *  @brief
+ *    More outbound message data is pending than available buffer space available to copy it.
+ *
+ */
+#define CHIP_ERROR_OUTBOUND_MESSAGE_TOO_BIG                    CHIP_CORE_ERROR(195)
 
 /**
  * @def CHIP_ERROR_DUPLICATE_MESSAGE_RECEIVED
@@ -1791,7 +1831,7 @@
  * @brief
  *   The received message is a duplicate of a previously received message.
  */
-#define CHIP_ERROR_DUPLICATE_MESSAGE_RECEIVED                      _CHIP_ERROR(191)
+#define CHIP_ERROR_DUPLICATE_MESSAGE_RECEIVED                  CHIP_CORE_ERROR(196)
 
 /**
  *  @}
@@ -1806,6 +1846,6 @@
 namespace chip {
 
 extern void RegisterCHIPLayerErrorFormatter();
-extern bool FormatCHIPError(char * buf, uint16_t bufSize, int32_t err);
+extern bool FormatCHIPError(char * buf, uint16_t bufSize, CHIP_ERROR err);
 
 } // namespace chip
diff --git a/src/lib/core/CHIPTLVUtilities.cpp b/src/lib/core/CHIPTLVUtilities.cpp
index 32d428f..f0f9691 100644
--- a/src/lib/core/CHIPTLVUtilities.cpp
+++ b/src/lib/core/CHIPTLVUtilities.cpp
@@ -54,7 +54,7 @@
  *                              any encountered arrays or structures should be
  *                              descended into.
  *
- *  @retval  #CHIP_END_OF_TLV  On a successful iteration to the end of a TLV encoding,
+ *  @retval  #CHIP_END_OF_TLV   On a successful iteration to the end of a TLV encoding,
  *                              or to the end of a TLV container.
  *
  *  @retval  The last value returned by @a aHandler, if different than #CHIP_NO_ERROR
@@ -239,7 +239,7 @@
  *
  *  @retval  #CHIP_ERROR_INVALID_ARGUMENT  If @a aContext is NULL.
  *
- *  @retval  #CHIP_ERROR_MAX               If the specified tag is found.
+ *  @retval  #CHIP_ERROR_SENTINEL          If the specified tag is found.
  *
  */
 static CHIP_ERROR FindHandler(const TLVReader & aReader, size_t aDepth, void * aContext)
@@ -251,7 +251,7 @@
     {
         theContext->mReader.Init(aReader);
         // terminate the iteration when the specified tag is found
-        return CHIP_ERROR_MAX;
+        return CHIP_ERROR_SENTINEL;
     }
 
     return CHIP_NO_ERROR;
@@ -302,7 +302,7 @@
     FindContext theContext = { aTag, aResult };
     CHIP_ERROR retval      = Iterate(aReader, FindHandler, &theContext, aRecurse);
 
-    if (retval == CHIP_ERROR_MAX)
+    if (retval == CHIP_ERROR_SENTINEL)
         retval = CHIP_NO_ERROR;
     else
         retval = CHIP_ERROR_TLV_TAG_NOT_FOUND;
@@ -329,7 +329,7 @@
 
     err = theContext->mHandler(aReader, aDepth, theContext->mContext);
 
-    if (err == CHIP_ERROR_MAX)
+    if (err == CHIP_ERROR_SENTINEL)
         theContext->mResult.Init(aReader);
 
     return err;
@@ -338,7 +338,7 @@
 /**
  *  Search for the first element matching the predicate within the TLV reader
  *  descending into arrays or structures. The @a aPredicate is applied
- *  to each visited TLV element; the @a aPredicate shall return #CHIP_ERROR_MAX
+ *  to each visited TLV element; the @a aPredicate shall return #CHIP_ERROR_SENTINEL
  *  for the matching elements, #CHIP_NO_ERROR for non-matching elements, and any
  *  other value to terminate the search.
  *
@@ -347,10 +347,10 @@
  *  @param[in] aPredicate  A predicate to be applied to each TLV element.  To
  *                         support the code reuse, aPredicate has the
  *                         IterateHandler type.  The return value of aPredicate
- *                         controls the search: a #CHIP_ERROR_MAX signals that
+ *                         controls the search: a #CHIP_ERROR_SENTINEL signals that
  *                         desired element has been found, #CHIP_NO_ERROR
  *                         signals that the desired element has not been found,
- *                         and all other values signal that the saerch should be
+ *                         and all other values signal that the search should be
  *                         terminated.
  *  @param[in] aContext    An optional pointer to caller-provided context data.
  *
@@ -371,7 +371,7 @@
 /**
  *  Search for the first element matching the predicate within the TLV reader
  *  optionally descending into arrays or structures. The @a aPredicate is applied
- *  to each visited TLV element; the @a aPredicate shall return #CHIP_ERROR_MAX
+ *  to each visited TLV element; the @a aPredicate shall return #CHIP_ERROR_SENTINEL
  *  for the matching elements, #CHIP_NO_ERROR for non-matching elements, and any
  *  other value to terminate the search.
  *
@@ -380,7 +380,7 @@
  *  @param[in] aPredicate  A predicate to be applied to each TLV element.  To
  *                         support the code reuse, aPredicate has the
  *                         @a IterateHandler type.  The return value of aPredicate
- *                         controls the search: a #CHIP_ERROR_MAX signals that
+ *                         controls the search: a #CHIP_ERROR_SENTINEL signals that
  *                         desired element has been found, #CHIP_NO_ERROR
  *                         signals that the desired element has not been found,
  *                         and all other values signal that the saerch should be
@@ -405,7 +405,7 @@
 
     retval = Iterate(aReader, FindPredicateHandler, &theContext, aRecurse);
 
-    if (retval == CHIP_ERROR_MAX)
+    if (retval == CHIP_ERROR_SENTINEL)
         retval = CHIP_NO_ERROR;
     else
         retval = CHIP_ERROR_TLV_TAG_NOT_FOUND;
diff --git a/src/lib/core/tests/TestCHIPErrorStr.cpp b/src/lib/core/tests/TestCHIPErrorStr.cpp
index 8d6d950..93b1fde 100644
--- a/src/lib/core/tests/TestCHIPErrorStr.cpp
+++ b/src/lib/core/tests/TestCHIPErrorStr.cpp
@@ -47,7 +47,7 @@
 // Test input data.
 
 // clang-format off
-static int32_t sContext[] =
+static CHIP_ERROR sContext[] =
 {
     CHIP_ERROR_TOO_MANY_CONNECTIONS,
     CHIP_ERROR_SENDING_BLOCKED,
@@ -236,7 +236,7 @@
     RegisterCHIPLayerErrorFormatter();
 
     // For each defined error...
-    for (int err : sContext)
+    for (CHIP_ERROR err : sContext)
     {
         const char * errStr = ErrorStr(err);
         char expectedText[9];
diff --git a/src/lib/core/tests/TestCHIPTLV.cpp b/src/lib/core/tests/TestCHIPTLV.cpp
index 3c43c26..6047cfd 100644
--- a/src/lib/core/tests/TestCHIPTLV.cpp
+++ b/src/lib/core/tests/TestCHIPTLV.cpp
@@ -1468,7 +1468,7 @@
         // Map a successful find (CHIP_NO_ERROR) onto a signal that the element has been found.
         if (err == CHIP_NO_ERROR)
         {
-            err = CHIP_ERROR_MAX;
+            err = CHIP_ERROR_SENTINEL;
         }
         // Map a failed find attempt to NO_ERROR
         else if (err == CHIP_ERROR_TLV_TAG_NOT_FOUND)
diff --git a/src/lib/shell/Engine.cpp b/src/lib/shell/Engine.cpp
index 2f2fcd5..d57252a 100644
--- a/src/lib/shell/Engine.cpp
+++ b/src/lib/shell/Engine.cpp
@@ -71,9 +71,9 @@
     ++_commandSetCount;
 }
 
-int Engine::ExecCommand(int argc, char * argv[])
+CHIP_ERROR Engine::ExecCommand(int argc, char * argv[])
 {
-    int retval = CHIP_ERROR_INVALID_ARGUMENT;
+    CHIP_ERROR retval = CHIP_ERROR_INVALID_ARGUMENT;
 
     VerifyOrReturnError(argc > 0, retval);
     // Find the command
diff --git a/src/lib/shell/Engine.h b/src/lib/shell/Engine.h
index 15a3be4..da3163a 100644
--- a/src/lib/shell/Engine.h
+++ b/src/lib/shell/Engine.h
@@ -25,6 +25,8 @@
 
 #include "streamer.h"
 
+#include <core/CHIPError.h>
+
 #include <stdarg.h>
 #include <stddef.h>
 
@@ -55,7 +57,7 @@
  *
  * @return                      0 on success; CHIP_ERROR[...] on failure.
  */
-typedef int shell_command_fn(int argc, char * argv[]);
+typedef CHIP_ERROR shell_command_fn(int argc, char * argv[]);
 
 /**
  * Descriptor structure for a single command.
@@ -87,9 +89,9 @@
  * @param command               The shell command being iterated.
  * @param arg                   A context variable passed to the iterator function.
  *
- * @return                      0 continue iteration; 1 break iteration.
+ * @return                      CHIP_NO_ERROR to continue iteration; anything else to break iteration.
  */
-typedef int shell_command_iterator_t(shell_command_t * command, void * arg);
+typedef CHIP_ERROR shell_command_iterator_t(shell_command_t * command, void * arg);
 
 class Engine
 {
@@ -130,9 +132,9 @@
      * @param argc                  Number of arguments in argv.
      * @param argv                  Array of arguments in the tokenized command line to execute.
      *
-     * @return                      0 on success; CHIP_ERROR[...] on failure.
+     * @return                      CHIP_NO_ERROR on success; CHIP_ERROR[...] on failure.
      */
-    int ExecCommand(int argc, char * argv[]);
+    CHIP_ERROR ExecCommand(int argc, char * argv[]);
 
     /**
      * Registers a command set, or array of commands with the shell.
diff --git a/src/lib/shell/MainLoopDefault.cpp b/src/lib/shell/MainLoopDefault.cpp
index 9266d45..22351e2 100644
--- a/src/lib/shell/MainLoopDefault.cpp
+++ b/src/lib/shell/MainLoopDefault.cpp
@@ -145,7 +145,6 @@
 
 void ProcessShellLine(intptr_t args)
 {
-    int retval;
     int argc;
     char * argv[CHIP_SHELL_MAX_TOKENS];
 
@@ -154,7 +153,7 @@
 
     if (argc > 0)
     {
-        retval = Engine::Root().ExecCommand(argc, argv);
+        CHIP_ERROR retval = Engine::Root().ExecCommand(argc, argv);
 
         if (retval)
         {
diff --git a/src/lib/shell/commands/BLE.cpp b/src/lib/shell/commands/BLE.cpp
index b652638..3e991ae 100644
--- a/src/lib/shell/commands/BLE.cpp
+++ b/src/lib/shell/commands/BLE.cpp
@@ -33,13 +33,13 @@
 
 static chip::Shell::Engine sShellDeviceSubcommands;
 
-int BLEHelpHandler(int argc, char ** argv)
+CHIP_ERROR BLEHelpHandler(int argc, char ** argv)
 {
     sShellDeviceSubcommands.ForEachCommand(PrintCommandHelp, nullptr);
-    return 0;
+    return CHIP_NO_ERROR;
 }
 
-int BLEAdvertiseHandler(int argc, char ** argv)
+CHIP_ERROR BLEAdvertiseHandler(int argc, char ** argv)
 {
     CHIP_ERROR error  = CHIP_NO_ERROR;
     streamer_t * sout = streamer_get();
@@ -91,7 +91,7 @@
     return error;
 }
 
-int BLEDispatch(int argc, char ** argv)
+CHIP_ERROR BLEDispatch(int argc, char ** argv)
 {
     if (argc == 0)
     {
diff --git a/src/lib/shell/commands/Base64.cpp b/src/lib/shell/commands/Base64.cpp
index f2518a3..52db733 100644
--- a/src/lib/shell/commands/Base64.cpp
+++ b/src/lib/shell/commands/Base64.cpp
@@ -35,13 +35,13 @@
 namespace chip {
 namespace Shell {
 
-static int Base64HelpHandler(int argc, char ** argv)
+static CHIP_ERROR Base64HelpHandler(int argc, char ** argv)
 {
     sShellBase64Commands.ForEachCommand(PrintCommandHelp, nullptr);
-    return 0;
+    return CHIP_NO_ERROR;
 }
 
-static int Base64DecodeHandler(int argc, char ** argv)
+static CHIP_ERROR Base64DecodeHandler(int argc, char ** argv)
 {
     streamer_t * sout = streamer_get();
     uint32_t binarySize;
@@ -54,7 +54,7 @@
     return CHIP_NO_ERROR;
 }
 
-static int Base64EncodeHandler(int argc, char ** argv)
+static CHIP_ERROR Base64EncodeHandler(int argc, char ** argv)
 {
     streamer_t * sout = streamer_get();
     char base64[256];
@@ -68,17 +68,13 @@
     return CHIP_NO_ERROR;
 }
 
-static int Base64Dispatch(int argc, char ** argv)
+static CHIP_ERROR Base64Dispatch(int argc, char ** argv)
 {
-    CHIP_ERROR error = CHIP_NO_ERROR;
-
     if (argc == 0)
     {
-        Base64HelpHandler(argc, argv);
-        return error;
+        return Base64HelpHandler(argc, argv);
     }
-    error = sShellBase64Commands.ExecCommand(argc, argv);
-    return error;
+    return sShellBase64Commands.ExecCommand(argc, argv);
 }
 
 void RegisterBase64Commands()
diff --git a/src/lib/shell/commands/Config.cpp b/src/lib/shell/commands/Config.cpp
index 1bc778d..d486e6c 100644
--- a/src/lib/shell/commands/Config.cpp
+++ b/src/lib/shell/commands/Config.cpp
@@ -128,7 +128,7 @@
     return CHIP_NO_ERROR;
 }
 
-static int PrintAllConfigs()
+static CHIP_ERROR PrintAllConfigs()
 {
     CHIP_ERROR error = CHIP_NO_ERROR;
 
@@ -145,10 +145,8 @@
     return (error) ? CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND : CHIP_NO_ERROR;
 }
 
-static int ConfigHandler(int argc, char ** argv)
+static CHIP_ERROR ConfigHandler(int argc, char ** argv)
 {
-    CHIP_ERROR error = CHIP_NO_ERROR;
-
     if (argc == 0)
     {
         return PrintAllConfigs();
@@ -160,27 +158,27 @@
     }
     else if (strcmp(argv[0], "productid") == 0)
     {
-        return error = ConfigGetProductId(false);
+        return ConfigGetProductId(false);
     }
     else if (strcmp(argv[0], "productrev") == 0)
     {
-        return error = ConfigGetProductRevision(false);
+        return ConfigGetProductRevision(false);
     }
     else if (strcmp(argv[0], "deviceid") == 0)
     {
-        return error = ConfigGetDeviceId(false);
+        return ConfigGetDeviceId(false);
     }
     else if (strcmp(argv[0], "pincode") == 0)
     {
-        return error = ConfigGetSetupPinCode(false);
+        return ConfigGetSetupPinCode(false);
     }
     else if (strcmp(argv[0], "discriminator") == 0)
     {
-        return error = ConfigGetSetupDiscriminator(false);
+        return ConfigGetSetupDiscriminator(false);
     }
     else if (strcmp(argv[0], "fabricid") == 0)
     {
-        return error = ConfigGetFabricId(false);
+        return ConfigGetFabricId(false);
     }
     else
     {
diff --git a/src/lib/shell/commands/Device.cpp b/src/lib/shell/commands/Device.cpp
index 6b17629..b0c3562 100644
--- a/src/lib/shell/commands/Device.cpp
+++ b/src/lib/shell/commands/Device.cpp
@@ -39,14 +39,14 @@
     return 0;
 }
 
-static int FactoryResetHandler(int argc, char ** argv)
+static CHIP_ERROR FactoryResetHandler(int argc, char ** argv)
 {
     streamer_printf(streamer_get(), "Performing factory reset ... \r\n");
     DeviceLayer::ConfigurationMgr().InitiateFactoryReset();
-    return 0;
+    return CHIP_NO_ERROR;
 }
 
-static int DeviceHandler(int argc, char ** argv)
+static CHIP_ERROR DeviceHandler(int argc, char ** argv)
 {
     if (argc == 0)
     {
diff --git a/src/lib/shell/commands/Help.cpp b/src/lib/shell/commands/Help.cpp
index 76f4244..7fdbc4c 100644
--- a/src/lib/shell/commands/Help.cpp
+++ b/src/lib/shell/commands/Help.cpp
@@ -27,10 +27,10 @@
 namespace chip {
 namespace Shell {
 
-int PrintCommandHelp(shell_command_t * command, void * arg)
+CHIP_ERROR PrintCommandHelp(shell_command_t * command, void * arg)
 {
     streamer_printf(streamer_get(), "  %-15s %s\r\n", command->cmd_name, command->cmd_help);
-    return 0;
+    return CHIP_NO_ERROR;
 }
 
 } // namespace Shell
diff --git a/src/lib/shell/commands/Help.h b/src/lib/shell/commands/Help.h
index 2a72bb5..4577d91 100644
--- a/src/lib/shell/commands/Help.h
+++ b/src/lib/shell/commands/Help.h
@@ -27,7 +27,7 @@
 namespace chip {
 namespace Shell {
 
-int PrintCommandHelp(shell_command_t * command, void * arg);
+CHIP_ERROR PrintCommandHelp(shell_command_t * command, void * arg);
 
 } // namespace Shell
 } // namespace chip
diff --git a/src/lib/shell/commands/Meta.cpp b/src/lib/shell/commands/Meta.cpp
index 2e95e8f..eef589a 100644
--- a/src/lib/shell/commands/Meta.cpp
+++ b/src/lib/shell/commands/Meta.cpp
@@ -36,20 +36,20 @@
 namespace chip {
 namespace Shell {
 
-static int ExitHandler(int argc, char ** argv)
+static CHIP_ERROR ExitHandler(int argc, char ** argv)
 {
     streamer_printf(streamer_get(), "Goodbye\r\n");
     exit(0);
     return 0;
 }
 
-static int HelpHandler(int argc, char ** argv)
+static CHIP_ERROR HelpHandler(int argc, char ** argv)
 {
     Engine::Root().ForEachCommand(PrintCommandHelp, nullptr);
     return 0;
 }
 
-static int VersionHandler(int argc, char ** argv)
+static CHIP_ERROR VersionHandler(int argc, char ** argv)
 {
     streamer_printf(streamer_get(), "CHIP %s\r\n", CHIP_VERSION_STRING);
     return 0;
diff --git a/src/lib/shell/commands/OnboardingCodes.cpp b/src/lib/shell/commands/OnboardingCodes.cpp
index 2d7d82a..5b9bf90 100644
--- a/src/lib/shell/commands/OnboardingCodes.cpp
+++ b/src/lib/shell/commands/OnboardingCodes.cpp
@@ -91,10 +91,8 @@
     return error;
 }
 
-static int OnboardingHandler(int argc, char ** argv)
+static CHIP_ERROR OnboardingHandler(int argc, char ** argv)
 {
-    CHIP_ERROR error = CHIP_NO_ERROR;
-
     if (argc == 0)
     {
         return PrintAllOnboardingCodes();
@@ -106,11 +104,11 @@
     }
     else if (strcmp(argv[0], "qrcodeurl") == 0)
     {
-        return error = GetOnboardingQRCodeUrl(false);
+        return GetOnboardingQRCodeUrl(false);
     }
     else if (strcmp(argv[0], "manualpairingcode") == 0)
     {
-        return error = GetOnboardingManualPairingCode(false);
+        return GetOnboardingManualPairingCode(false);
     }
     else
     {
diff --git a/src/lib/shell/commands/WiFi.cpp b/src/lib/shell/commands/WiFi.cpp
index e282b9f..a25d63f 100644
--- a/src/lib/shell/commands/WiFi.cpp
+++ b/src/lib/shell/commands/WiFi.cpp
@@ -37,10 +37,10 @@
 
 static chip::Shell::Engine sShellWifiSubCommands;
 
-static int WiFiHelpHandler(int argc, char ** argv)
+static CHIP_ERROR WiFiHelpHandler(int argc, char ** argv)
 {
     sShellWifiSubCommands.ForEachCommand(PrintCommandHelp, nullptr);
-    return 0;
+    return CHIP_NO_ERROR;
 }
 
 static int PrintWifiMode()
@@ -96,7 +96,7 @@
     return 0;
 }
 
-static int WiFiModeHandler(int argc, char ** argv)
+static CHIP_ERROR WiFiModeHandler(int argc, char ** argv)
 {
     if (argc == 0)
     {
@@ -109,7 +109,7 @@
     return SetWifiMode(argv[0]);
 }
 
-static int WiFiConnectHandler(int argc, char ** argv)
+static CHIP_ERROR WiFiConnectHandler(int argc, char ** argv)
 {
     if (argc != 2)
     {
@@ -119,7 +119,7 @@
     return deviceDelegate.ProvisionWiFi(argv[0], argv[1]);
 }
 
-static int WiFiDispatch(int argc, char ** argv)
+static CHIP_ERROR WiFiDispatch(int argc, char ** argv)
 {
     if (argc == 0)
     {
diff --git a/src/lib/support/ErrorStr.cpp b/src/lib/support/ErrorStr.cpp
index f6cee46..bea328d 100644
--- a/src/lib/support/ErrorStr.cpp
+++ b/src/lib/support/ErrorStr.cpp
@@ -54,7 +54,7 @@
  * @return A pointer to a NULL-terminated C string describing the
  *         provided error.
  */
-DLL_EXPORT const char * ErrorStr(int32_t err)
+DLL_EXPORT const char * ErrorStr(CHIP_ERROR err)
 {
     if (err == 0)
     {
@@ -137,7 +137,7 @@
  * @param[in] desc                  A string describing the cause or meaning of the error,
  *                                  or NULL if no such information is available.
  */
-DLL_EXPORT void FormatError(char * buf, uint16_t bufSize, const char * subsys, int32_t err, const char * desc)
+DLL_EXPORT void FormatError(char * buf, uint16_t bufSize, const char * subsys, CHIP_ERROR err, const char * desc)
 {
 #if CHIP_CONFIG_SHORT_ERROR_STR
 
@@ -166,8 +166,8 @@
         descSep = "";
     }
 
-    (void) snprintf(buf, bufSize, "%s%sError %" PRId32 " (0x%08" PRIX32 ")%s%s", subsys, subsysSep, err, static_cast<uint32_t>(err),
-                    descSep, desc);
+    (void) snprintf(buf, bufSize, "%s%sError %" CHIP_ERROR_FORMAT " (0x%08" PRIX32 ")%s%s", subsys, subsysSep, err,
+                    static_cast<uint32_t>(err), descSep, desc);
 
 #endif // CHIP_CONFIG_SHORT_ERROR_STR
 }
diff --git a/src/lib/support/ErrorStr.h b/src/lib/support/ErrorStr.h
index 676ff93..b5fe66a 100644
--- a/src/lib/support/ErrorStr.h
+++ b/src/lib/support/ErrorStr.h
@@ -27,22 +27,23 @@
 
 #include <stdint.h>
 
+#include <core/CHIPError.h>
 #include <support/DLLUtil.h>
 
 namespace chip {
 
 struct ErrorFormatter
 {
-    typedef bool (*FormatFunct)(char * buf, uint16_t bufSize, int32_t err);
+    typedef bool (*FormatFunct)(char * buf, uint16_t bufSize, CHIP_ERROR err);
 
     FormatFunct FormatError;
     ErrorFormatter * Next;
 };
 
-extern const char * ErrorStr(int32_t err);
+extern const char * ErrorStr(CHIP_ERROR err);
 extern void RegisterErrorFormatter(ErrorFormatter * errFormatter);
 extern void DeregisterErrorFormatter(ErrorFormatter * errFormatter);
-extern void FormatError(char * buf, uint16_t bufSize, const char * subsys, int32_t err, const char * desc);
+extern void FormatError(char * buf, uint16_t bufSize, const char * subsys, CHIP_ERROR err, const char * desc);
 
 extern const char * StatusReportStr(uint32_t profileId, uint16_t statusCode);
 
diff --git a/src/lib/support/tests/TestErrorStr.cpp b/src/lib/support/tests/TestErrorStr.cpp
index 95c9819..c04b7c6 100644
--- a/src/lib/support/tests/TestErrorStr.cpp
+++ b/src/lib/support/tests/TestErrorStr.cpp
@@ -34,19 +34,19 @@
         : (fprintf(stderr, "%s:%d: error: CHECK_EQ_STR(\"%s\", \"%s\") failed\n", __FUNCTION__, __LINE__, (a), (b)), false)
 
 static int falseFormatCalled = 0;
-static bool falseFormat(char * buf, uint16_t bufSize, int32_t err)
+static bool falseFormat(char * buf, uint16_t bufSize, CHIP_ERROR err)
 {
     falseFormatCalled += 1;
     return false; // means keep going
 }
 static int falseFormat2Called = 0;
-static bool falseFormat2(char * buf, uint16_t bufSize, int32_t err)
+static bool falseFormat2(char * buf, uint16_t bufSize, CHIP_ERROR err)
 {
     falseFormat2Called += 1;
     return false; // means keep going
 }
 static int trueFormatCalled = 0;
-static bool trueFormat(char * buf, uint16_t bufSize, int32_t err)
+static bool trueFormat(char * buf, uint16_t bufSize, CHIP_ERROR err)
 {
     trueFormatCalled += 1;
     return true; // means I handled it
@@ -154,7 +154,7 @@
     ret &= CHECK_EQ_STR(buf, "Error 1 (0x00000001)");
 
     // negative
-    FormatError(buf, kBufSize, nullptr, -1, nullptr);
+    FormatError(buf, kBufSize, nullptr, static_cast<CHIP_ERROR>(-1), nullptr);
     ret &= CHECK_EQ_STR(buf, "Error -1 (0xFFFFFFFF)");
 #endif
 
diff --git a/src/messaging/ErrorCategory.cpp b/src/messaging/ErrorCategory.cpp
index 331d702..d213cf7 100644
--- a/src/messaging/ErrorCategory.cpp
+++ b/src/messaging/ErrorCategory.cpp
@@ -77,8 +77,8 @@
  */
 bool IsSendErrorNonCritical(CHIP_ERROR err)
 {
-    return (err == INET_ERROR_NOT_IMPLEMENTED || err == INET_ERROR_OUTBOUND_MESSAGE_TRUNCATED ||
-            err == INET_ERROR_MESSAGE_TOO_LONG || err == INET_ERROR_NO_MEMORY || CHIP_CONFIG_IsPlatformErrorNonCritical(err));
+    return (err == CHIP_ERROR_NOT_IMPLEMENTED || err == CHIP_ERROR_OUTBOUND_MESSAGE_TOO_BIG || err == CHIP_ERROR_MESSAGE_TOO_LONG ||
+            err == CHIP_ERROR_NO_MEMORY || CHIP_CONFIG_IsPlatformErrorNonCritical(err));
 }
 
 } // namespace Messaging
diff --git a/src/messaging/ExchangeContext.cpp b/src/messaging/ExchangeContext.cpp
index 2dfa925..4cdbc17 100644
--- a/src/messaging/ExchangeContext.cpp
+++ b/src/messaging/ExchangeContext.cpp
@@ -344,7 +344,7 @@
     lSystemLayer->CancelTimer(HandleResponseTimeout, this);
 }
 
-void ExchangeContext::HandleResponseTimeout(System::Layer * aSystemLayer, void * aAppState, System::Error aError)
+void ExchangeContext::HandleResponseTimeout(System::Layer * aSystemLayer, void * aAppState, CHIP_ERROR aError)
 {
     ExchangeContext * ec = reinterpret_cast<ExchangeContext *>(aAppState);
 
diff --git a/src/messaging/ExchangeContext.h b/src/messaging/ExchangeContext.h
index 8c8c603..5a83e66 100644
--- a/src/messaging/ExchangeContext.h
+++ b/src/messaging/ExchangeContext.h
@@ -226,7 +226,7 @@
     CHIP_ERROR StartResponseTimer();
 
     void CancelResponseTimer();
-    static void HandleResponseTimeout(System::Layer * aSystemLayer, void * aAppState, System::Error aError);
+    static void HandleResponseTimeout(System::Layer * aSystemLayer, void * aAppState, CHIP_ERROR aError);
 
     void DoClose(bool clearRetransTable);
 };
diff --git a/src/messaging/ReliableMessageMgr.cpp b/src/messaging/ReliableMessageMgr.cpp
index 54e0ea8..6b143c9 100644
--- a/src/messaging/ReliableMessageMgr.cpp
+++ b/src/messaging/ReliableMessageMgr.cpp
@@ -234,7 +234,7 @@
 #endif
 }
 
-void ReliableMessageMgr::Timeout(System::Layer * aSystemLayer, void * aAppState, System::Error aError)
+void ReliableMessageMgr::Timeout(System::Layer * aSystemLayer, void * aAppState, CHIP_ERROR aError)
 {
     ReliableMessageMgr * manager = reinterpret_cast<ReliableMessageMgr *>(aAppState);
 
diff --git a/src/messaging/ReliableMessageMgr.h b/src/messaging/ReliableMessageMgr.h
index 29dde3d..ea105de 100644
--- a/src/messaging/ReliableMessageMgr.h
+++ b/src/messaging/ReliableMessageMgr.h
@@ -102,7 +102,7 @@
      * Handle physical wakeup of system due to ReliableMessageProtocol wakeup.
      *
      */
-    static void Timeout(System::Layer * aSystemLayer, void * aAppState, System::Error aError);
+    static void Timeout(System::Layer * aSystemLayer, void * aAppState, CHIP_ERROR aError);
 
     /**
      *  Add a CHIP message into the retransmission table to be subsequently resent if a corresponding acknowledgment
diff --git a/src/messaging/tests/TestReliableMessageProtocol.cpp b/src/messaging/tests/TestReliableMessageProtocol.cpp
index 8e09873..b25b1a7 100644
--- a/src/messaging/tests/TestReliableMessageProtocol.cpp
+++ b/src/messaging/tests/TestReliableMessageProtocol.cpp
@@ -305,7 +305,7 @@
 
     // 1 tick is 64 ms, sleep 65 ms to trigger first re-transmit
     test_os_sleep_ms(65);
-    ReliableMessageMgr::Timeout(&ctx.GetSystemLayer(), rm, CHIP_SYSTEM_NO_ERROR);
+    ReliableMessageMgr::Timeout(&ctx.GetSystemLayer(), rm, CHIP_NO_ERROR);
 
     // Ensure the retransmit message was dropped, and is still there in the retransmit table
     NL_TEST_ASSERT(inSuite, gLoopback.mSendMessageCount == 2);
@@ -315,7 +315,7 @@
 
     // sleep another 65 ms to trigger second re-transmit
     test_os_sleep_ms(65);
-    ReliableMessageMgr::Timeout(&ctx.GetSystemLayer(), rm, CHIP_SYSTEM_NO_ERROR);
+    ReliableMessageMgr::Timeout(&ctx.GetSystemLayer(), rm, CHIP_NO_ERROR);
 
     // Ensure the retransmit message was NOT dropped, and the retransmit table is empty, as we should have gotten an ack
     NL_TEST_ASSERT(inSuite, gLoopback.mSendMessageCount >= 3);
@@ -371,7 +371,7 @@
 
     // 1 tick is 64 ms, sleep 65 ms to trigger first re-transmit
     test_os_sleep_ms(65);
-    ReliableMessageMgr::Timeout(&ctx.GetSystemLayer(), rm, CHIP_SYSTEM_NO_ERROR);
+    ReliableMessageMgr::Timeout(&ctx.GetSystemLayer(), rm, CHIP_NO_ERROR);
 
     // Ensure the retransmit message was dropped, and is still there in the retransmit table
     NL_TEST_ASSERT(inSuite, gLoopback.mSendMessageCount == 2);
@@ -381,7 +381,7 @@
 
     // sleep another 65 ms to trigger second re-transmit
     test_os_sleep_ms(65);
-    ReliableMessageMgr::Timeout(&ctx.GetSystemLayer(), rm, CHIP_SYSTEM_NO_ERROR);
+    ReliableMessageMgr::Timeout(&ctx.GetSystemLayer(), rm, CHIP_NO_ERROR);
 
     // Ensure the retransmit message was NOT dropped, and the retransmit table is empty, as we should have gotten an ack
     NL_TEST_ASSERT(inSuite, gLoopback.mSendMessageCount >= 3);
@@ -436,7 +436,7 @@
 
     // 1 tick is 64 ms, sleep 65 ms to trigger first re-transmit
     test_os_sleep_ms(65);
-    ReliableMessageMgr::Timeout(&ctx.GetSystemLayer(), rm, CHIP_SYSTEM_NO_ERROR);
+    ReliableMessageMgr::Timeout(&ctx.GetSystemLayer(), rm, CHIP_NO_ERROR);
 
     // Ensure the retransmit table is empty, as we did not provide a message to retain
     NL_TEST_ASSERT(inSuite, rm->TestGetCountRetransTable() == 0);
@@ -497,7 +497,7 @@
 
     // 1 tick is 64 ms, sleep 65 ms to trigger first re-transmit
     test_os_sleep_ms(65);
-    ReliableMessageMgr::Timeout(&ctx.GetSystemLayer(), rm, CHIP_SYSTEM_NO_ERROR);
+    ReliableMessageMgr::Timeout(&ctx.GetSystemLayer(), rm, CHIP_NO_ERROR);
 
     // Ensure the retransmit message was not dropped, and is no longer in the retransmit table
     NL_TEST_ASSERT(inSuite, gLoopback.mSendMessageCount >= 2);
@@ -574,7 +574,7 @@
 
     // 1 tick is 64 ms, sleep 65 ms to trigger first re-transmit
     test_os_sleep_ms(65);
-    ReliableMessageMgr::Timeout(&ctx.GetSystemLayer(), rm, CHIP_SYSTEM_NO_ERROR);
+    ReliableMessageMgr::Timeout(&ctx.GetSystemLayer(), rm, CHIP_NO_ERROR);
 
     // Ensure the retransmit message was sent and the ack was sent
     // and retransmit table was cleared
@@ -647,7 +647,7 @@
 
     // 1 tick is 64 ms, sleep 65 ms to trigger first re-transmit
     test_os_sleep_ms(65);
-    ReliableMessageMgr::Timeout(&ctx.GetSystemLayer(), rm, CHIP_SYSTEM_NO_ERROR);
+    ReliableMessageMgr::Timeout(&ctx.GetSystemLayer(), rm, CHIP_NO_ERROR);
 
     // Ensure the retransmit message was not dropped, and is no longer in the retransmit table
     NL_TEST_ASSERT(inSuite, gLoopback.mSendMessageCount >= 2);
diff --git a/src/platform/Darwin/BleConnectionDelegate.h b/src/platform/Darwin/BleConnectionDelegate.h
index 45135a5..a86171b 100644
--- a/src/platform/Darwin/BleConnectionDelegate.h
+++ b/src/platform/Darwin/BleConnectionDelegate.h
@@ -27,7 +27,7 @@
 {
 public:
     virtual void NewConnection(Ble::BleLayer * bleLayer, void * appState, const uint16_t connDiscriminator);
-    virtual BLE_ERROR CancelConnection();
+    virtual CHIP_ERROR CancelConnection();
 };
 
 } // namespace Internal
diff --git a/src/platform/Darwin/BleConnectionDelegateImpl.mm b/src/platform/Darwin/BleConnectionDelegateImpl.mm
index 1664d40..bdb8071 100644
--- a/src/platform/Darwin/BleConnectionDelegateImpl.mm
+++ b/src/platform/Darwin/BleConnectionDelegateImpl.mm
@@ -77,12 +77,12 @@
             ble.centralManager = [ble.centralManager initWithDelegate:ble queue:ble.workQueue];
         }
 
-        BLE_ERROR BleConnectionDelegateImpl::CancelConnection()
+        CHIP_ERROR BleConnectionDelegateImpl::CancelConnection()
         {
             ChipLogProgress(Ble, "%s", __FUNCTION__);
             [ble stop];
             ble = nil;
-            return BLE_NO_ERROR;
+            return CHIP_NO_ERROR;
         }
     } // namespace Internal
 } // namespace DeviceLayer
@@ -218,7 +218,7 @@
 
     if (!found || error != nil) {
         ChipLogError(Ble, "Service not found on the device.");
-        _onConnectionError(_appState, BLE_ERROR_INCORRECT_STATE);
+        _onConnectionError(_appState, CHIP_ERROR_INCORRECT_STATE);
     }
 }
 
@@ -310,7 +310,7 @@
         } else {
             ChipLogError(Ble, "Failed at allocating buffer for incoming BLE data");
             dispatch_async(_chipWorkQueue, ^{
-                _mBleLayer->HandleConnectionError((__bridge void *) peripheral, BLE_ERROR_NO_MEMORY);
+                _mBleLayer->HandleConnectionError((__bridge void *) peripheral, CHIP_ERROR_NO_MEMORY);
             });
         }
     } else {
diff --git a/src/platform/Darwin/CHIPPlatformConfig.h b/src/platform/Darwin/CHIPPlatformConfig.h
index b803bed..0c00b75 100644
--- a/src/platform/Darwin/CHIPPlatformConfig.h
+++ b/src/platform/Darwin/CHIPPlatformConfig.h
@@ -25,6 +25,9 @@
 
 // ==================== General Platform Adaptations ====================
 
+#define CHIP_CONFIG_ERROR_TYPE int32_t
+#define CHIP_CONFIG_ERROR_FORMAT PRId32
+
 #define ChipDie() abort()
 
 // TODO:(#756) Add FabricState support
diff --git a/src/platform/Darwin/PlatformManagerImpl.cpp b/src/platform/Darwin/PlatformManagerImpl.cpp
index e7434b0..cce976d 100644
--- a/src/platform/Darwin/PlatformManagerImpl.cpp
+++ b/src/platform/Darwin/PlatformManagerImpl.cpp
@@ -111,7 +111,7 @@
 CHIP_ERROR PlatformManagerImpl::_Shutdown()
 {
     // Call up to the base class _Shutdown() to perform the bulk of the shutdown.
-    return System::MapErrorPOSIX(GenericPlatformManagerImpl<ImplClass>::_Shutdown());
+    return GenericPlatformManagerImpl<ImplClass>::_Shutdown();
 }
 
 void PlatformManagerImpl::_PostEvent(const ChipDeviceEvent * event)
diff --git a/src/platform/DeviceControlServer.cpp b/src/platform/DeviceControlServer.cpp
index 60bf9cd..41b4df2 100644
--- a/src/platform/DeviceControlServer.cpp
+++ b/src/platform/DeviceControlServer.cpp
@@ -28,7 +28,7 @@
 namespace DeviceLayer {
 namespace Internal {
 
-void CommissioningTimerFunction(System::Layer * layer, void * aAppState, System::Error aError)
+void CommissioningTimerFunction(System::Layer * layer, void * aAppState, CHIP_ERROR aError)
 {
     DeviceControlServer * server = reinterpret_cast<DeviceControlServer *>(aAppState);
     server->CommissioningFailedTimerComplete(aError);
@@ -41,7 +41,7 @@
     return sInstance;
 }
 
-void DeviceControlServer::CommissioningFailedTimerComplete(System::Error aError)
+void DeviceControlServer::CommissioningFailedTimerComplete(CHIP_ERROR aError)
 {
     ChipDeviceEvent event;
     event.Type                         = DeviceEventType::kCommissioningComplete;
diff --git a/src/platform/EFR32/BLEManagerImpl.cpp b/src/platform/EFR32/BLEManagerImpl.cpp
index 1dd53c1..0241882 100644
--- a/src/platform/EFR32/BLEManagerImpl.cpp
+++ b/src/platform/EFR32/BLEManagerImpl.cpp
@@ -550,7 +550,7 @@
     case SL_STATUS_INVALID_PARAMETER:
         return CHIP_ERROR_INVALID_ARGUMENT;
     default:
-        return (CHIP_ERROR) bleErr + CHIP_DEVICE_CONFIG_EFR32_BLE_ERROR_MIN;
+        return static_cast<CHIP_ERROR>(bleErr + CHIP_DEVICE_CONFIG_EFR32_BLE_ERROR_MIN);
     }
 }
 
diff --git a/src/platform/EFR32/BlePlatformConfig.h b/src/platform/EFR32/BlePlatformConfig.h
index 3804f1c..92a1690 100644
--- a/src/platform/EFR32/BlePlatformConfig.h
+++ b/src/platform/EFR32/BlePlatformConfig.h
@@ -33,12 +33,8 @@
 #define BLE_CONNECTION_UNINITIALIZED ((uint8_t) -1)
 #define BLE_MAX_RECEIVE_WINDOW_SIZE 5
 
-#define BLE_CONFIG_ERROR_TYPE int32_t
-#define BLE_CONFIG_ERROR_FORMAT PRId32
-#define BLE_CONFIG_NO_ERROR 0
 #define BLE_CONFIG_ERROR_MIN 6000000
 #define BLE_CONFIG_ERROR_MAX 6000999
-#define _BLE_CONFIG_ERROR(e) (BLE_CONFIG_ERROR_MIN + (e))
 
 // ========== Platform-specific Configuration Overrides =========
 
diff --git a/src/platform/EFR32/CHIPPlatformConfig.h b/src/platform/EFR32/CHIPPlatformConfig.h
index a3206d1..5304e91 100644
--- a/src/platform/EFR32/CHIPPlatformConfig.h
+++ b/src/platform/EFR32/CHIPPlatformConfig.h
@@ -29,12 +29,10 @@
 // ==================== General Platform Adaptations ====================
 
 #define CHIP_CONFIG_ERROR_TYPE int32_t
-#define CHIP_CONFIG_NO_ERROR 0
-#define CHIP_CONFIG_ERROR_MIN 4000000
-#define CHIP_CONFIG_ERROR_MAX 4000999
+#define CHIP_CONFIG_ERROR_FORMAT PRId32
+#define CHIP_CONFIG_CORE_ERROR_MIN 4000000
+#define CHIP_CONFIG_CORE_ERROR_MAX 4000999
 
-#define ASN1_CONFIG_ERROR_TYPE int32_t
-#define ASN1_CONFIG_NO_ERROR 0
 #define ASN1_CONFIG_ERROR_MIN 5000000
 #define ASN1_CONFIG_ERROR_MAX 5000999
 
diff --git a/src/platform/EFR32/EFR32Config.cpp b/src/platform/EFR32/EFR32Config.cpp
index 0e4164d..27f5b9d 100644
--- a/src/platform/EFR32/EFR32Config.cpp
+++ b/src/platform/EFR32/EFR32Config.cpp
@@ -566,7 +566,7 @@
         err = CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND;
         break;
     default:
-        err = (nvm3Res & 0xFF) + CHIP_DEVICE_CONFIG_EFR32_NVM3_ERROR_MIN;
+        err = static_cast<CHIP_ERROR>((nvm3Res & 0xFF) + CHIP_DEVICE_CONFIG_EFR32_NVM3_ERROR_MIN);
         break;
     }
 
diff --git a/src/platform/EFR32/InetPlatformConfig.h b/src/platform/EFR32/InetPlatformConfig.h
index 2f4a01b..a5cc4eb 100644
--- a/src/platform/EFR32/InetPlatformConfig.h
+++ b/src/platform/EFR32/InetPlatformConfig.h
@@ -29,8 +29,6 @@
 
 // ==================== Platform Adaptations ====================
 
-#define INET_CONFIG_ERROR_TYPE int32_t
-#define INET_CONFIG_NO_ERROR 0
 #define INET_CONFIG_ERROR_MIN 1000000
 #define INET_CONFIG_ERROR_MAX 1000999
 
diff --git a/src/platform/EFR32/SystemPlatformConfig.h b/src/platform/EFR32/SystemPlatformConfig.h
index 33df2b3..1995824 100644
--- a/src/platform/EFR32/SystemPlatformConfig.h
+++ b/src/platform/EFR32/SystemPlatformConfig.h
@@ -39,11 +39,6 @@
 #define CHIP_SYSTEM_CONFIG_LWIP_EVENT_TYPE int
 #define CHIP_SYSTEM_CONFIG_LWIP_EVENT_OBJECT_TYPE const struct ::chip::DeviceLayer::ChipDeviceEvent *
 
-#define CHIP_SYSTEM_CONFIG_ERROR_TYPE int32_t
-#define CHIP_SYSTEM_CONFIG_NO_ERROR 0
-#define CHIP_SYSTEM_CONFIG_ERROR_MIN 7000000
-#define CHIP_SYSTEM_CONFIG_ERROR_MAX 7000999
-#define _CHIP_SYSTEM_CONFIG_ERROR(e) (CHIP_SYSTEM_CONFIG_ERROR_MIN + (e))
 #define CHIP_SYSTEM_LWIP_ERROR_MIN 3000000
 #define CHIP_SYSTEM_LWIP_ERROR_MAX 3000128
 
diff --git a/src/platform/ESP32/BlePlatformConfig.h b/src/platform/ESP32/BlePlatformConfig.h
index 7daddf3..495a1d0 100644
--- a/src/platform/ESP32/BlePlatformConfig.h
+++ b/src/platform/ESP32/BlePlatformConfig.h
@@ -34,9 +34,5 @@
 #define BLE_CONNECTION_UNINITIALIZED ((uint16_t) 0xFFFF)
 #define BLE_MAX_RECEIVE_WINDOW_SIZE 5
 
-#define BLE_CONFIG_ERROR_TYPE esp_err_t
-#define BLE_CONFIG_ERROR_FORMAT "d"
-#define BLE_CONFIG_NO_ERROR ESP_OK
 #define BLE_CONFIG_ERROR_MIN 6000000
 #define BLE_CONFIG_ERROR_MAX 6000999
-#define _BLE_CONFIG_ERROR(e) (BLE_CONFIG_ERROR_MIN + (e))
diff --git a/src/platform/ESP32/CHIPPlatformConfig.h b/src/platform/ESP32/CHIPPlatformConfig.h
index 39d542d..ef27857 100644
--- a/src/platform/ESP32/CHIPPlatformConfig.h
+++ b/src/platform/ESP32/CHIPPlatformConfig.h
@@ -42,12 +42,10 @@
 #define CHIP_CONFIG_PERSISTED_STORAGE_MAX_KEY_LENGTH 15
 
 #define CHIP_CONFIG_ERROR_TYPE esp_err_t
-#define CHIP_CONFIG_NO_ERROR ESP_OK
-#define CHIP_CONFIG_ERROR_MIN 4000000
-#define CHIP_CONFIG_ERROR_MAX 4000999
+#define CHIP_CONFIG_ERROR_FORMAT PRId32
+#define CHIP_CONFIG_CORE_ERROR_MIN 4000000
+#define CHIP_CONFIG_CORE_ERROR_MAX 4000999
 
-#define ASN1_CONFIG_ERROR_TYPE esp_err_t
-#define ASN1_CONFIG_NO_ERROR ESP_OK
 #define ASN1_CONFIG_ERROR_MIN 5000000
 #define ASN1_CONFIG_ERROR_MAX 5000999
 
diff --git a/src/platform/ESP32/ConnectivityManagerImpl.cpp b/src/platform/ESP32/ConnectivityManagerImpl.cpp
index 2f3e97c..db1daf4 100644
--- a/src/platform/ESP32/ConnectivityManagerImpl.cpp
+++ b/src/platform/ESP32/ConnectivityManagerImpl.cpp
@@ -714,7 +714,7 @@
     }
 }
 
-void ConnectivityManagerImpl::DriveStationState(::chip::System::Layer * aLayer, void * aAppState, ::chip::System::Error aError)
+void ConnectivityManagerImpl::DriveStationState(::chip::System::Layer * aLayer, void * aAppState, ::CHIP_ERROR aError)
 {
     sInstance.DriveStationState();
 }
@@ -894,7 +894,7 @@
     }
 }
 
-void ConnectivityManagerImpl::DriveAPState(::chip::System::Layer * aLayer, void * aAppState, ::chip::System::Error aError)
+void ConnectivityManagerImpl::DriveAPState(::chip::System::Layer * aLayer, void * aAppState, ::CHIP_ERROR aError)
 {
     sInstance.DriveAPState();
 }
diff --git a/src/platform/ESP32/ConnectivityManagerImpl.h b/src/platform/ESP32/ConnectivityManagerImpl.h
index 9e41eb9..8629c66 100644
--- a/src/platform/ESP32/ConnectivityManagerImpl.h
+++ b/src/platform/ESP32/ConnectivityManagerImpl.h
@@ -114,12 +114,12 @@
     void OnStationConnected(void);
     void OnStationDisconnected(void);
     void ChangeWiFiStationState(WiFiStationState newState);
-    static void DriveStationState(::chip::System::Layer * aLayer, void * aAppState, ::chip::System::Error aError);
+    static void DriveStationState(::chip::System::Layer * aLayer, void * aAppState, ::CHIP_ERROR aError);
 
     void DriveAPState(void);
     CHIP_ERROR ConfigureWiFiAP(void);
     void ChangeWiFiAPState(WiFiAPState newState);
-    static void DriveAPState(::chip::System::Layer * aLayer, void * aAppState, ::chip::System::Error aError);
+    static void DriveAPState(::chip::System::Layer * aLayer, void * aAppState, ::CHIP_ERROR aError);
 
     void UpdateInternetConnectivityState(void);
     void OnStationIPv4AddressAvailable(const ip_event_got_ip_t & got_ip);
diff --git a/src/platform/ESP32/InetPlatformConfig.h b/src/platform/ESP32/InetPlatformConfig.h
index 0053c23..a1d6865 100644
--- a/src/platform/ESP32/InetPlatformConfig.h
+++ b/src/platform/ESP32/InetPlatformConfig.h
@@ -30,8 +30,6 @@
 
 // ==================== Platform Adaptations ====================
 
-#define INET_CONFIG_ERROR_TYPE esp_err_t
-#define INET_CONFIG_NO_ERROR ESP_OK
 #define INET_CONFIG_ERROR_MIN 1000000
 #define INET_CONFIG_ERROR_MAX 1000999
 
diff --git a/src/platform/ESP32/SystemPlatformConfig.h b/src/platform/ESP32/SystemPlatformConfig.h
index 2253ec4..93e957e 100644
--- a/src/platform/ESP32/SystemPlatformConfig.h
+++ b/src/platform/ESP32/SystemPlatformConfig.h
@@ -42,11 +42,6 @@
 #define CHIP_SYSTEM_CONFIG_LWIP_EVENT_TYPE int
 #define CHIP_SYSTEM_CONFIG_LWIP_EVENT_OBJECT_TYPE const struct ::chip::DeviceLayer::ChipDeviceEvent *
 
-#define CHIP_SYSTEM_CONFIG_ERROR_TYPE esp_err_t
-#define CHIP_SYSTEM_CONFIG_NO_ERROR ESP_OK
-#define CHIP_SYSTEM_CONFIG_ERROR_MIN 7000000
-#define CHIP_SYSTEM_CONFIG_ERROR_MAX 7000999
-#define _CHIP_SYSTEM_CONFIG_ERROR(e) (CHIP_SYSTEM_CONFIG_ERROR_MIN + (e))
 #define CHIP_SYSTEM_LWIP_ERROR_MIN 3000000
 #define CHIP_SYSTEM_LWIP_ERROR_MAX 3000128
 
diff --git a/src/platform/ESP32/SystemTimeSupport.cpp b/src/platform/ESP32/SystemTimeSupport.cpp
index 5ba9612..ab28d2b 100644
--- a/src/platform/ESP32/SystemTimeSupport.cpp
+++ b/src/platform/ESP32/SystemTimeSupport.cpp
@@ -50,7 +50,7 @@
     return (uint64_t)::esp_timer_get_time();
 }
 
-Error GetClock_RealTime(uint64_t & curTime)
+CHIP_ERROR GetClock_RealTime(uint64_t & curTime)
 {
     struct timeval tv;
     int res = gettimeofday(&tv, NULL);
@@ -60,13 +60,13 @@
     }
     if (tv.tv_sec < CHIP_SYSTEM_CONFIG_VALID_REAL_TIME_THRESHOLD)
     {
-        return CHIP_SYSTEM_ERROR_REAL_TIME_NOT_SYNCED;
+        return CHIP_ERROR_REAL_TIME_NOT_SYNCED;
     }
     curTime = (tv.tv_sec * UINT64_C(1000000)) + tv.tv_usec;
-    return CHIP_SYSTEM_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
-Error GetClock_RealTimeMS(uint64_t & curTime)
+CHIP_ERROR GetClock_RealTimeMS(uint64_t & curTime)
 {
     struct timeval tv;
     int res = gettimeofday(&tv, NULL);
@@ -76,13 +76,13 @@
     }
     if (tv.tv_sec < CHIP_SYSTEM_CONFIG_VALID_REAL_TIME_THRESHOLD)
     {
-        return CHIP_SYSTEM_ERROR_REAL_TIME_NOT_SYNCED;
+        return CHIP_ERROR_REAL_TIME_NOT_SYNCED;
     }
     curTime = (tv.tv_sec * UINT64_C(1000)) + (tv.tv_usec / 1000);
-    return CHIP_SYSTEM_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
-Error SetClock_RealTime(uint64_t newCurTime)
+CHIP_ERROR SetClock_RealTime(uint64_t newCurTime)
 {
     struct timeval tv;
     tv.tv_sec  = static_cast<time_t>(newCurTime / UINT64_C(1000000));
@@ -90,7 +90,7 @@
     int res    = settimeofday(&tv, NULL);
     if (res != 0)
     {
-        return (errno == EPERM) ? CHIP_SYSTEM_ERROR_ACCESS_DENIED : MapErrorPOSIX(errno);
+        return (errno == EPERM) ? CHIP_ERROR_ACCESS_DENIED : MapErrorPOSIX(errno);
     }
 #if CHIP_PROGRESS_LOGGING
     {
@@ -103,7 +103,7 @@
                         tv.tv_sec, year, month, dayOfMonth, hour, minute, second);
     }
 #endif // CHIP_PROGRESS_LOGGING
-    return CHIP_SYSTEM_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 } // namespace Layer
diff --git a/src/platform/ESP32/bluedroid/BLEManagerImpl.cpp b/src/platform/ESP32/bluedroid/BLEManagerImpl.cpp
index a1f1a66..316c045 100644
--- a/src/platform/ESP32/bluedroid/BLEManagerImpl.cpp
+++ b/src/platform/ESP32/bluedroid/BLEManagerImpl.cpp
@@ -443,7 +443,7 @@
     case ESP_ERR_NO_MEM:
         return CHIP_ERROR_NO_MEMORY;
     default:
-        return CHIP_DEVICE_CONFIG_ESP32_BLE_ERROR_MIN + (CHIP_ERROR) bleErr;
+        return CHIP_DEVICE_CONFIG_ESP32_BLE_ERROR_MIN + static_cast<CHIP_ERROR>(bleErr);
     }
 }
 
@@ -725,7 +725,7 @@
         ExitNow();
     }
 
-    VerifyOrExit(index + sizeof(deviceIdInfo) <= sizeof(advData), err = BLE_ERROR_OUTBOUND_MESSAGE_TOO_BIG);
+    VerifyOrExit(index + sizeof(deviceIdInfo) <= sizeof(advData), err = CHIP_ERROR_OUTBOUND_MESSAGE_TOO_BIG);
     memcpy(&advData[index], &deviceIdInfo, sizeof(deviceIdInfo));
     index = static_cast<uint8_t>(index + sizeof(deviceIdInfo));
 
diff --git a/src/platform/ESP32/nimble/BLEManagerImpl.cpp b/src/platform/ESP32/nimble/BLEManagerImpl.cpp
index 2e36743..3d473af 100644
--- a/src/platform/ESP32/nimble/BLEManagerImpl.cpp
+++ b/src/platform/ESP32/nimble/BLEManagerImpl.cpp
@@ -452,7 +452,7 @@
     case ESP_ERR_INVALID_ARG:
         return CHIP_ERROR_INVALID_ARGUMENT;
     default:
-        return CHIP_DEVICE_CONFIG_ESP32_BLE_ERROR_MIN + (CHIP_ERROR) bleErr;
+        return CHIP_DEVICE_CONFIG_ESP32_BLE_ERROR_MIN + static_cast<CHIP_ERROR>(bleErr);
     }
 }
 void BLEManagerImpl::DriveBLEState(void)
@@ -705,7 +705,7 @@
         ExitNow();
     }
 
-    VerifyOrExit(index + sizeof(deviceIdInfo) <= sizeof(advData), err = BLE_ERROR_OUTBOUND_MESSAGE_TOO_BIG);
+    VerifyOrExit(index + sizeof(deviceIdInfo) <= sizeof(advData), err = CHIP_ERROR_OUTBOUND_MESSAGE_TOO_BIG);
     memcpy(&advData[index], &deviceIdInfo, sizeof(deviceIdInfo));
     index = static_cast<uint8_t>(index + sizeof(deviceIdInfo));
 
diff --git a/src/platform/FreeRTOS/SystemTimeSupport.cpp b/src/platform/FreeRTOS/SystemTimeSupport.cpp
index 5f753ef..23e195c 100644
--- a/src/platform/FreeRTOS/SystemTimeSupport.cpp
+++ b/src/platform/FreeRTOS/SystemTimeSupport.cpp
@@ -104,27 +104,27 @@
     return GetClock_Monotonic();
 }
 
-Error GetClock_RealTime(uint64_t & curTime)
+CHIP_ERROR GetClock_RealTime(uint64_t & curTime)
 {
     if (sBootTimeUS == 0)
     {
-        return CHIP_SYSTEM_ERROR_REAL_TIME_NOT_SYNCED;
+        return CHIP_ERROR_REAL_TIME_NOT_SYNCED;
     }
     curTime = sBootTimeUS + GetClock_Monotonic();
-    return CHIP_SYSTEM_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
-Error GetClock_RealTimeMS(uint64_t & curTime)
+CHIP_ERROR GetClock_RealTimeMS(uint64_t & curTime)
 {
     if (sBootTimeUS == 0)
     {
-        return CHIP_SYSTEM_ERROR_REAL_TIME_NOT_SYNCED;
+        return CHIP_ERROR_REAL_TIME_NOT_SYNCED;
     }
     curTime = (sBootTimeUS + GetClock_Monotonic()) / 1000;
-    return CHIP_SYSTEM_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
-Error SetClock_RealTime(uint64_t newCurTime)
+CHIP_ERROR SetClock_RealTime(uint64_t newCurTime)
 {
     uint64_t timeSinceBootUS = GetClock_Monotonic();
     if (newCurTime > timeSinceBootUS)
@@ -135,7 +135,7 @@
     {
         sBootTimeUS = 0;
     }
-    return CHIP_SYSTEM_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 } // namespace Layer
diff --git a/src/platform/GeneralUtils.cpp b/src/platform/GeneralUtils.cpp
index 56e1103..140a329 100644
--- a/src/platform/GeneralUtils.cpp
+++ b/src/platform/GeneralUtils.cpp
@@ -111,7 +111,7 @@
  * @return false                    If the supplied error was not a Device Layer error.
  *
  */
-bool FormatDeviceLayerError(char * buf, uint16_t bufSize, int32_t err)
+bool FormatDeviceLayerError(char * buf, uint16_t bufSize, CHIP_ERROR err)
 {
     const char * desc = nullptr;
 
diff --git a/src/platform/K32W/CHIPPlatformConfig.h b/src/platform/K32W/CHIPPlatformConfig.h
index 9270eca..1305a7e 100644
--- a/src/platform/K32W/CHIPPlatformConfig.h
+++ b/src/platform/K32W/CHIPPlatformConfig.h
@@ -30,12 +30,10 @@
 // ==================== General Platform Adaptations ====================
 
 #define CHIP_CONFIG_ERROR_TYPE int32_t
-#define CHIP_CONFIG_NO_ERROR 0
-#define CHIP_CONFIG_ERROR_MIN 4000000
-#define CHIP_CONFIG_ERROR_MAX 4000999
+#define CHIP_CONFIG_ERROR_FORMAT PRId32
+#define CHIP_CONFIG_CORE_ERROR_MIN 4000000
+#define CHIP_CONFIG_CORE_ERROR_MAX 4000999
 
-#define ASN1_CONFIG_ERROR_TYPE int32_t
-#define ASN1_CONFIG_NO_ERROR 0
 #define ASN1_CONFIG_ERROR_MIN 5000000
 #define ASN1_CONFIG_ERROR_MAX 5000999
 
diff --git a/src/platform/K32W/InetPlatformConfig.h b/src/platform/K32W/InetPlatformConfig.h
index ebac09e..ad1757d 100644
--- a/src/platform/K32W/InetPlatformConfig.h
+++ b/src/platform/K32W/InetPlatformConfig.h
@@ -30,8 +30,6 @@
 
 // ==================== Platform Adaptations ====================
 
-#define INET_CONFIG_ERROR_TYPE int32_t
-#define INET_CONFIG_NO_ERROR 0
 #define INET_CONFIG_ERROR_MIN 1000000
 #define INET_CONFIG_ERROR_MAX 1000999
 
diff --git a/src/platform/K32W/K32WConfig.cpp b/src/platform/K32W/K32WConfig.cpp
index e1dea80..cba0a20 100644
--- a/src/platform/K32W/K32WConfig.cpp
+++ b/src/platform/K32W/K32WConfig.cpp
@@ -411,7 +411,7 @@
         err = CHIP_NO_ERROR;
         break;
     default:
-        err = CHIP_CONFIG_ERROR_MIN + pdmStatus;
+        err = CHIP_CONFIG_CORE_ERROR_MIN + pdmStatus;
         break;
     }
 
@@ -420,7 +420,7 @@
 
 CHIP_ERROR K32WConfig::MapPdmInitStatus(int pdmStatus)
 {
-    return (pdmStatus == 0) ? CHIP_NO_ERROR : CHIP_CONFIG_ERROR_MIN + pdmStatus;
+    return (pdmStatus == 0) ? CHIP_NO_ERROR : CHIP_CONFIG_CORE_ERROR_MIN + pdmStatus;
 }
 
 bool K32WConfig::ValidConfigKey(Key key)
diff --git a/src/platform/K32W/SystemPlatformConfig.h b/src/platform/K32W/SystemPlatformConfig.h
index 059d2c7..44138dd 100644
--- a/src/platform/K32W/SystemPlatformConfig.h
+++ b/src/platform/K32W/SystemPlatformConfig.h
@@ -40,11 +40,6 @@
 #define CHIP_SYSTEM_CONFIG_LWIP_EVENT_TYPE int
 #define CHIP_SYSTEM_CONFIG_LWIP_EVENT_OBJECT_TYPE const struct ::chip::DeviceLayer::ChipDeviceEvent *
 
-#define CHIP_SYSTEM_CONFIG_ERROR_TYPE int32_t
-#define CHIP_SYSTEM_CONFIG_NO_ERROR 0
-#define CHIP_SYSTEM_CONFIG_ERROR_MIN 7000000
-#define CHIP_SYSTEM_CONFIG_ERROR_MAX 7000999
-#define _CHIP_SYSTEM_CONFIG_ERROR(e) (CHIP_SYSTEM_CONFIG_ERROR_MIN + (e))
 #define CHIP_SYSTEM_LWIP_ERROR_MIN 3000000
 #define CHIP_SYSTEM_LWIP_ERROR_MAX 3000128
 
diff --git a/src/platform/Linux/BLEManagerImpl.cpp b/src/platform/Linux/BLEManagerImpl.cpp
index 6593ea7..74658c6 100644
--- a/src/platform/Linux/BLEManagerImpl.cpp
+++ b/src/platform/Linux/BLEManagerImpl.cpp
@@ -54,7 +54,7 @@
 const ChipBleUUID ChipUUID_CHIPoBLEChar_TX = { { 0x18, 0xEE, 0x2E, 0xF5, 0x26, 0x3D, 0x45, 0x59, 0x95, 0x9F, 0x4F, 0x9C, 0x42, 0x9F,
                                                  0x9D, 0x12 } };
 
-void HandleConnectTimeout(chip::System::Layer *, void * apEndpoint, chip::System::Error)
+void HandleConnectTimeout(chip::System::Layer *, void * apEndpoint, CHIP_ERROR)
 {
     assert(apEndpoint != nullptr);
 
@@ -734,9 +734,9 @@
     PlatformMgr().ScheduleWork(InitiateScan, static_cast<intptr_t>(BleScanState::kScanForDiscriminator));
 }
 
-BLE_ERROR BLEManagerImpl::CancelConnection()
+CHIP_ERROR BLEManagerImpl::CancelConnection()
 {
-    return BLE_ERROR_NOT_IMPLEMENTED;
+    return CHIP_ERROR_NOT_IMPLEMENTED;
 }
 
 void BLEManagerImpl::NotifyBLEPeripheralRegisterAppComplete(bool aIsSuccess, void * apAppstate)
diff --git a/src/platform/Linux/BLEManagerImpl.h b/src/platform/Linux/BLEManagerImpl.h
index 72705ba..c8b0072 100644
--- a/src/platform/Linux/BLEManagerImpl.h
+++ b/src/platform/Linux/BLEManagerImpl.h
@@ -150,7 +150,7 @@
     // ===== Members that implement virtual methods on BleConnectionDelegate.
 
     void NewConnection(BleLayer * bleLayer, void * appState, uint16_t connDiscriminator) override;
-    BLE_ERROR CancelConnection() override;
+    CHIP_ERROR CancelConnection() override;
 
     // ===== Members that implement virtual methods on ChipDeviceScannerDelegate
     void OnDeviceScanned(BluezDevice1 * device, const chip::Ble::ChipBLEDeviceIdentificationInfo & info) override;
diff --git a/src/platform/Linux/ConnectivityManagerImpl.cpp b/src/platform/Linux/ConnectivityManagerImpl.cpp
index f73e0dc..5ed6c5f 100644
--- a/src/platform/Linux/ConnectivityManagerImpl.cpp
+++ b/src/platform/Linux/ConnectivityManagerImpl.cpp
@@ -831,7 +831,7 @@
     }
 }
 
-void ConnectivityManagerImpl::DriveAPState(::chip::System::Layer * aLayer, void * aAppState, ::chip::System::Error aError)
+void ConnectivityManagerImpl::DriveAPState(::chip::System::Layer * aLayer, void * aAppState, ::CHIP_ERROR aError)
 {
     sInstance.DriveAPState();
 }
diff --git a/src/platform/Linux/ConnectivityManagerImpl.h b/src/platform/Linux/ConnectivityManagerImpl.h
index f381470..57d7ef7 100644
--- a/src/platform/Linux/ConnectivityManagerImpl.h
+++ b/src/platform/Linux/ConnectivityManagerImpl.h
@@ -158,7 +158,7 @@
     void DriveAPState();
     CHIP_ERROR ConfigureWiFiAP();
     void ChangeWiFiAPState(WiFiAPState newState);
-    static void DriveAPState(::chip::System::Layer * aLayer, void * aAppState, ::chip::System::Error aError);
+    static void DriveAPState(::chip::System::Layer * aLayer, void * aAppState, ::CHIP_ERROR aError);
 #endif
 
     // ===== Members for internal use by the following friends.
diff --git a/src/platform/Linux/SystemTimeSupport.cpp b/src/platform/Linux/SystemTimeSupport.cpp
index c2fdc91..c5d536d 100644
--- a/src/platform/Linux/SystemTimeSupport.cpp
+++ b/src/platform/Linux/SystemTimeSupport.cpp
@@ -64,7 +64,7 @@
     return static_cast<uint64_t>(epoch.count());
 }
 
-System::Error GetClock_RealTime(uint64_t & curTime)
+CHIP_ERROR GetClock_RealTime(uint64_t & curTime)
 {
     struct timeval tv;
     int res = gettimeofday(&tv, nullptr);
@@ -74,18 +74,18 @@
     }
     if (tv.tv_sec < CHIP_SYSTEM_CONFIG_VALID_REAL_TIME_THRESHOLD)
     {
-        return CHIP_SYSTEM_ERROR_REAL_TIME_NOT_SYNCED;
+        return CHIP_ERROR_REAL_TIME_NOT_SYNCED;
     }
     if (tv.tv_usec < 0)
     {
-        return CHIP_SYSTEM_ERROR_REAL_TIME_NOT_SYNCED;
+        return CHIP_ERROR_REAL_TIME_NOT_SYNCED;
     }
     static_assert(CHIP_SYSTEM_CONFIG_VALID_REAL_TIME_THRESHOLD >= 0, "We might be letting through negative tv_sec values!");
     curTime = (static_cast<uint64_t>(tv.tv_sec) * UINT64_C(1000000)) + static_cast<uint64_t>(tv.tv_usec);
-    return CHIP_SYSTEM_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
-System::Error GetClock_RealTimeMS(uint64_t & curTime)
+CHIP_ERROR GetClock_RealTimeMS(uint64_t & curTime)
 {
     struct timeval tv;
     int res = gettimeofday(&tv, nullptr);
@@ -95,18 +95,18 @@
     }
     if (tv.tv_sec < CHIP_SYSTEM_CONFIG_VALID_REAL_TIME_THRESHOLD)
     {
-        return CHIP_SYSTEM_ERROR_REAL_TIME_NOT_SYNCED;
+        return CHIP_ERROR_REAL_TIME_NOT_SYNCED;
     }
     if (tv.tv_usec < 0)
     {
-        return CHIP_SYSTEM_ERROR_REAL_TIME_NOT_SYNCED;
+        return CHIP_ERROR_REAL_TIME_NOT_SYNCED;
     }
     static_assert(CHIP_SYSTEM_CONFIG_VALID_REAL_TIME_THRESHOLD >= 0, "We might be letting through negative tv_sec values!");
     curTime = (static_cast<uint64_t>(tv.tv_sec) * UINT64_C(1000)) + (static_cast<uint64_t>(tv.tv_usec) / 1000);
-    return CHIP_SYSTEM_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
-System::Error SetClock_RealTime(uint64_t newCurTime)
+CHIP_ERROR SetClock_RealTime(uint64_t newCurTime)
 {
     struct timeval tv;
     tv.tv_sec  = static_cast<time_t>(newCurTime / UINT64_C(1000000));
@@ -114,7 +114,7 @@
     int res    = settimeofday(&tv, nullptr);
     if (res != 0)
     {
-        return (errno == EPERM) ? CHIP_SYSTEM_ERROR_ACCESS_DENIED : MapErrorPOSIX(errno);
+        return (errno == EPERM) ? CHIP_ERROR_ACCESS_DENIED : MapErrorPOSIX(errno);
     }
 #if CHIP_PROGRESS_LOGGING
     {
@@ -127,7 +127,7 @@
             tv.tv_sec, calendar.tm_year, calendar.tm_mon, calendar.tm_mday, calendar.tm_hour, calendar.tm_min, calendar.tm_sec);
     }
 #endif // CHIP_PROGRESS_LOGGING
-    return CHIP_SYSTEM_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 } // namespace Layer
diff --git a/src/platform/Linux/ThreadStackManagerImpl.cpp b/src/platform/Linux/ThreadStackManagerImpl.cpp
index 7c7a080..f7c6fcc 100644
--- a/src/platform/Linux/ThreadStackManagerImpl.cpp
+++ b/src/platform/Linux/ThreadStackManagerImpl.cpp
@@ -38,7 +38,8 @@
 #endif
 
 #define OTBR_TO_CHIP_ERROR(x)                                                                                                      \
-    (x == ClientError::ERROR_NONE ? CHIP_NO_ERROR : _CHIP_ERROR(CHIP_CONFIG_OTBR_CLIENT_ERROR_MIN + static_cast<int>(x)))
+    (x == ClientError::ERROR_NONE ? CHIP_NO_ERROR                                                                                  \
+                                  : static_cast<CHIP_ERROR>(CHIP_CONFIG_OTBR_CLIENT_ERROR_MIN + static_cast<int>(x)))
 
 #define LogClientError(error)                                                                                                      \
     do                                                                                                                             \
diff --git a/src/platform/Linux/bluez/ChipDeviceScanner.cpp b/src/platform/Linux/bluez/ChipDeviceScanner.cpp
index c7c492f..339a848 100644
--- a/src/platform/Linux/bluez/ChipDeviceScanner.cpp
+++ b/src/platform/Linux/bluez/ChipDeviceScanner.cpp
@@ -143,7 +143,7 @@
     return CHIP_NO_ERROR;
 }
 
-void ChipDeviceScanner::TimerExpiredCallback(chip::System::Layer * layer, void * appState, chip::System::Error error)
+void ChipDeviceScanner::TimerExpiredCallback(chip::System::Layer * layer, void * appState, CHIP_ERROR error)
 {
     static_cast<ChipDeviceScanner *>(appState)->StopScan();
 }
diff --git a/src/platform/Linux/bluez/ChipDeviceScanner.h b/src/platform/Linux/bluez/ChipDeviceScanner.h
index 431be2a..8f825f1 100644
--- a/src/platform/Linux/bluez/ChipDeviceScanner.h
+++ b/src/platform/Linux/bluez/ChipDeviceScanner.h
@@ -75,7 +75,7 @@
     static std::unique_ptr<ChipDeviceScanner> Create(BluezAdapter1 * adapter, ChipDeviceScannerDelegate * delegate);
 
 private:
-    static void TimerExpiredCallback(chip::System::Layer * layer, void * appState, chip::System::Error error);
+    static void TimerExpiredCallback(chip::System::Layer * layer, void * appState, CHIP_ERROR error);
     static int MainLoopStartScan(ChipDeviceScanner * self);
     static int MainLoopStopScan(ChipDeviceScanner * self);
     static void SignalObjectAdded(GDBusObjectManager * manager, GDBusObject * object, ChipDeviceScanner * self);
diff --git a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.cpp b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.cpp
index 2082f5a..122015c 100644
--- a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.cpp
+++ b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.cpp
@@ -586,7 +586,7 @@
 exit:
     if (err != CHIP_NO_ERROR)
     {
-        ChipLogError(DeviceLayer, "GetAndLogThreadTopologyMinimul failed: %" PRId32, err);
+        ChipLogError(DeviceLayer, "GetAndLogThreadTopologyMinimul failed: %" CHIP_ERROR_FORMAT, err);
     }
 
     return err;
diff --git a/src/platform/OpenThread/OpenThreadUtils.cpp b/src/platform/OpenThread/OpenThreadUtils.cpp
index b8925f3..6a8a673 100644
--- a/src/platform/OpenThread/OpenThreadUtils.cpp
+++ b/src/platform/OpenThread/OpenThreadUtils.cpp
@@ -42,7 +42,7 @@
  */
 CHIP_ERROR MapOpenThreadError(otError otErr)
 {
-    return (otErr == OT_ERROR_NONE) ? CHIP_NO_ERROR : CHIP_CONFIG_OPENTHREAD_ERROR_MIN + (CHIP_ERROR) otErr;
+    return (otErr == OT_ERROR_NONE) ? CHIP_NO_ERROR : CHIP_CONFIG_OPENTHREAD_ERROR_MIN + static_cast<CHIP_ERROR>(otErr);
 }
 
 /**
@@ -57,7 +57,7 @@
  * @return false                    If the supplied error was not an OpenThread error.
  *
  */
-bool FormatOpenThreadError(char * buf, uint16_t bufSize, int32_t err)
+bool FormatOpenThreadError(char * buf, uint16_t bufSize, CHIP_ERROR err)
 {
     if (err < CHIP_CONFIG_OPENTHREAD_ERROR_MIN || err > CHIP_CONFIG_OPENTHREAD_ERROR_MAX)
     {
diff --git a/src/platform/SystemEventSupport.cpp b/src/platform/SystemEventSupport.cpp
index 3d7c027..f29a30d 100644
--- a/src/platform/SystemEventSupport.cpp
+++ b/src/platform/SystemEventSupport.cpp
@@ -34,8 +34,8 @@
 
 using namespace ::chip::DeviceLayer;
 
-System::Error PostEvent(System::Layer & aLayer, void * aContext, System::Object & aTarget, System::EventType aType,
-                        uintptr_t aArgument)
+CHIP_ERROR PostEvent(System::Layer & aLayer, void * aContext, System::Object & aTarget, System::EventType aType,
+                     uintptr_t aArgument)
 {
     ChipDeviceEvent event;
     event.Type                          = DeviceEventType::kChipSystemLayerEvent;
@@ -45,21 +45,21 @@
 
     PlatformMgr().PostEvent(&event);
 
-    return CHIP_SYSTEM_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
-System::Error DispatchEvents(Layer & aLayer, void * aContext)
+CHIP_ERROR DispatchEvents(Layer & aLayer, void * aContext)
 {
     PlatformMgr().RunEventLoop();
 
-    return CHIP_SYSTEM_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
-System::Error DispatchEvent(System::Layer & aLayer, void * aContext, const ChipDeviceEvent * aEvent)
+CHIP_ERROR DispatchEvent(System::Layer & aLayer, void * aContext, const ChipDeviceEvent * aEvent)
 {
     PlatformMgr().DispatchEvent(aEvent);
 
-    return CHIP_SYSTEM_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 } // namespace Layer
diff --git a/src/platform/SystemTimerSupport.cpp b/src/platform/SystemTimerSupport.cpp
index 3657113..8e90c72 100644
--- a/src/platform/SystemTimerSupport.cpp
+++ b/src/platform/SystemTimerSupport.cpp
@@ -34,7 +34,7 @@
 
 using namespace ::chip::DeviceLayer;
 
-System::Error StartTimer(System::Layer & aLayer, void * aContext, uint32_t aMilliseconds)
+CHIP_ERROR StartTimer(System::Layer & aLayer, void * aContext, uint32_t aMilliseconds)
 {
     return PlatformMgr().StartChipTimer(aMilliseconds);
 }
diff --git a/src/platform/Zephyr/BLEManagerImpl.cpp b/src/platform/Zephyr/BLEManagerImpl.cpp
index 14b2d92..a017e72 100644
--- a/src/platform/Zephyr/BLEManagerImpl.cpp
+++ b/src/platform/Zephyr/BLEManagerImpl.cpp
@@ -524,13 +524,13 @@
     return CHIP_NO_ERROR;
 }
 
-void BLEManagerImpl::HandleBLEAdvertisementTimeout(System::Layer * layer, void * param, System::Error error)
+void BLEManagerImpl::HandleBLEAdvertisementTimeout(System::Layer * layer, void * param, CHIP_ERROR error)
 {
     BLEMgr().SetAdvertisingEnabled(false);
     ChipLogProgress(DeviceLayer, "CHIPoBLE advertising disabled because of timeout expired");
 }
 
-void BLEManagerImpl::HandleBLEAdvertisementIntervalChange(System::Layer * layer, void * param, System::Error error)
+void BLEManagerImpl::HandleBLEAdvertisementIntervalChange(System::Layer * layer, void * param, CHIP_ERROR error)
 {
     BLEMgr().SetAdvertisingMode(BLEAdvertisingMode::kSlowAdvertising);
     ChipLogProgress(DeviceLayer, "CHIPoBLE advertising mode changed to slow");
diff --git a/src/platform/Zephyr/BLEManagerImpl.h b/src/platform/Zephyr/BLEManagerImpl.h
index 9a8fcda..0e4cca0 100644
--- a/src/platform/Zephyr/BLEManagerImpl.h
+++ b/src/platform/Zephyr/BLEManagerImpl.h
@@ -122,8 +122,8 @@
     static void HandleTXCompleted(bt_conn * conn, void * param);
     static void HandleConnect(bt_conn * conn, uint8_t err);
     static void HandleDisconnect(bt_conn * conn, uint8_t reason);
-    static void HandleBLEAdvertisementTimeout(System::Layer * layer, void * param, System::Error error);
-    static void HandleBLEAdvertisementIntervalChange(System::Layer * layer, void * param, System::Error error);
+    static void HandleBLEAdvertisementTimeout(System::Layer * layer, void * param, CHIP_ERROR error);
+    static void HandleBLEAdvertisementIntervalChange(System::Layer * layer, void * param, CHIP_ERROR error);
 
     // ===== Members for internal use by the following friends.
 
diff --git a/src/platform/Zephyr/SystemTimeSupport.cpp b/src/platform/Zephyr/SystemTimeSupport.cpp
index faf562c..25a9061 100644
--- a/src/platform/Zephyr/SystemTimeSupport.cpp
+++ b/src/platform/Zephyr/SystemTimeSupport.cpp
@@ -52,27 +52,27 @@
     return GetClock_Monotonic();
 }
 
-Error GetClock_RealTime(uint64_t & curTime)
+CHIP_ERROR GetClock_RealTime(uint64_t & curTime)
 {
     if (sBootTimeUS == 0)
     {
-        return CHIP_SYSTEM_ERROR_REAL_TIME_NOT_SYNCED;
+        return CHIP_ERROR_REAL_TIME_NOT_SYNCED;
     }
     curTime = sBootTimeUS + GetClock_Monotonic();
-    return CHIP_SYSTEM_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
-Error GetClock_RealTimeMS(uint64_t & curTime)
+CHIP_ERROR GetClock_RealTimeMS(uint64_t & curTime)
 {
     if (sBootTimeUS == 0)
     {
-        return CHIP_SYSTEM_ERROR_REAL_TIME_NOT_SYNCED;
+        return CHIP_ERROR_REAL_TIME_NOT_SYNCED;
     }
     curTime = (sBootTimeUS + GetClock_Monotonic()) / 1000;
-    return CHIP_SYSTEM_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
-Error SetClock_RealTime(uint64_t newCurTime)
+CHIP_ERROR SetClock_RealTime(uint64_t newCurTime)
 {
     // FIXME: make thread-safe or update comment in SystemClock.h
     uint64_t timeSinceBootUS = GetClock_Monotonic();
@@ -84,7 +84,7 @@
     {
         sBootTimeUS = 0;
     }
-    return CHIP_SYSTEM_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 } // namespace Layer
diff --git a/src/platform/cc13x2_26x2/BlePlatformConfig.h b/src/platform/cc13x2_26x2/BlePlatformConfig.h
index ae611aa..a4745eb 100644
--- a/src/platform/cc13x2_26x2/BlePlatformConfig.h
+++ b/src/platform/cc13x2_26x2/BlePlatformConfig.h
@@ -26,6 +26,3 @@
  */
 
 #pragma once
-
-#define BLE_CONFIG_ERROR_TYPE int32_t
-#define BLE_CONFIG_ERROR_FORMAT PRId32
diff --git a/src/platform/cc13x2_26x2/CHIPPlatformConfig.h b/src/platform/cc13x2_26x2/CHIPPlatformConfig.h
index 5444e51..f9abcb8 100644
--- a/src/platform/cc13x2_26x2/CHIPPlatformConfig.h
+++ b/src/platform/cc13x2_26x2/CHIPPlatformConfig.h
@@ -31,10 +31,7 @@
 // ==================== General Platform Adaptations ====================
 
 #define CHIP_CONFIG_ERROR_TYPE uint32_t
-#define CHIP_CONFIG_NO_ERROR (0)
-
-#define ASN1_CONFIG_ERROR_TYPE uint32_t
-#define ASN1_CONFIG_NO_ERROR (0)
+#define CHIP_CONFIG_ERROR_FORMAT PRIu32
 
 #define ChipDie() assert()
 
diff --git a/src/platform/cc13x2_26x2/InetPlatformConfig.h b/src/platform/cc13x2_26x2/InetPlatformConfig.h
index a90834c..eb6d4ca 100644
--- a/src/platform/cc13x2_26x2/InetPlatformConfig.h
+++ b/src/platform/cc13x2_26x2/InetPlatformConfig.h
@@ -27,9 +27,6 @@
 
 // ==================== Platform Adaptations ====================
 
-#define INET_CONFIG_ERROR_TYPE uint32_t
-#define INET_CONFIG_NO_ERROR (0)
-
 #define INET_CONFIG_ERROR_MIN 1000000
 #define INET_CONFIG_ERROR_MAX 1000999
 
diff --git a/src/platform/cc13x2_26x2/SystemPlatformConfig.h b/src/platform/cc13x2_26x2/SystemPlatformConfig.h
index c1dc8bc..7cd34b8 100644
--- a/src/platform/cc13x2_26x2/SystemPlatformConfig.h
+++ b/src/platform/cc13x2_26x2/SystemPlatformConfig.h
@@ -39,13 +39,6 @@
 #define CHIP_SYSTEM_CONFIG_LWIP_EVENT_TYPE int
 #define CHIP_SYSTEM_CONFIG_LWIP_EVENT_OBJECT_TYPE const struct ::chip::DeviceLayer::ChipDeviceEvent *
 
-#define CHIP_SYSTEM_CONFIG_ERROR_TYPE uint32_t
-#define CHIP_SYSTEM_CONFIG_NO_ERROR (0)
-
-#define CHIP_SYSTEM_CONFIG_ERROR_MIN 0
-#define CHIP_SYSTEM_CONFIG_ERROR_MAX 999
-#define _CHIP_SYSTEM_CONFIG_ERROR(e) (CHIP_SYSTEM_CONFIG_ERROR_MIN + (e))
-
 // ========== Platform-specific Configuration Overrides =========
 
 /* none yet */
diff --git a/src/platform/mbed/CHIPPlatformConfig.h b/src/platform/mbed/CHIPPlatformConfig.h
index 91f96be..5083cd3 100644
--- a/src/platform/mbed/CHIPPlatformConfig.h
+++ b/src/platform/mbed/CHIPPlatformConfig.h
@@ -29,15 +29,11 @@
 // ==================== General Platform Adaptations ====================
 
 #define CHIP_CONFIG_ERROR_TYPE int32_t
-#define CHIP_CONFIG_NO_ERROR 0
+#define CHIP_CONFIG_ERROR_FORMAT PRId32
+
 #define CHIP_CONFIG_ERROR_MIN 4000000
 #define CHIP_CONFIG_ERROR_MAX 4000999
 
-#define ASN1_CONFIG_ERROR_TYPE int32_t
-#define ASN1_CONFIG_NO_ERROR 0
-#define ASN1_CONFIG_ERROR_MIN 5000000
-#define ASN1_CONFIG_ERROR_MAX 5000999
-
 #define ChipDie() abort()
 
 #define CHIP_CONFIG_PERSISTED_STORAGE_KEY_TYPE const char *
diff --git a/src/platform/qpg6100/BlePlatformConfig.h b/src/platform/qpg6100/BlePlatformConfig.h
index 896d3df..4e7fd64 100644
--- a/src/platform/qpg6100/BlePlatformConfig.h
+++ b/src/platform/qpg6100/BlePlatformConfig.h
@@ -30,12 +30,8 @@
 #define BLE_CONNECTION_UNINITIALIZED (0xFFFF)
 #define BLE_MAX_RECEIVE_WINDOW_SIZE 5
 
-#define BLE_CONFIG_ERROR_TYPE int32_t
-#define BLE_CONFIG_ERROR_FORMAT PRId32
-#define BLE_CONFIG_NO_ERROR 0
 #define BLE_CONFIG_ERROR_MIN 6000000
 #define BLE_CONFIG_ERROR_MAX 6000999
-#define _BLE_CONFIG_ERROR(e) (BLE_CONFIG_ERROR_MIN + (e))
 
 // ========== Platform-specific Configuration Overrides =========
 
diff --git a/src/platform/qpg6100/CHIPPlatformConfig.h b/src/platform/qpg6100/CHIPPlatformConfig.h
index 15e894c..9b3f9d4 100644
--- a/src/platform/qpg6100/CHIPPlatformConfig.h
+++ b/src/platform/qpg6100/CHIPPlatformConfig.h
@@ -26,12 +26,10 @@
 // ==================== General Platform Adaptations ====================
 
 #define CHIP_CONFIG_ERROR_TYPE int32_t
-#define CHIP_CONFIG_NO_ERROR 0
-#define CHIP_CONFIG_ERROR_MIN 4000000
-#define CHIP_CONFIG_ERROR_MAX 4000999
+#define CHIP_CONFIG_ERROR_FORMAT PRId32
+#define CHIP_CONFIG_CORE_ERROR_MIN 4000000
+#define CHIP_CONFIG_CORE_ERROR_MAX 4000999
 
-#define ASN1_CONFIG_ERROR_TYPE int32_t
-#define ASN1_CONFIG_NO_ERROR 0
 #define ASN1_CONFIG_ERROR_MIN 5000000
 #define ASN1_CONFIG_ERROR_MAX 5000999
 
diff --git a/src/platform/qpg6100/InetPlatformConfig.h b/src/platform/qpg6100/InetPlatformConfig.h
index 63b8717..037aebb 100644
--- a/src/platform/qpg6100/InetPlatformConfig.h
+++ b/src/platform/qpg6100/InetPlatformConfig.h
@@ -26,8 +26,6 @@
 
 // ==================== Platform Adaptations ====================
 
-#define INET_CONFIG_ERROR_TYPE int32_t
-#define INET_CONFIG_NO_ERROR 0
 #define INET_CONFIG_ERROR_MIN 1000000
 #define INET_CONFIG_ERROR_MAX 1000999
 
diff --git a/src/platform/qpg6100/SystemPlatformConfig.h b/src/platform/qpg6100/SystemPlatformConfig.h
index 4842bb0..2e12c72 100644
--- a/src/platform/qpg6100/SystemPlatformConfig.h
+++ b/src/platform/qpg6100/SystemPlatformConfig.h
@@ -38,11 +38,6 @@
 #define CHIP_SYSTEM_CONFIG_LWIP_EVENT_TYPE int
 #define CHIP_SYSTEM_CONFIG_LWIP_EVENT_OBJECT_TYPE const struct ::chip::DeviceLayer::ChipDeviceEvent *
 
-#define CHIP_SYSTEM_CONFIG_ERROR_TYPE int32_t
-#define CHIP_SYSTEM_CONFIG_NO_ERROR 0
-#define CHIP_SYSTEM_CONFIG_ERROR_MIN 7000000
-#define CHIP_SYSTEM_CONFIG_ERROR_MAX 7000999
-#define _CHIP_SYSTEM_CONFIG_ERROR(e) (CHIP_SYSTEM_CONFIG_ERROR_MIN + (e))
 #define CHIP_SYSTEM_LWIP_ERROR_MIN 3000000
 #define CHIP_SYSTEM_LWIP_ERROR_MAX 3000128
 
diff --git a/src/protocols/secure_channel/CASESession.cpp b/src/protocols/secure_channel/CASESession.cpp
index eb9a411..6a99d92 100644
--- a/src/protocols/secure_channel/CASESession.cpp
+++ b/src/protocols/secure_channel/CASESession.cpp
@@ -310,7 +310,7 @@
     uint8_t * msg = nullptr;
 
     msg_R1 = System::PacketBufferHandle::New(data_len);
-    VerifyOrReturnError(!msg_R1.IsNull(), CHIP_SYSTEM_ERROR_NO_MEMORY);
+    VerifyOrReturnError(!msg_R1.IsNull(), CHIP_ERROR_NO_MEMORY);
 
     msg = msg_R1->Start();
 
@@ -519,7 +519,7 @@
                                      msg_r2_signed_enc_len + sizeof(tag));
 
     msg_R2 = System::PacketBufferHandle::New(data_len);
-    VerifyOrExit(!msg_R2.IsNull(), err = CHIP_SYSTEM_ERROR_NO_MEMORY);
+    VerifyOrExit(!msg_R2.IsNull(), err = CHIP_ERROR_NO_MEMORY);
 
     // Step 10
     // now construct sigmaR2
@@ -783,7 +783,7 @@
     data_len = static_cast<uint16_t>(sizeof(tag) + msg_r3_encrypted_len);
 
     msg_R3 = System::PacketBufferHandle::New(data_len);
-    VerifyOrExit(!msg_R3.IsNull(), err = CHIP_SYSTEM_ERROR_NO_MEMORY);
+    VerifyOrExit(!msg_R3.IsNull(), err = CHIP_ERROR_NO_MEMORY);
 
     {
         Encoding::LittleEndian::BufferWriter bbuf(msg_R3->Start(), data_len);
diff --git a/src/protocols/secure_channel/PASESession.cpp b/src/protocols/secure_channel/PASESession.cpp
index 8676bb9..bb935e2 100644
--- a/src/protocols/secure_channel/PASESession.cpp
+++ b/src/protocols/secure_channel/PASESession.cpp
@@ -345,7 +345,7 @@
 CHIP_ERROR PASESession::SendPBKDFParamRequest()
 {
     System::PacketBufferHandle req = System::PacketBufferHandle::New(kPBKDFParamRandomNumberSize);
-    VerifyOrReturnError(!req.IsNull(), CHIP_SYSTEM_ERROR_NO_MEMORY);
+    VerifyOrReturnError(!req.IsNull(), CHIP_ERROR_NO_MEMORY);
 
     ReturnErrorOnFailure(DRBG_get_bytes(req->Start(), kPBKDFParamRandomNumberSize));
 
@@ -404,7 +404,7 @@
     uint8_t * msg = nullptr;
 
     resp = System::PacketBufferHandle::New(resplen);
-    VerifyOrReturnError(!resp.IsNull(), CHIP_SYSTEM_ERROR_NO_MEMORY);
+    VerifyOrReturnError(!resp.IsNull(), CHIP_ERROR_NO_MEMORY);
 
     msg = resp->Start();
 
@@ -496,7 +496,7 @@
     ReturnErrorOnFailure(mSpake2p.ComputeRoundOne(NULL, 0, X, &X_len));
 
     Encoding::LittleEndian::PacketBufferWriter bbuf(System::PacketBufferHandle::New(sizeof(uint16_t) + X_len));
-    VerifyOrReturnError(!bbuf.IsNull(), CHIP_SYSTEM_ERROR_NO_MEMORY);
+    VerifyOrReturnError(!bbuf.IsNull(), CHIP_ERROR_NO_MEMORY);
     bbuf.Put16(mConnectionState.GetLocalKeyID());
     bbuf.Put(&X[0], X_len);
     VerifyOrReturnError(bbuf.Fit(), CHIP_ERROR_NO_MEMORY);
@@ -556,7 +556,7 @@
 
     {
         Encoding::LittleEndian::PacketBufferWriter bbuf(System::PacketBufferHandle::New(data_len));
-        VerifyOrExit(!bbuf.IsNull(), err = CHIP_SYSTEM_ERROR_NO_MEMORY);
+        VerifyOrExit(!bbuf.IsNull(), err = CHIP_ERROR_NO_MEMORY);
         bbuf.Put16(mConnectionState.GetLocalKeyID());
         bbuf.Put(&Y[0], Y_len);
         bbuf.Put(verifier, verifier_len);
@@ -632,7 +632,7 @@
 
     {
         Encoding::PacketBufferWriter bbuf(System::PacketBufferHandle::New(verifier_len));
-        VerifyOrExit(!bbuf.IsNull(), err = CHIP_SYSTEM_ERROR_NO_MEMORY);
+        VerifyOrExit(!bbuf.IsNull(), err = CHIP_ERROR_NO_MEMORY);
 
         bbuf.Put(verifier, verifier_len);
         VerifyOrExit(bbuf.Fit(), err = CHIP_ERROR_NO_MEMORY);
diff --git a/src/protocols/secure_channel/tests/TestCASESession.cpp b/src/protocols/secure_channel/tests/TestCASESession.cpp
index a0968de..9458c12 100644
--- a/src/protocols/secure_channel/tests/TestCASESession.cpp
+++ b/src/protocols/secure_channel/tests/TestCASESession.cpp
@@ -489,10 +489,11 @@
 
 static TestContext sContext;
 
-/**
+namespace {
+/*
  *  Set up the test suite.
  */
-int CASE_TestSecurePairing_Setup(void * inContext)
+CHIP_ERROR CASETestSecurePairingSetup(void * inContext)
 {
     TestContext & ctx = *reinterpret_cast<TestContext *>(inContext);
 
@@ -512,6 +513,15 @@
 
     return InitCredentialSets();
 }
+} // anonymous namespace
+
+/**
+ *  Set up the test suite.
+ */
+int CASE_TestSecurePairing_Setup(void * inContext)
+{
+    return CASETestSecurePairingSetup(inContext) == CHIP_NO_ERROR ? SUCCESS : FAILURE;
+}
 
 /**
  *  Tear down the test suite.
diff --git a/src/protocols/secure_channel/tests/TestPASESession.cpp b/src/protocols/secure_channel/tests/TestPASESession.cpp
index 67a5295..98c16b3 100644
--- a/src/protocols/secure_channel/tests/TestPASESession.cpp
+++ b/src/protocols/secure_channel/tests/TestPASESession.cpp
@@ -78,7 +78,7 @@
             {
                 test_os_sleep_ms(65);
                 ReliableMessageMgr * rm = mContext->GetExchangeManager().GetReliableMessageMgr();
-                ReliableMessageMgr::Timeout(&mContext->GetSystemLayer(), rm, CHIP_SYSTEM_NO_ERROR);
+                ReliableMessageMgr::Timeout(&mContext->GetSystemLayer(), rm, CHIP_NO_ERROR);
             }
         }
 
diff --git a/src/system/SystemClock.cpp b/src/system/SystemClock.cpp
index a4b45b2..4fc082e 100644
--- a/src/system/SystemClock.cpp
+++ b/src/system/SystemClock.cpp
@@ -116,7 +116,7 @@
 #endif // HAVE_CLOCK_GETTIME
 }
 
-Error GetClock_RealTime(uint64_t & curTime)
+CHIP_ERROR GetClock_RealTime(uint64_t & curTime)
 {
 #if HAVE_CLOCK_GETTIME
     struct timespec ts;
@@ -127,10 +127,10 @@
     }
     if (ts.tv_sec < CHIP_SYSTEM_CONFIG_VALID_REAL_TIME_THRESHOLD)
     {
-        return CHIP_SYSTEM_ERROR_REAL_TIME_NOT_SYNCED;
+        return CHIP_ERROR_REAL_TIME_NOT_SYNCED;
     }
     curTime = (static_cast<uint64_t>(ts.tv_sec) * UINT64_C(1000000)) + (static_cast<uint64_t>(ts.tv_nsec) / 1000);
-    return CHIP_SYSTEM_NO_ERROR;
+    return CHIP_NO_ERROR;
 #else  // HAVE_CLOCK_GETTIME
     struct timeval tv;
     int res = gettimeofday(&tv, NULL);
@@ -140,23 +140,23 @@
     }
     if (tv.tv_sec < CHIP_SYSTEM_CONFIG_VALID_REAL_TIME_THRESHOLD)
     {
-        return CHIP_SYSTEM_ERROR_REAL_TIME_NOT_SYNCED;
+        return CHIP_ERROR_REAL_TIME_NOT_SYNCED;
     }
     curTime = (tv.tv_sec * UINT64_C(1000000)) + tv.tv_usec;
-    return CHIP_SYSTEM_NO_ERROR;
+    return CHIP_NO_ERROR;
 #endif // HAVE_CLOCK_GETTIME
 }
 
-Error GetClock_RealTimeMS(uint64_t & curTime)
+CHIP_ERROR GetClock_RealTimeMS(uint64_t & curTime)
 {
-    Error err = GetClock_RealTime(curTime);
-    curTime   = curTime / 1000;
+    CHIP_ERROR err = GetClock_RealTime(curTime);
+    curTime        = curTime / 1000;
     return err;
 }
 
 #if HAVE_CLOCK_SETTIME || HAVE_SETTIMEOFDAY
 
-Error SetClock_RealTime(uint64_t newCurTime)
+CHIP_ERROR SetClock_RealTime(uint64_t newCurTime)
 {
 #if HAVE_CLOCK_SETTIME
     struct timespec ts;
@@ -165,9 +165,9 @@
     int res    = clock_settime(CLOCK_REALTIME, &ts);
     if (res != 0)
     {
-        return (errno == EPERM) ? CHIP_SYSTEM_ERROR_ACCESS_DENIED : MapErrorPOSIX(errno);
+        return (errno == EPERM) ? CHIP_ERROR_ACCESS_DENIED : MapErrorPOSIX(errno);
     }
-    return CHIP_SYSTEM_NO_ERROR;
+    return CHIP_NO_ERROR;
 #else  // HAVE_CLOCK_SETTIME
     struct timeval tv;
     tv.tv_sec  = static_cast<time_t>(newCurTime / UINT64_C(1000000));
@@ -175,17 +175,17 @@
     int res    = settimeofday(&tv, NULL);
     if (res != 0)
     {
-        return (errno == EPERM) ? CHIP_SYSTEM_ERROR_ACCESS_DENIED : MapErrorPOSIX(errno);
+        return (errno == EPERM) ? CHIP_ERROR_ACCESS_DENIED : MapErrorPOSIX(errno);
     }
-    return CHIP_SYSTEM_NO_ERROR;
+    return CHIP_NO_ERROR;
 #endif // HAVE_CLOCK_SETTIME
 }
 
 #else // !HAVE_CLOCK_SETTTIME
 
-Error SetClock_RealTime(uint64_t newCurTime)
+CHIP_ERROR SetClock_RealTime(uint64_t newCurTime)
 {
-    return CHIP_SYSTEM_ERROR_NOT_SUPPORTED;
+    return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
 }
 
 #endif // HAVE_CLOCK_SETTIME || HAVE_SETTIMEOFDAY
@@ -246,19 +246,19 @@
     return GetClock_MonotonicMS();
 }
 
-Error GetClock_RealTime(uint64_t & curTime)
+CHIP_ERROR GetClock_RealTime(uint64_t & curTime)
 {
-    return CHIP_SYSTEM_ERROR_NOT_SUPPORTED;
+    return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
 }
 
-Error GetClock_RealTimeMS(uint64_t & curTime)
+CHIP_ERROR GetClock_RealTimeMS(uint64_t & curTime)
 {
-    return CHIP_SYSTEM_ERROR_NOT_SUPPORTED;
+    return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
 }
 
-Error SetClock_RealTime(uint64_t newCurTime)
+CHIP_ERROR SetClock_RealTime(uint64_t newCurTime)
 {
-    return CHIP_SYSTEM_ERROR_NOT_SUPPORTED;
+    return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
 }
 
 #endif // CHIP_SYSTEM_CONFIG_USE_LWIP_MONOTONIC_TIME
diff --git a/src/system/SystemClock.h b/src/system/SystemClock.h
index ea8e6fc..9686006 100644
--- a/src/system/SystemClock.h
+++ b/src/system/SystemClock.h
@@ -128,12 +128,12 @@
  * rate of least at whole seconds (values of 1,000,000), but may tick faster.
  *
  * On those platforms that are capable of tracking real time, GetClock_RealTime() must return the
- * error CHIP_SYSTEM_ERROR_REAL_TIME_NOT_SYNCED whenever the system is unsynchronized with real time.
+ * error CHIP_ERROR_REAL_TIME_NOT_SYNCED whenever the system is unsynchronized with real time.
  *
  * Platforms that are incapable of tracking real time should not implement the GetClock_RealTime()
  * function, thereby forcing link-time failures of features that depend on access to real time.
  * Alternatively, such platforms may supply an implementation of GetClock_RealTime() that returns
- * the error CHIP_SYSTEM_ERROR_NOT_SUPPORTED.
+ * the error CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE.
  *
  * This function is expected to be thread-safe on any platform that employs threading.
  *
@@ -143,14 +143,14 @@
  *
  * @param[out] curTime                  The current time, expressed as Unix time scaled to microseconds.
  *
- * @retval #CHIP_SYSTEM_NO_ERROR       If the method succeeded.
- * @retval #CHIP_SYSTEM_ERROR_REAL_TIME_NOT_SYNCED
+ * @retval #CHIP_NO_ERROR       If the method succeeded.
+ * @retval #CHIP_ERROR_REAL_TIME_NOT_SYNCED
  *                                      If the platform is capable of tracking real time, but is
  *                                      is currently unsynchronized.
- * @retval #CHIP_SYSTEM_ERROR_NOT_SUPPORTED
+ * @retval #CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE
  *                                      If the platform is incapable of tracking real time.
  */
-extern Error GetClock_RealTime(uint64_t & curTime);
+extern CHIP_ERROR GetClock_RealTime(uint64_t & curTime);
 
 /**
  * @brief
@@ -168,14 +168,14 @@
  *
  * @param[out] curTimeMS               The current time, expressed as Unix time scaled to milliseconds.
  *
- * @retval #CHIP_SYSTEM_NO_ERROR       If the method succeeded.
- * @retval #CHIP_SYSTEM_ERROR_REAL_TIME_NOT_SYNCED
+ * @retval #CHIP_NO_ERROR       If the method succeeded.
+ * @retval #CHIP_ERROR_REAL_TIME_NOT_SYNCED
  *                                      If the platform is capable of tracking real time, but is
  *                                      is currently unsynchronized.
- * @retval #CHIP_SYSTEM_ERROR_NOT_SUPPORTED
+ * @retval #CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE
  *                                      If the platform is incapable of tracking real time.
  */
-extern Error GetClock_RealTimeMS(uint64_t & curTimeMS);
+extern CHIP_ERROR GetClock_RealTimeMS(uint64_t & curTimeMS);
 
 /**
  * @brief
@@ -188,13 +188,13 @@
  * seconds.
  *
  * On platforms that support tracking real time, the SetClock_RealTime() function must return the error
- * CHIP_SYSTEM_ERROR_ACCESS_DENIED if the calling application does not have the privilege to set the
+ * CHIP_ERROR_ACCESS_DENIED if the calling application does not have the privilege to set the
  * current time.
  *
  * Platforms that are incapable of tracking real time, or do not offer the ability to set real time,
  * should not implement the SetClock_RealTime() function, thereby forcing link-time failures of features
  * that depend on setting real time.  Alternatively, such platforms may supply an implementation of
- * SetClock_RealTime() that returns the error CHIP_SYSTEM_ERROR_NOT_SUPPORTED.
+ * SetClock_RealTime() that returns the error CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE.
  *
  * This function is expected to be thread-safe on any platform that employs threading.
  *
@@ -204,14 +204,14 @@
  *
  * @param[in] newCurTime                The new current time, expressed as Unix time scaled to microseconds.
  *
- * @retval #CHIP_SYSTEM_NO_ERROR       If the method succeeded.
- * @retval #CHIP_SYSTEM_ERROR_NOT_SUPPORTED
+ * @retval #CHIP_NO_ERROR       If the method succeeded.
+ * @retval #CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE
  *                                      If the platform is incapable of tracking real time.
- * @retval #CHIP_SYSTEM_ERROR_ACCESS_DENIED
+ * @retval #CHIP_ERROR_ACCESS_DENIED
  *                                      If the calling application does not have the privilege to set the
  *                                      current time.
  */
-extern Error SetClock_RealTime(uint64_t newCurTime);
+extern CHIP_ERROR SetClock_RealTime(uint64_t newCurTime);
 
 } // namespace Layer
 } // namespace Platform
diff --git a/src/system/SystemConfig.h b/src/system/SystemConfig.h
index d6038dc..5487148 100644
--- a/src/system/SystemConfig.h
+++ b/src/system/SystemConfig.h
@@ -157,11 +157,6 @@
 
 #endif // CHIP_SYSTEM_CONFIG_TRANSFER_INETLAYER_PROJECT_CONFIGURATION
 
-/* Standard include headers */
-#ifndef CHIP_SYSTEM_CONFIG_ERROR_TYPE
-#include <stdint.h>
-#endif /* CHIP_SYSTEM_CONFIG_ERROR_TYPE */
-
 #if CHIP_SYSTEM_CONFIG_USE_LWIP
 #ifdef TARGET_MCU_STM32L4
 // [ MBED HACK ]
@@ -260,59 +255,6 @@
 #error "FORBIDDEN: CHIP_SYSTEM_CONFIG_FREERTOS_LOCKING && CHIP_SYSTEM_CONFIG_MBED_LOCKING"
 #endif // CHIP_SYSTEM_CONFIG_FREERTOS_LOCKING && CHIP_SYSTEM_CONFIG_MBED_LOCKING
 
-#ifndef CHIP_SYSTEM_CONFIG_ERROR_TYPE
-
-/**
- *  @def CHIP_SYSTEM_CONFIG_ERROR_TYPE
- *
- *  @brief
- *      This defines the data type used to represent errors for the CHIP System Layer subsystem.
- */
-#define CHIP_SYSTEM_CONFIG_ERROR_TYPE int32_t
-
-/**
- *  @def CHIP_SYSTEM_CONFIG_NO_ERROR
- *
- *  @brief
- *      This defines the CHIP System Layer error code for no error or success.
- */
-#ifndef CHIP_SYSTEM_CONFIG_NO_ERROR
-#define CHIP_SYSTEM_CONFIG_NO_ERROR 0
-#endif /* CHIP_SYSTEM_CONFIG_NO_ERROR */
-
-/**
- *  @def CHIP_SYSTEM_CONFIG_ERROR_MIN
- *
- *  @brief
- *      This defines the base or minimum CHIP System Layer error number range.
- */
-#ifndef CHIP_SYSTEM_CONFIG_ERROR_MIN
-#define CHIP_SYSTEM_CONFIG_ERROR_MIN 7000
-#endif /* CHIP_SYSTEM_CONFIG_ERROR_MIN */
-
-/**
- *  @def CHIP_SYSTEM_CONFIG_ERROR_MAX
- *
- *  @brief
- *      This defines the top or maximum CHIP System Layer error number range.
- */
-#ifndef CHIP_SYSTEM_CONFIG_ERROR_MAX
-#define CHIP_SYSTEM_CONFIG_ERROR_MAX 7999
-#endif /* CHIP_SYSTEM_CONFIG_ERROR_MAX */
-
-/**
- *  @def _CHIP_SYSTEM_CONFIG_ERROR
- *
- *  @brief
- *      This defines a mapping function for CHIP System Layer errors that allows mapping such errors into a platform- or
- *      system-specific range.
- */
-#ifndef _CHIP_SYSTEM_CONFIG_ERROR
-#define _CHIP_SYSTEM_CONFIG_ERROR(e) (CHIP_SYSTEM_CONFIG_ERROR_MIN + (e))
-#endif /* _CHIP_SYSTEM_CONFIG_ERROR */
-
-#endif /* CHIP_SYSTEM_CONFIG_ERROR_TYPE */
-
 /**
  *  @def CHIP_SYSTEM_HEADER_RESERVE_SIZE
  *
diff --git a/src/system/SystemError.cpp b/src/system/SystemError.cpp
index 0dd361c..112be57 100644
--- a/src/system/SystemError.cpp
+++ b/src/system/SystemError.cpp
@@ -101,72 +101,6 @@
 namespace chip {
 namespace System {
 
-/**
- * Register a text error formatter for System Layer errors.
- */
-void RegisterLayerErrorFormatter()
-{
-    static ErrorFormatter sSystemLayerErrorFormatter = { FormatLayerError, nullptr };
-
-    RegisterErrorFormatter(&sSystemLayerErrorFormatter);
-}
-
-/**
- * Given a System Layer error, returns a human-readable NULL-terminated C string
- * describing the error.
- *
- * @param[in] buf                   Buffer into which the error string will be placed.
- * @param[in] bufSize               Size of the supplied buffer in bytes.
- * @param[in] err                   The error to be described.
- *
- * @return true                     If a description string was written into the supplied buffer.
- * @return false                    If the supplied error was not a System Layer error.
- *
- */
-bool FormatLayerError(char * buf, uint16_t bufSize, int32_t err)
-{
-    const char * desc = nullptr;
-
-    if (err < CHIP_SYSTEM_ERROR_MIN || err > CHIP_SYSTEM_ERROR_MAX)
-    {
-        return false;
-    }
-
-#if !CHIP_CONFIG_SHORT_ERROR_STR
-    switch (err)
-    {
-    case CHIP_SYSTEM_ERROR_NOT_IMPLEMENTED:
-        desc = "Not implemented";
-        break;
-    case CHIP_SYSTEM_ERROR_NOT_SUPPORTED:
-        desc = "Not supported";
-        break;
-    case CHIP_SYSTEM_ERROR_BAD_ARGS:
-        desc = "Bad arguments";
-        break;
-    case CHIP_SYSTEM_ERROR_UNEXPECTED_STATE:
-        desc = "Unexpected state";
-        break;
-    case CHIP_SYSTEM_ERROR_UNEXPECTED_EVENT:
-        desc = "Unexpected event";
-        break;
-    case CHIP_SYSTEM_ERROR_NO_MEMORY:
-        desc = "No memory";
-        break;
-    case CHIP_SYSTEM_ERROR_REAL_TIME_NOT_SYNCED:
-        desc = "Real time not synchronized";
-        break;
-    case CHIP_SYSTEM_ERROR_ACCESS_DENIED:
-        desc = "Access denied";
-        break;
-    }
-#endif // !CHIP_CONFIG_SHORT_ERROR_STR
-
-    chip::FormatError(buf, bufSize, "Sys", err, desc);
-
-    return true;
-}
-
 #if !CHIP_SYSTEM_CONFIG_PLATFORM_PROVIDES_POSIX_ERROR_FUNCTIONS
 /**
  * This implements a mapping function for CHIP System Layer errors that allows mapping integers in the number space of the
@@ -177,9 +111,9 @@
  *
  *  @return The mapped POSIX network or OS error.
  */
-DLL_EXPORT Error MapErrorPOSIX(int aError)
+DLL_EXPORT CHIP_ERROR MapErrorPOSIX(int aError)
 {
-    return (aError == 0 ? CHIP_SYSTEM_NO_ERROR : CHIP_SYSTEM_POSIX_ERROR_MIN + aError);
+    return (aError == 0 ? CHIP_NO_ERROR : static_cast<CHIP_ERROR>(CHIP_SYSTEM_POSIX_ERROR_MIN + aError));
 }
 
 /**
@@ -190,9 +124,9 @@
  *
  *  @return A NULL-terminated, OS-specific descriptive C string describing the error.
  */
-DLL_EXPORT const char * DescribeErrorPOSIX(Error aError)
+DLL_EXPORT const char * DescribeErrorPOSIX(CHIP_ERROR aError)
 {
-    const int lError = (aError - CHIP_SYSTEM_POSIX_ERROR_MIN);
+    const int lError = (static_cast<int>(aError) - CHIP_SYSTEM_POSIX_ERROR_MIN);
     return strerror(lError);
 }
 
@@ -204,7 +138,7 @@
  *
  *  @return True if the specified error is an OS error; otherwise, false.
  */
-DLL_EXPORT bool IsErrorPOSIX(Error aError)
+DLL_EXPORT bool IsErrorPOSIX(CHIP_ERROR aError)
 {
     return (aError >= CHIP_SYSTEM_POSIX_ERROR_MIN && aError <= CHIP_SYSTEM_POSIX_ERROR_MAX);
 }
@@ -233,9 +167,9 @@
  * @return false                    If the supplied error was not a POSIX error.
  *
  */
-bool FormatPOSIXError(char * buf, uint16_t bufSize, int32_t err)
+bool FormatPOSIXError(char * buf, uint16_t bufSize, CHIP_ERROR err)
 {
-    const Error sysErr = static_cast<Error>(err);
+    const CHIP_ERROR sysErr = static_cast<CHIP_ERROR>(err);
 
     if (IsErrorPOSIX(sysErr))
     {
@@ -260,7 +194,7 @@
  *
  *  @return The mapped POSIX error.
  */
-DLL_EXPORT Error MapErrorZephyr(int aError)
+DLL_EXPORT CHIP_ERROR MapErrorZephyr(int aError)
 {
     return MapErrorPOSIX(-aError);
 }
@@ -277,11 +211,11 @@
  *  @return The mapped LwIP network or OS error.
  *
  */
-DLL_EXPORT Error MapErrorLwIP(err_t aError)
+DLL_EXPORT CHIP_ERROR MapErrorLwIP(err_t aError)
 {
     static_assert(std::numeric_limits<err_t>::min() == CHIP_SYSTEM_LWIP_ERROR_MIN - CHIP_SYSTEM_LWIP_ERROR_MAX,
                   "Can't represent all LWIP errors");
-    return (aError == ERR_OK ? CHIP_SYSTEM_NO_ERROR : CHIP_SYSTEM_LWIP_ERROR_MIN - aError);
+    return (aError == ERR_OK ? CHIP_NO_ERROR : CHIP_SYSTEM_LWIP_ERROR_MIN - aError);
 }
 
 /**
@@ -293,7 +227,7 @@
  *  @return A NULL-terminated, LwIP-specific descriptive C string describing the error.
  *
  */
-DLL_EXPORT const char * DescribeErrorLwIP(Error aError)
+DLL_EXPORT const char * DescribeErrorLwIP(CHIP_ERROR aError)
 {
     if (!IsErrorLwIP(aError))
     {
@@ -328,7 +262,7 @@
  *  @return True if the specified error is a LwIP error; otherwise, false.
  *
  */
-DLL_EXPORT bool IsErrorLwIP(Error aError)
+DLL_EXPORT bool IsErrorLwIP(CHIP_ERROR aError)
 {
     return (aError >= CHIP_SYSTEM_LWIP_ERROR_MIN && aError <= CHIP_SYSTEM_LWIP_ERROR_MAX);
 }
@@ -357,9 +291,9 @@
  * @return false                    If the supplied error was not an LwIP error.
  *
  */
-bool FormatLwIPError(char * buf, uint16_t bufSize, int32_t err)
+bool FormatLwIPError(char * buf, uint16_t bufSize, CHIP_ERROR err)
 {
-    const chip::System::Error sysErr = static_cast<chip::System::Error>(err);
+    const CHIP_ERROR sysErr = static_cast<CHIP_ERROR>(err);
 
     if (IsErrorLwIP(sysErr))
     {
diff --git a/src/system/SystemError.h b/src/system/SystemError.h
index 3f8e5f1..bc1667c 100644
--- a/src/system/SystemError.h
+++ b/src/system/SystemError.h
@@ -32,167 +32,55 @@
 #pragma once
 
 // Include headers
+#include <core/CHIPError.h>
 #include <system/SystemConfig.h>
 
 #if CHIP_SYSTEM_CONFIG_USE_LWIP
 #include <lwip/err.h>
 #endif // CHIP_SYSTEM_CONFIG_USE_LWIP
 
-/**
- *  @def CHIP_SYSTEM_NO_ERROR
- *
- *  @brief
- *      This macro expands to a constant expression representing the error code for success or no error. Its definition may be
- *      configured via the #CHIP_SYSTEM_CONFIG_NO_ERROR configuration variable.
- */
-#define CHIP_SYSTEM_NO_ERROR CHIP_SYSTEM_CONFIG_NO_ERROR
-
-/**
- *  @def CHIP_SYSTEM_CONFIG_ERROR_MIN
- *
- *  @brief
- *      This macro expands to a constant expression representing the minimum code number for error conditions in the CHIP System
- *      Layer. This value may be configured via #CHIP_SYSTEM_CONFIG_ERROR_MIN.
- */
-#ifdef CHIP_SYSTEM_CONFIG_ERROR_MIN
-#define CHIP_SYSTEM_ERROR_MIN CHIP_SYSTEM_CONFIG_ERROR_MIN
-#endif // CHIP_SYSTEM_CONFIG_ERROR_MIN
-
-/**
- *  @def CHIP_SYSTEM_CONFIG_ERROR_MAX
- *
- *  @brief
- *      This macro expands to a constant expression representing the maximum code number for error conditions in the CHIP System
- *      Layer. This value may be configured via #CHIP_SYSTEM_CONFIG_ERROR_MAX.
- */
-#ifdef CHIP_SYSTEM_CONFIG_ERROR_MAX
-#define CHIP_SYSTEM_ERROR_MAX CHIP_SYSTEM_CONFIG_ERROR_MAX
-#endif // CHIP_SYSTEM_CONFIG_ERROR_MAX
-
-/**
- *  @def _CHIP_SYSTEM_ERROR(e)
- *
- *  @brief
- *      This defines a mapping function for CHIP System Layer errors that allows mapping such errors into a platform- or
- *      system-specific range. This function may be configured via #_CHIP_SYSTEM_CONFIG_ERROR(e).
- *
- *  @param[in]  e  The CHIP System Layer error to map.
- *
- *  @return The mapped CHIP System Layer error.
- */
-#define _CHIP_SYSTEM_ERROR(e) _CHIP_SYSTEM_CONFIG_ERROR(e)
-
-/**
- *  @name Error Definitions
- *
- *  @{
- */
-
-/**
- *  @def CHIP_SYSTEM_ERROR_NOT_IMPLEMENTED
- *
- *  @brief
- *      A requested function has not been implemented.
- */
-#define CHIP_SYSTEM_ERROR_NOT_IMPLEMENTED _CHIP_SYSTEM_ERROR(0)
-
-/**
- *  @def CHIP_SYSTEM_ERROR_NOT_SUPPORTED
- *
- *  @brief
- *      A requested function or feature is not supported.
- */
-#define CHIP_SYSTEM_ERROR_NOT_SUPPORTED _CHIP_SYSTEM_ERROR(1)
-
-/**
- *  @def CHIP_SYSTEM_ERROR_BAD_ARGS
- *
- *  @brief
- *      An invalid argument or arguments were supplied.
- */
-#define CHIP_SYSTEM_ERROR_BAD_ARGS _CHIP_SYSTEM_ERROR(2)
-
-/**
- *  @def CHIP_SYSTEM_ERROR_UNEXPECTED_STATE
- *
- *  @brief
- *      An unexpected state was encountered.
- */
-#define CHIP_SYSTEM_ERROR_UNEXPECTED_STATE _CHIP_SYSTEM_ERROR(3)
-
-/**
- *  @def CHIP_SYSTEM_ERROR_UNEXPECTED_EVENT
- *
- *  @brief
- *      An unexpected event was encountered.
- */
-#define CHIP_SYSTEM_ERROR_UNEXPECTED_EVENT _CHIP_SYSTEM_ERROR(4)
-
-/**
- *  @def CHIP_SYSTEM_ERROR_NO_MEMORY
- *
- *  @brief
- *      A request for memory could not be fulfilled.
- */
-#define CHIP_SYSTEM_ERROR_NO_MEMORY _CHIP_SYSTEM_ERROR(5)
-
-/**
- *  @def CHIP_SYSTEM_ERROR_REAL_TIME_NOT_SYNCED
- *
- *  @brief
- *      The system's real time clock is not synchronized to an accurate time source.
- */
-#define CHIP_SYSTEM_ERROR_REAL_TIME_NOT_SYNCED _CHIP_SYSTEM_ERROR(6)
-
-/**
- *  @def CHIP_SYSTEM_ERROR_ACCESS_DENIED
- *
- *  @brief
- *      The requestor is not privileged to perform the requested operation.
- */
-#define CHIP_SYSTEM_ERROR_ACCESS_DENIED _CHIP_SYSTEM_ERROR(7)
-
-//                        !!!!! IMPORTANT !!!!!
-//
-// If you add new CHIP System Layer errors, please update the translation of error
-// codes to strings in SystemError.cpp, and add them to unittest in test-apps/TestErrorStr.cpp
-
-/**
- *  @}
- */
-
 #ifdef __cplusplus
 
 namespace chip {
 namespace System {
 
-/**
- *  The basic type for all chip::System errors.
- *
- *  This is defined to a platform- or system-specific type.
- */
-typedef CHIP_SYSTEM_CONFIG_ERROR_TYPE Error;
-
 extern void RegisterLayerErrorFormatter();
-extern bool FormatLayerError(char * buf, uint16_t bufSize, int32_t err);
+extern bool FormatLayerError(char * buf, uint16_t bufSize, CHIP_ERROR err);
 
-extern Error MapErrorPOSIX(int code);
-extern const char * DescribeErrorPOSIX(Error code);
-extern bool IsErrorPOSIX(Error code);
+extern CHIP_ERROR MapErrorPOSIX(int code);
+extern const char * DescribeErrorPOSIX(CHIP_ERROR code);
+extern bool IsErrorPOSIX(CHIP_ERROR code);
 extern void RegisterPOSIXErrorFormatter();
-extern bool FormatPOSIXError(char * buf, uint16_t bufSize, int32_t err);
-extern Error MapErrorZephyr(int code);
+extern bool FormatPOSIXError(char * buf, uint16_t bufSize, CHIP_ERROR err);
+extern CHIP_ERROR MapErrorZephyr(int code);
 
 #if CHIP_SYSTEM_CONFIG_USE_LWIP
 
-extern Error MapErrorLwIP(err_t code);
-extern const char * DescribeErrorLwIP(Error code);
-extern bool IsErrorLwIP(Error code);
+extern CHIP_ERROR MapErrorLwIP(err_t code);
+extern const char * DescribeErrorLwIP(CHIP_ERROR code);
+extern bool IsErrorLwIP(CHIP_ERROR code);
 extern void RegisterLwIPErrorFormatter(void);
-extern bool FormatLwIPError(char * buf, uint16_t bufSize, int32_t err);
+extern bool FormatLwIPError(char * buf, uint16_t bufSize, CHIP_ERROR err);
 
 #endif // CHIP_SYSTEM_CONFIG_USE_LWIP
 
+// clang-format off
+
+// !!!!! IMPORTANT !!!!!
+// These definitions are present temporarily in order to reduce breakage for PRs in flight.
+// TODO: remove compatibility definitions
+using Error = CHIP_ERROR;
+#define CHIP_SYSTEM_NO_ERROR                    CHIP_NO_ERROR
+#define CHIP_SYSTEM_ERROR_ACCESS_DENIED         CHIP_ERROR_ACCESS_DENIED
+#define CHIP_SYSTEM_ERROR_BAD_ARGS              CHIP_ERROR_INVALID_ARGUMENT
+#define CHIP_SYSTEM_ERROR_NOT_SUPPORTED         CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE
+#define CHIP_SYSTEM_ERROR_NO_MEMORY             CHIP_ERROR_NO_MEMORY
+#define CHIP_SYSTEM_ERROR_REAL_TIME_NOT_SYNCED  CHIP_ERROR_REAL_TIME_NOT_SYNCED
+#define CHIP_SYSTEM_ERROR_UNEXPECTED_EVENT      CHIP_ERROR_UNEXPECTED_EVENT
+#define CHIP_SYSTEM_ERROR_UNEXPECTED_STATE      CHIP_ERROR_INCORRECT_STATE
+
+// clang-format on
+
 } // namespace System
 } // namespace chip
 
diff --git a/src/system/SystemLayer.cpp b/src/system/SystemLayer.cpp
index 203aa46..3af4332 100644
--- a/src/system/SystemLayer.cpp
+++ b/src/system/SystemLayer.cpp
@@ -125,11 +125,10 @@
 #endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS || CHIP_SYSTEM_CONFIG_USE_NETWORK_FRAMEWORK
 }
 
-Error Layer::Init(void * aContext)
+CHIP_ERROR Layer::Init(void * aContext)
 {
-    Error lReturn;
+    CHIP_ERROR lReturn;
 
-    RegisterLayerErrorFormatter();
 #if CHIP_SYSTEM_CONFIG_USE_SOCKETS
     RegisterPOSIXErrorFormatter();
 #endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS
@@ -138,7 +137,7 @@
 #endif // CHIP_SYSTEM_CONFIG_USE_LWIP
 
     if (this->mLayerState != kLayerState_NotInitialized)
-        return CHIP_SYSTEM_ERROR_UNEXPECTED_STATE;
+        return CHIP_ERROR_INCORRECT_STATE;
 
     lReturn = Platform::Layer::WillInit(*this, aContext);
     SuccessOrExit(lReturn);
@@ -164,13 +163,13 @@
     return lReturn;
 }
 
-Error Layer::Shutdown()
+CHIP_ERROR Layer::Shutdown()
 {
-    Error lReturn;
+    CHIP_ERROR lReturn;
     void * lContext;
 
     if (this->mLayerState == kLayerState_NotInitialized)
-        return CHIP_SYSTEM_ERROR_UNEXPECTED_STATE;
+        return CHIP_ERROR_INCORRECT_STATE;
 
     lContext = this->mContext;
     lReturn  = Platform::Layer::WillShutdown(*this, lContext);
@@ -225,12 +224,12 @@
     this->mPlatformData = aPlatformData;
 }
 
-Error Layer::NewTimer(Timer *& aTimerPtr)
+CHIP_ERROR Layer::NewTimer(Timer *& aTimerPtr)
 {
     Timer * lTimer = nullptr;
 
     if (this->State() != kLayerState_Initialized)
-        return CHIP_SYSTEM_ERROR_UNEXPECTED_STATE;
+        return CHIP_ERROR_INCORRECT_STATE;
 
     lTimer    = Timer::sPool.TryCreate(*this);
     aTimerPtr = lTimer;
@@ -238,10 +237,10 @@
     if (lTimer == nullptr)
     {
         ChipLogError(chipSystemLayer, "Timer pool EMPTY");
-        return CHIP_SYSTEM_ERROR_NO_MEMORY;
+        return CHIP_ERROR_NO_MEMORY;
     }
 
-    return CHIP_SYSTEM_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 static bool TimerReady(const Timer::Epoch epoch, const Cancelable * timer)
@@ -271,7 +270,7 @@
  *   @param[in]  aMilliseconds Expiration time in milliseconds.
  *   @param[in]  aCallback     A pointer to the Callback that fires when the timer expires
  *
- *   @return CHIP_SYSTEM_NO_ERROR On success.
+ *   @return CHIP_NO_ERROR On success.
  *   @return Other Value indicating timer failed to start.
  *
  */
@@ -320,14 +319,14 @@
  *   @param[in]  aComplete     A pointer to the function called when timer expires.
  *   @param[in]  aAppState     A pointer to the application state object used when timer expires.
  *
- *   @return CHIP_SYSTEM_NO_ERROR On success.
- *   @return CHIP_SYSTEM_ERROR_NO_MEMORY If a timer cannot be allocated.
+ *   @return CHIP_NO_ERROR On success.
+ *   @return CHIP_ERROR_NO_MEMORY If a timer cannot be allocated.
  *   @return Other Value indicating timer failed to start.
  *
  */
-Error Layer::StartTimer(uint32_t aMilliseconds, TimerCompleteFunct aComplete, void * aAppState)
+CHIP_ERROR Layer::StartTimer(uint32_t aMilliseconds, TimerCompleteFunct aComplete, void * aAppState)
 {
-    Error lReturn;
+    CHIP_ERROR lReturn;
     Timer * lTimer;
 
     this->CancelTimer(aComplete, aAppState);
@@ -335,7 +334,7 @@
     SuccessOrExit(lReturn);
 
     lReturn = lTimer->Start(aMilliseconds, aComplete, aAppState);
-    if (lReturn != CHIP_SYSTEM_NO_ERROR)
+    if (lReturn != CHIP_NO_ERROR)
     {
         lTimer->Release();
     }
@@ -398,26 +397,26 @@
  * @param[in] aAppState A pointer to an application state object to be
  *                      passed to the callback function as argument.
  *
- * @retval CHIP_SYSTEM_ERROR_UNEXPECTED_STATE If the SystemLayer has
+ * @retval CHIP_ERROR_INCORRECT_STATE If the SystemLayer has
  *                      not been initialized.
  *
- * @retval CHIP_SYSTEM_ERROR_NO_MEMORY If the SystemLayer cannot
+ * @retval CHIP_ERROR_NO_MEMORY If the SystemLayer cannot
  *                      allocate a new timer.
  *
- * @retval CHIP_SYSTEM_NO_ERROR On success.
+ * @retval CHIP_NO_ERROR On success.
  */
-Error Layer::ScheduleWork(TimerCompleteFunct aComplete, void * aAppState)
+CHIP_ERROR Layer::ScheduleWork(TimerCompleteFunct aComplete, void * aAppState)
 {
     assertChipStackLockedByCurrentThread();
 
-    Error lReturn;
+    CHIP_ERROR lReturn;
     Timer * lTimer;
 
     lReturn = this->NewTimer(lTimer);
     SuccessOrExit(lReturn);
 
     lReturn = lTimer->ScheduleWork(aComplete, aAppState);
-    if (lReturn != CHIP_SYSTEM_NO_ERROR)
+    if (lReturn != CHIP_NO_ERROR)
     {
         lTimer->Release();
     }
@@ -510,24 +509,24 @@
  * whole seconds (values of 1,000,000), but on some platforms may tick faster.
  *
  * If the underlying platform is capable of tracking real time, but the system is currently
- * unsynchronized, GetClock_RealTime() will return the error CHIP_SYSTEM_ERROR_REAL_TIME_NOT_SYNCED.
+ * unsynchronized, GetClock_RealTime() will return the error CHIP_ERROR_REAL_TIME_NOT_SYNCED.
  *
  * On platforms that are incapable of tracking real time, the GetClock_RealTime() method may be absent,
  * resulting a link error for any application that references it.  Alternatively, such platforms may
- * supply an implementation of GetClock_RealTime() that always returns the error CHIP_SYSTEM_ERROR_NOT_SUPPORTED.
+ * supply an implementation of GetClock_RealTime() that always returns the error CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE.
  *
  * This function is guaranteed to be thread-safe on any platform that employs threading.
  *
  * @param[out] curTime                  The current time, expressed as Unix time scaled to microseconds.
  *
- * @retval #CHIP_SYSTEM_NO_ERROR       If the method succeeded.
- * @retval #CHIP_SYSTEM_ERROR_REAL_TIME_NOT_SYNCED
+ * @retval #CHIP_NO_ERROR       If the method succeeded.
+ * @retval #CHIP_ERROR_REAL_TIME_NOT_SYNCED
  *                                      If the platform is capable of tracking real time, but is
  *                                      is currently unsynchronized.
- * @retval #CHIP_SYSTEM_ERROR_NOT_SUPPORTED
+ * @retval #CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE
  *                                      If the platform is incapable of tracking real time.
  */
-Error Layer::GetClock_RealTime(uint64_t & curTime)
+CHIP_ERROR Layer::GetClock_RealTime(uint64_t & curTime)
 {
     // Current implementation is a simple pass-through to the platform.
     return Platform::Layer::GetClock_RealTime(curTime);
@@ -542,24 +541,24 @@
  * whole seconds (values of 1,000,000), but on some platforms may tick faster.
  *
  * If the underlying platform is capable of tracking real time, but the system is currently
- * unsynchronized, GetClock_RealTimeMS() will return the error CHIP_SYSTEM_ERROR_REAL_TIME_NOT_SYNCED.
+ * unsynchronized, GetClock_RealTimeMS() will return the error CHIP_ERROR_REAL_TIME_NOT_SYNCED.
  *
  * On platforms that are incapable of tracking real time, the GetClock_RealTimeMS() method may be absent,
  * resulting a link error for any application that references it.  Alternatively, such platforms may
- * supply an implementation of GetClock_RealTimeMS() that always returns the error CHIP_SYSTEM_ERROR_NOT_SUPPORTED.
+ * supply an implementation of GetClock_RealTimeMS() that always returns the error CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE.
  *
  * This function is guaranteed to be thread-safe on any platform that employs threading.
  *
  * @param[out] curTimeMS               The current time, expressed as Unix time scaled to milliseconds.
  *
- * @retval #CHIP_SYSTEM_NO_ERROR       If the method succeeded.
- * @retval #CHIP_SYSTEM_ERROR_REAL_TIME_NOT_SYNCED
+ * @retval #CHIP_NO_ERROR       If the method succeeded.
+ * @retval #CHIP_ERROR_REAL_TIME_NOT_SYNCED
  *                                      If the platform is capable of tracking real time, but is
  *                                      is currently unsynchronized.
- * @retval #CHIP_SYSTEM_ERROR_NOT_SUPPORTED
+ * @retval #CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE
  *                                      If the platform is incapable of tracking real time.
  */
-Error Layer::GetClock_RealTimeMS(uint64_t & curTimeMS)
+CHIP_ERROR Layer::GetClock_RealTimeMS(uint64_t & curTimeMS)
 {
     // Current implementation is a simple pass-through to the platform.
     return Platform::Layer::GetClock_RealTimeMS(curTimeMS);
@@ -577,25 +576,25 @@
  *
  * Some platforms may restrict which applications or processes can set real time.  If the caller is
  * not permitted to change real time, the SetClock_RealTime() function will return the error
- * CHIP_SYSTEM_ERROR_ACCESS_DENIED.
+ * CHIP_ERROR_ACCESS_DENIED.
  *
  * On platforms that are incapable of tracking real time, or do not offer the ability to set real time,
  * the SetClock_RealTime() function may be absent, resulting a link error for any application that
  * references it.  Alternatively, such platforms may supply an implementation of SetClock_RealTime()
- * that always returns the error CHIP_SYSTEM_ERROR_NOT_SUPPORTED.
+ * that always returns the error CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE.
  *
  * This function is guaranteed to be thread-safe on any platform that employs threading.
  *
  * @param[in] newCurTime                The new current time, expressed as Unix time scaled to microseconds.
  *
- * @retval #CHIP_SYSTEM_NO_ERROR       If the method succeeded.
- * @retval #CHIP_SYSTEM_ERROR_NOT_SUPPORTED
+ * @retval #CHIP_NO_ERROR               If the method succeeded.
+ * @retval #CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE
  *                                      If the platform is incapable of tracking real time.
- * @retval #CHIP_SYSTEM_ERROR_ACCESS_DENIED
+ * @retval #CHIP_ERROR_ACCESS_DENIED
  *                                      If the calling application does not have the privilege to set the
  *                                      current time.
  */
-Error Layer::SetClock_RealTime(uint64_t newCurTime)
+CHIP_ERROR Layer::SetClock_RealTime(uint64_t newCurTime)
 {
     // Current implementation is a simple pass-through to the platform.
     return Platform::Layer::SetClock_RealTime(newCurTime);
@@ -713,7 +712,7 @@
  */
 void Layer::WakeIOThread()
 {
-    Error lReturn;
+    CHIP_ERROR lReturn;
 
     if (this->State() != kLayerState_Initialized)
         return;
@@ -727,7 +726,7 @@
 
     // Send notification to wake up the select call.
     lReturn = this->mWakeEvent.Notify();
-    if (lReturn != CHIP_SYSTEM_NO_ERROR)
+    if (lReturn != CHIP_NO_ERROR)
     {
         ChipLogError(chipSystemLayer, "System wake event notify failed: %s", ErrorStr(lReturn));
     }
@@ -745,9 +744,9 @@
  *  @param[in]      aEventType  The type of event to post.
  *  @param[in,out]  aArgument   The argument associated with the event to post.
  */
-Error Layer::HandleSystemLayerEvent(Object & aTarget, EventType aEventType, uintptr_t aArgument)
+CHIP_ERROR Layer::HandleSystemLayerEvent(Object & aTarget, EventType aEventType, uintptr_t aArgument)
 {
-    Error lReturn = CHIP_SYSTEM_NO_ERROR;
+    CHIP_ERROR lReturn = CHIP_NO_ERROR;
     ;
 
     // Dispatch logic specific to the event type
@@ -762,7 +761,7 @@
         break;
 
     default:
-        lReturn = CHIP_SYSTEM_ERROR_UNEXPECTED_EVENT;
+        lReturn = CHIP_ERROR_UNEXPECTED_EVENT;
         break;
     }
 
@@ -774,16 +773,16 @@
  *
  *  @param[in]  aDelegate   An uninitialied LwIP event handler delegate structure
  *
- *  @retval     CHIP_SYSTEM_NO_ERROR          On success.
- *  @retval     CHIP_SYSTEM_ERROR_BAD_ARGS    If the function pointer contained in aDelegate is NULL
+ *  @retval     CHIP_NO_ERROR                 On success.
+ *  @retval     CHIP_ERROR_INVALID_ARGUMENT   If the function pointer contained in aDelegate is NULL
  */
-Error Layer::AddEventHandlerDelegate(LwIPEventHandlerDelegate & aDelegate)
+CHIP_ERROR Layer::AddEventHandlerDelegate(LwIPEventHandlerDelegate & aDelegate)
 {
-    Error lReturn;
+    CHIP_ERROR lReturn;
 
-    VerifyOrExit(aDelegate.mFunction != NULL, lReturn = CHIP_SYSTEM_ERROR_BAD_ARGS);
+    VerifyOrExit(aDelegate.mFunction != NULL, lReturn = CHIP_ERROR_INVALID_ARGUMENT);
     aDelegate.Prepend(this->mEventDelegateList);
-    lReturn = CHIP_SYSTEM_NO_ERROR;
+    lReturn = CHIP_NO_ERROR;
 
 exit:
     return lReturn;
@@ -797,22 +796,22 @@
  *  @param[in]      aEventType  The type of event to post.
  *  @param[in,out]  aArgument   The argument associated with the event to post.
  *
- *  @retval    CHIP_SYSTEM_NO_ERROR                   On success.
- *  @retval    CHIP_SYSTEM_ERROR_UNEXPECTED_STATE     If the state of the Layer object is incorrect.
- *  @retval    CHIP_SYSTEM_ERROR_NO_MEMORY            If the event queue is already full.
+ *  @retval    CHIP_NO_ERROR                  On success.
+ *  @retval    CHIP_ERROR_INCORRECT_STATE     If the state of the Layer object is incorrect.
+ *  @retval    CHIP_ERROR_NO_MEMORY           If the event queue is already full.
  *  @retval    other Platform-specific errors generated indicating the reason for failure.
  */
-Error Layer::PostEvent(Object & aTarget, EventType aEventType, uintptr_t aArgument)
+CHIP_ERROR Layer::PostEvent(Object & aTarget, EventType aEventType, uintptr_t aArgument)
 {
-    Error lReturn = CHIP_SYSTEM_NO_ERROR;
-    VerifyOrExit(this->State() == kLayerState_Initialized, lReturn = CHIP_SYSTEM_ERROR_UNEXPECTED_STATE);
+    CHIP_ERROR lReturn = CHIP_NO_ERROR;
+    VerifyOrExit(this->State() == kLayerState_Initialized, lReturn = CHIP_ERROR_INCORRECT_STATE);
 
     // Sanity check that this instance and the target layer haven't been "crossed".
     VerifyOrDieWithMsg(aTarget.IsRetained(*this), chipSystemLayer, "wrong poster! [target %p != this %p]", &(aTarget.SystemLayer()),
                        this);
 
     lReturn = Platform::Layer::PostEvent(*this, this->mContext, aTarget, aEventType, aArgument);
-    if (lReturn != CHIP_SYSTEM_NO_ERROR)
+    if (lReturn != CHIP_NO_ERROR)
     {
         ChipLogError(chipSystemLayer, "Failed to queue CHIP System Layer event (type %d): %s", aEventType, ErrorStr(lReturn));
     }
@@ -826,12 +825,12 @@
  * This is a syntactic wrapper around a platform-specific hook that effects an event loop, waiting on a queue that services this
  * instance, pulling events off of that queue, and then dispatching them for handling.
  *
- *  @return #CHIP_SYSTEM_NO_ERROR on success; otherwise, a specific error indicating the reason for initialization failure.
+ *  @return #CHIP_NO_ERROR on success; otherwise, a specific error indicating the reason for initialization failure.
  */
-Error Layer::DispatchEvents()
+CHIP_ERROR Layer::DispatchEvents()
 {
-    Error lReturn = CHIP_SYSTEM_NO_ERROR;
-    VerifyOrExit(this->State() == kLayerState_Initialized, lReturn = CHIP_SYSTEM_ERROR_UNEXPECTED_STATE);
+    CHIP_ERROR lReturn = CHIP_NO_ERROR;
+    VerifyOrExit(this->State() == kLayerState_Initialized, lReturn = CHIP_ERROR_INCORRECT_STATE);
 
     lReturn = Platform::Layer::DispatchEvents(*this, this->mContext);
     SuccessOrExit(lReturn);
@@ -848,12 +847,12 @@
  *
  *  @param[in]  aEvent  The platform-specific event object to dispatch for handling.
  *
- * @return CHIP_SYSTEM_NO_ERROR on success; otherwise, a specific error indicating the reason for initialization failure.
+ * @return CHIP_NO_ERROR on success; otherwise, a specific error indicating the reason for initialization failure.
  */
-Error Layer::DispatchEvent(Event aEvent)
+CHIP_ERROR Layer::DispatchEvent(Event aEvent)
 {
-    Error lReturn = CHIP_SYSTEM_NO_ERROR;
-    VerifyOrExit(this->State() == kLayerState_Initialized, lReturn = CHIP_SYSTEM_ERROR_UNEXPECTED_STATE);
+    CHIP_ERROR lReturn = CHIP_NO_ERROR;
+    VerifyOrExit(this->State() == kLayerState_Initialized, lReturn = CHIP_ERROR_INCORRECT_STATE);
 
     lReturn = Platform::Layer::DispatchEvent(*this, this->mContext, aEvent);
     SuccessOrExit(lReturn);
@@ -869,33 +868,33 @@
  *  @param[in]      aEventType  The event / message type to handle.
  *  @param[in]      aArgument   The argument associated with the event / message.
  *
- *  @retval   CHIP_SYSTEM_NO_ERROR                On success.
- *  @retval   CHIP_SYSTEM_ERROR_UNEXPECTED_STATE  If the state of the InetLayer object is incorrect.
- *  @retval   CHIP_SYSTEM_ERROR_UNEXPECTED_EVENT  If the event type is unrecognized.
+ *  @retval   CHIP_NO_ERROR                 On success.
+ *  @retval   CHIP_ERROR_INCORRECT_STATE    If the state of the InetLayer object is incorrect.
+ *  @retval   CHIP_ERROR_UNEXPECTED_EVENT   If the event type is unrecognized.
  */
-Error Layer::HandleEvent(Object & aTarget, EventType aEventType, uintptr_t aArgument)
+CHIP_ERROR Layer::HandleEvent(Object & aTarget, EventType aEventType, uintptr_t aArgument)
 {
     const LwIPEventHandlerDelegate * lEventDelegate;
-    Error lReturn;
-    VerifyOrExit(this->State() == kLayerState_Initialized, lReturn = CHIP_SYSTEM_ERROR_UNEXPECTED_STATE);
+    CHIP_ERROR lReturn;
+    VerifyOrExit(this->State() == kLayerState_Initialized, lReturn = CHIP_ERROR_INCORRECT_STATE);
 
     // Sanity check that this instance and the target layer haven't been "crossed".
     VerifyOrDieWithMsg(aTarget.IsRetained(*this), chipSystemLayer, "wrong handler! [target %p != this %p]",
                        &(aTarget.SystemLayer()), this);
 
-    lReturn        = CHIP_SYSTEM_ERROR_UNEXPECTED_EVENT;
+    lReturn        = CHIP_ERROR_UNEXPECTED_EVENT;
     lEventDelegate = this->mEventDelegateList;
 
     // Prevent the target object from being freed while dispatching the event.
     aTarget.Retain();
 
-    while (lReturn == CHIP_SYSTEM_ERROR_UNEXPECTED_EVENT && lEventDelegate != NULL)
+    while (lReturn == CHIP_ERROR_UNEXPECTED_EVENT && lEventDelegate != NULL)
     {
         lReturn        = lEventDelegate->mFunction(aTarget, aEventType, aArgument);
         lEventDelegate = lEventDelegate->mNextDelegate;
     }
 
-    if (lReturn == CHIP_SYSTEM_ERROR_UNEXPECTED_EVENT)
+    if (lReturn == CHIP_ERROR_UNEXPECTED_EVENT)
     {
         ChipLogError(chipSystemLayer, "Unexpected event type %d", aEventType);
     }
@@ -919,13 +918,13 @@
  *
  *  @param[in]  aDelayMilliseconds  The timer duration in milliseconds.
  *
- *  @return CHIP_SYSTEM_NO_ERROR on success, error code otherwise.
+ *  @return CHIP_NO_ERROR on success, error code otherwise.
  *
  */
-Error Layer::StartPlatformTimer(uint32_t aDelayMilliseconds)
+CHIP_ERROR Layer::StartPlatformTimer(uint32_t aDelayMilliseconds)
 {
-    Error lReturn = CHIP_SYSTEM_NO_ERROR;
-    VerifyOrExit(this->State() == kLayerState_Initialized, lReturn = CHIP_SYSTEM_ERROR_UNEXPECTED_STATE);
+    CHIP_ERROR lReturn = CHIP_NO_ERROR;
+    VerifyOrExit(this->State() == kLayerState_Initialized, lReturn = CHIP_ERROR_INCORRECT_STATE);
 
     lReturn = Platform::Layer::StartTimer(*this, this->mContext, aDelayMilliseconds);
     SuccessOrExit(lReturn);
@@ -941,13 +940,13 @@
  *      Calls chip::System::Timer::HandleExpiredTimers to handle any expired timers.  It is assumed that this API is called
  *      only while on the thread which owns the CHIP System Layer object.
  *
- *  @return CHIP_SYSTEM_NO_ERROR on success, error code otherwise.
+ *  @return CHIP_NO_ERROR on success, error code otherwise.
  *
  */
-Error Layer::HandlePlatformTimer()
+CHIP_ERROR Layer::HandlePlatformTimer()
 {
-    Error lReturn = CHIP_SYSTEM_NO_ERROR;
-    VerifyOrExit(this->State() == kLayerState_Initialized, lReturn = CHIP_SYSTEM_ERROR_UNEXPECTED_STATE);
+    CHIP_ERROR lReturn = CHIP_NO_ERROR;
+    VerifyOrExit(this->State() == kLayerState_Initialized, lReturn = CHIP_ERROR_INCORRECT_STATE);
 
     lReturn = Timer::HandleExpiredTimers(*this);
 
@@ -987,15 +986,15 @@
  *
  *  @param[in,out] aContext  Platform-specific context data passed to the layer initialization method, \::Init.
  *
- *  @return #CHIP_SYSTEM_NO_ERROR on success; otherwise, a specific error indicating the reason for initialization failure.
+ *  @return #CHIP_NO_ERROR on success; otherwise, a specific error indicating the reason for initialization failure.
  *      Returning non-successful status will abort initialization.
  */
-DLL_EXPORT Error WillInit(Layer & aLayer, void * aContext)
+DLL_EXPORT CHIP_ERROR WillInit(Layer & aLayer, void * aContext)
 {
     static_cast<void>(aLayer);
     static_cast<void>(aContext);
 
-    return CHIP_SYSTEM_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 /**
@@ -1006,15 +1005,15 @@
  *
  *  @param[in,out] aContext  Platform-specific context data passed to the layer initialization method, \::Shutdown.
  *
- *  @return #CHIP_SYSTEM_NO_ERROR on success; otherwise, a specific error indicating the reason for shutdown failure. Returning
+ *  @return #CHIP_NO_ERROR on success; otherwise, a specific error indicating the reason for shutdown failure. Returning
  *      non-successful status will abort shutdown.
  */
-DLL_EXPORT Error WillShutdown(Layer & aLayer, void * aContext)
+DLL_EXPORT CHIP_ERROR WillShutdown(Layer & aLayer, void * aContext)
 {
     static_cast<void>(aLayer);
     static_cast<void>(aContext);
 
-    return CHIP_SYSTEM_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 /**
@@ -1027,7 +1026,7 @@
  *
  *  @param[in]     aStatus   The overall status being returned via the CHIP System Layer \::Init method.
  */
-DLL_EXPORT void DidInit(Layer & aLayer, void * aContext, Error aStatus)
+DLL_EXPORT void DidInit(Layer & aLayer, void * aContext, CHIP_ERROR aStatus)
 {
     static_cast<void>(aLayer);
     static_cast<void>(aContext);
@@ -1044,10 +1043,10 @@
  *
  *  @param[in]     aStatus   The overall status being returned via the CHIP System Layer \::Shutdown method.
  *
- *  @return #CHIP_SYSTEM_NO_ERROR on success; otherwise, a specific error indicating the reason for shutdown failure. Returning
+ *  @return #CHIP_NO_ERROR on success; otherwise, a specific error indicating the reason for shutdown failure. Returning
  *      non-successful status will abort shutdown.
  */
-DLL_EXPORT void DidShutdown(Layer & aLayer, void * aContext, Error aStatus)
+DLL_EXPORT void DidShutdown(Layer & aLayer, void * aContext, CHIP_ERROR aStatus)
 {
     static_cast<void>(aLayer);
     static_cast<void>(aContext);
@@ -1081,20 +1080,20 @@
  *
  *  @param[in,out] aArgument The argument associated with the event to post.
  *
- *  @return #CHIP_SYSTEM_NO_ERROR on success; otherwise, a specific error indicating the reason for initialization failure.
+ *  @return #CHIP_NO_ERROR on success; otherwise, a specific error indicating the reason for initialization failure.
  */
-DLL_EXPORT Error PostEvent(Layer & aLayer, void * aContext, Object & aTarget, EventType aType, uintptr_t aArgument)
+DLL_EXPORT CHIP_ERROR PostEvent(Layer & aLayer, void * aContext, Object & aTarget, EventType aType, uintptr_t aArgument)
 {
-    Error lReturn = CHIP_SYSTEM_NO_ERROR;
+    CHIP_ERROR lReturn = CHIP_NO_ERROR;
     sys_mbox_t lSysMbox;
     LwIPEvent * ev;
     err_t lLwIPError;
 
-    VerifyOrExit(aContext != NULL, lReturn = CHIP_SYSTEM_ERROR_BAD_ARGS);
+    VerifyOrExit(aContext != NULL, lReturn = CHIP_ERROR_INVALID_ARGUMENT);
     lSysMbox = reinterpret_cast<sys_mbox_t>(aContext);
 
     ev = chip::Platform::New<LwIPEvent>();
-    VerifyOrExit(ev != nullptr, lReturn = CHIP_SYSTEM_ERROR_NO_MEMORY);
+    VerifyOrExit(ev != nullptr, lReturn = CHIP_ERROR_NO_MEMORY);
 
     ev->Type     = aType;
     ev->Target   = &aTarget;
@@ -1121,21 +1120,21 @@
  *
  *  @param[in,out] aContext  Platform-specific context data passed to the layer initialization method, \::Init.
  *
- *  @retval   #CHIP_SYSTEM_ERROR_BAD_ARGS          If aLayer or aContext is NULL.
- *  @retval   #CHIP_SYSTEM_ERROR_UNEXPECTED_STATE  If the state of the CHIP System Layer object is unexpected.
- *  @retval   #CHIP_SYSTEM_ERROR_UNEXPECTED_EVENT  If an event type is unrecognized.
- *  @retval   #CHIP_SYSTEM_NO_ERROR                On success.
+ *  @retval   #CHIP_ERROR_INVALID_ARGUMENT      If aLayer or aContext is NULL.
+ *  @retval   #CHIP_ERROR_INCORRECT_STATE       If the state of the CHIP System Layer object is unexpected.
+ *  @retval   #CHIP_ERROR_UNEXPECTED_EVENT      If an event type is unrecognized.
+ *  @retval   #CHIP_NO_ERROR                    On success.
  */
-DLL_EXPORT Error DispatchEvents(Layer & aLayer, void * aContext)
+DLL_EXPORT CHIP_ERROR DispatchEvents(Layer & aLayer, void * aContext)
 {
-    Error lReturn = CHIP_SYSTEM_NO_ERROR;
+    CHIP_ERROR lReturn = CHIP_NO_ERROR;
     err_t lLwIPError;
     sys_mbox_t lSysMbox;
     void * lVoidPointer;
     const LwIPEvent * lEvent;
 
     // Sanity check the context / queue.
-    VerifyOrExit(aContext != NULL, lReturn = CHIP_SYSTEM_ERROR_BAD_ARGS);
+    VerifyOrExit(aContext != NULL, lReturn = CHIP_ERROR_INVALID_ARGUMENT);
     lSysMbox = reinterpret_cast<sys_mbox_t>(aContext);
 
     while (true)
@@ -1144,7 +1143,7 @@
         VerifyOrExit(lLwIPError == ERR_OK, lReturn = chip::System::MapErrorLwIP(lLwIPError));
 
         lEvent = static_cast<const LwIPEvent *>(lVoidPointer);
-        VerifyOrExit(lEvent != NULL && lEvent->Target != NULL, lReturn = CHIP_SYSTEM_ERROR_UNEXPECTED_EVENT);
+        VerifyOrExit(lEvent != NULL && lEvent->Target != NULL, lReturn = CHIP_ERROR_UNEXPECTED_EVENT);
 
         lReturn = aLayer.HandleEvent(*lEvent->Target, lEvent->Type, lEvent->Argument);
         chip::Platform::Delete(lEvent);
@@ -1170,20 +1169,20 @@
  *  @param[in,out] aContext  Platform-specific context data passed to the layer initialization method, \::Init.
  *  @param[in]     aEvent    The platform-specific event object to dispatch for handling.
  *
- *  @retval   #CHIP_SYSTEM_ERROR_BAD_ARGS          If aLayer or the event target is NULL.
- *  @retval   #CHIP_SYSTEM_ERROR_UNEXPECTED_EVENT  If the event type is unrecognized.
- *  @retval   #CHIP_SYSTEM_ERROR_UNEXPECTED_STATE  If the state of the CHIP System Layer object is unexpected.
- *  @retval   #CHIP_SYSTEM_NO_ERROR                On success.
+ *  @retval   #CHIP_ERROR_INVALID_ARGUMENT      If aLayer or the event target is NULL.
+ *  @retval   #CHIP_ERROR_UNEXPECTED_EVENT      If the event type is unrecognized.
+ *  @retval   #CHIP_ERROR_INCORRECT_STATE       If the state of the CHIP System Layer object is unexpected.
+ *  @retval   #CHIP_NO_ERROR                    On success.
  */
-DLL_EXPORT Error DispatchEvent(Layer & aLayer, void * aContext, Event aEvent)
+DLL_EXPORT CHIP_ERROR DispatchEvent(Layer & aLayer, void * aContext, Event aEvent)
 {
     const EventType type = aEvent->Type;
     Object * target      = aEvent->Target;
     const uint32_t data  = aEvent->Argument;
-    Error lReturn        = CHIP_SYSTEM_NO_ERROR;
+    CHIP_ERROR lReturn   = CHIP_NO_ERROR;
 
     // Sanity check the target object.
-    VerifyOrExit(target != NULL, lReturn = CHIP_SYSTEM_ERROR_BAD_ARGS);
+    VerifyOrExit(target != NULL, lReturn = CHIP_ERROR_INVALID_ARGUMENT);
 
     // Handle the event.
     lReturn = aLayer.HandleEvent(*target, type, data);
@@ -1204,11 +1203,11 @@
  *  @param[in,out] aContext             Platform-specific context data passed to the layer initialization method, \::Init.
  *  @param[in]     aMilliseconds        The number of milliseconds to set for the timer.
  *
- *  @retval   #CHIP_SYSTEM_NO_ERROR    Always succeeds unless overridden.
+ *  @retval   #CHIP_NO_ERROR    Always succeeds unless overridden.
  */
-DLL_EXPORT Error StartTimer(Layer & aLayer, void * aContext, uint32_t aMilliseconds)
+DLL_EXPORT CHIP_ERROR StartTimer(Layer & aLayer, void * aContext, uint32_t aMilliseconds)
 {
-    Error lReturn = CHIP_SYSTEM_NO_ERROR;
+    CHIP_ERROR lReturn = CHIP_NO_ERROR;
 
     // At the moment there is no need to do anything for standalone CHIP + LWIP.
     // the Task will periodically call HandleTimer which will process any expired
diff --git a/src/system/SystemLayer.h b/src/system/SystemLayer.h
index 832a21c..8d8f9d4 100644
--- a/src/system/SystemLayer.h
+++ b/src/system/SystemLayer.h
@@ -62,24 +62,23 @@
 namespace Platform {
 namespace Layer {
 
-using ::chip::System::Error;
 using ::chip::System::Layer;
 
 #if CHIP_SYSTEM_CONFIG_USE_LWIP
 using ::chip::System::Object;
 #endif // CHIP_SYSTEM_CONFIG_USE_LWIP
 
-extern Error WillInit(Layer & aLayer, void * aContext);
-extern Error WillShutdown(Layer & aLayer, void * aContext);
+extern CHIP_ERROR WillInit(Layer & aLayer, void * aContext);
+extern CHIP_ERROR WillShutdown(Layer & aLayer, void * aContext);
 
-extern void DidInit(Layer & aLayer, void * aContext, Error aStatus);
-extern void DidShutdown(Layer & aLayer, void * aContext, Error aStatus);
+extern void DidInit(Layer & aLayer, void * aContext, CHIP_ERROR aStatus);
+extern void DidShutdown(Layer & aLayer, void * aContext, CHIP_ERROR aStatus);
 
 #if CHIP_SYSTEM_CONFIG_USE_LWIP
-extern Error PostEvent(Layer & aLayer, void * aContext, Object & aTarget, EventType aType, uintptr_t aArgument);
-extern Error DispatchEvents(Layer & aLayer, void * aContext);
-extern Error DispatchEvent(Layer & aLayer, void * aContext, Event aEvent);
-extern Error StartTimer(Layer & aLayer, void * aContext, uint32_t aMilliseconds);
+extern CHIP_ERROR PostEvent(Layer & aLayer, void * aContext, Object & aTarget, EventType aType, uintptr_t aArgument);
+extern CHIP_ERROR DispatchEvents(Layer & aLayer, void * aContext);
+extern CHIP_ERROR DispatchEvent(Layer & aLayer, void * aContext, Event aEvent);
+extern CHIP_ERROR StartTimer(Layer & aLayer, void * aContext, uint32_t aMilliseconds);
 #endif // CHIP_SYSTEM_CONFIG_USE_LWIP
 
 } // namespace Layer
@@ -97,7 +96,7 @@
 };
 
 #if CHIP_SYSTEM_CONFIG_USE_LWIP
-typedef Error (*LwIPEventHandlerFunction)(Object & aTarget, EventType aEventType, uintptr_t aArgument);
+typedef CHIP_ERROR (*LwIPEventHandlerFunction)(Object & aTarget, EventType aEventType, uintptr_t aArgument);
 
 class LwIPEventHandlerDelegate
 {
@@ -130,27 +129,27 @@
 public:
     Layer();
 
-    Error Init(void * aContext);
+    CHIP_ERROR Init(void * aContext);
 
     // Some other layers hold pointers to System::Layer, so care must be taken
     // to ensure that they are not used after calling Shutdown().
-    Error Shutdown();
+    CHIP_ERROR Shutdown();
 
     void * GetPlatformData() const;
     void SetPlatformData(void * aPlatformData);
 
     LayerState State() const;
 
-    Error NewTimer(Timer *& aTimerPtr);
+    CHIP_ERROR NewTimer(Timer *& aTimerPtr);
 
     void StartTimer(uint32_t aMilliseconds, chip::Callback::Callback<> * aCallback);
     void DispatchTimerCallbacks(uint64_t kCurrentEpoch);
 
-    typedef void (*TimerCompleteFunct)(Layer * aLayer, void * aAppState, Error aError);
-    Error StartTimer(uint32_t aMilliseconds, TimerCompleteFunct aComplete, void * aAppState);
+    typedef void (*TimerCompleteFunct)(Layer * aLayer, void * aAppState, CHIP_ERROR aError);
+    CHIP_ERROR StartTimer(uint32_t aMilliseconds, TimerCompleteFunct aComplete, void * aAppState);
     void CancelTimer(TimerCompleteFunct aOnComplete, void * aAppState);
 
-    Error ScheduleWork(TimerCompleteFunct aComplete, void * aAppState);
+    CHIP_ERROR ScheduleWork(TimerCompleteFunct aComplete, void * aAppState);
 
 #if CHIP_SYSTEM_CONFIG_USE_SOCKETS
     WatchableEventManager & WatchableEvents() { return mWatchableEvents; }
@@ -162,17 +161,17 @@
 #endif // CHIP_SYSTEM_CONFIG_USE_IO_THREAD
 
 #if CHIP_SYSTEM_CONFIG_USE_LWIP
-    typedef Error (*EventHandler)(Object & aTarget, EventType aEventType, uintptr_t aArgument);
-    Error AddEventHandlerDelegate(LwIPEventHandlerDelegate & aDelegate);
+    typedef CHIP_ERROR (*EventHandler)(Object & aTarget, EventType aEventType, uintptr_t aArgument);
+    CHIP_ERROR AddEventHandlerDelegate(LwIPEventHandlerDelegate & aDelegate);
 
     // Event Handling
-    Error PostEvent(Object & aTarget, EventType aEventType, uintptr_t aArgument);
-    Error DispatchEvents(void);
-    Error DispatchEvent(Event aEvent);
-    Error HandleEvent(Object & aTarget, EventType aEventType, uintptr_t aArgument);
+    CHIP_ERROR PostEvent(Object & aTarget, EventType aEventType, uintptr_t aArgument);
+    CHIP_ERROR DispatchEvents(void);
+    CHIP_ERROR DispatchEvent(Event aEvent);
+    CHIP_ERROR HandleEvent(Object & aTarget, EventType aEventType, uintptr_t aArgument);
 
     // Timer Management
-    Error HandlePlatformTimer(void);
+    CHIP_ERROR HandlePlatformTimer(void);
 #endif // CHIP_SYSTEM_CONFIG_USE_LWIP
 
 #if CHIP_SYSTEM_CONFIG_USE_DISPATCH
@@ -183,9 +182,9 @@
     static uint64_t GetClock_Monotonic();
     static uint64_t GetClock_MonotonicMS();
     static uint64_t GetClock_MonotonicHiRes();
-    static Error GetClock_RealTime(uint64_t & curTime);
-    static Error GetClock_RealTimeMS(uint64_t & curTimeMS);
-    static Error SetClock_RealTime(uint64_t newCurTime);
+    static CHIP_ERROR GetClock_RealTime(uint64_t & curTime);
+    static CHIP_ERROR GetClock_RealTimeMS(uint64_t & curTimeMS);
+    static CHIP_ERROR SetClock_RealTime(uint64_t newCurTime);
 
 private:
     LayerState mLayerState;
@@ -210,15 +209,15 @@
 #endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS || CHIP_SYSTEM_CONFIG_USE_NETWORK_FRAMEWORK
 
 #if CHIP_SYSTEM_CONFIG_USE_LWIP
-    static Error HandleSystemLayerEvent(Object & aTarget, EventType aEventType, uintptr_t aArgument);
+    static CHIP_ERROR HandleSystemLayerEvent(Object & aTarget, EventType aEventType, uintptr_t aArgument);
 
-    Error StartPlatformTimer(uint32_t aDelayMilliseconds);
+    CHIP_ERROR StartPlatformTimer(uint32_t aDelayMilliseconds);
 
-    friend Error Platform::Layer::PostEvent(Layer & aLayer, void * aContext, Object & aTarget, EventType aType,
-                                            uintptr_t aArgument);
-    friend Error Platform::Layer::DispatchEvents(Layer & aLayer, void * aContext);
-    friend Error Platform::Layer::DispatchEvent(Layer & aLayer, void * aContext, Event aEvent);
-    friend Error Platform::Layer::StartTimer(Layer & aLayer, void * aContext, uint32_t aMilliseconds);
+    friend CHIP_ERROR Platform::Layer::PostEvent(Layer & aLayer, void * aContext, Object & aTarget, EventType aType,
+                                                 uintptr_t aArgument);
+    friend CHIP_ERROR Platform::Layer::DispatchEvents(Layer & aLayer, void * aContext);
+    friend CHIP_ERROR Platform::Layer::DispatchEvent(Layer & aLayer, void * aContext, Event aEvent);
+    friend CHIP_ERROR Platform::Layer::StartTimer(Layer & aLayer, void * aContext, uint32_t aMilliseconds);
 #endif // CHIP_SYSTEM_CONFIG_USE_LWIP
 
 #if CHIP_SYSTEM_CONFIG_USE_DISPATCH
diff --git a/src/system/SystemMutex.cpp b/src/system/SystemMutex.cpp
index 4dfb351..abd0671 100644
--- a/src/system/SystemMutex.cpp
+++ b/src/system/SystemMutex.cpp
@@ -41,29 +41,29 @@
  *
  *  @param[in,out]  aThis   A zero-initialized object.
  *
- *  @retval         #CHIP_SYSTEM_NO_ERROR                  The mutual exclusion lock is ready to use.
- *  @retval         #CHIP_SYSTEM_ERROR_NO_MEMORY           Insufficient system memory to allocate the mutual exclusion lock.
- *  @retval         #CHIP_SYSTEM_ERROR_UNEXPECTED_STATE    An unexpected system error encountered during initialization.
+ *  @retval         #CHIP_NO_ERROR                  The mutual exclusion lock is ready to use.
+ *  @retval         #CHIP_ERROR_NO_MEMORY           Insufficient system memory to allocate the mutual exclusion lock.
+ *  @retval         #CHIP_ERROR_INCORRECT_STATE     An unexpected system error encountered during initialization.
  */
 
 #if CHIP_SYSTEM_CONFIG_POSIX_LOCKING
-DLL_EXPORT Error Mutex::Init(Mutex & aThis)
+DLL_EXPORT CHIP_ERROR Mutex::Init(Mutex & aThis)
 {
     int lSysError = pthread_mutex_init(&aThis.mPOSIXMutex, nullptr);
-    Error lError;
+    CHIP_ERROR lError;
 
     switch (lSysError)
     {
     case 0:
-        lError = CHIP_SYSTEM_NO_ERROR;
+        lError = CHIP_NO_ERROR;
         break;
 
     case ENOMEM:
-        lError = CHIP_SYSTEM_ERROR_NO_MEMORY;
+        lError = CHIP_ERROR_NO_MEMORY;
         break;
 
     default:
-        lError = CHIP_SYSTEM_ERROR_UNEXPECTED_STATE;
+        lError = CHIP_ERROR_INCORRECT_STATE;
         break;
     }
 
@@ -72,7 +72,7 @@
 #endif // CHIP_SYSTEM_CONFIG_POSIX_LOCKING
 
 #if CHIP_SYSTEM_CONFIG_FREERTOS_LOCKING
-DLL_EXPORT Error Mutex::Init(Mutex & aThis)
+DLL_EXPORT CHIP_ERROR Mutex::Init(Mutex & aThis)
 {
 restart:
     if (__sync_bool_compare_and_swap(&aThis.mInitialized, 0, 1))
@@ -86,7 +86,7 @@
         {
             aThis.mInitialized = 0;
 
-            return CHIP_SYSTEM_ERROR_NO_MEMORY;
+            return CHIP_ERROR_NO_MEMORY;
         }
     }
     else
@@ -102,7 +102,7 @@
         }
     }
 
-    return CHIP_SYSTEM_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 DLL_EXPORT void Mutex::Lock(void)
diff --git a/src/system/SystemMutex.h b/src/system/SystemMutex.h
index 4eaeb1e..24fe262 100644
--- a/src/system/SystemMutex.h
+++ b/src/system/SystemMutex.h
@@ -74,7 +74,7 @@
     Mutex();
     ~Mutex();
 
-    static Error Init(Mutex & aMutex);
+    static CHIP_ERROR Init(Mutex & aMutex);
 
     void Lock();   /**< Acquire the mutual exclusion lock, blocking the current thread indefinitely if necessary. */
     void Unlock(); /**< Release the mutual exclusion lock (can block on some systems until scheduler completes). */
diff --git a/src/system/SystemObject.cpp b/src/system/SystemObject.cpp
index c909f94..7997fb2 100644
--- a/src/system/SystemObject.cpp
+++ b/src/system/SystemObject.cpp
@@ -81,9 +81,9 @@
 void Object::DeferredRelease(Object::ReleaseDeferralErrorTactic aTactic)
 {
     Layer & lSystemLayer = *this->mSystemLayer;
-    Error lError         = lSystemLayer.PostEvent(*this, chip::System::kEvent_ReleaseObj, 0);
+    CHIP_ERROR lError    = lSystemLayer.PostEvent(*this, chip::System::kEvent_ReleaseObj, 0);
 
-    if (lError != CHIP_SYSTEM_NO_ERROR)
+    if (lError != CHIP_NO_ERROR)
     {
         switch (aTactic)
         {
diff --git a/src/system/SystemSockets.cpp b/src/system/SystemSockets.cpp
index 8234157..bea24b6 100644
--- a/src/system/SystemSockets.cpp
+++ b/src/system/SystemSockets.cpp
@@ -50,7 +50,7 @@
 }
 } // anonymous namespace
 
-Error WakeEvent::Open(WatchableEventManager & watchState)
+CHIP_ERROR WakeEvent::Open(WatchableEventManager & watchState)
 {
     enum
     {
@@ -75,10 +75,10 @@
 
     mWriteFD = fds[FD_WRITE];
 
-    return CHIP_SYSTEM_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
-Error WakeEvent::Close()
+CHIP_ERROR WakeEvent::Close()
 {
     int res = 0;
 
@@ -91,7 +91,7 @@
         return chip::System::MapErrorPOSIX(errno);
     }
 
-    return CHIP_SYSTEM_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 void WakeEvent::Confirm()
@@ -110,7 +110,7 @@
     } while (res == sizeof(buffer));
 }
 
-Error WakeEvent::Notify()
+CHIP_ERROR WakeEvent::Notify()
 {
     char byte = 1;
 
@@ -119,12 +119,12 @@
         return chip::System::MapErrorPOSIX(errno);
     }
 
-    return CHIP_SYSTEM_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 #else // CHIP_SYSTEM_CONFIG_USE_POSIX_PIPE
 
-Error WakeEvent::Open(WatchableEventManager & watchState)
+CHIP_ERROR WakeEvent::Open(WatchableEventManager & watchState)
 {
     mFD.Init(watchState);
 
@@ -138,10 +138,10 @@
     mFD.SetCallback(Confirm, reinterpret_cast<intptr_t>(this));
     mFD.RequestCallbackOnPendingRead();
 
-    return CHIP_SYSTEM_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
-Error WakeEvent::Close()
+CHIP_ERROR WakeEvent::Close()
 {
     int res = mFD.Close();
 
@@ -150,7 +150,7 @@
         return chip::System::MapErrorPOSIX(errno);
     }
 
-    return CHIP_SYSTEM_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 void WakeEvent::Confirm()
@@ -163,7 +163,7 @@
     }
 }
 
-Error WakeEvent::Notify()
+CHIP_ERROR WakeEvent::Notify()
 {
     uint64_t value = 1;
 
@@ -172,7 +172,7 @@
         return chip::System::MapErrorPOSIX(errno);
     }
 
-    return CHIP_SYSTEM_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 #endif // CHIP_SYSTEM_CONFIG_USE_POSIX_PIPE
diff --git a/src/system/SystemSockets.h b/src/system/SystemSockets.h
index 2c04163..c2ee88d 100644
--- a/src/system/SystemSockets.h
+++ b/src/system/SystemSockets.h
@@ -309,8 +309,6 @@
 namespace chip {
 namespace System {
 
-using ::chip::System::Error;
-
 /**
  * @class WakeEvent
  *
@@ -320,13 +318,13 @@
 class WakeEvent
 {
 public:
-    Error Open(WatchableEventManager & watchState); /**< Initialize the pipeline */
-    Error Close();                                  /**< Close both ends of the pipeline. */
+    CHIP_ERROR Open(WatchableEventManager & watchState); /**< Initialize the pipeline */
+    CHIP_ERROR Close();                                  /**< Close both ends of the pipeline. */
 
     int GetNotifFD() const { return mFD.GetFD(); }
 
-    Error Notify(); /**< Set the event. */
-    void Confirm(); /**< Clear the event. */
+    CHIP_ERROR Notify(); /**< Set the event. */
+    void Confirm();      /**< Clear the event. */
     static void Confirm(WatchableSocket & socket) { reinterpret_cast<WakeEvent *>(socket.GetCallbackData())->Confirm(); }
 
 private:
diff --git a/src/system/SystemTimer.cpp b/src/system/SystemTimer.cpp
index 382aadc..72b4cdd 100644
--- a/src/system/SystemTimer.cpp
+++ b/src/system/SystemTimer.cpp
@@ -119,10 +119,10 @@
  *  @param[in]  aOnComplete          A pointer to the callback function when this timer fires
  *  @param[in]  aAppState            An arbitrary pointer to be passed into onComplete when this timer fires
  *
- *  @retval #CHIP_SYSTEM_NO_ERROR Unconditionally.
+ *  @retval #CHIP_NO_ERROR Unconditionally.
  *
  */
-Error Timer::Start(uint32_t aDelayMilliseconds, OnCompleteFunct aOnComplete, void * aAppState)
+CHIP_ERROR Timer::Start(uint32_t aDelayMilliseconds, OnCompleteFunct aOnComplete, void * aAppState)
 {
     Layer & lLayer = this->SystemLayer();
 
@@ -168,7 +168,7 @@
         this->mNextTimer   = lTimer->mNextTimer;
         lTimer->mNextTimer = this;
     }
-    return CHIP_SYSTEM_NO_ERROR;
+    return CHIP_NO_ERROR;
 #endif // CHIP_SYSTEM_CONFIG_USE_LWIP
 
 #if CHIP_SYSTEM_CONFIG_USE_SOCKETS || CHIP_SYSTEM_CONFIG_USE_NETWORK_FRAMEWORK
@@ -191,7 +191,7 @@
             this->HandleComplete();
         });
         dispatch_resume(timerSource);
-        return CHIP_SYSTEM_NO_ERROR;
+        return CHIP_NO_ERROR;
     }
 #endif // CHIP_SYSTEM_CONFIG_USE_DISPATCH
 
@@ -200,12 +200,12 @@
 #endif // CHIP_SYSTEM_CONFIG_USE_IO_THREAD
 #endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS || CHIP_SYSTEM_CONFIG_USE_NETWORK_FRAMEWORK
 
-    return CHIP_SYSTEM_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
-Error Timer::ScheduleWork(OnCompleteFunct aOnComplete, void * aAppState)
+CHIP_ERROR Timer::ScheduleWork(OnCompleteFunct aOnComplete, void * aAppState)
 {
-    Error err      = CHIP_SYSTEM_NO_ERROR;
+    CHIP_ERROR err = CHIP_NO_ERROR;
     Layer & lLayer = this->SystemLayer();
 
     this->AppState     = aAppState;
@@ -243,9 +243,9 @@
 /**
  *  This method de-initializes the timer object, and prevents this timer from firing if it hasn't done so.
  *
- *  @retval #CHIP_SYSTEM_NO_ERROR Unconditionally.
+ *  @retval #CHIP_NO_ERROR Unconditionally.
  */
-Error Timer::Cancel()
+CHIP_ERROR Timer::Cancel()
 {
 #if CHIP_SYSTEM_CONFIG_USE_LWIP
     Layer & lLayer = this->SystemLayer();
@@ -297,7 +297,7 @@
 
     this->Release();
 exit:
-    return CHIP_SYSTEM_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 /**
@@ -321,7 +321,7 @@
 
     // Invoke the app's callback, if it's still valid.
     if (lOnComplete != nullptr)
-        lOnComplete(&lLayer, lAppState, CHIP_SYSTEM_NO_ERROR);
+        lOnComplete(&lLayer, lAppState, CHIP_NO_ERROR);
 
 exit:
     return;
@@ -339,10 +339,10 @@
  *  @note
  *      It's harmless if this API gets called and there are no expired timers.
  *
- *  @return CHIP_SYSTEM_NO_ERROR on success, error code otherwise.
+ *  @return CHIP_NO_ERROR on success, error code otherwise.
  *
  */
-Error Timer::HandleExpiredTimers(Layer & aLayer)
+CHIP_ERROR Timer::HandleExpiredTimers(Layer & aLayer)
 {
     size_t timersHandled = 0;
 
@@ -394,7 +394,7 @@
         }
     }
 
-    return CHIP_SYSTEM_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 #endif // CHIP_SYSTEM_CONFIG_USE_LWIP
 
diff --git a/src/system/SystemTimer.h b/src/system/SystemTimer.h
index 3b45a19..2413d06 100644
--- a/src/system/SystemTimer.h
+++ b/src/system/SystemTimer.h
@@ -69,11 +69,11 @@
     static Epoch GetCurrentEpoch();
     static bool IsEarlierEpoch(const Epoch & first, const Epoch & second);
 
-    typedef void (*OnCompleteFunct)(Layer * aLayer, void * aAppState, Error aError);
+    typedef void (*OnCompleteFunct)(Layer * aLayer, void * aAppState, CHIP_ERROR aError);
     OnCompleteFunct OnComplete;
 
-    Error Start(uint32_t aDelayMilliseconds, OnCompleteFunct aOnComplete, void * aAppState);
-    Error Cancel();
+    CHIP_ERROR Start(uint32_t aDelayMilliseconds, OnCompleteFunct aOnComplete, void * aAppState);
+    CHIP_ERROR Cancel();
 
     static void GetStatistics(chip::System::Stats::count_t & aNumInUse, chip::System::Stats::count_t & aHighWatermark);
 
@@ -84,12 +84,12 @@
 
     void HandleComplete();
 
-    Error ScheduleWork(OnCompleteFunct aOnComplete, void * aAppState);
+    CHIP_ERROR ScheduleWork(OnCompleteFunct aOnComplete, void * aAppState);
 
 #if CHIP_SYSTEM_CONFIG_USE_LWIP
     Timer * mNextTimer;
 
-    static Error HandleExpiredTimers(Layer & aLayer);
+    static CHIP_ERROR HandleExpiredTimers(Layer & aLayer);
 #endif // CHIP_SYSTEM_CONFIG_USE_LWIP
 
 #if CHIP_SYSTEM_CONFIG_USE_DISPATCH
diff --git a/src/system/tests/TestSystemErrorStr.cpp b/src/system/tests/TestSystemErrorStr.cpp
index 878b4f4..4855d68 100644
--- a/src/system/tests/TestSystemErrorStr.cpp
+++ b/src/system/tests/TestSystemErrorStr.cpp
@@ -48,16 +48,15 @@
 // Test input data.
 
 // clang-format off
-static int32_t sContext[] =
+static CHIP_ERROR sContext[] =
 {
-    CHIP_SYSTEM_ERROR_NOT_IMPLEMENTED,
-    CHIP_SYSTEM_ERROR_NOT_SUPPORTED,
-    CHIP_SYSTEM_ERROR_BAD_ARGS,
-    CHIP_SYSTEM_ERROR_UNEXPECTED_STATE,
-    CHIP_SYSTEM_ERROR_UNEXPECTED_EVENT,
-    CHIP_SYSTEM_ERROR_NO_MEMORY,
-    CHIP_SYSTEM_ERROR_REAL_TIME_NOT_SYNCED,
-    CHIP_SYSTEM_ERROR_ACCESS_DENIED
+    CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE,
+    CHIP_ERROR_INVALID_ARGUMENT,
+    CHIP_ERROR_INCORRECT_STATE,
+    CHIP_ERROR_UNEXPECTED_EVENT,
+    CHIP_ERROR_NO_MEMORY,
+    CHIP_ERROR_REAL_TIME_NOT_SYNCED,
+    CHIP_ERROR_ACCESS_DENIED
 };
 // clang-format on
 
@@ -65,10 +64,10 @@
 {
     // Register the layer error formatter
 
-    System::RegisterLayerErrorFormatter();
+    RegisterCHIPLayerErrorFormatter();
 
     // For each defined error...
-    for (int err : sContext)
+    for (CHIP_ERROR err : sContext)
     {
         const char * errStr = ErrorStr(err);
         char expectedText[9];
diff --git a/src/system/tests/TestSystemObject.cpp b/src/system/tests/TestSystemObject.cpp
index 29079f2..69fda04 100644
--- a/src/system/tests/TestSystemObject.cpp
+++ b/src/system/tests/TestSystemObject.cpp
@@ -70,7 +70,7 @@
 class TestObject : public Object
 {
 public:
-    Error Init();
+    CHIP_ERROR Init();
 
     static void CheckRetention(nlTestSuite * inSuite, void * aContext);
     static void CheckConcurrency(nlTestSuite * inSuite, void * aContext);
@@ -104,7 +104,7 @@
 
 ObjectPool<TestObject, TestObject::kPoolSize> TestObject::sPool;
 
-Error TestObject::Init()
+CHIP_ERROR TestObject::Init()
 {
 #if CHIP_SYSTEM_CONFIG_POSIX_LOCKING
     this->mDelay = kMaxDelayIterations > 0 ? 1 : 0;
@@ -114,7 +114,7 @@
     }
 #endif // CHIP_SYSTEM_CONFIG_POSIX_LOCKING
 
-    return CHIP_SYSTEM_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
 namespace {
diff --git a/src/system/tests/TestSystemTimer.cpp b/src/system/tests/TestSystemTimer.cpp
index 6adbceb..7265e46 100644
--- a/src/system/tests/TestSystemTimer.cpp
+++ b/src/system/tests/TestSystemTimer.cpp
@@ -111,13 +111,13 @@
     sOverflowTestDone = true;
 }
 
-void HandleTimerFailed(Layer * inetLayer, void * aState, Error aError)
+void HandleTimerFailed(Layer * inetLayer, void * aState, CHIP_ERROR aError)
 {
     (void) inetLayer, (void) aError;
     TimerFailed(aState);
 }
 
-void HandleTimer10Success(Layer * inetLayer, void * aState, Error aError)
+void HandleTimer10Success(Layer * inetLayer, void * aState, CHIP_ERROR aError)
 {
     TestContext & lContext = *static_cast<TestContext *>(aState);
     NL_TEST_ASSERT(lContext.mTestSuite, true);
@@ -153,7 +153,7 @@
     lSys.CancelTimer(HandleTimer10Success, aContext);
 }
 
-void HandleGreedyTimer(Layer * aLayer, void * aState, Error aError)
+void HandleGreedyTimer(Layer * aLayer, void * aState, CHIP_ERROR aError)
 {
     static uint32_t sNumTimersHandled = 0;
     TestContext & lContext            = *static_cast<TestContext *>(aState);
diff --git a/src/system/tests/TestSystemWakeEvent.cpp b/src/system/tests/TestSystemWakeEvent.cpp
index 4fecf03..19104e1 100644
--- a/src/system/tests/TestSystemWakeEvent.cpp
+++ b/src/system/tests/TestSystemWakeEvent.cpp
@@ -139,7 +139,7 @@
     const auto notifFD = lContext.mWakeEvent.GetNotifFD();
 
     // Check that Close() has cleaned up itself and reopen is possible
-    NL_TEST_ASSERT(inSuite, lContext.mWakeEvent.Open(lContext.mWatchableEvents) == CHIP_SYSTEM_NO_ERROR);
+    NL_TEST_ASSERT(inSuite, lContext.mWakeEvent.Open(lContext.mWatchableEvents) == CHIP_NO_ERROR);
     NL_TEST_ASSERT(inSuite, notifFD < 0);
 }
 } // namespace
diff --git a/src/transport/SecureSessionMgr.cpp b/src/transport/SecureSessionMgr.cpp
index 6179ce3..83e5da1 100644
--- a/src/transport/SecureSessionMgr.cpp
+++ b/src/transport/SecureSessionMgr.cpp
@@ -380,7 +380,7 @@
             {
                 ChipLogError(Inet,
                              "Message counter synchronization for received message, failed to "
-                             "QueueReceivedMessageAndStartSync, err = %" PRId32,
+                             "QueueReceivedMessageAndStartSync, err = %" CHIP_ERROR_FORMAT,
                              err);
             }
             else
@@ -400,7 +400,7 @@
         }
         if (err != CHIP_NO_ERROR)
         {
-            ChipLogError(Inet, "Message counter verify failed, err = %" PRId32, err);
+            ChipLogError(Inet, "Message counter verify failed, err = %" CHIP_ERROR_FORMAT, err);
         }
         SuccessOrExit(err);
     }
@@ -532,7 +532,7 @@
     mTransportMgr->Disconnect(state.GetPeerAddress());
 }
 
-void SecureSessionMgr::ExpiryTimerCallback(System::Layer * layer, void * param, System::Error error)
+void SecureSessionMgr::ExpiryTimerCallback(System::Layer * layer, void * param, CHIP_ERROR error)
 {
     SecureSessionMgr * mgr = reinterpret_cast<SecureSessionMgr *>(param);
 #if CHIP_CONFIG_SESSION_REKEYING
diff --git a/src/transport/SecureSessionMgr.h b/src/transport/SecureSessionMgr.h
index ca0ff7e..2813307 100644
--- a/src/transport/SecureSessionMgr.h
+++ b/src/transport/SecureSessionMgr.h
@@ -324,7 +324,7 @@
     /**
      * Callback for timer expiry check
      */
-    static void ExpiryTimerCallback(System::Layer * layer, void * param, System::Error error);
+    static void ExpiryTimerCallback(System::Layer * layer, void * param, CHIP_ERROR error);
 
     void SecureMessageDispatch(const PacketHeader & packetHeader, const Transport::PeerAddress & peerAddress,
                                System::PacketBufferHandle && msg);
diff --git a/src/transport/raw/BLE.cpp b/src/transport/raw/BLE.cpp
index 0f2432a..9a40c85 100644
--- a/src/transport/raw/BLE.cpp
+++ b/src/transport/raw/BLE.cpp
@@ -145,7 +145,7 @@
     }
 }
 
-void BLEBase::OnBleConnectionError(BLE_ERROR err)
+void BLEBase::OnBleConnectionError(CHIP_ERROR err)
 {
     ClearPendingPackets();
     ChipLogDetail(Inet, "BleConnection Error: %s", ErrorStr(err));
@@ -156,11 +156,11 @@
     HandleMessageReceived(Transport::PeerAddress(Transport::Type::kBle), std::move(buffer));
 }
 
-void BLEBase::OnEndPointConnectComplete(BLEEndPoint * endPoint, BLE_ERROR err)
+void BLEBase::OnEndPointConnectComplete(BLEEndPoint * endPoint, CHIP_ERROR err)
 {
     mState = State::kConnected;
 
-    if (err != BLE_NO_ERROR)
+    if (err != CHIP_NO_ERROR)
     {
         ChipLogError(Inet, "Failed to establish BLE connection: %s", ErrorStr(err));
         ClearPendingPackets();
@@ -177,7 +177,7 @@
     ChipLogDetail(Inet, "BLE EndPoint %p Connection Complete", endPoint);
 }
 
-void BLEBase::OnEndPointConnectionClosed(BLEEndPoint * endPoint, BLE_ERROR err)
+void BLEBase::OnEndPointConnectionClosed(BLEEndPoint * endPoint, CHIP_ERROR err)
 {
     mState       = State::kInitialized;
     mBleEndPoint = nullptr;
diff --git a/src/transport/raw/BLE.h b/src/transport/raw/BLE.h
index 6cedb01..89045fd 100644
--- a/src/transport/raw/BLE.h
+++ b/src/transport/raw/BLE.h
@@ -107,14 +107,14 @@
     // Those functions are BLEConnectionDelegate callbacks used when the connection
     // parameters used a name instead of a BLE_CONNECTION_OBJECT.
     void OnBleConnectionComplete(Ble::BLEEndPoint * endPoint) override;
-    void OnBleConnectionError(BLE_ERROR err) override;
+    void OnBleConnectionError(CHIP_ERROR err) override;
 
     void ClearPendingPackets();
 
     // Those functions are BLEEndPoint callbacks
     void OnEndPointMessageReceived(Ble::BLEEndPoint * endPoint, System::PacketBufferHandle && buffer) override;
-    void OnEndPointConnectComplete(Ble::BLEEndPoint * endPoint, BLE_ERROR err) override;
-    void OnEndPointConnectionClosed(Ble::BLEEndPoint * endPoint, BLE_ERROR err) override;
+    void OnEndPointConnectComplete(Ble::BLEEndPoint * endPoint, CHIP_ERROR err) override;
+    void OnEndPointConnectionClosed(Ble::BLEEndPoint * endPoint, CHIP_ERROR err) override;
 
     Ble::BleLayer * mBleLayer       = nullptr;          ///< Associated ble layer
     State mState                    = State::kNotReady; ///< State of the BLE transport
diff --git a/src/transport/raw/TCP.cpp b/src/transport/raw/TCP.cpp
index e7b28c8..fabace0 100644
--- a/src/transport/raw/TCP.cpp
+++ b/src/transport/raw/TCP.cpp
@@ -86,7 +86,7 @@
 #if INET_CONFIG_ENABLE_TCP_ENDPOINT
     err = params.GetInetLayer()->NewTCPEndPoint(&mListenSocket);
 #else
-    err = CHIP_SYSTEM_ERROR_NOT_SUPPORTED;
+    err = CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
 #endif
     SuccessOrExit(err);
 
@@ -248,7 +248,7 @@
 #if INET_CONFIG_ENABLE_TCP_ENDPOINT
     err = mListenSocket->Layer().NewTCPEndPoint(&endPoint);
 #else
-    err = CHIP_SYSTEM_ERROR_NOT_SUPPORTED;
+    err = CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
 #endif
     SuccessOrExit(err);
 
@@ -352,7 +352,7 @@
     return CHIP_NO_ERROR;
 }
 
-INET_ERROR TCPBase::OnTcpReceive(Inet::TCPEndPoint * endPoint, System::PacketBufferHandle && buffer)
+CHIP_ERROR TCPBase::OnTcpReceive(Inet::TCPEndPoint * endPoint, System::PacketBufferHandle && buffer)
 {
     Inet::IPAddress ipAddress;
     uint16_t port;
@@ -369,12 +369,12 @@
     {
         // Connection could need to be closed at this point
         ChipLogError(Inet, "Failed to accept received TCP message: %s", ErrorStr(err));
-        return INET_ERROR_UNEXPECTED_EVENT;
+        return CHIP_ERROR_UNEXPECTED_EVENT;
     }
-    return INET_NO_ERROR;
+    return CHIP_NO_ERROR;
 }
 
-void TCPBase::OnConnectionComplete(Inet::TCPEndPoint * endPoint, INET_ERROR inetErr)
+void TCPBase::OnConnectionComplete(Inet::TCPEndPoint * endPoint, CHIP_ERROR inetErr)
 {
     CHIP_ERROR err          = CHIP_NO_ERROR;
     bool foundPendingPacket = false;
@@ -448,7 +448,7 @@
     }
 }
 
-void TCPBase::OnConnectionClosed(Inet::TCPEndPoint * endPoint, INET_ERROR err)
+void TCPBase::OnConnectionClosed(Inet::TCPEndPoint * endPoint, CHIP_ERROR err)
 {
     TCPBase * tcp = reinterpret_cast<TCPBase *>(endPoint->AppState);
 
@@ -497,7 +497,7 @@
     }
 }
 
-void TCPBase::OnAcceptError(Inet::TCPEndPoint * endPoint, INET_ERROR err)
+void TCPBase::OnAcceptError(Inet::TCPEndPoint * endPoint, CHIP_ERROR err)
 {
     ChipLogError(Inet, "Accept error: %s", ErrorStr(err));
 }
diff --git a/src/transport/raw/TCP.h b/src/transport/raw/TCP.h
index 59878d8..a1de89b 100644
--- a/src/transport/raw/TCP.h
+++ b/src/transport/raw/TCP.h
@@ -232,15 +232,15 @@
 
     // Callback handler for TCPEndPoint. TCP message receive handler.
     // @see TCPEndpoint::OnDataReceivedFunct
-    static INET_ERROR OnTcpReceive(Inet::TCPEndPoint * endPoint, System::PacketBufferHandle && buffer);
+    static CHIP_ERROR OnTcpReceive(Inet::TCPEndPoint * endPoint, System::PacketBufferHandle && buffer);
 
     // Callback handler for TCPEndPoint. Called when a connection has been completed.
     // @see TCPEndpoint::OnConnectCompleteFunct
-    static void OnConnectionComplete(Inet::TCPEndPoint * endPoint, INET_ERROR err);
+    static void OnConnectionComplete(Inet::TCPEndPoint * endPoint, CHIP_ERROR err);
 
     // Callback handler for TCPEndPoint. Called when a connection has been closed.
     // @see TCPEndpoint::OnConnectionClosedFunct
-    static void OnConnectionClosed(Inet::TCPEndPoint * endPoint, INET_ERROR err);
+    static void OnConnectionClosed(Inet::TCPEndPoint * endPoint, CHIP_ERROR err);
 
     // Callback handler for TCPEndPoint. Callend when a peer closes the connection.
     // @see TCPEndpoint::OnPeerCloseFunct
@@ -253,7 +253,7 @@
 
     // Called on accept error
     // @see TCPEndpoint::OnAcceptErrorFunct
-    static void OnAcceptError(Inet::TCPEndPoint * endPoint, INET_ERROR err);
+    static void OnAcceptError(Inet::TCPEndPoint * endPoint, CHIP_ERROR err);
 
     Inet::TCPEndPoint * mListenSocket = nullptr;                                     ///< TCP socket used by the transport
     Inet::IPAddressType mEndpointType = Inet::IPAddressType::kIPAddressType_Unknown; ///< Socket listening type