My STM32F407 microcontroller datasheet states that my flash region is between the following addresses:
0x08000000 to 0x080FFFFF
I want to calculate the amount of flash, which I know is 1024KB, but when I try to prove this, I always get to 1023. Here's my math:
0x080FFFFF - 0x08000000 = 0x000FFFFF = 1048575 = (1048575 / 1024)KB = 1023KB
1024 * 1024 = 1048576
Why am I confused with 1 byte? Dumb question, and I know this is high school stuff...