Skip to content

RFC: drivers: biometrics: Add driver subsystem, GT5x, and ZFM-X0 fingerprint sensor drivers#100139

Merged
aescolar merged 11 commits intozephyrproject-rtos:mainfrom
heronet:drivers/biometrics/add-biometrics-subsys
Feb 6, 2026
Merged

RFC: drivers: biometrics: Add driver subsystem, GT5x, and ZFM-X0 fingerprint sensor drivers#100139
aescolar merged 11 commits intozephyrproject-rtos:mainfrom
heronet:drivers/biometrics/add-biometrics-subsys

Conversation

@heronet
Copy link
Member

@heronet heronet commented Nov 27, 2025

This PR proposes a new biometrics driver subsystem to standardise interactions with biometric sensors (Fingerprint, Iris, Face, etc.).

Currently, Zephyr lacks a dedicated API for these devices. Users are forced to use raw UART/I2C, which is not portable. This RFC introduces a generic API and a reference implementation.

This subsystem provides a unified API for:

  • Enrollment (Start, Capture, Finalize)
  • Matching (Verify 1:1, Identify 1:N)
  • Template Management (Store, Delete, List)
  • Feedback (LED control)

On the naming of the (Biometrics) API:

A biometric sensor is a device that measures and analyzes biological characteristics or behavioral patterns of individuals for the purpose of identifying or verifying their identity. These sensors capture unique physical or behavioral traits that are distinct to each person, allowing for accurate authentication.

(source: https://ieeexplore.ieee.org/document/10808205) (thanks to @rodrigopex)

More references:

  1. ISO/IEC 2382-37: International standard for "Biometric recognition"
  2. Android SDK uses android.hardware.biometrics for its authentication system

Copy link
Contributor

@pdgendt pdgendt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool stuff! This will need to go through the architecture working group as it introduces a new driver API class.

Some nice additions would be:

  • Documentation!
  • Maintainer area
  • A simulated/emulated test
  • Shell commands for testing

@pdgendt pdgendt added the Architecture Review Discussion in the Architecture WG required label Nov 27, 2025
@heronet
Copy link
Member Author

heronet commented Nov 27, 2025

Cool stuff! This will need to go through the architecture working group as it introduces a new driver API class.

Some nice additions would be:

  • Documentation!
  • Maintainer area
  • A simulated/emulated test
  • Shell commands for testing

Thanks for the feedback! I am happy to work with the Architecture WG on the API design.

My todo list for now is:

  1. Add Documentation and MAINTAINERS entry.
  2. Shell commands.
  3. Emulated Test.

I will push the Documentation and Maintainers update shortly.

@heronet heronet force-pushed the drivers/biometrics/add-biometrics-subsys branch from 38b5ed6 to 6fa3aca Compare November 27, 2025 12:04
@carlescufi
Copy link
Member

@heronet Thanks for your proposal! would you be available to present this work in the Architecture Working Group meeting in the near future?

@heronet
Copy link
Member Author

heronet commented Nov 27, 2025

@heronet Thanks for your proposal! would you be available to present this work in the Architecture Working Group meeting in the near future?

Sure. Please let me know what time/date slot fits this the best. Besides, is there a specific agenda I should prepare for?

@heronet heronet force-pushed the drivers/biometrics/add-biometrics-subsys branch from 0a99aa4 to 1cca502 Compare November 29, 2025 07:15
@zephyrbot zephyrbot added the area: Tests Issues related to a particular existing or missing test label Nov 29, 2025
@heronet heronet requested a review from pdgendt November 29, 2025 07:18
@heronet heronet force-pushed the drivers/biometrics/add-biometrics-subsys branch 2 times, most recently from e1eabb2 to 98a5ee7 Compare November 29, 2025 17:28
@heronet heronet force-pushed the drivers/biometrics/add-biometrics-subsys branch 2 times, most recently from 27e1446 to 05cb7c6 Compare January 29, 2026 16:20
@heronet
Copy link
Member Author

heronet commented Jan 30, 2026

A twister test failed unrelated to my code. Can't seem to rerun the test

@heronet heronet force-pushed the drivers/biometrics/add-biometrics-subsys branch from 05cb7c6 to 7ef6297 Compare February 1, 2026 10:35
@heronet
Copy link
Member Author

heronet commented Feb 1, 2026

Minor improvements to the sample

Copy link
Contributor

@mbolivar mbolivar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! Please add a rationale for your default values or mark them as required, then I'm happy to approve this PR.

Comment on lines 21 to 29
Default is 0xFFFFFFFF. Can be changed via system parameter commands.
password:
type: int
default: 0x00000000
description: |
Sensor password for authentication. All sensors ship with default
password 0x00000000. Only change if you've modified the sensor's
password using the password change command.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review. I have updated the descriptions with better explanation. These values are factory programmed so I chose to keep them as defaults. But let me know if required is the better approach.

Adds device tree binding for Zhiantec ZFM-X0 fingerprint
sensor and biometrics-emul

Signed-off-by: Siratul Islam <[email protected]>
Add driver for ZFM-x0 series optical fingerprint sensors supporting
ZFM-X0, R30x, JM-101, DY-50, FPM10A, and compatible modules.

Features:
- Multi-sample enrollment flow (2 samples)
- 1:1 verification and 1:N identification matching
- LED control
- Configurable security level and timeout

Signed-off-by: Siratul Islam <[email protected]>
Adds a sample application demonstrating the Biometrics
subsystem with a fingerprint sensor.

The sample demonstrates:
- Getting sensor capabilities
- Two-stage enrollment process
- Verification (1:1 matching)
- Identification (1:N matching)
- Template management

Signed-off-by: Siratul Islam <[email protected]>
Add emulated biometrics driver for testing shell commands
and application logic. Implements full API:
- Configurable attributes
- Template storage with simulated enrollment workflow
- Match operations with configurable success simulation
- LED state tracking

Signed-off-by: Siratul Islam <[email protected]>
Add shell interface for biometrics driver subsystem providing
commands for:
- info: display device capabilities
- attr_get/attr_set: read/write device attributes
- enroll: full enrollment flow and individual steps
- template_list/delete/delete_all: template management
- match: verify or identify operations
- led: LED control

Signed-off-by: Siratul Islam <[email protected]>
- Add test suite for biometrics API using emulated driver
- Test enrollment flow: start, capture, finalize, abort
- Test template operations: store, read, delete, list
- Test matching: verify and identify modes
- Test attribute get/set and error handling
- Runs on native_sim and real hardware

Signed-off-by: Siratul Islam <[email protected]>
Add device tree binding for ADH Technology GT5X series optical
fingerprint sensors (GT-511C1R, GT-511C3, GT-521F32, GT-521F52).

Signed-off-by: Siratul Islam <[email protected]>
Add driver for ADH Technology GT5X series optical fingerprint
sensors. Supports GT-511C1R, GT-511C3, GT-521F32, and GT-521F52
variants.

Features:
- 3-stage enrollment with retry support
- 1:1 verification and 1:N identification
- LED control
- Model-agnostic design via device tree configuration

Signed-off-by: Siratul Islam <[email protected]>
Add maintainer entry for the new biometrics drivers subsystem,
covering drivers, bindings, headers, samples, and tests

Signed-off-by: Siratul Islam <[email protected]>
@heronet heronet force-pushed the drivers/biometrics/add-biometrics-subsys branch from 7ef6297 to 450b405 Compare February 5, 2026 20:45
@zephyrbot zephyrbot requested a review from mbolivar February 5, 2026 20:47
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 5, 2026

@pdgendt
Copy link
Contributor

pdgendt commented Feb 6, 2026

Nice work!

@heronet
Copy link
Member Author

heronet commented Feb 6, 2026

Nice work!

Thanks @pdgendt for sticking to this PR and providing feedback from the beginning.

@aescolar aescolar merged commit a8f8f7d into zephyrproject-rtos:main Feb 6, 2026
28 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Architecture Review Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Boards/SoCs area: Devicetree Binding PR modifies or adds a Device Tree binding area: Devicetree Bindings area: Devicetree area: MAINTAINER File area: Samples Samples area: Tests Issues related to a particular existing or missing test

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Comments