Переглянути джерело

Add bootloader flash limit

Thomas Hondema 3 днів тому
батько
коміт
b61ae89ecb
2 змінених файлів з 11 додано та 0 видалено
  1. 6 0
      README.md
  2. 5 0
      platformio.ini

+ 6 - 0
README.md

@@ -7,6 +7,12 @@ original V10 image.
 
 Besides the original hardware this firmware can also be compiled for ATmega328P based 16 MHz Arduino Uno R3, Nano and Pro Mini.
 
+Application flash limits are board-specific: 31,744 bytes for the original
+meCoffee controller (the verified bootloader starts at `0x7c00`), 32,256 bytes
+for Uno, and the board definitions' 30,720 bytes for Pro Mini and Nano.
+The original-controller limit also applies to `328p8m_aligned` and `float_check`.
+An original-controller uploader must preserve and verify all of `0x7c00–0x7fff`.
+
 ## Toolchain
 
 The registry toolchain `toolchain-atmelavr@1.70300.191015` is an x86_64 build and does not run on

+ 5 - 0
platformio.ini

@@ -14,6 +14,8 @@ extra_scripts = pre:tools/apply_cplusplus_flags.py
 [env:328p8m]
 platform = atmelavr@5.3.0
 board = 328p8m
+; The device-matched original bootloader occupies 0x7c00..0x7fff (1 KiB).
+board_upload.maximum_size = 31744
 framework = arduino
 ; The registry toolchain (x86_64 avr-gcc 7.3) does not run on Apple Silicon without
 ; Rosetta. tools/toolchain-native wraps the Homebrew avr-gcc 9.5 (arm64).
@@ -34,6 +36,7 @@ upload_speed = 57600
 [env:uno]
 extends = env:328p8m
 board = uno
+board_upload.maximum_size = 32256
 board_build.f_cpu = 16000000L
 build_flags =
     ${common.build_flags}
@@ -43,11 +46,13 @@ upload_speed = 115200
 [env:pro_mini]
 extends = env:uno
 board = pro16MHzatmega328
+board_upload.maximum_size = 30720
 upload_speed = 57600
 
 [env:nano]
 extends = env:uno
 board = nanoatmega328new
+board_upload.maximum_size = 30720
 upload_speed = 115200
 
 ; Bench-only BLE upload experiment, pinned to the verified stock Uno Optiboot 4.4.