Spark Logic

[solved] MFRC522 library and STM32

STM32F103C8T6 LQFP48 Pinout

Hi,

I’m trying to use the MFRC522MFRC522Communications, navigation, interfaces and RFID…is used to unlock a door with a rfid card. It uses a Maple Mini with an ENC28J60 and MFRC522 on the SPI bus. I would like to add a ILI9431 tft display to show some door entry mess…View in hardware catalog library to read RFID Mifare cards. This library (https://github.com/miguelbalboa/rfid) was written for Arduino and although it was not specifically written for STM32STM32Microcontrollers and processors…Map magic glue code, ethernet compiles, just WARNING: library LwIP claims to run on [ stm32 ] architecture(s) and may be incompatible with your current board which runs on [STM32]…View in hardware catalog it seems to compile without errors for my STM32F103C8T6STM32F103C8T6Microcontrollers and processors…e Sep 27, 2016 10:28 pm I know this is an old topic, but… I’m using blue pill board ( STM32F103C8T6 , version 3). With the current (modified) Adafruit library 0.96″ OLED display w…View in hardware catalog ARM STM32STM32Microcontrollers and processors…Map magic glue code, ethernet compiles, just WARNING: library LwIP claims to run on [ stm32 ] architecture(s) and may be incompatible with your current board which runs on [STM32]…View in hardware catalog Minimum System Dev Board. Unfortunately I did not managed to make it work. There seems to be some SPI communication failure.

I was able to use this rfid reader (http://www.electrodragon.com/product/mifare-RC522RC522Communications, navigation, interfaces and RFID…ge . Removed all my connections and it doesn’t crash. Will double check again all my RC522 connections LE: my mistake, I had the “mfrc522.PCD_DumpVersionToSerial(); ” commented ou…View in hardware catalog -rfid-card-readerdetector-ic-card/) previously with a Pro Mini, so I’m confident it is not broken and I do understand how to make the wiring for both Pro Mini and STM32F103C8T6STM32F103C8T6Microcontrollers and processors…e Sep 27, 2016 10:28 pm I know this is an old topic, but… I’m using blue pill board ( STM32F103C8T6 , version 3). With the current (modified) Adafruit library 0.96″ OLED display w…View in hardware catalog boards, so the problem is definitely on the software side.

Does anyone have any positive experience making this particular RFID reader work with the MFRC522MFRC522Communications, navigation, interfaces and RFID…is used to unlock a door with a rfid card. It uses a Maple Mini with an ENC28J60 and MFRC522 on the SPI bus. I would like to add a ILI9431 tft display to show some door entry mess…View in hardware catalog lib on the STM32STM32Microcontrollers and processors…Map magic glue code, ethernet compiles, just WARNING: library LwIP claims to run on [ stm32 ] architecture(s) and may be incompatible with your current board which runs on [STM32]…View in hardware catalog ?

Thanks!
Adrian

Replies12

Thu Jun 11, 2015 5:40 pm

Not sure if you have seen the other thread about the SPI SS pin, but if you are trying to use the hardware SPI NSS pin to manage CS, that may not work.
If that is the case, try to use some other GPIO pin for CS.

Thu Jun 11, 2015 6:37 pm

Hi Victor!

Excellent advice. It works after changing the SS pin. The lib also seems to need some tweaking to move some pinMode calls out of the MFRC522MFRC522Communications, navigation, interfaces and RFID…is used to unlock a door with a rfid card. It uses a Maple Mini with an ENC28J60 and MFRC522 on the SPI bus. I would like to add a ILI9431 tft display to show some door entry mess…View in hardware catalog constructor into an init function that is called in setup().
I still have some minor issues but it generally works and I think I’ll start to port this one.

Thanks!

Thu Jun 11, 2015 6:57 pm

anistor wrote:Hi Victor!

Excellent advice. It works after changing the SS pin. The lib also seems to need some tweaking to move some pinMode calls out of the MFRC522MFRC522Communications, navigation, interfaces and RFID…is used to unlock a door with a rfid card. It uses a Maple Mini with an ENC28J60 and MFRC522 on the SPI bus. I would like to add a ILI9431 tft display to show some door entry mess…View in hardware catalog constructor into an init function that is called in setup().
I still have some minor issues but it generally works and I think I’ll start to port this one.

Thanks!

Tue Jun 16, 2015 2:10 pm

Glad to let you know the MFRC522MFRC522Communications, navigation, interfaces and RFID…is used to unlock a door with a rfid card. It uses a Maple Mini with an ENC28J60 and MFRC522 on the SPI bus. I would like to add a ILI9431 tft display to show some door entry mess…View in hardware catalog library (https://github.com/miguelbalboa/rfid) was patched and the patch was integrated in master so now it works on STM32F103STM32F103Microcontrollers and processors…19.html . ag123 Sat Apr 28, 2018 5:54 pm come to think of it blue pill / maple mini ( stm32f103 ) is an *ideal* keyboard controller, the scanning can be done with assistance of sh…View in hardware catalog boards out of the box.

Adrian

Tue Jul 07, 2015 1:23 am

Excellent

Thanks for letting us know

Thu Nov 10, 2016 9:49 am

trying to use MFRC522MFRC522Communications, navigation, interfaces and RFID…is used to unlock a door with a rfid card. It uses a Maple Mini with an ENC28J60 and MFRC522 on the SPI bus. I would like to add a ILI9431 tft display to show some door entry mess…View in hardware catalog with my STM32F103STM32F103Microcontrollers and processors…19.html . ag123 Sat Apr 28, 2018 5:54 pm come to think of it blue pill / maple mini ( stm32f103 ) is an *ideal* keyboard controller, the scanning can be done with assistance of sh…View in hardware catalog (Blue PillBlue PillDevelopment and computing boards…as become my new favorite board. I am calling it “blue pad” and it is kind of super “ blue pill ”. Pito Thu Jul 27, 2017 8:53 pm [victor_pv – Thu Jul 27, 2017 3:58 pm] – Just for…View in hardware catalog ).
It compiles fine but the code seems to crash at SPI.beginTransaction(SPISettings(SPI_CLOCK_DIV4, MSBFIRST, SPI_MODE0)); // Set the settings to work with SPI bus

Thu Nov 10, 2016 9:52 am

Must be crashing somewhere else

I just added that line to my blink code and it still runs OK

#include "SPI.h"
int counter=0;
void setup() {
// put your setup code here, to run once:
pinMode(PB12,OUTPUT);
Serial.begin(250000);
SPI.beginTransaction(SPISettings(SPI_CLOCK_DIV4, MSBFIRST, SPI_MODE0));
}
bool v=false;
void loop() {
Serial.println(counter++);
// put your main code here, to run repeatedly:
digitalWrite(PB12,v);
delay(50);
v=!v;
}

Thu Nov 10, 2016 10:27 am

Strange . Removed all my connections and it doesn’t crash. Will double check again all my RC522RC522Communications, navigation, interfaces and RFID…ge . Removed all my connections and it doesn’t crash. Will double check again all my RC522 connections LE: my mistake, I had the “mfrc522.PCD_DumpVersionToSerial(); ” commented ou…View in hardware catalog connections

LE: my mistake, I had the “MFRC522MFRC522Communications, navigation, interfaces and RFID…is used to unlock a door with a rfid card. It uses a Maple Mini with an ENC28J60 and MFRC522 on the SPI bus. I would like to add a ILI9431 tft display to show some door entry mess…View in hardware catalog .PCD_DumpVersionToSerial(); ” commented out…

Thu Nov 10, 2016 10:40 am

Sounds like the code is miss intrepreting the data and perhaps having a buffer overflow

remember the data types are different in ARM than AVRAVRMicrocontrollers and processors…Arduino\libraries\U8glib\U8glib.cpp, C:\Program Files (x86)\Arduino\hardware\arduino\ avr \cores\arduino\HardwareSerial.h, C:\Program Files (x86)\Arduino/Blink3.ino, D:\Users\me\A…View in hardware catalog e.g. int is 32 bit, double really is double, “word” may be a different size to what the AVRAVRMicrocontrollers and processors…Arduino\libraries\U8glib\U8glib.cpp, C:\Program Files (x86)\Arduino\hardware\arduino\ avr \cores\arduino\HardwareSerial.h, C:\Program Files (x86)\Arduino/Blink3.ino, D:\Users\me\A…View in hardware catalog code thinks it is.

Look carefully at the data types you are reading from the peripheral, you may need to change the variable declarations to explicitly set the size e.g. uint16_t etc

Thu Nov 10, 2016 11:06 am

No, It was crashing at that F() macro inside the void MFRC522MFRC522Communications, navigation, interfaces and RFID…is used to unlock a door with a rfid card. It uses a Maple Mini with an ENC28J60 and MFRC522 on the SPI bus. I would like to add a ILI9431 tft display to show some door entry mess…View in hardware catalog ::PCD_DumpVersionToSerial() {
Moved the #define F(x) x

Thu Nov 10, 2016 11:24 am

If i move the F() macro at th begining of my sketch i get compilation errors.

Can we find an workaround, other than replacing all th F() in that library ?

Thu Nov 10, 2016 8:39 pm

I’d just remove all the F() macros.

Or I guess you could modify WString where the existing F macro is defined

Post a reply

Optional · up to 10 MiB