# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [1.1.1] - 2026-08-14

### Changed

- Demos now consistently call `FLASH_DRV_Init()` before flash operations (added to the YTM32B1MC0 and YTM32B1LE1 demos).
- Updated the `FLASH_DRV_Init` documentation in `fls_drv_bin.h` and the READMEs: timing-register configuration, read-verify behavior, return values, and `DEV_ASSERT` wording.

### Fixed

- `FLASH_DRV_EraseSector` now rejects erase ranges that leave the flash arrays or cross arrays with different sector sizes, instead of silently truncating them or underflowing the remaining-size counter.
- `FLASH_GetSectorSize` now checks the main-array lower bound, so addresses below the main array (e.g. on YTM32B1HA0) are no longer misclassified as main-array sectors.
- Regenerated the driver binaries embedded in all demos so they match the driver source.

## [1.1.0] - 2026-08-13

### Added

- Added YTM32B1ME1 device support and its Flash driver demo project.
- Added `FLASH_READ_VERIFY_ENABLE` to configure erase/program read verification at build time; verification is enabled by default.
- Added Chinese documentation for the project and the YTM32B1ME1 demo.

### Changed

- Added sector-size detection for devices with separate data Flash arrays.
- Configured EFM timing registers during driver initialization on supported devices.
- Selected verified or non-verified erase/program commands according to `FLASH_READ_VERIFY_ENABLE`.
- Applied sector-erase timing before boot swap on devices with programmable erase timing.
- Updated YTM32B1 device headers, SVD files, and startup files.

### Fixed

- Cleared `DONE` and all command error flags before each Flash command by using `FEATURE_EFM_CMD_STS_CLEAR_MASK`.
- Removed `EFM_STS_RECOVERR_MASK` from `FEATURE_EFM_CMD_ERROR_MASK` so recoverable errors are no longer treated as final command failures.

## [1.0.1] - 2025-08-05

### Added

- Added YTM32B1MD2 device support and a flash driver demo project.

### Changed

- Changed the project license to BSD-3-Clause.
- Changed command completion detection from `IDLE` to `DONE`, with access-error handling while waiting.
- Added a NOP command before erase/program operations on devices without `EFM_CTRL_WE_MASK` to clear the write buffer.
- Added cache synchronization barriers after Flash cache invalidation.
- Moved the binary project memory layout fully into `relative.ld`, including the `.data` section.

## [1.0.0] - 2025-04-10

### Added

- Initial Flash driver release for the supported YTM32B1 devices.
