I come out of reset.
I read the banner, it is good.
I mount the sd card, it is good.
I open a file to append to, it is good.
Next is the 16 bytes I try to write.
I give write command, it is good.
I write 16 bytes and …,No response.
Flush command, No response.
I tried the L command and it does respond.
However, the written file is not correct.
3320,38611,63,11702
was written.
The file has
49 49 02 49 02 49 02 49 02 49 02 49 02 49 02 49 02 49 02 49 02
21 bytes, just not the 21 bytes I was hoping for.
Hi,
i have the same problem with the W command.
I come out of reset.
I read the banner, it is good.
I mount the sd card, it is good.
I open a file to append to, it is good.
Next is the 16 bytes I try to write.
I give write command, it is good.
I write 32 bytes and …,No response.
[quote]I open a file to append to, it is good.
Next is the 16 bytes I try to write.
I give write command, it is good.
I write 32 bytes and …,No response.
[/quote]
When you write by W command, ALFAT will send back “!00\n” then wait for data.
You have to send 3 bytes of header (for write transaction) + 32 bytes raw data, total 35 bytes.
3 bytes of header are:
1st: 1 - for write
2nd+3rd: size of raw data, here it should be 32
So I think after you received first “!00\n” from “W” command, you have to send
0x01,0x00, 0x20 and 32 bytes of raw data
ALFAT doesn’t response because you sent wrong format or not enough data and it is in waiting state.
And, W command you need to send 3 bytes header before you send raw data,
but L command, no header needed for raw data.