Closed RANAROYG closed 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?
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;
};
};
};
@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?
Yes @mfikes, I have tried the code several times as it is. But it didn't work out for me.
@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?
Unfortunately I do not have the Nucleo board. That was why I configured the overlay file as I mentioned earlier for my custom board.
@RANAROYG Do you have access to an oscilloscope? It might be worth taking a look at the SPI lines.
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.
Thanks @RANAROYG
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.