samples: ipc: icmsg: Add received bytes metric

By adding this metric, any problem with the remote core sending messages
is observable.

Signed-off-by: Celina Sophie Kalus <hello@celinakalus.de>
This commit is contained in:
Celina Sophie Kalus 2024-05-02 14:28:03 +02:00 committed by Anas Nashif
commit 9e0d4ef88f

View file

@ -21,8 +21,12 @@ K_SEM_DEFINE(bound_sem, 0, 1);
static unsigned char expected_message = 'A';
static size_t expected_len = PACKET_SIZE_START;
static size_t received;
static void ep_bound(void *priv)
{
received = 0;
k_sem_give(&bound_sem);
LOG_INF("Ep bounded");
}
@ -36,6 +40,7 @@ static void ep_recv(const void *data, size_t len, void *priv)
__ASSERT(len == expected_len, "Unexpected length. Expected %zu, got %zu",
expected_len, len);
received += len;
expected_message++;
expected_len++;
@ -129,6 +134,8 @@ int main(void)
LOG_INF("Wait 500ms. Let net core finish its sends");
k_msleep(500);
LOG_INF("Received %zu [Bytes] in total", received);
LOG_INF("Stop network core");
nrf53_cpunet_enable(false);