Flash size in boards.txt ATmega 328p 32u4 The ATmega328p and ATmega32u4 microcontroller have 32Kb of flash memory (as datasheet). Bootloader for each microcontroleer has different size (about 512 byte for 328p and 4kb for 32u4).

Why in boards.txt the "upload.maximum_size" parameters is 32256 for 328p and 28672 for 32u4?

I we have to consider bootloader size, the "upload.maximum_size" parameter for 328p must be about 31.5k and not 32k. And, if we do not have to consider bootloader size, as the default boards.txt configuration (above) for 328p, the "upload.maximum_size" parameter for 32u4 must be 32k not 28k. Correct?

Thank you
1KB is 1024 bytes, not 1000 bytes. 

Therefore 32kb = 32768 bytes. 

32768-512=32256, which is exactly the value used for upload.maximum_size for the 328p.

4kb=4096 bytes. 32768-4096=28672 which is the value for the 32u4.