vouch-opensource / zephyr-nfc08a1

Zephyr app to drive the X-NUCLEO-NFC08A1
Apache License 2.0
2 stars 0 forks source link

ST25R3916 initialization error #8

Closed RANAROYG closed 11 months ago

RANAROYG commented 11 months ago

My Setup I have my custom dev board wherein nRF52840 is communicating with the ST25R3916 chip through SPI interface. And using the ncs version 2.1.0.

My Application I want to implement the NFC Tag reader using zephyr for my board. I have built and flashed the code with appropriate board configurations in the nRF52840 overlay file and also in the prj.conf file for viewing the logs. I have also disabled the functions: platformSpiDeselect(), platformSpiSelect() and also enabled the macro ST25R_COM_SINGLETXRX as per the RFAL-user manual.

Issues The code throws the initialisation failure error. Attached are the screenshots for the portion of the code generating the error and the actual error. Queries How to implement the tag reader into my dev board? And also want to know if the previous issue got resolved, which you generated for code crash. I will be grateful if I can get some references.

JLinkErr pErrHandle

mfikes commented 11 months ago

@RANAROYG Have you tried the project at https://github.com/vouch-opensource/zephyr-nfc08a1 as a sample app-level driver to see if things work?

RANAROYG commented 11 months ago

I do not have the X-NUCLEO-NFC08A1 board. So, I tried with custom board. Below are the configurations in the overlay file. / SPI configuration /

&spi0 { compatible = "nordic,nrf-spi"; status = "okay"; cs-gpios = <&gpio0 4 GPIO_ACTIVE_LOW>;

pinctrl-0 = <&spi0_default>;
pinctrl-1 = <&spi0_sleep>;
pinctrl-names = "default", "sleep";
nfc0: st25r@0 {
    compatible = "st,st25r";
    reg = <0x0>;
    spi-max-frequency = <4000000>;
    irq-gpios = <&gpio0 5 GPIO_ACTIVE_HIGH>;
};

};

&spi1 { status = "disabled"; };

&spi2 { status = "disabled"; };

&spi3 { status = "disabled"; };

&pinctrl { spi0_default: spi0_default { group1 { psels = <NRF_PSEL(SPIM_SCK, 0, 6)>, <NRF_PSEL(SPIM_MOSI, 0, 7)>, <NRF_PSEL(SPIM_MISO, 0, 8)>; }; };

spi0_sleep: spi0_sleep {
    group1 {
        psels = <NRF_PSEL(SPIM_SCK, 0, 6)>,
            <NRF_PSEL(SPIM_MOSI, 0, 7)>,
            <NRF_PSEL(SPIM_MISO, 0, 8)>;
        low-power-enable;
    };
};

};

mfikes commented 11 months ago

@RANAROYG You mention

I have also disabled the functions: platformSpiDeselect(), platformSpiSelect() and also enabled the macro ST25R_COM_SINGLETXRX as per the RFAL-user manual.

Is it possible for you to try the code without making changes to see if it works that way?

RANAROYG commented 11 months ago

Yes @mfikes, I have tried the code several times as it is. But it didn't work out for me.

mfikes commented 11 months ago

@RANAROYG Do you have the option of obtaining a Nucleo board to be able to debug if there are hardware differences between the working system an your custom hardware?

RANAROYG commented 11 months ago

Unfortunately I do not have the Nucleo board. That was why I configured the overlay file as I mentioned earlier for my custom board.

mfikes commented 11 months ago

@RANAROYG Do you have access to an oscilloscope? It might be worth taking a look at the SPI lines.

RANAROYG commented 11 months ago

I checked the connections and confirmed it. There were uart pins in the nrf52840dk_nrf52840.dts file that needed to be disabled in the overlay file. After proper configuration, it worked well. I am very grateful to you for your support.

mfikes commented 11 months ago

Thanks @RANAROYG