---
title: "W7500 flash memory interface registers"
url: "https://maker.wiznet.io/forum/11417"
markdown_url: "https://maker.wiznet.io/forum/11417/md"
type: "Forum topic"
category: "MCU & Boards"
author: "aon"
created: "2015-10-23T14:29:23+09:00"
last_activity: "2017-10-06T14:31:53+09:00"
language: "en"
views: 2684
replies: 20
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# W7500 flash memory interface registers

## Question

Asked by aon on 2015-10-23 in MCU & Boards.

Hi,

Section 9.2.1 in the W7500 manual describes the addresses of the flash registers, but there are no details on the bit arrangement in FACCR, FACTRLR and FSTATR. Would it be possible to get this information?

## Replies

### Reply 1 by lawrence, 2015-10-26

Hello, aon

After Table 6, there is all description of using Flash memory Interface register with unlock FACCR, read operation, flash erase and program operation.

I hope you can fine how to handle them.

If there is no what you look for, please let me know .

Thank you

Lawrence

### Reply 2 by aon, 2015-10-26

Yes, I’ve found the descriptions. But for example, in section 9.2.2 on page 87 of the reference manual:

> 1. Check that no main Flash memory operation is ongoing by checking the RDY bit in the FSTATR register.
>    …
>
> 2. Set FEN and CTRL bits in the FACCR register.

I can’t find a table anywhere that tells me which bit is RDY in FSTATR, and which bits are FEN and CTRL in FACCR? And so on.

### Reply 3 by aon, 2015-11-07

Hi,

Any news on this?

Thanks.

### Reply 4 by lawrence, 2015-11-09

Hello, aon

Thank you for your interest.

I review the flash control and I realized that I supposed to say to you at first…

We support IAP to erase and write flash

but it is not possible to control flash without IAP.

I think datasheet made you confused with chapter 9… so sorry about that…

We have an IAP example here

[url][https://github.com/Wiznet/W7500\[/url\]](https://github.com/Wiznet/W7500%5B/url%5D)

please refer it and ask any thing about it!

Thank you

lawrence

### Reply 5 by lawrence, 2015-11-10

Please refer how to use IAP function

[url][http://wizwiki.net/wiki/doku.php?id=products:w7500:peripherals:flash\[/url\]](http://wizwiki.net/wiki/doku.php?id=products:w7500:peripherals:flash%5B/url%5D)

Thank you

lawrence

### Reply 6 by aon, 2015-11-10

OK, thank you Lawrence.

### Reply 7 by Hooligan0, 2015-12-17

Hi lawrence,

lawrence:

> <http://wizwiki.net/wiki/doku.php?id=products:w7500:peripherals:flash>

I think there are two errors into the table (on web and into datasheet).

1. Each memory block is 4k but the table show 4 sectors of 256 bytes for each block …

2. If the first sector number is “0” … then the last must be 31 (not 32)

### Reply 8 by lawrence, 2015-12-22

Hello, Hooligan0

Thank you so much for finding the incorrect part of the datasheet ![:smiley:](https://emoji.discourse-cdn.com/twitter/smiley.png?v=12)

We will make sure the flash memory.

And… I am very sorry to make you so confused with the table… ![:cry:](https://emoji.discourse-cdn.com/twitter/cry.png?v=12)

Each block has 4KB and 16 Sectors. (but I know the table only show 4 Sectors…)

Then as you said, 0 ~ 31 block and 0 ~ 511 sectors is right! ( datasheet is wrong)

As soon as possible, we will modify the errors in flash memory description.

Thank you again!

lawrence

### Reply 9 by lawrence, 2015-12-22

Hello,

before datasheet corrected, please refer wizwiki page

[url][http://wizwiki.net/wiki/doku.php?id=products:w7500:peripherals:flash\[/url\]](http://wizwiki.net/wiki/doku.php?id=products:w7500:peripherals:flash%5B/url%5D)

Thank you

lawrence

### Reply 10 by Hooligan0, 2015-12-22

[quote=“aon”]Hi,

Section 9.2.1 in the W7500 manual describes the addresses of the flash registers, but there are no details on the bit arrangement in FACCR, FACTRLR and FSTATR. Would it be possible to get this information?[/quote]

FEN and CTRL bits of FACCR are located at bits 16 and 17 (write 0x00030000 to set)
SER of FACTRLR seems to be at bit 27 (0x08000000)

For the RDY bit, wait until FSTATR is 0x00

### Reply 11 by SURYA OBULA REDDY NA, 2017-08-22 (in reply to reply 10)

1.What is the Use of Information block ,DATA 0 & DATA 1 In W7500P ???
2.What is the 0x1FFF1001 & 0x010)??
#define IAP_ENTRY (0x1FFF1001) // Because Thum code
#define IAP_ERAS (0x010)
3. What is meant by Thum Code??

### Reply 12 by SURYA OBULA REDDY NA, 2017-08-22 (in reply to reply 9)

1.What is the Use of Information block ,DATA 0 & DATA 1 In W7500P ???
2.What is the 0x1FFF1001 & 0x010)??
#define IAP_ENTRY (0x1FFF1001) // Because Thum code
#define IAP_ERAS (0x010)
3. What is meant by Thum Code??

### Reply 13 by Hooligan0, 2017-08-22

1. Blocks DATA0 and DATA1

There is no technical restrictions (as i know) about DATA0 and DATA1. You can use this pages for custom datas like configs, keys, … You can use other flash pages for same purpose but using DATAx pages reduce risk of erasing/modifying firmware (and use a better protecting strategy)

1. Where did you see “0x1FFF1001 & 0x010” (i have not the whole docs and code in mind)

2. About Thumb code

The W7500 chip contains an ARM cortex M0 cpu. This processor use by default 32 bits instructions set but may also support 16 bits instruction set called Thumb instructions. This reduce code size and improve performance in many cases.

See chap A5 of v7-M doc <https://static.docs.arm.com/ddi0403/e/DDI0403E_B_armv7m_arm.pdf>

### Reply 14 by SURYA OBULA REDDY NA, 2017-08-23

#define IAP_ENTRY (0x1FFF1001) // Because Thum code
#define IAP_ERAS (0x010)

It will be appeared to you in Flash W7500x_peripheral Example Code…

[github.com](https://github.com/Wiznet/W7500P/blob/master/W7500P_FW/Projects/Peripheral_Examples/Flash/IAP_Example/main.c)

#### [Wiznet/W7500P/blob/master/W7500P_FW/Projects/Peripheral_Examples/Flash/IAP_Example/main.c](https://github.com/Wiznet/W7500P/blob/master/W7500P_FW/Projects/Peripheral_Examples/Flash/IAP_Example/main.c)

```
/*******************************************************************************************************************************************************
 * Copyright �� 2016 <WIZnet Co.,Ltd.> 
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ��Software��), 
 * to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 
 * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

 * THE SOFTWARE IS PROVIDED ��AS IS��, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 
 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 
 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*********************************************************************************************************************************************************/
/**
  ******************************************************************************
  * @file    Flash/IAP_Example/main.c 
  * @author  IOP Team
  * @version V1.0.0
  * @date    26-AUG-2015
  * @brief   Main program body
```

This file has been truncated. [show original](https://github.com/Wiznet/W7500P/blob/master/W7500P_FW/Projects/Peripheral_Examples/Flash/IAP_Example/main.c)

### Reply 15 by Hooligan0, 2017-08-23

Oh, i have badly understand your first question (i have read “&” as logic operator, not just as “and” ![:slight_smile:](https://emoji.discourse-cdn.com/twitter/slight_smile.png?v=12) )

The first value (0x1FFF1001) is the address of a small piece of code located into a reserved memory. This piece of code contains functions that can be used to update flash content (IAP). I don’t know if this is a ROM or a reserved flash page because the doc about this page is poor (this is not important if you just want to use it).

When you call this IAP code, you need to give arguments. One of them is a code that define the command you want to call (erase, write, …). The second value of your question (0x10) is one of this commands.

### Reply 16 by SURYA OBULA REDDY NA, 2017-09-04

Hi Hooligan,

I have a problem with the UART Configuration in Example Code
In that examples for Uart0 and Uart1 gpio’s are not configured in Polling UART Example

### Reply 17 by Hooligan0, 2017-09-04

Please, do not reuse a topic for another question ![:slight_smile:](https://emoji.discourse-cdn.com/twitter/slight_smile.png?v=12) I will reply after your other post :

![](https://avatars.discourse-cdn.com/v4/letter/s/ea5d25/48.png) [UART0 and UART1 Gpio's in Polling UART Example](https://forum.wiznet.io/t/UART0-and-UART1-Gpios-in-Polling-UART-Example/3541) [W7500x](https://maker.wiznet.io/c/internet-mcu/w7500x/19)

> UART0 and UART1 Gpio’s are not configured in Polling UART Example Code…

### Reply 18 by Ilya, 2017-09-15

Hello! How can I learn a number of the bit of SER in the register FCTRLR, and also a number of the bits of SZ in the register FACCR and a number of the bits of WR and WRI in the register FCTRLR???

### Reply 19 by Hooligan0, 2017-10-03 (in reply to reply 18)

Hi Ilya,

As i know, there is no detail about FCTRLR bits into any document. Wiznet recommands to use the embedded IAP functions, that works fine (with some limitations on clock speed). I don’t know really why they have not documented this registers.

In a previous post of this thread i have give position of some bits (like SER and FEN) found by disasembling IAP functions. At the end this is useless because you **can’t** initiate a flash erase/write from a code into flash (i will locks).

### Reply 20 by Ilya, 2017-10-06

Hello, Hooligan!

Thank you!

---

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