Need help with custom Keil flash algorithm (.FLM) for ISSI SPI NOR on MIMXRT1173

Dear Team,

Currently we are having NXP MIMXRT1173, FlexSPI1A mapped at 0x30000000. we use that flash for booting the image also. We boot directly from this external flash .its a qurad spi nor flash. We are currently using Keil versions:
- MDK: 5.41 and  ULINK Pro (programming tool) for programming the flash.

Recently we changed our external flash from 1 Giga bit flash (ISSI IS25LE01G) to 2 Gigabit flash(IS25LE02GG-RHLE).

After changing the flash just tried to program my image to the new flash using the old algorithm . Programming to that flash failed in the beginning it self . i went to googled some and found that if JEDEC ID mismatch then programing the flash will fail   in the beginning only. So i decided to write my cutomised flash algorithm .

taking references from this Algorithm Functions ..i took the template for flash algorithm from C:\Keil_v5\ARM\Flash\_Template\  .  i customized the flashing algorithm but that is also failing at the  begning of the programing of the flash with below error

pop up come as "Flash timeout.Reset the target "

and in KEIL i can see below failure

Erase Failed!
Error: Flash Download failed - "Cortex-M7"

Attaching my flash algorithm for your reference.

Flash_algo_z.zip

Regards

Khushboo