Skip to content

Commit 7a2d97b

Browse files
committed
Working icmsg sample for nRF53
1 parent 0e8ee75 commit 7a2d97b

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

samples/subsys/ipc/ipc_service/icmsg/boards/nrf5340dk_nrf5340_cpuapp.overlay

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
mboxes = <&mbox 0>, <&mbox 1>;
3333
mbox-names = "tx", "rx";
3434
status = "okay";
35+
dcache-alignment = <8>;
3536

3637
bt_hci_ipc0: bt_hci_ipc0 {
3738
compatible = "zephyr,bt-hci-ipc";

samples/subsys/ipc/ipc_service/icmsg/remote/boards/nrf5340dk_nrf5340_cpunet.overlay

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
mboxes = <&mbox 0>, <&mbox 1>;
3333
mbox-names = "rx", "tx";
3434
status = "okay";
35+
dcache-alignment = <8>;
3536
};
3637
};
3738
};

subsys/ipc/ipc_service/lib/pbuf.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ static int validate_cfg(const struct pbuf_cfg *cfg)
3232
{
3333
/* Validate pointers. */
3434
if (!cfg || !cfg->rd_idx_loc || !cfg->wr_idx_loc || !cfg->data_loc) {
35+
printk("Invalid pointers\n");
3536
return -EINVAL;
3637
}
3738

@@ -40,11 +41,13 @@ static int validate_cfg(const struct pbuf_cfg *cfg)
4041
!IS_PTR_ALIGNED_BYTES(cfg->wr_idx_loc, MAX(cfg->dcache_alignment, _PBUF_IDX_SIZE)) ||
4142
!IS_PTR_ALIGNED_BYTES(cfg->handshake_loc, _PBUF_IDX_SIZE) ||
4243
!IS_PTR_ALIGNED_BYTES(cfg->data_loc, _PBUF_IDX_SIZE)) {
44+
printk("Invalid alignment\n");
4345
return -EINVAL;
4446
}
4547

4648
/* Validate len. */
4749
if (cfg->len < _PBUF_MIN_DATA_LEN || !IS_PTR_ALIGNED_BYTES(cfg->len, _PBUF_IDX_SIZE)) {
50+
printk("Invalid length\n");
4851
return -EINVAL;
4952
}
5053

@@ -55,6 +58,12 @@ static int validate_cfg(const struct pbuf_cfg *cfg)
5558
!((uint8_t *)cfg->wr_idx_loc < cfg->data_loc) ||
5659
!(((uint8_t *)cfg->rd_idx_loc + MAX(_PBUF_IDX_SIZE, cfg->dcache_alignment)) ==
5760
(uint8_t *)cfg->wr_idx_loc)) {
61+
printk("Invalid pointer values\n");
62+
printk("rd_idx_loc: 0x%08X\n", (uintptr_t)cfg->rd_idx_loc);
63+
printk("wr_idx_loc: 0x%08X\n", (uintptr_t)cfg->wr_idx_loc);
64+
printk("handshake_loc: 0x%08X\n", (uintptr_t)cfg->handshake_loc);
65+
printk("data_loc: 0x%08X\n", (uintptr_t)cfg->data_loc);
66+
printk("dcache_alignment: 0x%08X\n", (uintptr_t)cfg->dcache_alignment);
5867
return -EINVAL;
5968
}
6069

0 commit comments

Comments
 (0)