Skip to content
New issue

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

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

Already on GitHub? # to your account

Example that supports RTIC using nrf52840-dk-bsp? #7

Open
cpfister opened this issue Aug 26, 2020 · 1 comment
Open

Example that supports RTIC using nrf52840-dk-bsp? #7

cpfister opened this issue Aug 26, 2020 · 1 comment

Comments

@cpfister
Copy link

Would it be possible to add an example that supports RTIC, with interrupt and periodic tasks? Is this possible, given that the API does not appear to export Interrupt and NVIC_PRIO_BITS?

Screenshot 2020-08-26 at 17 44 31

I tried to add my own RTIC device implementation, although I didn't find much documentation about it, and it just might work for Interrupt, but it still lacks the other part because pac is not accessible:

Screenshot 2020-08-26 at 17 40 57

As a more general question: is there hope that e.g. an rtic-hal-api crate will be defined, so that all HAL implementers can opt to not just implement the embedded-hal API, but also the rtic-hal-api? Ideally in a way that makes it possible to support different monotonic timers for RTIC, for different usage scenarios? Or is this already the (cortex-m-)rtic crate, but HAL implementers do not support it? And finally, what's the best place on the Web to keep up-to-date regarding such questions?

@oberon-sk
Copy link

I do not have a clean solution but at least a workaround:
Setting device = nrf52840_dk_bsp::hal::target (the pac) works for me:

#[rtic::app(device = nrf52840_dk_bsp::hal::target, monotonic = rtic::cyccnt::CYCCNT)]

To also use nrf52840 peripherals, I could only make it work by nrf52840_dk_bsp::Board::steal, because RTIC's pre_init.rs generates:

rtic::export::Peripherals::steal().into();

which is called before [init] and makes nrf52840_dk_bsp::Board::take fail.

There has been a discussion how RTIC should make peripherals available: see rtic-rs/rtic#163 (closed) that eventually led to the following change: rtic-rs/rtic#201

I am not sure if/how nrf52840_dk_bsp could support both, RTIC and non-RTIC in a clean way.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants