Skip to content

TomerMellick/ble

Repository files navigation

NFC Tap-to-Pair BLE Firmware for Nordic nRF52840-DK

This firmware enables seamless Bluetooth Low Energy (BLE) connection establishment using Near Field Communication (NFC) tap-to-pair functionality on the Nordic nRF52840 Development Kit.

Features

  • NFC Tap-to-Pair: Simply tap an NFC-enabled device to initiate BLE pairing
  • Visual Feedback: LED indicators show system status and pairing progress
  • Power Management: Optimized for battery-powered applications
  • Security: PIN/passkey authentication and session-based security
  • Standard Compliance: Uses NDEF format for NFC data exchange

Hardware Requirements

  • Nordic nRF52840-DK development board
  • NFC-enabled device (smartphone, tablet) for testing
  • Nordic nRF5 SDK v17.1.0 or later
  • ARM GCC toolchain
  • nRF Command Line Tools

Quick Start

1. Setup Development Environment

# Install Nordic nRF5 SDK (adjust path in Makefile)
export SDK_ROOT=/path/to/nRF5_SDK_17.1.0_ddde560

# Install ARM GCC toolchain
# Install nRF Command Line Tools

2. Build Firmware

make clean
make

3. Flash to Device

make flash

4. Test NFC Tap-to-Pair

  1. Power on the nRF52840-DK (blue LED should blink slowly)
  2. Bring NFC-enabled device within 4cm of the board
  3. Green LED should blink fast during pairing
  4. Solid green LED indicates successful BLE connection

LED Status Indicators

LED Pattern Status
Slow blue blink (2s) Idle - waiting for NFC field
Fast green blink (200ms) NFC active - processing pairing
Solid green (3s) BLE connection established
Solid red (3s) Error condition
Slow blue blink (5s) Low power mode

Project Structure

├── src/                    # Source files
│   ├── main.c             # Main application
│   ├── nfc_handler.c      # NFC field detection and NDEF handling
│   ├── ble_manager.c      # BLE stack and connection management
│   ├── state_machine.c    # System state coordination
│   ├── led_controller.c   # LED status indicators
│   └── power_manager.c    # Power optimization
├── config/                # Configuration files
│   └── sdk_config.h       # Nordic SDK configuration
├── tests/                 # Unit and integration tests
├── Makefile              # Build configuration
└── README.md             # This file

Configuration

Key configuration options in config/sdk_config.h:

  • NFC_T4T_HAL_ENABLED: Enable NFC Type 4 Tag emulation
  • BLE_ADVERTISING_ENABLED: Enable BLE advertising
  • NRF_PWR_MGMT_ENABLED: Enable power management
  • NRF_LOG_ENABLED: Enable debug logging

Development Status

This project is currently under development. See the implementation tasks in .kiro/specs/nfc-ble-tap-to-pair/tasks.md for current progress.

License

This project is licensed under the Nordic 5-Clause License. See the Nordic nRF5 SDK for license details.

Support

For issues and questions:

  1. Check the Nordic DevZone: https://devzone.nordicsemi.com/
  2. Review the nRF52840 documentation
  3. Consult the Nordic nRF5 SDK examples

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors