cancel
Showing results for 
Search instead for 
Did you mean: 

Bug in \STM32Cube_FW_F1_V1.6.0\STM3210C_EVAL

Evgeni Sosnin
Associate
Posted on July 18, 2017 at 17:04

Hi I have built the project STM32Cube_FW_F1_V1.6.0\Projects\STM3210C_EVAL\Applications\FatFs\FatFs_uSD, but he was off with a bug in FatFs study showed that when the functions

BSP_SD_WriteBlocks uint8_t(uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks, uint32_t Timeout)

BSP_SD_ReadBlocks(uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks, uint32_t Timeout)

STM32Cube_FW_F1_V1.6.0\Drivers\BSP\STM3210C_EVAL\stm3210c_eval_sd.c

there were bugs I've attached the corrected file

I found 1 error when read sector function

static void SPIx_ReadData(const uint8_t *Data, uint16_t DataLength)

error reading 8 bytes, that it was not necessary to fill the buffer with 0xFF

in 

stm3210c_eval.c

/**

* @brief SPI Read Data from device

* @param Data: value to be read

* @param DataLength: length of data

*/

static void SPIx_ReadData(const uint8_t *Data, uint16_t DataLength)

{

 HAL_StatusTypeDef status = HAL_OK;

uint8_t *pData = (uint8_t*)Data;

memset(pData, 0xFF, DataLength);

//todo ????????? ??? ??? ??????? ?????? ?????? ? ???????

// ?????? 8 ???? ???????? ????????

status = HAL_SPI_Receive(&heval_Spi, (uint8_t*) Data, DataLength, SpixTimeout);

if(status != HAL_OK)

{

/* Execute user timeout callback */

SPIx_Error();

}

}

#bug-stm3210c
0 REPLIES 0