Closed Valraox closed 2 years ago
Yaa Valraox thank you for sharing issues. I will check that and I will get back to you asap. Please make sure PIN_NUM_CS(GPIO -22) should be connected with SDA line of MFRC522. Can you share the debug messages and connection which you had made as screenshots?
Well, we have checked connections with GPIO extension on board and now it's getting version number, but the program enter on loop and is not reading the RFID cards. This is the console output (From there is on "Allocate RX buffer for DMA":
Later is putting
I'm testing to determinate where it's the problem. In the call to function PICC_RequestA on function PICC_IsNewCardPresent is where buffer infinite loops but I don't know why.
Today I will check this one but I am using esp idf v3.0 to test and it able to detect card and uid of the card also.i have to check with your idf version also.
On Tue, Sep 17, 2019, 6:18 PM Valraox notifications@github.com wrote:
I'm testing where it's the problem. In the call to function PICC_RequestA on function PICC_IsNewCardPresent is where buffer infinite loops but I don't know why.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/anuragmandal/ESPIDF-INTERFACE-MFRC522/issues/1?email_source=notifications&email_token=AM7XUYHDR22E3TZCCZLF7MLQKDGYRA5CNFSM4IWDLB52YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD64M43Q#issuecomment-532205166, or mute the thread https://github.com/notifications/unsubscribe-auth/AM7XUYBEFP7KRLLWCOKMBWLQKDGYRANCNFSM4IWDLB5Q .
The version of esp-idf repository I'm using to compile is v4.0-dev-621-g81ca1c013. I tried to compile changing the sources of spi_master.c and spi_master.h from other repository installed by esp-idf for Windows which is on version v3.2.2 with same result.
I have to download esp idf v3.1.3 then I will check with this one and let you know asap. Currently with esp idf 3.0 it's working fine I checked now.
On Tue, Sep 17, 2019, 7:01 PM Valraox notifications@github.com wrote:
The version of esp-idf repository I'm using to compile is v4.0-dev-621-g81ca1c013. I tried to compile changing the sources of spi_master.c and spi_master.h from other repository installed by esp-idf for Windows which is on version v3.2.2 with same result.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/anuragmandal/ESPIDF-INTERFACE-MFRC522/issues/1?email_source=notifications&email_token=AM7XUYB2KPFZENZS7XQZ6L3QKDL2PA5CNFSM4IWDLB52YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD64Q7EI#issuecomment-532221841, or mute the thread https://github.com/notifications/unsubscribe-auth/AM7XUYAT6JDE6DWO5MPQQ4DQKDL2PANCNFSM4IWDLB5Q .
Well, now with esp-idf v3.0 is not in infinite loop about buffer for DMA, but isn't reading card, this is the output: Note: I added printf with "LOOP INTIALIZATION"
Try with disabling the watchdog in sdkconfig file. It will better if you show your connection pins with module. Below is the debug message that what i am getting.
I disabled "Interrupt watchdog" and "Initialize Task Watchdog Timer on startup" on menuconfig but it isn't reading the card (I'm using the card provided with the module RC522). I'm receiving un the result from PICC_IsNewCardPresent function 3 value, I see in the code is STATUS_TIMEOUT. I put a printf to show the result: Note: I'm using default GPIO in the code, the conections from module is: -SDA -> GPIO 22 (Extension pin 22) -SCK -> GPIO 19 (Extension pin 20) -MOSI -> GPIO 23 (Extension pin 23) -MISO -> GPIO 25 (Extension pin 24) -IRQ -> Not connected -GND -> Extension pin 35 -RST -> GPIO 14 (Extension pin 15) -3.3V -> Extension pin 37 I attached extension pin schema:
In function PCD_CommunicateWithPICC() Add debug statement as below :- for (i = 20000; i > 0; i--) { n = PCD_ReadRegister(spi,ComIrqReg); if (n & waitIRq) { /Add debug message here / printf ("GOT INTERRUPT SIGNAL\n"); break; } if (n & 0x01) { return STATUS_TIMEOUT; } } So after adding load the code and check by placing card near to reader and check in debug will it able to print the message "Got interrupt signal" or not. If not means it not able to read irq register.
As I have tested the code with below link module its working https://docs.zerynth.com/latest/official/board.zerynth.doit_esp32/docs/index.html Which module or kit are you using ? So in your module the default pins which I am using might it connected with somewhere else also which can cause problem in transmitting and receiving data. So you can test by assigning other pins.
Finally it works!! It was the pins on the board, in the datasheet I have didn't say anything of GPIOS usage, I found other document where was the correct ones for SPI. I'm using a ESP32-EVB_rev_d https://riot-os.org/api/group__boards__esp32__olimex-esp32-evb.html#pinout When I was testing other GPIOS I should have used a wrong reset pin. Actually I'm using:
Thanks a lot for all the help!!
Ok great . Always welcome. Have a great day. Any help you can ping me.
Good afternoon guys, will this lib have portability to version v4.0 of the SDK-IDF? Using version v4 I have the same problem as the friend in the dynamic allocation of DMA, however, I did not want to have to regress the version on my computer because of other projects ...
Good afternoon, I finally used v4.0 from SDK-IDF in the project because other functionalities not working on v3.0 but I copy the libraries of SPI from v3 and pasted in the v4.0. If you don't need new v4.0 SPI library or work with v3 you can do that. The C files are on 'components/driver' folder: -spi_common.c -spi_master.c -spi_slave.c And the headers on 'components/driver/include/driver' -spi_common.h -spi_master.h -spi_slave.h
Thank u @Valraox , i go to test your implementations and i will bring feedback!
Resolved
I'm trying to read from RFID and PCD_Version function is returning 0 value so the device is rebooting all time. I have checked the pin connections several times as defined in MFRC522.h and didn't work.