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

Cast errors with 0.4.0 #16

Closed
garrensmith opened this issue May 14, 2020 · 3 comments
Closed

Cast errors with 0.4.0 #16

garrensmith opened this issue May 14, 2020 · 3 comments

Comments

@garrensmith
Copy link

Hi, I'm very new to doing embedded dev with Rust.
I'm trying to use https://github.com/42-technology-ltd/nrf9160-demo
but I keep getting cast errors like this:

let result = unsafe { sys::nrf_write(self.fd, ptr as *const _, length) };
    |                                                                        ^^^^^^ expected `u32`, found `usize`

Is there a way to fix this or can I help fix it?

@jonathanpallant
Copy link
Member

Which version of nrfxlib are you using with the demo crate? It should probably be updated to use the latest one.

@garrensmith
Copy link
Author

I've tried the master branch for the nrf9160-demo and that doesn't build. I played around with updating dependencies which caused the above issue. I think switched to the use_latest_nrfxlib branch. That failed to get nrfxlib. I changed updated the nrfxlib to:

nrfxlib = {git = "https://github.com/42-technology-ltd/nrfxlib"}

That builds up to a point and then I get:

warning: Linking globals named 'DEVICE_PERIPHERALS': symbol multiply defined!

error: failed to load bc of "nrf9160_pac-149a0337cd75d160.nrf9160_pac.780wv3by-cgu.0.rcgu.o": 

error: aborting due to previous error; 1 warning emitted

error: could not compile `nrf9160-demo`.

Any ideas on how to fix that?

@jonathanpallant
Copy link
Member

jonathanpallant commented May 19, 2020

Please see 42-technology-ltd/nrf9160-demo#1 for a working example using nrfxlib v0.5.0 (which uses nrfxlib-sys v1.2.0)

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

No branches or pull requests

2 participants