Closed kelada closed 1 year ago
Hi. Thanks for taking the time to submit this issue. There is currently a bug SPI implementation in 0.2.2 which is fixed by #7.
I haven't gotten around publishing a new version, sorry about that.
Could you check if using this fixes your problem?
pn532 = { git = "https://github.com/WMT-GmbH/pn532", features = ["msb-spi"] }
You'll probably also want to include this line before inlisting the target (I should update the readme)
pn532.process(
&Request::sam_configuration(SAMMode::Normal, false),
0,
50.ms(),
)?;
Thanks for the quick response.
Unfortunately it throws an TimeoutAck
error at this new line.
Unfortunately it throws an
TimeoutAck
error at this new line.
That is with the updated git dependency?
Unfortunately it throws an
TimeoutAck
error at this new line.That is with the updated git dependency?
Yeah, I still get the same error.
[dependencies]
pn532 = { git = "https://github.com/WMT-GmbH/pn532", branch = "master", features = ["msb-spi"] }
rppal = { version = "0.14.1", features = ["hal"] }
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: TimeoutAck', src/main.rs:25:10
Note: I'm using unwrap()
rather than ?
to get it to panic if there is an error.
Hm strange. At this point I can't see why the code woudn't work.
Could you compare the signals with the adafruit implementation using a scope or logic analyzer?
I'll try and reproduce the issue on my end but I won't have access to the hardware until in two weeks.
Could you compare the signals with the adafruit implementation using a scope or logic analyzer?
I don't have either on hand today, i'll see if I can get ahold of something this week.
In the meantime, do you think it's worth me testing I2C to see that that works?
Sure thing! Be sure to cross check with the adafruit library to rule out hardware issues :)
In regard to SPI, changing the CS pin from 8 to 5 on the RPi seems to have resolved the consistant TimeoutAck
error when calling sam_configuration(...)
. I'm satisfied that this is not an issue with the library. Thanks for you help.
Thanks for checking back in. Glad you found a solution :)
Hi there. I'm interested in using this library to replace an existing application I've written using https://github.com/adafruit/Adafruit_CircuitPython_PN532 python library. I am new to embedded rust so it's very likely I'm doing something wrong.
Running the example below I always get
TimeoutAck
errors, but I'm not sure why. Looking at the Adafruit library I've understood that I need to enable themsb-spi
flag in addition to matching the clock frequency (source)However, I don't seem to have had much luck with this. Any guidance would be greatly appreciated.
Hardware:
Software
Cargo.toml
main.rs