Quantcast
Channel: Forum - Recent Threads
Viewing all articles
Browse latest Browse all 1583

RZ/A2M SPI "Write Buffer Operation"

$
0
0

I am working on RZ/A2M RTK7921053C00000BE board and have developed the code to write to SPI flash memory (Macronix MX25L51245G) that is mounted on the board.
However to reduce write time and to get better performance I want to use the "read cache" as "write buffer" as mentioned in Figure 20.26 of section [20.5.13 Write Buffer Operation] in the User's manual [RZ/A2M Group User’s Manual: Hardware] R01UH0746EJ0400 Rev.4.00.

I have made the following modifications in the code as mentioned in Figure 20.26:
1. Set the RCF bit in DRCR to 1
2. Set the WBUF/WBUF2 bit in PHYCNT to 1
3. Write data starting at address 0x1F808000 (Read cache/write buffer space)
4. Set the SPIWE and SPIE bits in SMCR to 1
5. Wait for TEND bit in CMNSR .

Data is written and I am able to achieve better performance, but unfortunately 2 extra bytes are written at the end of write operation.

Example:
When 64-bytes of data are written from address 0x00, the value at address "0x3F" is also written to addresses "0x40" and "0x41".
When 256 bytes of page data is written from address 0x00, the value at address "0xFF" is written to addresses "0x00" and "0x01" (in loopback fashion).

I would appreciate any help or tips to fix this issue.
Thank you.

Best regards,
Aiyappa


Viewing all articles
Browse latest Browse all 1583

Trending Articles