/* This function is used to read data from the flash.  */
HAL_StatusTypeDef HAL_FLASH_Read(uint32_t addr, uint8_t *buf, uint32_t len)
/* This function is used to read data from the flash.  */
HAL_StatusTypeDef HAL_FLASH_Read(uint32_t addr, uint8_t *buf, uint32_t len)
{
    int err;
    if (((addr & (INSIDE_FLS_BASE_ADDR - 1)) >=  getFlashDensity()) || (len == 0) || (buf == NULL))
    {
        return HAL_ERROR;
    }
    __HAL_LOCK(&pFlash);
    flashRead(addr, buf, len);
    err = HAL_OK;
    __HAL_UNLOCK(&pFlash);
    return err;
}