Files
esphome-configs/mcu-stm32-nucleo.yaml
T
randy 3cafd749d3
CI / YAML lint (push) Successful in 7s
CI / ESPHome config validation (push) Successful in 53s
stm32: F4 Discovery and miniSTM32F103ZE-EK, button debounce, ST-LINK serials
2026-11-07 11:20:18 +01:00

75 lines
2.2 KiB
YAML

---
# Hardware: ST NUCLEO-F411RE (STM32F411RE, 512K flash, no radio)
# Pinout:
# PA2/PA3 USART2 TX/RX -> ST-LINK virtual COM port (logger)
# PA5 LD2 green (active high) -> LED (light binary)
# PC13 B1 user (active low) -> Button (binary_sensor gpio)
# ST-LINK SN: 066BFF554954777167032417 (on-board V2-1, upload --device /dev/ttyACM0 resolves it from the VCP)
esphome:
name: mcu-stm32-nucleo
friendly_name: STM32 Nucleo
# needs the esphomeplatformzephyr fork (esphome-zephyr), upstream has no stm32: platform yet
stm32:
variant: STM32F4
board: nucleo_f411re
framework:
type: zephyr
# no network, so no OTA: one image slot, MCUboot only verifies and boots it
single_slot: true
# NVS sector = flash page; needs >= 2 of them, so storage takes the two 16K pages (sectors 2-3)
kconfig_options:
SETTINGS_NVS_SECTOR_COUNT: 2
# nucleo_f411re ships no partitions at all: MCUboot in sectors 0-1, storage in 2-3, the app in 4-7.
# MCUboot needs the same table; the fork appends its own code-partition = &boot_partition after it
overlays:
app: &partitions |
&flash0 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
boot_partition: partition@0 {
label = "mcuboot";
reg = <0x00000000 DT_SIZE_K(32)>;
read-only;
};
storage_partition: partition@8000 {
label = "storage";
reg = <0x00008000 DT_SIZE_K(32)>;
};
slot0_partition: partition@10000 {
label = "image-0";
reg = <0x00010000 DT_SIZE_K(448)>;
};
};
};
/ { chosen { zephyr,code-partition = &slot0_partition; }; };
mcuboot: *partitions
logger:
output:
- platform: gpio
id: led_out
pin: PA5
light:
- platform: binary
name: LED
id: led
output: led_out
# B1 has an external pull-up on the board
binary_sensor:
- platform: gpio
name: Button
pin:
number: PC13
inverted: true
# B1 bounces, toggle fired twice per press
filters:
- delayed_on_off: 30ms
on_press:
light.toggle: led