---
title: "Data Flash Write in W7500"
url: "https://maker.wiznet.io/forum/9376"
markdown_url: "https://maker.wiznet.io/forum/9376/md"
type: "Forum topic"
category: "MCU & Boards"
author: "boseji"
created: "2024-06-11T17:47:10+09:00"
last_activity: "2024-06-11T17:52:27+09:00"
language: "en"
tags: ["surf5-contest-ref"]
views: 4
replies: 1
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# Data Flash Write in W7500

## Question

Asked by boseji on 2024-06-11 in MCU & Boards.

Hello,

I am trying to Write to DataFlash 0 at 0x0003FE00 with size of 256 bytes.

Normally I have interrupts enabled since I use the SysTick timer and Dual Timers.

```c
// Write Value Back
FLASH_IAP(IAP_ERAS_DAT0, 0, 0, 0);                           // Erase
FLASH_IAP(IAP_PROG, DAT0_START_ADDR, df->buffer, SECT_SIZE); // Write
```

Once in the `main()` these are initiated the program gets stuck. And I don't receive any more periodic messages.

I am also using the TOE module to help with DHCP operations.

Kindly guide me on this.

Regards,

boseji

## Replies

### Reply 1 by boseji, 2024-06-11

Thanks This worked !

Just missed the ISR Disable and Enable in code. New Code is:

```c
// Write Value Back
__disable_irq();                   // Disable interrupts
FLASH_IAP(IAP_ERAS_DAT0, 0, 0, 0); // Erase
FLASH_IAP(IAP_PROG, DAT0_START_ADDR, df->buffer, SECT_SIZE); // Write
__enable_irq(); // Enable interrupts
```

This help fix the Issue and I am able to get values from Data Flash 0.

Thanks for the help.

---

Source: https://maker.wiznet.io/forum/9376
