cancel
Showing results for 
Search instead for 
Did you mean: 

Help finalizing custom Rust driver (st25r3911b)

RMuiz.1
Associate III

Hi!

A while back I started writing Rust driver for st25r3911b chip. Currently, it works and can read 14443A chip. The issue is that compared to official software (Discovery GUI) the read distance is about half. So if official software reads at 8-9cm then with rust driver it would just 5-6 cm.

I feel like I have messed up some register configurations. My knowledge of RF is very limited. Could someone point me in the right direction of what I should look into?
https://github.com/xpresshd/st25r3911b/blob/master/src/lib.rs#L168

Thanks!

 

11 REPLIES 11

Found out the issue of 1. point about CS being low. Had race condition in CS logic. Fixed it and everything works well

For 2. point about reading all interrupts in one go I run into issue. Now chip crashes very often, tho it seems to be doing correct thing.
What confuses me is why Intr jumps back high when I start reading interrupt registers

Full capture https://drive.google.com/file/d/1SAemCfJw4mEV1qpmJcbMVyvOv9UK2beI/view?usp=sharing


Hi,

 


@RMuiz.1 wrote:

What confuses me is why Intr jumps back high when I start reading interrupt registers



See  § "Interrupt interface" in the ST25R3911B datasheet: [...]IRQ pin transitions to low after the interrupt bit(s) that caused its transition to high has (have) been read.

It is likely that a second interrupt is signalled while reading the second interrutp register (likely I_rxe interrupt).

Make sure to configure the Salae SPI decoder with CPOL=0 and CPHA=1 to properly decode the SPI frames. The SPI CS handling seems to be erroneous (except if another devices are connected to the SPI bus):

BrianTIDAL_0-1688741138271.png

The SPI clock seems to be quite low (300 kHz). Our demos use a SPI clock = 3Mbps.

Rgds

BT

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.