Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

samples: subsys: ipc: basic: Basic cores communication #4

Closed
wants to merge 1 commit into from

Conversation

jaz1-nordic
Copy link
Collaborator

Add basic cores communication sample to show how to send messages between two cores using mbox and shared data structure.

Add basic cores communication sample to show how to send
messages between two cores using mbox and shared data structure.

Signed-off-by: Jakub Zymelka <jakub.zymelka@nordicsemi.no>
Copy link
Collaborator

@magp-nordic magp-nordic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a few nitpicking notes. I am also wondering: is it possible that one of the first mbox messages ("No data from host/remote") is missed because the other core enabled mbox after some delay? Or maybe mbox does not send anything until it is enabled by both cores?
Besides that, LGTM.

Overview
********

This application demonstrates how to communcate between cores without any backend in
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This application demonstrates how to communcate between cores without any backend in
This application demonstrates how to communicate between cores without any backend in


*** Booting Zephyr OS build v3.7.0-rc1-427-g7f891a6a40e8 ***
I: No data from remote
I: Sent 14 bytes to host
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
I: Sent 14 bytes to host
I: Sent 14 bytes to remote

I guess it should be remote, as it is the host's log.

ordered: false
regex:
- "No data from remote"
- "Sent 14 bytes to host"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- "Sent 14 bytes to host"
- "Sent 14 bytes to remote"

data_packet_t data_packet;

/**
* @brief Send data to aother core
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @brief Send data to aother core
* @brief Send data to another core

Comment on lines +157 to +159
int bytes_sent = 0;

int ret = mbox_init();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
int bytes_sent = 0;
int ret = mbox_init();
int bytes_sent = 0;
int ret = mbox_init();

To fix compliance check


/**
* @brief Verify whether another core has data ready for us to read
* @return -1 if lock is not acquired, otherwise how many items are available for reading
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would put it the other way around:
"Number of items available for reading, -1 if lock is not acquired"

* @brief Send data to aother core
* @param buffer
* @param size
* @return -1 if lock is not acquired, otherwise how many items were transfered
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as in the host main.c

return -1;
}

/* Limit size of buffer to be transfered to the size of destine buffer */
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it should be "destination buffer" or "destined buffer".

* @brief Get data from another core
* @param buffer
* @param size
* @return -1 if lock is not acquired, otherwise how many items were read
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as in the host main.c

@jaz1-nordic
Copy link
Collaborator Author

Changes moved to nrfconnect/sdk-zephyr#1910 .

@jaz1-nordic jaz1-nordic deleted the non-ic-msg-ipc branch July 30, 2024 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants