---
title: "W7500 flash read and write protection"
url: "https://maker.wiznet.io/forum/11979"
markdown_url: "https://maker.wiznet.io/forum/11979/md"
type: "Forum topic"
category: "MCU & Boards"
author: "robalflex"
created: "2016-10-19T13:37:14+09:00"
last_activity: "2024-11-18T20:13:42+09:00"
language: "en"
views: 1642
replies: 9
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# W7500 flash read and write protection

## Question

Asked by robalflex on 2016-10-19 in MCU & Boards.

Hi all,

I have a question regarding the W7500P IAP functionality. In the IAP example for the W7500 there is some functionality for erasing, reading and writing the flash, but I can’t find anything to protect the flash from reading and writing.

The reference manual chapter 9.3.1 states one can read protect the flash by writing the CRL bit in the FLOCKR0 register. But I can’t find which bit the CRL bit is?

According to [url][W7500 flash memory interface registers](https://forum.wiznet.io/t/w7500-flash-memory-interface-registers/2126/1)] it is even not possible to control the flash without the IAP…

So my question is, how can i protect flash from reading and writing?

## Replies

### Reply 1 by lawrence, 2017-01-31

hello, robalflex

the FLOCKR0 is on table 6, description on flash memory in 9.2.1.

the address is 0x4100 5014 and size is 4 bytes.

thank you

### Reply 2 by robalflex, 2017-06-01

Hello Lawrence,

I know the FLOCKR0 register is located at address 0x4100 5014, but my question is: which bit in this register is the CRL bit? And is this bit responsible for the read protection, or is there another way to read/write protect the chip?

### Reply 3 by lawrence, 2017-06-02

hello, robalflex

sorry about datasheet including no info. of FLOCKR0.

WIZnet will update soon.

CRL is FLOCKR0[31] and it is active low.

FLOCKR0 is R=W. you can read the bit changing after writing the bit as ‘0’.

Thank you

### Reply 4 by robalflex, 2017-06-06

Hello Lawrence,

Thanks for your response.

I tried writing bit 31 of the FLOCKR0 register to ‘0’ and to ‘1’, but it’s not working. The FLOCKR0 register always reads back as 0x00000000.

Maybe it is necessary to set other registers first? Can you describe the exact procedure to follow to read-protect the main flash?

### Reply 5 by lawrence, 2017-06-08

hello, robalflex

I miss another bit for read protection…

for read protection active, user need to set DRL and CRL in FLOCKR0.

CRL is FLOCKR0[31]

DRL is FLOCKR0[3:2]

DRL0 is FLOCKR0[3] and it is for Data0 area.

DRL1 is FLOCKR0[2] and it is for Data1 area.

These are what reference document guides…

There is no example yet… but hopefully it will be prepared soon.

thank you

### Reply 6 by nda, 2018-11-13 (in reply to reply 4)

Hello Robalflex. Did you find how to protect main flash?

### Reply 7 by jameskim, 2019-02-11

Hi,

I’d like to share useful information about locking and/or unlocking W7500 flash memory via ISP.

![](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/a/a081ac67b8bdaa3e5e36e80689bdceb6b8929a6b.png) [The Journal of javakys – 9 Feb 19](https://javakys.wordpress.com/2019/02/09/how-to-lock-unlock-w7500p-flash-memory/)

![](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/8/8e974a20c8e176392ed23c767f767eddc829f556.png)

### [How to LOCK/Unlock W7500(P) Flash memory](https://javakys.wordpress.com/2019/02/09/how-to-lock-unlock-w7500p-flash-memory/)

The Cortex M0 base W7500(and W7500P) from WIZnet has 128Kbytes Code Flash and 512 Bytes Data Flash inside. Locking read/write operation to Flash memory is an inevitable capability of a MCU, in orde…

I wrote a python module for ISP communication with W7500(P)
And above blog post is a guide for how to use it.

I expect it would be helpful for you.

Thank you.
javakys

### Reply 8 by MikeChanSeong.Kim, 2021-12-09

Can u advise me how to set read-protection in normal boot mode?
Above link is for boot mode.
I’d like to know how to enable flash read protection in my already alread deployed firmware.

일반부팅상태일때 펌웨에서 read-protection을 설정하는 방법이 있을까요?
저는 기존에 배포된 펌웨어에서 새로운 버젼으로 펌웨어 업데이트하면 새로운 펌웨어가 실행될때 read-protection기능을 부여하거나 다음 업데이트 부터는 flash read-protection(lock flash reading)을 설정하고 싶습니다.

### Reply 9 by barcaluti, 2024-11-18 (in reply to reply 5)

Hi everyone,

I know this is an old post, but could you please share if you finally achieved lock protection of main flash programmatically and how? I´m struggling with it, and I see chaotic documentation about it (latest User Manual version does not even mention this feature -maybe it´s not possible in latest silicon versions?-).

Thanks in advance

---

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