2016-01-06 02:16 AM
Target: STM32_EVAL evaluation board
with STM32F107VC
Tools: ST-Link/V2
Does anyone know how to read 4G SD (or more) card ?!how can I fix it?!I used fatfs to operate SD card, when 2G SDcard plugged in the slot, it's fine.Butplugged more than 2G SDcard, it doesn't work.
2016-01-06 06:17 AM
The block addressing scheme must not use a byte offset via a 32-bit variable, and the code would need to support SDHC cards which use a slightly different command expectation.
I'm not currently working on F1 platforms, or have this board.2016-01-06 05:46 PM
Thanks for your reply.
I checked my fatfs the file object structure (FIL) showForce 32bits alignement
so I think software it on the right way.Is it the H/W limitation on this D-board?Does any ideas to solve my problem? I willappreciate your help very much.
Thanks All.2016-01-06 06:09 PM
No, it's really not a FatFs issue, it's the sector read/write routines for the SDIO/SPI layer below DISKIO.C
I've posted fixed routine for the F4 using SDIO.The F1 series has thisSTM32F10x_StdPeriph_Lib_V3.5.0\Utilities\STM32_EVAL\Common\stm32_eval_sdio_sd.cThe ReadAddr here is broken because it uses a 32-bit variable that isn't going to hold an offset >4GB properly./** * @brief Allows to read one block from a specified address in a card. The Data * transfer can be managed by DMA mode or Polling mode. * @note This operation should be followed by two functions to check if the * DMA Controller and SD Card status. * - SD_ReadWaitOperation(): this function insure that the DMA * controller has finished all data transfer. * - SD_GetStatus(): to check that the SD Card has finished the * data transfer and it is ready for data. * @param readbuff: pointer to the buffer that will contain the received data * @param ReadAddr: Address from where data are to be read. * @param BlockSize: the SD card Data block size. The Block size should be 512. * @retval SD_Error: SD Card Error code. */SD_Error SD_ReadBlock(uint8_t *readbuff, uint32_t ReadAddr, uint16_t BlockSize){2016-01-07 07:34 PM
Thanks for your reply.
Well, I got the samecharacterization
instm32f1XX series
peripheral library
* @brief Reads block(s) from a specified address in an SD card, in polling mode. * @param p32Data: Pointer to the buffer that will contain the data to transmit * @param ReadAddr: Address from where data is to be read * @param BlockSize: SD card data block size, that should be 512 * @param NumberOfBlocks: Number of SD blocks to read * @retval SD statusuint8_t BSP_SD_ReadBlocks(uint32_t* p32Data, uint64_t ReadAddr, uint16_t BlockSize, uint32_t NumberOfBlocks){==============================================Do you have any suggestion to fix it that I can read/write 4G(above) SD card?!I willappreciate your help very much.
Thanks