Skip to content

f_write fails with error (1) #21

Description

@cmd05

I am interfacing an SD module with my STM32F401RE board. I followed your blog for the guide but I get the following error for f_write

~ SD card demo by kiwih ~

SD card stats:
  16764928 KiB total drive space.
  16764848 KiB available.
I was able to open 'test.txt' for reading!
Read string from 'test.txt' contents: microsd: hello!
I was able to open 'write.txt' for writing
f_write error (1)

I tried debugging the issue and it seems that USER_SPI_read fails because of the functions send_cmd and rcvr_datablock. In this screenshot the if condition should be executed, then the function will return RES_OK, however it fails because both the conditions are false.

Image

send_cmd returns res=0xFF at the end of the loop.

Image

I'd have to check the error for rcvr_datablock too.

How would I be able to fix this error? Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions