[MIGRATING PROBLEM]. From (MFRC522) python script to STM32F030CC code.

The official STMicroelectronics Arduino core
Post Reply
francisjjp
Posts: 1
Joined: Wed Sep 20, 2017 7:34 pm

[MIGRATING PROBLEM]. From (MFRC522) python script to STM32F030CC code.

Post by francisjjp » Wed Sep 20, 2017 7:41 pm

Hello.

First. I have tested one python script (READ.py) with one raspberry and the MFRC522 works fine. It detects UID, it does SelectTag process as ok, it does Authentication process and It reads sector. All work ok

https://github.com/mxgxw/MFRC522-python

I have started to have problem when I have migrated this code to STM32F030CC microcontroller. Migrating code was easy. Only SPI process was a little more complicated. Finally I did two versions: one version by simulating MISO, MOSI, SCK and CS with GPIO and another one using SPI1. MISO, MOSI, SCK with SPI1 and CS manually with GPIO.

With these two versions I can read any register from MFRC522, I can detect card and get UID serial number, problem is that output for SelectTAG process is MI_NOTAGERR instead MI_OK, and process for Authentication process is MI_ERR instead MI_OK. First process for detect card requires to send to FIFO_DATA_REGISTER into MFRC522 only 1 byte, for getting UID serial requires to send to FIFO_DATA_REGISTER 2 bytes. For rest of process the number of bytes are more than 2 bytes (9 or more).

Someone has worked with this, and knows the problem?

Best regards!

Francis.

Post Reply