https://github.com/venkatesh4009/rfid-rc522-linux-driver
This project provides a complete Linux kernel driver and integration guide for interfacing the RC522 RFID module with the A5D2X Rugged Board via the SPI interface. It includes kernel-mode driver source code, device tree updates, patch generation, and a user-space test application. The main goal is to enable seamless RFID communication on embedded
https://github.com/venkatesh4009/rfid-rc522-linux-driver
a5d2x cross-compilation-toolchain device-tree embedded-linux kernel-modules linux-driver linux-kernel patch-generation rc522-rfid spi-driver yocto
Last synced: 3 months ago
JSON representation
This project provides a complete Linux kernel driver and integration guide for interfacing the RC522 RFID module with the A5D2X Rugged Board via the SPI interface. It includes kernel-mode driver source code, device tree updates, patch generation, and a user-space test application. The main goal is to enable seamless RFID communication on embedded
- Host: GitHub
- URL: https://github.com/venkatesh4009/rfid-rc522-linux-driver
- Owner: venkatesh4009
- Created: 2025-07-17T03:43:23.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-07-21T10:01:03.000Z (4 months ago)
- Last Synced: 2025-07-21T12:07:49.317Z (4 months ago)
- Topics: a5d2x, cross-compilation-toolchain, device-tree, embedded-linux, kernel-modules, linux-driver, linux-kernel, patch-generation, rc522-rfid, spi-driver, yocto
- Language: C
- Homepage:
- Size: 350 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ๐ ๏ธ RFID RC522 Linux Driver for A5D2X
This repository contains a Linux kernel driver and integration guide for the **RC522 RFID module** on the **A5D2X (Rugged Board)** using SPI interface. It includes kernel driver source, device tree patching, and testing procedures.
---
## ๐ฆ Project Structure
```text
rfid-rc522-linux-driver/
โโโ rfid_rc522/ # Kernel driver source folder
โ โโโ rc522.c
โ โโโ rc522_api.c
โ โโโ rc522_api.h
โ โโโ Makefile
โ โโโ Kconfig
โโโ rfid_rc522_dev.c # User-space test application
โโโ driver-readme # Developer notes
โโโ 0001-Rb-a5d2x.dtsi.patch # Device tree patch
โโโ 0002-rfid-rc522_driver.patch # Driver patch
โโโ Integration_rfid-rc522.pdf # Driver integration guide
โโโ rfid-rc522_Generating_patch.pdf # Patch generation guide
```
### โ๏ธ Hardware Requirements
- ๐ RC522 RFID Module (SPI)
- ๐ป RB-A5D2X (Rugged Board)
- ๐ SPI-connected via mikroBUS (VCC, MISO, MOSI, SCK, CS, RST, GND)
- ๐ท๏ธ RFID Tags
---
### ๐ง Software Requirements
- ๐ง Linux kernel source for RB-A5D2X
- ๐ ๏ธ Yocto or similar toolchain setup
- ๐ฆ Git, GCC, Device Tree tools
- ๐งฐ Cross-compilation environment (e.g. poky-tiny)
---
### ๐ Driver Integration (Kernel Static Build)
### ๐ 1. Copy driver files into kernel
```bash
Place files into `/drivers/misc/rfid_rc522/`:
- rc522.c
- rc522_api.c
- rc522_api.h
- Kconfig
- Makefile
```
### ๐ ๏ธ 2. Modify kernel Kconfig & Makefile
```bash
$ Edit `drivers/misc/Kconfig`:
$ source "drivers/misc/rfid_rc522/Kconfig"
```
```bash
$ Edit drivers/misc/Makefile:
obj-y += rfid_rc522/
```
### ๐ฒ 3. Update device tree
```bash
Modify a5d2x-rugged_board_common.dtsi to include SPI node and pinctrl for RC522.
```
### ๐๏ธ 4. Recompile kernel
```bash
$ source /opt/poky-tiny/2.5.2/environment-setup-cortexa5hf-neon-poky-linux-musleabi
$ make distclean
$ make rb_a5d2x_defconfig
$ make menuconfig # Enable RFID_RC522
$ make
```
### ๐พ 5. Copy artifacts to SD card
- Replace zImage and .dtb files in the boot partition with newly built ones.
### ๐งช Testing the Driver
### ๐ 1. Boot and check device
```bash
$ ls /dev/rfid_rc522_dev
```
### ๐งฐ 2. Compile & send test app
```bash
$ {CC} rfid_rc522_dev.c -o rfid_rc522_dev
$ scp rfid_rc522_dev root@:/home/root
```
### โถ๏ธ 3. Run on board
```bash
$ chmod +x rfid_rc522_dev
$ ./rfid_rc522_dev
```
### ๐งต Patch Generation (Optional)
```bash
To create patches:
git add drivers/misc/rfid_rc522/
git commit -m "Add RC522 RFID driver"
git format-patch -p1 -o patches/
```
### To apply patch later:
```bash
$ git am 0001-rfid-rc522_driver.patch
```
### ๐ Documentation
### ๐ Integration_rfid-rc522.pdf โ Full hardware & software integration guide
### ๐ rfid-rc522_Generating_patch.pdf โ Kernel patch generation steps
---
๐จโ๐ผ Author
Developed by:
Venkatesh M โ venkatesh.m@phytecembedded.com
Embedded System Engineer
---