Hi everybody
I want to launch SD card with STM32f030k ,and I connected the pins like this.
SDcard pin number MCUpin
3(MOSI) A7
4(POWER) 3.3v
5(CLK) A5
6(GND) GND
7(MISO) A6
2(CS) A0
when the program reaches this line (myfres=disk_initialize(0)
.Inter this part.
this function is in the mmc.c
static
void power_on (void)
{
for (Timer1 =3; Timer1; ); /* Wait for 30ms */
}
And stays there.
This is my code:
#include "main.h"
/* USER CODE BEGIN Includes */
#include "stdio.h"
#include "low_level.h"
#include "ff.h"
#include "diskio.h"
/* USER CODE END Includes */
/* USER CODE BEGIN 0 */
FATFS fs;
FIL myfile;
#define sample_no 100
static uint16_t sai_buf[2][sample_no];
/* USER CODE END 0 */
int main(void)
{
/* USER CODE BEGIN 1 */
static FRESULT myfres=1;
uint32_t bt;
/* USER CODE END 1 */
/* USER CODE BEGIN 2 */
myfres=disk_initialize(0);
myfres=f_mount(0, &fs);
myfres=f_open(&myfile, "1.wav",FA_READ);
myfres=f_read(&myfile,&sai_buf[0],sample_no,&bt);
myfres=f_read(&myfile,&sai_buf[1],sample_no,&bt);
/* USER CODE END 2 */
while (1)
{
}
}
this code working for stm32f401 ,but I don't know why it doesn't work for stm32f030k ?