How to write multiple file in sd card sdio using fatfs
Hi,
1.I want to save multiple files but only 50 or 55 files savings.
and how to save files next to next file.
I want to fo fill data files up to to 32 GB.
2. how to reuse same memory for multi file creation
int main(void)
{
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
/* MCU Configuration--------------------------------------------------------*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
/* USER CODE BEGIN Init */
/* USER CODE END Init */
/* Configure the system clock */
SystemClock_Config();
/* USER CODE BEGIN SysInit */
/* USER CODE END SysInit */
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_SDIO_SD_Init();
/* USER CODE BEGIN 2 */
#if 1
/*##-1- Link the SD disk I/O driver ########################################*/
static uint8_t buffer[_MAX_SS]; /* a work buffer for the f_mkfs() */
// HAL_GPIO_WritePin(LD2_GPIO_Port, LD2_Pin, GPIO_PIN_SET);
/*##-1- Link the SD disk I/O driver ########################################*/
if(FATFS_LinkDriver(&SD_Driver, SDPath) == 0)
{
/*##-2- Register the file system object to the FatFs module ##############*/
if(f_mount(&SDFatFS, (TCHAR const*)SDPath, 0) != FR_OK)
{
/* FatFs Initialization Error */
Error_Handler();
}
else
{
/*##-3- Create a FAT file system (format) on the logical drive #########*/
if(f_mkfs((TCHAR const*)SDPath, FM_ANY, 0, buffer, sizeof(buffer)) != FR_OK)
{
HAL_GPIO_WritePin(LD3_GPIO_Port, LD3_Pin, GPIO_PIN_SET);
Error_Handler();
}
else
{
for(k=0;k<10000;k++)
{
sprintf(f_name,"Test%u.csv",k);
newFileName(f_name);
//HAL_Delay(200);
}
}
}
}
/*##-11- Unlink the SD disk I/O driver ####################################*/
FATFS_UnLinkDriver(SDPath);
I also changed Stack size and heap size
_Min_Heap_Size = 0x2000; /* required amount of heap */
_Min_Stack_Size = 0x4000; /* required amount of stack */
Please help me.
Thanks
Pankaj
