Public Access
- Uploader sends 'FLASH <baud>' first; the ESP32 restarts the Nano and bridges at that baud rate, then answers OK - --baud=auto (default) tries 57600 (old ATmegaBOOT) then 115200 (Optiboot) - Optional nano_reset GPIO (NPN to Nano RESET) pulses reset after power on, needed for Optiboot which skips the bootloader after a power cycle - Clear errors for outdated ESP32 firmware and missing wires - README: bootloader table, reset wire, troubleshooting Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
89 lines
3.1 KiB
INI
89 lines
3.1 KiB
INI
; Flipdot display - one PlatformIO project, two firmware targets.
|
|
;
|
|
; nano Arduino Nano that drives the Brose flipdot panels directly (USB upload)
|
|
; nano_ota Same Nano firmware, flashed over WiFi through the ESP32
|
|
; esp32 ESP32 "brain" (WiFi, NTP clock, Home Assistant) - OTA upload
|
|
; esp32_usb Same ESP32 firmware, flashed over USB (first flash / recovery)
|
|
; native Unit tests for the Nano firmware, run on the PC (needs gcc on PATH)
|
|
;
|
|
; Build all: pio run
|
|
; Build one: pio run -e nano
|
|
; Upload one: pio run -e nano -t upload
|
|
; Serial monitor: pio device monitor -e nano
|
|
; Run tests: pio test -e native
|
|
;
|
|
; https://docs.platformio.org/page/projectconf.html
|
|
|
|
[platformio]
|
|
default_envs = nano, esp32
|
|
|
|
[env]
|
|
framework = arduino
|
|
monitor_speed = 115200
|
|
lib_deps =
|
|
adafruit/Adafruit GFX Library@^1.10.12
|
|
; Tests only run in the native environment, never on the boards
|
|
test_ignore = *
|
|
|
|
; ---------------------------------------------------------------------------
|
|
; Arduino Nano - display driver
|
|
; ---------------------------------------------------------------------------
|
|
[env:nano]
|
|
platform = atmelavr
|
|
board = nanoatmega328
|
|
board_build.mcu = atmega328p
|
|
board_build.f_cpu = 16000000L
|
|
build_src_filter = +<nano/>
|
|
; Uncomment when using the PLCC adapter board (different pinout, see lib/BROSE9323/BROSE9323.h)
|
|
; build_flags = -D FLIPDOT_PLCC_ADAPTER
|
|
upload_port = COM10
|
|
monitor_port = COM10
|
|
|
|
; Same Nano firmware, flashed over WiFi through the ESP32 (see README.md).
|
|
; Needs the Nano TX -> ESP32 GPIO 16 wire. upload_port = ESP32 IP[:port], default port 2323.
|
|
; --baud: bootloader baud rate. auto tries 57600 (old bootloader), then 115200 (Optiboot).
|
|
[env:nano_ota]
|
|
extends = env:nano
|
|
upload_protocol = custom
|
|
upload_port = 10.1.1.198
|
|
upload_flags = --baud=auto
|
|
upload_command = "$PYTHONEXE" "$PROJECT_DIR/tools/nano_net_upload.py" "$SOURCE" $UPLOAD_PORT $UPLOAD_FLAGS
|
|
|
|
; ---------------------------------------------------------------------------
|
|
; ESP32 - controller, talks to the Nano over serial
|
|
; ---------------------------------------------------------------------------
|
|
[env:esp32]
|
|
platform = espressif32
|
|
board = esp32doit-devkit-v1
|
|
build_src_filter = +<esp32/>
|
|
; ESPSERIAL turns the BROSE9323 driver into a serial client: every draw call is
|
|
; sent to the Nano as a text command instead of toggling GPIO pins.
|
|
build_flags = -D ESPSERIAL
|
|
lib_deps =
|
|
${env.lib_deps}
|
|
https://github.com/robjen/GFX_fonts.git
|
|
dawidchyrzynski/home-assistant-integration@^2.1.0
|
|
knolleary/PubSubClient@^2.8.0
|
|
upload_protocol = espota
|
|
upload_port = 10.1.1.198
|
|
monitor_port = COM11
|
|
|
|
[env:esp32_usb]
|
|
extends = env:esp32
|
|
upload_protocol = esptool
|
|
upload_port = COM11
|
|
|
|
; ---------------------------------------------------------------------------
|
|
; Native - unit tests for the Nano firmware on the PC (test/test_nano)
|
|
; The Arduino core, EEPROM and the display driver are replaced by test/mocks.
|
|
; ---------------------------------------------------------------------------
|
|
[env:native]
|
|
platform = native
|
|
framework =
|
|
lib_deps =
|
|
lib_ignore = BROSE9323
|
|
test_ignore =
|
|
test_build_src = yes
|
|
build_src_filter = +<nano/>
|
|
build_flags = -std=gnu++17 -I test/mocks
|