All of lore.kernel.org
 help / color / mirror / Atom feed
* revl + timer
@ 2026-08-19 16:37 Brunet Yorick
  2026-08-19 17:45 ` Philippe Gerum
  0 siblings, 1 reply; 2+ messages in thread
From: Brunet Yorick @ 2026-08-19 16:37 UTC (permalink / raw)
  To: Xenomai

Hello,

I originally posted this question in the matrix channel but got no answer. I try with the mailing list.

I have been using `libevl` for some time. I am now testing `revl` as I want to move forward Rust.

As a first step before going on the embedded board, I'm using "qemu virt64".

First, I noticed that https://gitlab.com/Xenomai/xenomai4/revl/-/blob/master/Cargo.toml?ref\_type=heads doesn't refer a valid `evl-sys` as it points to the main branch and not a tag. I had to clone `revl v0.6.2` and change manually Cargo.toml to

```
-evl-sys = { version = "0.32", git = "https://gitlab.com/Xenomai/xenomai4/evl-sys" }
+evl-sys = { tag = "v0.36.1", git = "https://gitlab.com/Xenomai/xenomai4/evl-sys" }
```
(or v0.32.1)

Then I tried to use the timer with

```
let timer = timer::Timer::new(clock::STEADY_CLOCK).expect("[ERROR] timer create failed\n");
let now = clock::STEADY_CLOCK.now();
let period = Nanoseconds(1_000_000_000_u64);
let first_expiry = now + period;
timer.arm_periodic(first_expiry, period).expect("[ERROR] timer arm failed\n");
loop {
    match timer.wait() {
        [...]
    }
}
```

or

```
let timeout = clock::STEADY_CLOCK.now() + Seconds(1_u32);
assert!(clock::STEADY_CLOCK.sleep_until(timeout).is_ok());
```

Both cases fail, either on the `timer.wait()` or `sleep_until()`.

My system is composed of:
- uboot
- buildroot (I included the libevl r59, revl v0.6.2, and evl-sys v0.36.1 packages but I'm not sure that it was necessary)
- linux-evl v6.18.29-evl2-rebase

rustc 1.97.1 (8bab26f4f 2026-07-14)

The Cargo.toml of my project is:
```
[package]
name = "evl-periodic_task-rs"
version = "0.1.0"
edition = "2024"

[dependencies]
revl = { path = "../../../../revl" } <--- points to v0.6.2 with changes presented above
libc = "0.2.189"
embedded-time = "0.12.1"
```

Do you have any idea on the issue ?
How can I retrieve more logs from EVL?

Thanks !
Yorick

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: revl + timer
  2026-08-19 16:37 revl + timer Brunet Yorick
@ 2026-08-19 17:45 ` Philippe Gerum
  0 siblings, 0 replies; 2+ messages in thread
From: Philippe Gerum @ 2026-08-19 17:45 UTC (permalink / raw)
  To: Brunet Yorick; +Cc: Xenomai

Brunet Yorick <yorick.brunet@heig-vd.ch> writes:

> Hello,
>
> I originally posted this question in the matrix channel but got no answer. I try with the mailing list.
>

The matrix channel is dead, at least nobody is monitoring it anymore due
to lack of sustained interest from users, and lack of time on my end
too. This is the reason why the matrix URL was dropped from the website
information a year ago or so. I may have to close the channel and lose
the messages posted there. This mailing list is indeed the right place
to inquire about xenomai stuff.

> I have been using `libevl` for some time. I am now testing `revl` as I want to move forward Rust.
>
> As a first step before going on the embedded board, I'm using "qemu virt64".
>
> First, I noticed that https://gitlab.com/Xenomai/xenomai4/revl/-/blob/master/Cargo.toml?ref\_type=heads doesn't refer a valid `evl-sys` as it points to the main branch and not a tag. I had to clone `revl v0.6.2` and change manually Cargo.toml to
>
> ```
> -evl-sys = { version = "0.32", git = "https://gitlab.com/Xenomai/xenomai4/evl-sys" }
> +evl-sys = { tag = "v0.36.1", git = "https://gitlab.com/Xenomai/xenomai4/evl-sys" }
> ```      
> (or v0.32.1)
>

I'm not sure to understand the issue. Cargo should pick v0.32.1 since it
tries to upgrade automatically as long as it finds a newer compatible
version, e.g.:

$ cargo build
   Compiling autocfg v1.1.0
   Compiling proc-macro2 v1.0.89
   Compiling unicode-ident v1.0.1
   Compiling memchr v2.5.0
   Compiling glob v0.3.0
   Compiling cfg-if v1.0.0
   ...
   Compiling evl-sys v0.32.0 (https://gitlab.com/Xenomai/xenomai4/evl-sys#381404f7)

Which is evl-sys v0.32.1, as it should be:

$ git log -1 381404f7
commit 381404f7ab5a38744b6a771f60a4620b865d208d (tag: v0.32.1)
...

This said, I agree that using tags would be clearer and follow the
recommendation from the Cargo docs.

NOTE: in the version/tag information v0.x.y for evl-sys, 'x' refers to
the libevl API number this FFI is compatible with, and 'y' is a patch
level fixing minor issue(s) in this context.

> Then I tried to use the timer with
>
> ```
> let timer = timer::Timer::new(clock::STEADY_CLOCK).expect("[ERROR] timer create failed\n");
> let now = clock::STEADY_CLOCK.now();
> let period = Nanoseconds(1_000_000_000_u64);
> let first_expiry = now + period;
> timer.arm_periodic(first_expiry, period).expect("[ERROR] timer arm failed\n");
> loop {
>     match timer.wait() {
>         [...]
>     }
> }
> ```
>

Which error is this, precisely? e.g. using .unwrap() on the result
instead of expect() would give better details.

> or
>
> ```
> let timeout = clock::STEADY_CLOCK.now() + Seconds(1_u32);
> assert!(clock::STEADY_CLOCK.sleep_until(timeout).is_ok());
> ```
>
> Both cases fail, either on the `timer.wait()` or `sleep_until()`.
>
> My system is composed of:
> - uboot
> - buildroot (I included the libevl r59, revl v0.6.2, and evl-sys v0.36.1 packages but I'm not sure that it was necessary)
> - linux-evl v6.18.29-evl2-rebase
>
> rustc 1.97.1 (8bab26f4f 2026-07-14)
>
> The Cargo.toml of my project is:
> ```
> [package]
> name = "evl-periodic_task-rs"
> version = "0.1.0"
> edition = "2024"
>
> [dependencies]
> revl = { path = "../../../../revl" } <--- points to v0.6.2 with changes presented above
> libc = "0.2.189"
> embedded-time = "0.12.1"
> ```
>
> Do you have any idea on the issue ?

1. revl::init() was not called prior to issuing any of those requests. I
would suspect ErrorKind::Other to be returned by Timer::arm_timer().

2. Thread::attach was not called prior to attempting to sleep in oob
mode on the steady clock. In such an event, receiving
ErrorKind::PermissionDenied would make sense.

> How can I retrieve more logs from EVL?
>

There isn't, this is a system call (low-level) interface, so no cosy
application-level message logging in such layer.

-- 
Philippe.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-08-19 17:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-19 16:37 revl + timer Brunet Yorick
2026-08-19 17:45 ` Philippe Gerum

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.