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

Support for nrf5340 dual core architecture #101

Open
igiona opened this issue Aug 31, 2024 · 4 comments
Open

Support for nrf5340 dual core architecture #101

igiona opened this issue Aug 31, 2024 · 4 comments

Comments

@igiona
Copy link

igiona commented Aug 31, 2024

I'm quite familiar with the nrf52 family and I used the SoftDevice extensively in C and I did some fairly simple work in Rust using embassy-softdevice.
Recently I started looking into the nrf5340, and I though giving trouble a shot 'cause Nordic doesn't support the nrf53 family within the SoftDevice stack anymore :'(

I never worked on a dual core microcontroller in Rust, hence I'm not sure where to start here?
I saw that there is some support for the nrf5340 chip within embassy, but the examples do not really showcase the usage of the double cores.

Any suggestion on how to get started with trouble on that chip?

@lulf
Copy link
Member

lulf commented Sep 2, 2024

I think with the nrf53, you can run the controller on the network core, and then trouble on the application core, communicating over the IPC bus. You'd need to implement the traits from bt-hci that send/receive HCI packets to the network core.

@igiona
Copy link
Author

igiona commented Sep 2, 2024

I think with the nrf53, you can run the controller on the network core, and then trouble on the application core, communicating over the IPC bus. You'd need to implement the traits from bt-hci that send/receive HCI packets to the network core.

Are you aware of any non-sdc controller available for the nrf5340?

Why should trouble run on the app-core in your opinion?
I would have rather placed it in the net-core and I would have communicated over IPC only at an higher level of abstraction (like GATT read/write/notifications).
The app-core is quite power hungry, hence I wouldn't bothered waking it app at every "low-level" BLE event.

In general, I'm still not quite sure how to handle 2 applications in one rust project... would you handled them as completely separated apps that communicate over an IPC API?

@lulf
Copy link
Member

lulf commented Sep 2, 2024

I think with the nrf53, you can run the controller on the network core, and then trouble on the application core, communicating over the IPC bus. You'd need to implement the traits from bt-hci that send/receive HCI packets to the network core.

Are you aware of any non-sdc controller available for the nrf5340?

I'm not very familiar with it, but my impression was that Nordic provides a controller firmware that you flash to the network core and that's all you need.

Why should trouble run on the app-core in your opinion? I would have rather placed it in the net-core and I would have communicated over IPC only at an higher level of abstraction (like GATT read/write/notifications). The app-core is quite power hungry, hence I wouldn't bothered waking it app at every "low-level" BLE event.

Keep in mind even Trouble does not get notified of low level events. If you're using only GATT, there will not be any 'hidden' events on a connection other than the initial 'connected', 'gatt events' and 'disconnected', so I doubt you would save a lot of power by running trouble on the net core (and more likely complicate your firmware build/deployment model).

In general, I'm still not quite sure how to handle 2 applications in one rust project... would you handled them as completely separated apps that communicate over an IPC API?

I think you'd generally treat them as separate build targets/firmware, but they may share some common crates for type definitions over the IPC etc.

@igiona
Copy link
Author

igiona commented Sep 2, 2024

Thanks for the inputs!

I'm not very familiar with it, but my impression was that Nordic provides a controller firmware that you flash to the network core and that's all you need.

Your impression was right: https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/app_dev/device_guides/nrf53/features_nrf53.html#bluetooth_low_energy

image

To me it still seems like a waste of resources, to run only the controller on a dedicated CPU, in the nrf52 series app and BLE are coexisting with pretty decent performances after all... but I might underestimate all the job that the controller (and multi-protocol stuff) need to do...

I'll keep you posted here with any progress on this...

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

No branches or pull requests

2 participants