jamesmunns / nrf52dk-sys

A Rust Crate to develop on the Nordic nRF52-DK
MIT License
85 stars 19 forks source link

Missing app_error.h #1

Closed purew closed 7 years ago

purew commented 7 years ago

Building master results in a missing-file error:

? RUST_BACKTRACE=1 rustup run nightly cargo build                                                                                                                                   101 ↵
   Compiling smooth_blue v0.1.0 (file:///home/anders/dev/nrf52dk-sys)
error: failed to run custom build command for `smooth_blue v0.1.0 (file:///home/anders/dev/nrf52dk-sys)`
process didn't exit successfully: `/home/anders/dev/nrf52dk-sys/target/debug/build/smooth_blue-43218b6dfb45cdde/build-script-build` (exit code: 101)
--- stdout
cargo:rerun-if-changed=build.rs
cargo:rustc-link-search=/home/anders/dev/nrf52dk-sys/target/debug/build/smooth_blue-bc1ccef5e85e5a95/out
cargo:rerun-if-changed=memory.x
warning: x86_64-unknown-linux-gnu: 'linker' input unused [-Wunused-command-line-argument], err: false
bindings.h:14:10: fatal error: 'app_error.h' file not found, err: true

--- stderr
warning: x86_64-unknown-linux-gnu: 'linker' input unused [-Wunused-command-line-argument]
bindings.h:14:10: fatal error: 'app_error.h' file not found
thread 'main' panicked at 'Unable to generate bindings: ()', /checkout/src/libcore/result.rs:859
stack backtrace:
   0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
             at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::_print
             at /checkout/src/libstd/sys_common/backtrace.rs:71
   2: std::panicking::default_hook::{{closure}}
             at /checkout/src/libstd/sys_common/backtrace.rs:60
             at /checkout/src/libstd/panicking.rs:355
   3: std::panicking::default_hook
             at /checkout/src/libstd/panicking.rs:371
   4: std::panicking::rust_panic_with_hook
             at /checkout/src/libstd/panicking.rs:549
   5: std::panicking::begin_panic
             at /checkout/src/libstd/panicking.rs:511
   6: std::panicking::begin_panic_fmt
             at /checkout/src/libstd/panicking.rs:495
   7: rust_begin_unwind
             at /checkout/src/libstd/panicking.rs:471
   8: core::panicking::panic_fmt
             at /checkout/src/libcore/panicking.rs:69
   9: core::result::unwrap_failed
             at /checkout/src/libcore/macros.rs:29
  10: <core::result::Result<T, E>>::expect
             at /checkout/src/libcore/result.rs:761
  11: build_script_build::generate_ble
             at ./build.rs:71
  12: build_script_build::main
             at ./build.rs:28
  13: __rust_maybe_catch_panic
             at /checkout/src/libpanic_unwind/lib.rs:98
  14: std::rt::lang_start
             at /checkout/src/libstd/panicking.rs:433
             at /checkout/src/libstd/panic.rs:361
             at /checkout/src/libstd/rt.rs:59
  15: main
  16: __libc_start_main
  17: _start

On make-softdevice-work branch I see a slightly different build error:

? RUST_BACKTRACE=1 rustup run nightly cargo build
    Updating registry `https://github.com/rust-lang/crates.io-index`
 Downloading gcc v0.3.50
   Compiling gcc v0.3.50
   Compiling volatile-register v0.1.2
   Compiling r0 v0.2.1
   Compiling cortex-m v0.1.6
   Compiling smooth_blue v0.1.0 (file:///home/anders/dev/nrf52dk-sys)
error: failed to run custom build command for `smooth_blue v0.1.0 (file:///home/anders/dev/nrf52dk-sys)`
process didn't exit successfully: `/home/anders/dev/nrf52dk-sys/target/debug/build/smooth_blue-060906ae8a081a7a/build-script-build` (exit code: 101)
--- stdout
cargo:rerun-if-changed=build.rs
cargo:rerun-if-changed=bindings.h
cargo:rerun-if-changed=nRF5-sdk
cargo:rerun-if-changed=shims
cargo:rerun-if-changed=memory.x
cargo:rustc-link-search=/home/anders/dev/nrf52dk-sys/target/debug/build/smooth_blue-bc1ccef5e85e5a95/out

--- stderr
thread 'main' panicked at 'failed to build Blue libs: Error { repr: Os { code: 2, message: "No such file or directory" } }', /checkout/src/libcore/result.rs:859
stack backtrace:
   0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
             at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::_print
             at /checkout/src/libstd/sys_common/backtrace.rs:71
   2: std::panicking::default_hook::{{closure}}
             at /checkout/src/libstd/sys_common/backtrace.rs:60
             at /checkout/src/libstd/panicking.rs:355
   3: std::panicking::default_hook
             at /checkout/src/libstd/panicking.rs:371
   4: std::panicking::rust_panic_with_hook
             at /checkout/src/libstd/panicking.rs:549
   5: std::panicking::begin_panic
             at /checkout/src/libstd/panicking.rs:511
   6: std::panicking::begin_panic_fmt
             at /checkout/src/libstd/panicking.rs:495
   7: rust_begin_unwind
             at /checkout/src/libstd/panicking.rs:471
   8: core::panicking::panic_fmt
             at /checkout/src/libcore/panicking.rs:69
   9: core::result::unwrap_failed
             at /checkout/src/libcore/macros.rs:29
  10: <core::result::Result<T, E>>::expect
             at /checkout/src/libcore/result.rs:761
  11: build_script_build::generate_ble
             at ./build.rs:120
  12: build_script_build::main
             at ./build.rs:26
  13: __rust_maybe_catch_panic
             at /checkout/src/libpanic_unwind/lib.rs:98
  14: std::rt::lang_start
             at /checkout/src/libstd/panicking.rs:433
             at /checkout/src/libstd/panic.rs:361
             at /checkout/src/libstd/rt.rs:59
  15: main
  16: __libc_start_main
  17: _start

Versions:

? rustup run nightly cargo -V    
cargo 0.20.0-nightly (82733b014 2017-05-28)
? rustup run nightly rustc -V
rustc 1.19.0-nightly (e0cc22b4b 2017-05-31)
jamesmunns commented 7 years ago

Hey @PureW,

It looks like the first problem here is that my submodule link is broken (I had to force push to remove some licensed files). I will update that soon.

Additionally I have (unwritten) dependencies on Xargo and Bindgen. I'll be adding a skeleton readme soon, and more detailed information this weekend hopefully.

I'll keep this issue open until the submodule and documentation issues have been corrected. Thanks for reaching out!

purew commented 7 years ago

:+1:

jamesmunns commented 7 years ago

Submodule is fixed, and master should now begin advertising when run. Cleanup and documentation is next :D

jamesmunns commented 7 years ago

Hey @PureW, could you please review the documentation added in this branch, and make any comments on https://github.com/jamesmunns/nrf52dk-sys/pull/2 ?

This should be enough info to get you building and flashing (at least on a debian/ubuntu based PC), and after flashing you should see a bluetooth device (visible by a phone, laptop, etc) called RUST-BLE.

If you get stuck anywhere, please let me know.