Skip to main content
Graduate II
November 29, 2023
Solved

SD card error FR_NOT_ENABLED

  • November 29, 2023
  • 2 replies
  • 1365 views

Hi,

I'm trying to send image data to SD card with OV7670 FIFO cam. For the SD card part, I got FR_NOT_ENABLED error all the time. What do I have to do for the error?

Also the code:

HAL_Delay(200);

FIFO_REN_L();

FIFO_WE_H();

Vsync=0;

ov7670_init();

res = f_mount(0, "path", 0);

if(res != FR_OK)

{

while(1);

}

/* USER CODE END 2 */

/* Infinite loop */

/* USER CODE BEGIN WHILE */

while (1)

{

/* USER CODE END WHILE */

 

/* USER CODE BEGIN 3 */

Camera2LCD();

}

/* USER CODE END 3 */

}

 

void Camera2LCD(void)

{

short count,count2;

short x,y;

char CAM_Data[2];

short CAMdata;

int stopTime,startTime;

uint8_t HorizantalData[CAM_H * 2];

 

if(Vsync == 2)

{

startTime = HAL_GetTick();

res = f_open(&file, "image.bmp", FA_CREATE_ALWAYS | FA_WRITE);

f_write(&file, bmp_header, sizeof(bmp_header), &brw);

 

FIFO_RRST_L();

FIFO_RCLK_L();

FIFO_RCLK_H();

FIFO_RCLK_L();

FIFO_RRST_H();

FIFO_RCLK_H();

 

x=0;

y=0;

for(count2 = 0;count2 < CAM_V; count2++)

{

for( count = 0; count < CAM_H; count++ )

{

FIFO_RCLK_L();

CAM_Data[1] = (GPIOA->IDR); /* GPIO_ReadInputData(GPIOA) */

FIFO_RCLK_H();

FIFO_RCLK_L();

CAM_Data[0] = (GPIOA->IDR); /* GPIO_ReadInputData(GPIOA) */

FIFO_RCLK_H();

CAMdata = (CAM_Data[1]<<8) | (CAM_Data[0]);

HorizantalData[2*count] = CAM_Data[0];

HorizantalData[2*count-1] = CAM_Data[1];

}

f_write(&file, HorizantalData, sizeof(HorizantalData), &brw);

}

f_close(&file);

Vsync = 0;

stopTime = HAL_GetTick() - startTime;

}

}

    This topic has been closed for replies.
    Best answer by Mike_ST

    Hello,

    There are some example of how to use FatFs in the STM32F4 software package which is available here:

    STM32F4 SW Package 

    You can have a look at those projects as example:

    If you're using SDIO I/F:

    STM32Cube_FW_F4_V1.27.1\Projects\STM32F412G-Discovery\Applications\FatFs\FatFs_uSD

    If you're using SPI I/F:

    STM32Cube_FW_F4_V1.27.1\Projects\STM32F412ZG-Nucleo\Applications\FatFs\FatFs_uSD\Src

     

    2 replies

    Mike_STAnswer
    Technical Moderator
    November 29, 2023

    Hello,

    There are some example of how to use FatFs in the STM32F4 software package which is available here:

    STM32F4 SW Package 

    You can have a look at those projects as example:

    If you're using SDIO I/F:

    STM32Cube_FW_F4_V1.27.1\Projects\STM32F412G-Discovery\Applications\FatFs\FatFs_uSD

    If you're using SPI I/F:

    STM32Cube_FW_F4_V1.27.1\Projects\STM32F412ZG-Nucleo\Applications\FatFs\FatFs_uSD\Src

     

    Graduate II
    November 29, 2023

    Thanks  @Mike_ST @AScha.3 

    Super User
    November 29, 2023

    search/read in forum about sd-card problems... nothing new.

    +

    1. mount with parameter 1 ( = now)

    2. if result -> err...  you have no working hardware; look here first.