Modify flash calculation functions to support 2MB devices in the STM32F4 series