cancel
Showing results for 
Search instead for 
Did you mean: 

SD Card 1 Byte Write

AGond.2
Associate III

Hello 

we Have Custom Build PCB Board where we Mounted SD card Interface and Using stm32f4xx_HAL_SD.c Library file in which 512 byte Hard Coded as config.DataBlockSize = SDIO_DATABLOCK_SIZE_512B;, but we have to write Byte  means don't block size of 512 Byte.

So as i Went through Transcend Sd Card There they Recommended Something WRITE_BL_PARTIAL , if WRITE_BL_PARTIAL =0 means 512 Byte Block Size and WRITE_BL_PARTIAL =1 means Small Block Size that is 1 Byte. So how we can Enable or Disable  WRITE_BL_PARTIAL in  stm32f4xx_HAL_SD.c .

Anyone Have Idea how we can do ?

 

Thank You

2 REPLIES 2
Peter BENSCH
ST Employee

SD cards are based on NAND flash, where you cannot write individual bytes. You can only access them in blocks.

Regards
/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

It's a BLOCK DEVICE, want to change a BYTE, read a BLOCK, change the BYTE, and write the modified BLOCK back.

You don't use 128MB device just a BYTE at a time, it's just impractical. You can use FATFS to f_open() / f_write() content in small amounts, by it's incredibly inefficient

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..