Bring-up

Blink status LED

The first proof a board is alive. On a product this is the power or status lamp.

Bring-up GPIOStatus LED ESP32 family

Official path: examples/get-started/blink

01 Overview

The official Blink example toggles one LED to prove GPIO output. It is the minimum heartbeat of any ESP32 board.

  • Use when: first bring-up, fixture test, product status lamp.
  • Skip when: I/O is already proven and you are working on radios or sleep.
  • Official proves: the configured GPIO can toggle on a fixed period.
  • Official does not: size the resistor, place the lamp in an enclosure, or turn it off in sleep.

02 Hardware

  • Chip: any ESP32-class module or DevKit.
  • Minimum parts: LED + series resistor (often 220Ω–1kΩ). Some modules already have a lamp.
  • Pin: BLINK_GPIO in menuconfig. GPIO2 is common on ESP32-DevKit, GPIO8 on many C3 boards.
  • Power: 3.3V. Do not drive the LED from a 5V pin.
  • Production: the lamp must be visible through the housing; silkscreen polarity matters for SMT.

03 Software flow

1. Select the GPIO in menuconfig.

2. Reset the pin and set it as output.

3. Loop: high → delay → low → delay.

4. Newer trees may drive a WS2812 via RMT/led_strip — that is not a plain GPIO lamp.

5. Product firmware should encode states (boot, connected, error), not blink 1Hz forever.

04 Core points

  • Pin numbers change by chip. Copying GPIO2 from ESP32 to C3 will miss the lamp.
  • The DevKit LED is not your product LED. Custom boards need a new footprint.
  • Do not blink through deep sleep. Status policy is a power decision.
  • Custom work: status logic, GPIO map, schematic and PCB.

中文

点亮与上电

Blink 指示灯

第一块板活没活,先看这颗灯。量产产品里它就是电源/状态指示。

点亮与上电 GPIO状态灯 ESP32 family

官方路径: examples/get-started/blink

01 项目概述

官方 Blink 用一颗 LED 证明 GPIO 输出可用。这是所有 ESP32 硬件的最小心跳。

  • 适用: 新板第一次上电、产测治具、产品状态灯。
  • 不适用: 已经确认 IO 正常、要做通讯或低功耗的阶段。
  • 官方能证明: 配置的 GPIO 能按固定周期翻转。
  • 官方没做的: 限流电阻选型、灯的颜色与外壳开孔、低功耗时关掉指示。

02 项目硬件描述

  • 芯片: 任意 ESP32 系列开发板或模组。
  • 最小物料: LED + 限流电阻(常见 220Ω–1kΩ)。部分模组板载 LED。
  • 引脚: 由 menuconfig 的 BLINK_GPIO 决定。ESP32-DevKit 常见 GPIO2,C3 常见 GPIO8,不能抄错。
  • 供电: 3.3V。LED 不要直接接 5V 脚。
  • 量产: 指示灯要能被外壳看到;贴片灯方向和丝印要对产线。

03 项目软件流程描述

1. menuconfig 选定 GPIO,或改 Kconfig 默认值。

2. 复位该脚,设为输出。

3. 循环:置高 → delay → 置低 → delay。

4. 部分新示例对板载 WS2812 走 RMT/led_strip,和普通 GPIO 灯不是同一条驱动。

5. 产品固件应改成状态机:开机闪、联网常亮、错误快闪,而不是永久 1Hz。

04 项目核心点

  • 脚号随芯片变。 抄 ESP32 的 GPIO2 到 C3 会点不亮或点到别的功能。
  • 板载灯不等于你的产品灯。 定制板要重新画灯位和电阻。
  • 不要在深睡里还闪灯。 指示策略要和功耗一起定。
  • 可定制: 状态灯逻辑、GPIO 分配、原理图与 PCB。