Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about emmc speed in stm32l4p5g-dk #20

Closed
fito-jaeuklee opened this issue Nov 24, 2020 · 2 comments
Closed

Question about emmc speed in stm32l4p5g-dk #20

fito-jaeuklee opened this issue Nov 24, 2020 · 2 comments
Assignees
Labels
projects Projects-related (demos, applications, examples) issue or pull-request. question Further information is requested

Comments

@fito-jaeuklee
Copy link

fito-jaeuklee commented Nov 24, 2020

Hello!

I'm bought new DK board that name STM32L4P5G-DK for testing Fatfs-eMMC example.
( https://github.com/STMicroelectronics/STM32CubeL4/tree/master/Projects/32L4P5GDISCOVERY/Applications/FatFs/FatFs_eMMC_Standalone )

It works fine, but not the speed I expected.
Almost datasheet saying that eMMC speed is more than 50MB/s. But real speed is 1MB/s in this example .... :(

I would like to know if there are other ways to improve the speed.

i check up this write/read time

for (counter = 0; counter< N_SIZES; counter++)
{
  if(f_open(&MyFile, "TEST_ACCESS_TIME.TXT", FA_CREATE_ALWAYS | FA_WRITE) == FR_OK)
  {

    /* Start timer counter */
    HAL_TIM_Base_Start(&htim);
    /* Write data to the text file */
     res = f_write(&MyFile, copy_start, data_sizes[counter], (void *)&byteswritten);
    /* Stop timer counter */
    HAL_TIM_Base_Stop(&htim);
    Access_time_us = __HAL_TIM_GET_COUNTER(&htim);
    print_spend_time_clock_write = Access_time_us /= SystemClock;
    read_bytes = byteswritten;
    __HAL_TIM_SET_COUNTER(&htim, 0x0);

    if((byteswritten > 0) && (res == FR_OK))
    {
      /* Close the open text file */
      f_close(&MyFile);

      /* Open the text file object with read access */
      if(f_open(&MyFile, "TEST_ACCESS_TIME.TXT", FA_READ) == FR_OK)
      {
        /* Start timer counter */
        HAL_TIM_Base_Start(&htim);
        /* Read data from the text file */
        res = f_read(&MyFile, copy_start, data_sizes[counter], (void *)&bytesread);
        /* Stop timer counter */
        HAL_TIM_Base_Stop(&htim);
        Access_time_us = __HAL_TIM_GET_COUNTER(&htim);
        print_spend_time_clock_read = Access_time_us /= SystemClock;
        read_bytes = byteswritten;
        __HAL_TIM_SET_COUNTER(&htim, 0x0);

        if((bytesread > 0) && (res == FR_OK))
        {
          /* Close the open text file */
          f_close(&MyFile);

          /* Compare read data with the expected data */
          if((bytesread != byteswritten))
          {
            Error_Handler();
          }
        }
      }
    }
  }
@fito-jaeuklee
Copy link
Author

This capture is Stm32l4p5g-dk built-in chip emmc data speed from datasheet.
스크린샷 2020-11-24 오전 9 42 03

@fito-jaeuklee fito-jaeuklee reopened this Nov 24, 2020
@RKOUSTM RKOUSTM self-assigned this Dec 10, 2020
@RKOUSTM RKOUSTM added projects Projects-related (demos, applications, examples) issue or pull-request. question Further information is requested labels Dec 11, 2020
@RKOUSTM
Copy link
Contributor

RKOUSTM commented Dec 11, 2020

Hi @fito-jaeuklee,

Thank you for your contribution. To improve the eMMC speed, you can call BSP_MMC_ConfigSpeedBusOperation () in your application just inside function MMC_initialize() as follows:

DSTATUS MMC_initialize(BYTE lun)
{

    if (MMC_OK == BSP_MMC_DeInit())
    {
      if (MMC_OK == BSP_MMC_Init())
      {
+       BSP_MMC_ConfigSpeedBusOperation(SDMMC_SPEED_MODE_HIGH);
        Stat = MMC_CheckStatus(lun);
      }
    }

   return Stat;
}

Please let us know your feedback so that we can help you.

With regards,

@RKOUSTM RKOUSTM closed this as completed Dec 16, 2020
stm32cube-mcu-fw-dashboard automation moved this from To do to Done Dec 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
projects Projects-related (demos, applications, examples) issue or pull-request. question Further information is requested
Projects
Development

No branches or pull requests

2 participants