Open arthurlutz opened 8 months ago
Oh in case there is a way to compile for libc6 2.11.1 here is the info about the target system :
# /lib/libc.so.6
GNU C Library (Sourcery G++ Lite 2010.09-50) stable release version 2.11.1, by Roland McGrath et al.
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 4.5.1.
Compiled on a Linux >>2.6.24-26-server<< system on 2010-11-07.
Available extensions:
crypt add-on version 2.1 by Michael Glad and others
GNU Libidn by Simon Josefsson
Native POSIX Threads Library by Ulrich Drepper et al
Support for some architectures added on, not maintained in glibc core.
BIND-8.2.3-T5B
For bug reporting instructions, please see:
<https://support.codesourcery.com/GNUToolchain/>.
Your musl attempt looks like it could work. Did you copy the bmp image to the arm target as well? The example expects the image to be in the directory examples/rust-logo/rust-logo.bmp
relative to the executable.
Thanks for taking a look at this, copied the bmp over, got a new error :
# ls examples/rust-logo/ -alh
total 780
drwxr-xr-x 2 root root 4.0K Jan 1 06:06 .
drwxr-xr-x 3 root root 4.0K Jan 1 06:06 ..
-rwxr-xr-x 1 root root 768.1K Jan 1 06:05 rust-logo.bmp
# RUST_BACKTRACE=full ./rust-logo
thread 'main' panicked at examples/rust-logo/main.rs:18:56:
called `Result::unwrap()` on an `Err` value: FramebufferError { kind: IoctlFailed, details: "Ioctl returned -1: Invalid argument" }
stack backtrace:
0: 0x4bcb8 - std::backtrace_rs::backtrace::libunwind::trace::hea3d5153e764c050
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
1: 0x4bcb8 - std::backtrace_rs::backtrace::trace_unsynchronized::hacb9069f200825de
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
2: 0x4bcb8 - std::sys_common::backtrace::_print_fmt::h90dbb00d6508c657
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:68:5
3: 0x4bcb8 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h2b446da419d592f3
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:44:22
4: 0x78738 - core::fmt::rt::Argument::fmt::h09d128c793366338
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/fmt/rt.rs:142:9
5: 0x78738 - core::fmt::write::h45b92a037c87eaf5
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/fmt/mod.rs:1120:17
6: 0x49ae8 - std::io::Write::write_fmt::h0f28d5c22592974b
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/io/mod.rs:1810:15
7: 0x4bac8 - std::sys_common::backtrace::_print::h4d52ef9f57f19f2b
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:47:5
8: 0x4bac8 - std::sys_common::backtrace::print::h5dbcff432a7cbe45
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:34:9
9: 0x4d2fc - std::panicking::default_hook::{{closure}}::h2fa44243e5bb3271
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:272:22
10: 0x4cf2c - std::panicking::default_hook::hd36f53f04476be9c
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:292:9
11: 0x4da64 - std::panicking::rust_panic_with_hook::hca328fee80f5b668
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:779:13
12: 0x4d78c - std::panicking::begin_panic_handler::{{closure}}::ha3ec3077f2d4e4ab
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:657:13
13: 0x4c250 - std::sys_common::backtrace::__rust_end_short_backtrace::hd6287aa814225103
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:171:18
14: 0x4d564 - rust_begin_unwind
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:645:5
15: 0x77888 - core::panicking::panic_fmt::h6900c08ab98cc1b6
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panicking.rs:72:14
16: 0x77c48 - core::result::unwrap_failed::h1f533e5170477909
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/result.rs:1649:5
17: 0x29f04 - rust_logo::main::h0a42aac27a2b628c
18: 0x29398 - std::sys_common::backtrace::__rust_begin_short_backtrace::hb0ac5bab83c7a937
19: 0x293a8 - std::rt::lang_start::{{closure}}::h9dea685c079bcb66
20: 0x477ac - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h9b6ef54c94813411
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/ops/function.rs:284:13
21: 0x477ac - std::panicking::try::do_call::h7eb03187cfb96a8b
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:552:40
22: 0x477ac - std::panicking::try::h36ecfc2661d8f806
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:516:19
23: 0x477ac - std::panic::catch_unwind::h757d99a28a56ce61
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panic.rs:142:14
24: 0x477ac - std::rt::lang_start_internal::{{closure}}::hd41d5e46f1b021a0
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/rt.rs:148:48
25: 0x477ac - std::panicking::try::do_call::h84ff794ec6e03c79
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:552:40
26: 0x477ac - std::panicking::try::h2cee7dd41c2f3308
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:516:19
27: 0x477ac - std::panic::catch_unwind::h0c3481b3c8b3d096
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panic.rs:142:14
28: 0x477ac - std::rt::lang_start_internal::h42bd59014292d677
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/rt.rs:148:20
29: 0x2a174 - main
Could you try building without --release? Then we can see the actual line numbers at which it is failing.
(Sorry for the delay) :
I don't see a lot of difference but you might find some more useful info :
# RUST_BACKTRACE=full ./rust-logo
thread 'main' panicked at examples/rust-logo/main.rs:18:56:
called `Result::unwrap()` on an `Err` value: FramebufferError { kind: IoctlFailed, details: "Ioctl returned -1: Invalid argument" }
stack backtrace:
0: 0x57d04 - std::backtrace_rs::backtrace::libunwind::trace::hea3d5153e764c050
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
1: 0x57d04 - std::backtrace_rs::backtrace::trace_unsynchronized::hacb9069f200825de
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
2: 0x57d04 - std::sys_common::backtrace::_print_fmt::h90dbb00d6508c657
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:68:5
3: 0x57d04 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h2b446da419d592f3
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:44:22
4: 0x84830 - core::fmt::rt::Argument::fmt::h09d128c793366338
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/fmt/rt.rs:142:9
5: 0x84830 - core::fmt::write::h45b92a037c87eaf5
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/fmt/mod.rs:1120:17
6: 0x55b34 - std::io::Write::write_fmt::h0f28d5c22592974b
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/io/mod.rs:1810:15
7: 0x57b14 - std::sys_common::backtrace::_print::h4d52ef9f57f19f2b
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:47:5
8: 0x57b14 - std::sys_common::backtrace::print::h5dbcff432a7cbe45
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:34:9
9: 0x59348 - std::panicking::default_hook::{{closure}}::h2fa44243e5bb3271
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:272:22
10: 0x58f78 - std::panicking::default_hook::hd36f53f04476be9c
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:292:9
11: 0x59ab0 - std::panicking::rust_panic_with_hook::hca328fee80f5b668
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:779:13
12: 0x597d8 - std::panicking::begin_panic_handler::{{closure}}::ha3ec3077f2d4e4ab
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:657:13
13: 0x5829c - std::sys_common::backtrace::__rust_end_short_backtrace::hd6287aa814225103
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:171:18
14: 0x595b0 - rust_begin_unwind
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:645:5
15: 0x838d0 - core::panicking::panic_fmt::h6900c08ab98cc1b6
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panicking.rs:72:14
16: 0x83d40 - core::result::unwrap_failed::h1f533e5170477909
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/result.rs:1649:5
17: 0x2b3cc - core::result::Result<T,E>::unwrap::hf1dbb0cb478e0735
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/result.rs:1073:23
18: 0x2abe0 - rust_logo::main::h7857ffdadb652879
at /home/arthur/local/rust-framebuffer/examples/rust-logo/main.rs:18:13
19: 0x2b77c - core::ops::function::FnOnce::call_once::h3a71b2c428619bac
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/ops/function.rs:250:5
20: 0x2c6d0 - std::sys_common::backtrace::__rust_begin_short_backtrace::h4f1351e78b64b436
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:155:18
21: 0x2c74c - std::rt::lang_start::{{closure}}::h6b59d191b5a22dbb
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/rt.rs:166:18
22: 0x537f8 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h9b6ef54c94813411
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/ops/function.rs:284:13
23: 0x537f8 - std::panicking::try::do_call::h7eb03187cfb96a8b
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:552:40
24: 0x537f8 - std::panicking::try::h36ecfc2661d8f806
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:516:19
25: 0x537f8 - std::panic::catch_unwind::h757d99a28a56ce61
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panic.rs:142:14
26: 0x537f8 - std::rt::lang_start_internal::{{closure}}::hd41d5e46f1b021a0
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/rt.rs:148:48
27: 0x537f8 - std::panicking::try::do_call::h84ff794ec6e03c79
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:552:40
28: 0x537f8 - std::panicking::try::h2cee7dd41c2f3308
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:516:19
29: 0x537f8 - std::panic::catch_unwind::h0c3481b3c8b3d096
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panic.rs:142:14
30: 0x537f8 - std::rt::lang_start_internal::h42bd59014292d677
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/rt.rs:148:20
31: 0x2c71c - std::rt::lang_start::h46cde25d5903958f
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/rt.rs:165:17
32: 0x2b078 - main
Okay, now we can at least see at which line it fails. It appears to be line 18, which sets the graphics mode. Could you comment out this line and line 33 just for testing? You should still get the logo on the screen but some of the text may be visible through it. If this solves the issue we can further investigate why this ioctl fails on your device.
With lines 18 and 33 commented I get the following error :
# RUST_BACKTRACE=full ./rust-logo
thread 'main' panicked at src/lib.rs:194:24:
source slice length (1920000) does not match destination slice length (3840000)
stack backtrace:
0: 0x57a10 - std::backtrace_rs::backtrace::libunwind::trace::hea3d5153e764c050
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
1: 0x57a10 - std::backtrace_rs::backtrace::trace_unsynchronized::hacb9069f200825de
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
2: 0x57a10 - std::sys_common::backtrace::_print_fmt::h90dbb00d6508c657
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:68:5
3: 0x57a10 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h2b446da419d592f3
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:44:22
4: 0x84540 - core::fmt::rt::Argument::fmt::h09d128c793366338
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/fmt/rt.rs:142:9
5: 0x84540 - core::fmt::write::h45b92a037c87eaf5
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/fmt/mod.rs:1120:17
6: 0x55840 - std::io::Write::write_fmt::h0f28d5c22592974b
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/io/mod.rs:1810:15
7: 0x57820 - std::sys_common::backtrace::_print::h4d52ef9f57f19f2b
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:47:5
8: 0x57820 - std::sys_common::backtrace::print::h5dbcff432a7cbe45
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:34:9
9: 0x59054 - std::panicking::default_hook::{{closure}}::h2fa44243e5bb3271
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:272:22
10: 0x58c84 - std::panicking::default_hook::hd36f53f04476be9c
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:292:9
11: 0x597bc - std::panicking::rust_panic_with_hook::hca328fee80f5b668
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:779:13
12: 0x594e4 - std::panicking::begin_panic_handler::{{closure}}::ha3ec3077f2d4e4ab
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:657:13
13: 0x57fa8 - std::sys_common::backtrace::__rust_end_short_backtrace::hd6287aa814225103
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:171:18
14: 0x592bc - rust_begin_unwind
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:645:5
15: 0x835e0 - core::panicking::panic_fmt::h6900c08ab98cc1b6
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panicking.rs:72:14
16: 0x85a64 - core::slice::<impl [T]>::copy_from_slice::len_mismatch_fail::h2bf6934302003a04
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/slice/mod.rs:3658:13
17: 0x2cc70 - core::slice::<impl [T]>::copy_from_slice::h2f3c2bfa517db2cb
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/slice/mod.rs:3665:13
18: 0x2c8d4 - framebuffer::Framebuffer::write_frame::h88aa9af2aa2ff3b0
at /home/arthur/local/rust-framebuffer/src/lib.rs:194:9
19: 0x2acec - rust_logo::main::h7857ffdadb652879
at /home/arthur/local/rust-framebuffer/examples/rust-logo/main.rs:29:17
20: 0x2b5f0 - core::ops::function::FnOnce::call_once::h3a71b2c428619bac
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/ops/function.rs:250:5
21: 0x2c544 - std::sys_common::backtrace::__rust_begin_short_backtrace::h4f1351e78b64b436
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:155:18
22: 0x2c5c0 - std::rt::lang_start::{{closure}}::h6b59d191b5a22dbb
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/rt.rs:166:18
23: 0x53504 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h9b6ef54c94813411
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/ops/function.rs:284:13
24: 0x53504 - std::panicking::try::do_call::h7eb03187cfb96a8b
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:552:40
25: 0x53504 - std::panicking::try::h36ecfc2661d8f806
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:516:19
26: 0x53504 - std::panic::catch_unwind::h757d99a28a56ce61
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panic.rs:142:14
27: 0x53504 - std::rt::lang_start_internal::{{closure}}::hd41d5e46f1b021a0
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/rt.rs:148:48
28: 0x53504 - std::panicking::try::do_call::h84ff794ec6e03c79
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:552:40
29: 0x53504 - std::panicking::try::h2cee7dd41c2f3308
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:516:19
30: 0x53504 - std::panic::catch_unwind::h0c3481b3c8b3d096
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panic.rs:142:14
31: 0x53504 - std::rt::lang_start_internal::h42bd59014292d677
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/rt.rs:148:20
32: 0x2c590 - std::rt::lang_start::h46cde25d5903958f
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/rt.rs:165:17
33: 0x2afb8 - main
There might be something particular with this framebuffer, maybe there are some hints in https://github.com/allepet/nolim-ebook-sdk/blob/master/main.c (if you can read C code)...
(thanks again for debugging this with me)
I added some println to get the collected info at the beginning of the function :
# ./rust-logo
800 xres
600 yres
3200 line_length
4 bytespp
thread 'main' panicked at src/lib.rs:194:24:
source slice length (1920000) does not match destination slice length (3840000)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Okay, so it errors out because the source and destination do not have an equal size. This could have something to do with the device having a different value for yres and yres_virtual. Can you see if it works if you change the yres value to yres_virtual? Alternatively you could try limiting the size of the destination slice to the length of the frame slice.
On 13 March 2024 22:12:57 GMT+01:00, Arthur Lutz @.***> wrote:
I added some println to get the collected info at the beginning of the function :
# ./rust-logo 800 xres 600 yres 3200 line_length 4 bytespp thread 'main' panicked at src/lib.rs:194:24: source slice length (1920000) does not match destination slice length (3840000) note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
-- Reply to this email directly or view it on GitHub: https://github.com/Roysten/rust-framebuffer/issues/22#issuecomment-1995837061 You are receiving this because you commented.
Message ID: @.***>
:tada: It doesn't crash anymore ! ... but... it doesn't display anything either (yet!)
The yres_virtual seems to be 1200 (so 2x600), does that make sense ?
# time ./rust-logo
800 xres
1200 yres
3200 line_length
4 bytespp
real 0m 38.50s
user 0m 38.37s
sys 0m 0.06s
For the "nothing is displayed" can we try out to print the image elsewhere in the resolution ?
As shown in the image https://static.mamot.fr/media_attachments/files/111/561/908/190/422/354/original/04aee109f157f1dc.jpg the top of the screen is broken, (but since the image is 512x512 I would have expected for part of it to show...)
Maybe I'm missing some eink specific command to refresh the screen from the framebuffer, something similar to https://github.com/allepet/nolim-ebook-sdk/blob/master/eink_lib.h#L46 ?
Yes that could be the case. Looking through the kernel code of the device the 0x402 ioctl seems to be used for updating the eink display: https://github.com/BOOKEEN/kernel-linux-3.0/blob/0aeda9a8538f2e2dcdfee92b5740a6bcc33c3662/include/linux/drv_display_sun4i.h#L802. You could try adding a new function to the framebuffer library which does this ioctl. I can help with that if required.
Also note that they are opening /dev/disp
instead of /dev/fb0
.
I'm trying some things from the shell before trying them in rust, but with no luck. Not sure what I'm supposed to do (am attempting to force the screen update after writing to the framebuffer with the rust program) :
# ioctl /dev/fb0 0x402 0x04
# ioctl /dev/fb0 402 04
# ./rust-logo
800 xres
1200 yres
3200 line_length
4 bytespp
# ioctl /dev/fb0 0x402 0x04
# ioctl -L
# ioctl /dev/fb0 -L
Segmentation fault
# ioctl /dev/fb0 DISP_CMD_EINK_UPDATE
Segmentation fault
# ioctl /dev/fb0 DISP_CMD_EINK_UPDATE EINK_LOCAL_MODE
# ioctl /dev/fb0 DISP_CMD_EINK_UPDATE EINK_GC16_MODE
# ioctl /dev/fb0 DISP_CMD_EINK_UPDATE EINK_GC16_MODE | hexdump
# ioctl /dev/fb0 DISP_CMD_EINK_UPDATE EINK_GC16_MODE | hexdump -C
# ioctl /dev/disp DISP_CMD_EINK_UPDATE EINK_GC16_MODE
# ioctl /dev/disp DISP_CMD_EINK_UPDATE EINK_GC16_MODE | hexdump -C
# ioctl /dev/disp DISP_CMD_EINK_GET_UPDATE_STATUS EINK_GC16_MODE | hexdump -C
# ioctl /dev/disp DISP_CMD_EINK_GET_UPDATE_STATUS EINK_GC16_MODE
# ioctl /dev/disp DISP_CMD_EINK_GET_UPDATE_STATUS EINK_LOCAL_MODE
# ioctl /dev/disp DISP_CMD_EINK_GET_UPDATE_STATUS EINK_LOCAL_MODEx
# ioctl /dev/disp DISP_CMD_EINK_GET_UPDATE_STATUxS EINK_LOCAL_MODE
On the rust side I don't know either what I should be doing, I searched for ioctl and found a bunch of crates : https://docs.rs/releases/search?query=ioctl which one do you recommend for my use case ?
I ran into the same ioctl issue on some arm dev board, commenting out set_kd_mode
calls fixed it. Then I got length mismatch too, fixed it by taking minimum of both sides
///Writes a frame to the Framebuffer.
pub fn write_frame(&mut self, frame: &[u8]) {
let len = frame.len().min(self.frame.len());
self.frame[..len].copy_from_slice(&frame[..len]);
}
after this 2 changes examples run just fine
Compiling on a x86 computer for an arm target :
The error is :
This is because the target linux system is an "old" linux which I can't upgrade : https://linux-sunxi.org/Bookeen_Cybook_Muse
I tried to build with musleabi to avoid the dependency on libc6 :
with config :
This works for a "Hello World" rust binary, but doesn't for rust-framebuffer :
The result is :