cancel
Showing results for 
Search instead for 
Did you mean: 

How to Write Multiple BLOCKs at a Time

sliu.5
Associate II

I use ST25DV to write binary files. I can only write one BLOCK at a time. I think every time I write is Multiple BLLOCK,Each BLOCK has 4 bytes. If I want to write 64 bytes(binary fules), the boad have to read and write 16 times. If I want to read and write 64 bytes(16 BLOCK) at one time.What should I do?

1 ACCEPTED SOLUTION

Accepted Solutions
JL. Lebon
ST Employee

​Hello,

In ST25DV, user memory is accessed by RF by blocks of 4 bytes.

The ST25DV has 2 different RF commands to write binary data into user memory.

First RF command is "Write Single Block" (command code 21h, see chapter 7.6.8 of the datasheet). This command allow to write 1 block at a time which means 4 bytes.

Second RF command is "Write Multiple Blocks" command (command code 24h, see chapter 7.6.14 of the datasheet). In ST25DV, this command allows you to write from 1 to 4 blocks at a time, which means from 4 bytes to 16 bytes at a time.

It is not possible to write more than 4 blocks a time,

Extended versions of those two commands also exists (Extended Write Single Block and Extended Write Multiple Blocks) to write data at block address > 255 (but they can also be used to write data below address 255).

So, in your case, to write 64 bytes with minimum number of commands, you will need to issue 4 x Write multiple blocks commands of 4 blocks.

To read 64 bytes with minimum number of commands, you can use the Read Multiple Blocks command and read all 64 bytes (16 blocks) in one time.

For information, on I2C side, it is possible to write up to 256 bytes at a time.

Hope this answers your question.

Best regards.

View solution in original post

1 REPLY 1
JL. Lebon
ST Employee

​Hello,

In ST25DV, user memory is accessed by RF by blocks of 4 bytes.

The ST25DV has 2 different RF commands to write binary data into user memory.

First RF command is "Write Single Block" (command code 21h, see chapter 7.6.8 of the datasheet). This command allow to write 1 block at a time which means 4 bytes.

Second RF command is "Write Multiple Blocks" command (command code 24h, see chapter 7.6.14 of the datasheet). In ST25DV, this command allows you to write from 1 to 4 blocks at a time, which means from 4 bytes to 16 bytes at a time.

It is not possible to write more than 4 blocks a time,

Extended versions of those two commands also exists (Extended Write Single Block and Extended Write Multiple Blocks) to write data at block address > 255 (but they can also be used to write data below address 255).

So, in your case, to write 64 bytes with minimum number of commands, you will need to issue 4 x Write multiple blocks commands of 4 blocks.

To read 64 bytes with minimum number of commands, you can use the Read Multiple Blocks command and read all 64 bytes (16 blocks) in one time.

For information, on I2C side, it is possible to write up to 256 bytes at a time.

Hope this answers your question.

Best regards.