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

Fix transmute #30

Merged
merged 3 commits into from
Dec 27, 2024
Merged

Fix transmute #30

merged 3 commits into from
Dec 27, 2024

Conversation

diondokter
Copy link
Owner

Fixes #29

@rabarar could you try this out to see if it compiles for you now?

@rabarar
Copy link

rabarar commented Dec 26, 2024

switch to fix-transmute branch, cleaned and rebuilt:

error[E0432]: unresolved import `nrf_modem::no_std_net`
 --> src/main.rs:10:17
  |
10 | use nrf_modem::{no_std_net::SocketAddr, ConnectionPreference, LteLink, SystemMode, TcpStream};
  |                 ^^^^^^^^^^ could not find `no_std_net` in `nrf_modem`

error[E0425]: cannot find function `application_irq_handler` in crate `nrf_modem`
 --> src/main.rs:33:20
  |
33 |         nrf_modem::application_irq_handler();
  |                    ^^^^^^^^^^^^^^^^^^^^^^^ not found in `nrf_modem`

warning: unused import: `core::str::FromStr`
--> src/main.rs:5:5
 |
5 | use core::str::FromStr;
 |     ^^^^^^^^^^^^^^^^^^
 |
 = note: `#[warn(unused_imports)]` on by default

error: item does not constrain `Fut::{opaque#0}`, but has it in its signature
 --> src/main.rs:16:1
  |
16 | #[embassy_executor::main]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: consider moving the opaque type's declaration and defining uses into a separate module
note: this opaque type is in the signature
 --> src/main.rs:16:1
  |
16 | #[embassy_executor::main]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^
  = note: this error originates in the attribute macro `::embassy_executor::task` (in Nightly builds, run with -Z macro-backtrace for more info)

Some errors have detailed explanations: E0425, E0432.
For more information about an error, try `rustc --explain E0425`.
warning: `nrf9160-rust-starter` (bin "nrf9160-rust-starter") generated 1 warning
error: could not compile `nrf9160-rust-starter` (bin "nrf9160-rust-starter") due to 3 previous errors; 1 warning emitted

@rabarar
Copy link

rabarar commented Dec 26, 2024 via email

@rabarar
Copy link

rabarar commented Dec 26, 2024

Linux build:

cargo +nightly -vV:

cargo 1.85.0-nightly (c86f4b3a1 2024-12-24)
release: 1.85.0-nightly
commit-hash: c86f4b3a1b153218e6e50861214b0b4b4e695f23
commit-date: 2024-12-24
host: aarch64-unknown-linux-gnu
libgit2: 1.8.1 (sys:0.19.0 vendored)
libcurl: 8.9.0-DEV (sys:0.4.74+curl-8.9.0 vendored ssl:OpenSSL/1.1.1w)
ssl: OpenSSL 1.1.1w  11 Sep 2023
os: Ubuntu 24.10.0 (oracular) [64-bit]

lsb_release -a:

No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 24.10
Release:	24.10
Codename:	oracular
   Compiling nrf9160-rust-starter v0.1.0 (/home/robert/src/rust/nrf91-2.0.1-test)
error[E0432]: unresolved import `nrf_modem::no_std_net`
  --> src/main.rs:10:17
   |
10 | use nrf_modem::{no_std_net::SocketAddr, ConnectionPreference, LteLink, SystemMode, TcpStream};
   |                 ^^^^^^^^^^ could not find `no_std_net` in `nrf_modem`

error[E0425]: cannot find function `application_irq_handler` in crate `nrf_modem`
  --> src/main.rs:33:20
   |
33 |         nrf_modem::application_irq_handler();
   |                    ^^^^^^^^^^^^^^^^^^^^^^^ not found in `nrf_modem`

warning: unused import: `core::str::FromStr`
 --> src/main.rs:5:5
  |
5 | use core::str::FromStr;
  |     ^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

error: item does not constrain `Fut::{opaque#0}`, but has it in its signature
  --> src/main.rs:16:1
   |
16 | #[embassy_executor::main]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: consider moving the opaque type's declaration and defining uses into a separate module
note: this opaque type is in the signature
  --> src/main.rs:16:1
   |
16 | #[embassy_executor::main]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^
   = note: this error originates in the attribute macro `::embassy_executor::task` (in Nightly builds, run with -Z macro-backtrace for more info)

Some errors have detailed explanations: E0425, E0432.
For more information about an error, try `rustc --explain E0425`.
warning: `nrf9160-rust-starter` (bin "nrf9160-rust-starter") generated 1 warning
error: could not compile `nrf9160-rust-starter` (bin "nrf9160-rust-starter") due to 3 previous errors; 1 warning emitted

@diondokter
Copy link
Owner Author

Ok, did another fix in this branch. Please update.

It seems you were running on an older version of nrf-modem.
If you go through the readme, you'll see the setup you need to do.

The no_std_net crate is no longer used in favor of the recently stabilized core::net module.
And the application irq doesn't exist anymore, so no need to set that up and call it.

@rabarar
Copy link

rabarar commented Dec 26, 2024 via email

@diondokter
Copy link
Owner Author

No, I mean your application. You were calling some old APIs that don't exist anymore in the currently released version. That's the source of your errors.

@rabarar
Copy link

rabarar commented Dec 26, 2024 via email

@diondokter
Copy link
Owner Author

Yeah, we talked about that. It was the most up-to-date example I had. But it's not very up-to-date. Your errors are easily fixed if you go through the readme and make sure your code matches what it does

@rabarar
Copy link

rabarar commented Dec 27, 2024 via email

@rabarar
Copy link

rabarar commented Dec 27, 2024 via email

@diondokter
Copy link
Owner Author

The nrf-modem crate itself can be compiled with stable just fine

@rabarar
Copy link

rabarar commented Dec 27, 2024 via email

@diondokter
Copy link
Owner Author

Ok, I updated the nrf91-2.0.1-test repo to the newest nrf-modem version on master

@rabarar
Copy link

rabarar commented Dec 27, 2024 via email

@diondokter
Copy link
Owner Author

In the mean time, I was modifying your code to run in secure mode, and get everything compiled and flashed but get an assertion error on the nrf9120_pac for RAM > 32k the repo is https://github.com/rabarar/nrf91-2.0.1-test I believe I’ve followed the process your required - but perhaps I’ve misread or misunderstood something.

Not sure about that. There might a difference between the 60/61/51.

Also, I WANT TO THANK YOU for your kind feedback and assistance. Was a bit surprised by the response from the “gentleman” on matrix - not everyone’s willing to be helpful…

No problem, but I do want to stick up for Dario. He's done an incredible amount of work for the community and is generally very helpful. Beyond reasonable even. Not just for embassy, but for the greater embedded Rust ecosystem too.

I'm gonna be blunt and say your question was kinda bad. When you're asking for someone else's time, you should spend time on your question yourself too.

Examples of things you could've done:

  • Give a link to the code in question so people looking at it don't have to look it up: https://github.com/embassy-rs/embassy/blob/main/embassy-net-nrf91/src/context.rs#L87
  • When posting a code snippet, post is as code with the triple backticks: ```rust code ```
  • Show you've looked into it yourself: You just stated in hangs without any other info. You could've asked something like 'wait_init never finishes. It doesn't seem like it, but do I need to do some initialization myself first that I've missed?'.
    It shows you're critically thinking about the problem and is a much more specific question. There are so many people who don't do anything themselves and want to depend on others to give all the answers. With your question you looked to be such a person. Those people are not fun to help. You should make other people want to answer your questions.

If you take these tips to heart, I'm sure you'll be more successful in getting your questions answered.

@diondokter diondokter merged commit c1193a5 into master Dec 27, 2024
1 check passed
@diondokter diondokter deleted the fix-transmute branch December 27, 2024 16:15
@diondokter
Copy link
Owner Author

Released 0.6.1 with these changes

@rabarar
Copy link

rabarar commented Dec 27, 2024

points taken - nonetheless, I respectfully disagree. I've certainly not asked anyone to "do my work" as evidenced by the repo I've forked/modified/etc...

having been in the community for over 40 years - I've come to understand some people are more thoughtful/helpful than others. No one owes anyone anything - but assistance especially at the inception of a new ecosystems goes a long way to creating a community of inclusion... just sayin'

and btw - it wasn't my code - it was the code in the example that was in the repo! lol

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

Successfully merging this pull request may close these issues.

build failure
2 participants