Files
pi-pm3/LED_MAPPINGS.md
michael 5b9790c901
Some checks failed
Build Base Image (Stages 0-2) / build-base (push) Has been cancelled
fix: correct LED B color from blue to red for PM3 Easy
LED B on PM3 Easy is red per firmware define LED_RED=LED_B, not blue.
Updated all examples to use color names (green, red, orange, red2).
Added tune LED visualization examples and updated code references.

Tune LED color mappings inspired by the Dangerous Things RFID
diagnostic card color scheme:
- LF tune: Green (PM3 Easy) / Red2 (RDV4)
- HF tune: Red (PM3 Easy) / Orange (RDV4)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 20:15:49 -07:00

174 lines
5.5 KiB
Markdown

# Proxmark3 LED Mappings Reference
## Proxmark3 Easy
Based on hardware testing with Proxmark3 Easy and `LED_ORDER=PM3EASY`:
### LED Configuration
| LED | Color | GPIO Pin | PWM Channel | Brightness | Effects | Physical Position |
|-----|--------|----------|-------------|------------|---------|-------------------|
| A | Green | PA0 | PWM0 | 0-100% | All | 1st (leftmost) |
| B | Red | PA2 | PWM2 | 0-100% | All | 4th (rightmost) |
| C | Orange | PA9 | None | On/Off | Blink | 2nd |
| D | Red2 | PA8 | None | On/Off | Blink | 3rd |
**Physical LED order (left to right):** Green, Orange, Red2, Red
### GPIO Pin Details
From `include/config_gpio.h` with `LED_ORDER_PM3EASY`:
```c
#define GPIO_LED_A AT91C_PIO_PA0 // Green - PWM0 capable
#define GPIO_LED_B AT91C_PIO_PA2 // Red - PWM2 capable
#define GPIO_LED_C AT91C_PIO_PA9 // Orange - GPIO only
#define GPIO_LED_D AT91C_PIO_PA8 // Red2 - GPIO only
```
### Firmware Color Defines
From `armsrc/util.h` with `LED_ORDER_PM3EASY`:
```c
#define LED_GREEN LED_A // PA0 - PWM capable
#define LED_RED LED_B // PA2 - PWM capable
#define LED_ORANGE LED_C // PA9 - GPIO only
#define LED_RED2 LED_D // PA8 - GPIO only
```
### LED Bitmask Values
| LED | Bitmask (decimal) | Bitmask (hex) | Binary |
|-----|-------------------|---------------|--------|
| A | 1 | 0x01 | 0001 |
| B | 2 | 0x02 | 0010 |
| C | 4 | 0x04 | 0100 |
| D | 8 | 0x08 | 1000 |
| All | 15 | 0x0F | 1111 |
## Standard Proxmark3 (Non-Easy)
With default LED ordering (no `LED_ORDER_PM3EASY`):
| LED | Color | GPIO Pin | PWM Channel | Brightness | Effects |
|-----|---------|----------|-------------|------------|---------|
| A | Orange | PA0 | PWM0 | 0-100% | All |
| B | Green | PA8 | None | On/Off | Blink |
| C | Red | PA9 | None | On/Off | Blink |
| D | Red2 | PA2 | PWM2 | 0-100% | All |
**Note:** Only LEDs on PA0 and PA2 can use PWM brightness control and PWM effects (pulse, fade) on any PM3 variant.
## Usage Examples
### Basic LED Control
```bash
# Green LED at 50% brightness (or --led g)
hw led --led green --brightness 50
# Red LED at 75% brightness (or --led r)
hw led --led red --brightness 75
# Orange LED on (no brightness control, or --led o)
hw led --led orange --on
# Red2 LED toggle
hw led --led red2 --toggle
# Both PWM LEDs at 30%
hw led --led green,red --brightness 30
# Letter names also work
hw led --led a --on
hw led --led a,b --brightness 30
```
### LED Effects
Three effects are available: **pulse**, **fade**, and **blink**.
```bash
# Pulse effect (PWM LEDs only: green, red)
# Smoothly fades in and out
hw led --led green --pulse # 5 cycles @ 500ms default
hw led --led green --pulse --count 10 # 10 cycles
hw led --led green --pulse --speed 300 # Faster pulse (300ms cycle)
hw led --led red --pulse --count 0 # Infinite until button press
# Fade effect (PWM LEDs only: green, red)
# Starts at full brightness, fades to off
hw led --led green --fade # Default 500ms fade
hw led --led red --fade --speed 1000 # Slower 1-second fade
# Blink effect (ALL LEDs supported)
# Alternates on/off
hw led --led all --blink # All LEDs, 5 blinks
hw led --led orange,red2 --blink --count 20 # Non-PWM LEDs work too
hw led --led all --blink --speed 200 # Fast blink (200ms cycle)
hw led --led green --blink --count 0 # Infinite until stopped
```
### Effect Parameters
| Parameter | Description | Range | Default |
|-----------|-------------|-------|---------|
| `--speed` | Cycle time in milliseconds | 50-10000 | 500 |
| `--count` | Number of effect cycles | 0-65535 | 5 |
**Note:** `--count 0` runs the effect indefinitely until interrupted by:
- Pressing the button on the Proxmark3 device
### Tune LED Visualization
LED brightness tracks antenna voltage in real-time during tuning:
```bash
# LF tune with green LED tracking voltage
lf tune --led
# HF tune with red LED tracking voltage
hf tune --led
```
### Multi-Device Identification
Use brightness levels and effects to distinguish between multiple Proxmark3 devices:
```bash
# Device 1: Dim green
hw led --led green --brightness 20
# Device 2: Bright red
hw led --led red --brightness 100
# Device 3: Pulsing green (easy to spot)
hw led --led green --pulse --count 0
# Device 4: Fast blinking all LEDs
hw led --led all --blink --speed 200 --count 0
```
## Hardware Testing Notes
- Confirmed via individual LED testing on PM3 Easy hardware
- During `hw tune`: Red (B) and Red2 (D) LEDs typically active
- During flashing: Orange (C) and sometimes Green (A) visible
- PWM polarity: AT91 PWM with CPOL=0 outputs LOW during duty portion, so duty cycle is inverted to achieve correct brightness
## Code References
- LED definitions: `armsrc/util.h` lines 45-63
- LED macros: `include/proxmark3_arm.h` lines 91-102
- GPIO mapping: `include/config_gpio.h` lines 22-39
- PWM functions: `armsrc/util.c`
- LED control command: `client/src/cmdhw.c` (CmdHWLed)
- Tune LED integration: `armsrc/appmain.c` (CMD_MEASURE_ANTENNA_TUNING_HF/LF handlers)
---
**Last Updated:** 2026-03-15
**Hardware:** Proxmark3 Easy with LED_ORDER=PM3EASY
**Features:** brightness control, pulse, fade, blink, tune LED visualization