# nRF52840 — Board Knowledge

## Hardware Overview
- **SoC:** nRF52840 (ARM Cortex-M4F, 64 MHz)
- **Flash:** 1 MB
- **RAM:** 256 KB
- **Radio:** 2.4 GHz multi-protocol (BLE 5.0, Thread, Zigbee, IEEE 802.15.4, ANT, 2.4 GHz proprietary)
- **USB:** Full-speed USB 2.0
- **NFC:** NFC-A tag

## Board Target
Use `nrf52840dk/nrf52840` as the build target (Zephyr format: `<board>/<soc>`).

## Development Kit: nRF52840 DK (PCA10056)
- **J-Link debugger:** On-board SEGGER J-Link OB (supports RTT + SWD)
- **UART:** Via on-board VCOM (USB-CDC). Typically appears as `/dev/ttyACM0` (Linux) or `COM<N>` (Windows).
- **Buttons:** 4 user buttons (Button 1–4)
- **LEDs:** 4 user LEDs (LED 1–4)
- **Arduino header:** Yes (for shields)
- **Current measurement:** Pin header for power profiling

## Key Considerations
- When using BLE + Thread/Zigbee concurrently, enable the multiprotocol service layer (`CONFIG_MPSL=y`).
- USB CDC-ACM can conflict with UART logging if both use the same peripheral. Prefer RTT for logging when USB is in use.
- The nRF52840 DK supports external flash (QSPI) for FOTA or large asset storage.
- Stack size defaults may need increasing for complex BLE applications (`CONFIG_MAIN_STACK_SIZE`, `CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE`).

## Common DeviceTree Overlay Use Cases
- Remap UART pins: override `&uart0` node
- Enable QSPI flash: overlay for `&mx25r64` or equivalent
- GPIO pin assignment for custom hardware
