# Flash_Sync_Demo

---

## Function Description

This routine shows how to manipulate Flash.
1. Flash needs to be initialized by calling FLASH_DRV_Init() first.
2. The FLASH_DRV_EraseSector() function is called first to erase the specified sector.
3. Then call FLASH_DRV_Program() to program the specified location.
4. This was finally verified by reading the data back through the pointer read method.

---

## Hardware Requirements

+ **EVB**: YTM32B1MD2-EVB-Q100
+ **Debugger**: J-LINK v9.2 or later version

---

## Software Requirements

+ **SDK**      : YTM32B1MD2_1_3_1 or later version
+ **GCC**      : GNU GCC v10.3 or later version
+ **Keil/MDK** : ARM Keil/MDK v5.36 or later version
+ **IAR***     : IAR v8.4 or later version
+ **VS Code**  : Microsoft Visual Studio Code IDE v1.76 or later version(GNU GCC toolchain, CMake v3.25, ninja, Cortex-Debug extensions installation required)
+ **J-LINK** : SEGGER JLINK v6.96 or later version, YTM32B1MD2 patch(support package) installation required.
+ **Ozone**  : SEGGER Ozone v3.28 or later version.
  
---

## Notes
1. DFlash does not have ECC and will not be cached. It is recommended that users perform their own data verification.
2. When Flash Cache is enabled, it is strongly recommended to disable the Cache before operating PFlash (disabling the Cache is the simplest method and less prone to errors).
3. When calling the FLASH_DRV_Program() function, you need to make sure that the data in the address to be written is full FF.
4. The FLASH_DRV_EraseSector() parameter address must be an integer multiple of the sector.
5. The FLASH_DRV_Program() parameter address and size must be an integer multiple of FEATURE_EFM_WRITE_UNIT_SIZE and the pData parameter must be 4-byte aligned.
