STM32 - Keil 5 IDE with CubeMX: Tutorial 41 - SD Card SDIO with FreeRTOS

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 ก.ย. 2024
  • This video tutorial shows how to set up and use SD Card with FreeRTOS environment, using STM32 MCUs. I used the STM32F746 Discovery board in my demo.
    Attachments:
    1. Prep Text file
    2. Main.c
    3. Hex file
    github.com/MYa...

ความคิดเห็น • 82

  • @eduardodelarosaferrer2205
    @eduardodelarosaferrer2205 5 ปีที่แล้ว +1

    You are brilliant. These are the best tutorials on the web

  • @farazkhan9665
    @farazkhan9665 4 ปีที่แล้ว +1

    hello mohammed,
    i have followed this tutorial but its not working in my case when plug out sd card it prints "failed to read" but when i insert card it giving no response. i have used your .hex file and that one worked for me. what i am doing wrong please guide me.

  • @rjgonzalez8108
    @rjgonzalez8108 2 ปีที่แล้ว +1

    I'm an aspiring embedded systems engineer. I've learned a lot from watching your videos. As I'm now transitioning into advanced projects and professional work, I'm curious to know the reasons why you choose to use HAL libraries. I have nothing against them but I'm starting work with developers that prefer to avoid them. Are they/should they be used professionally?

    • @mutexembedded2206
      @mutexembedded2206  2 ปีที่แล้ว +3

      I use HAL libraries in all my projects, yes. I do sometimes avoid them only when necessary.
      But generally speaking, those are provided by MCU manufacturer (ST at this case) to make your life easier.

  • @Engineer_Valat
    @Engineer_Valat 5 ปีที่แล้ว +1

    Where are you man? we missed you,
    i hope you are ok. and thank you for new video.
    JazakALLAH Khayran...

  • @maximbolocan7081
    @maximbolocan7081 2 ปีที่แล้ว

    @Mutex Embedded-Education what to do if it fails at the f-open?

  • @abdullahaksoy159
    @abdullahaksoy159 5 ปีที่แล้ว +2

    thanks for this tutorial.I want to more tutorial about freeRTOS section.Moreover,you can do PID systems become tutorial.I will looking forward to other tutorial.

  • @mahmutbostan6080
    @mahmutbostan6080 5 ปีที่แล้ว +1

    for these courses very very thx bro

  • @hiralchaudhari7448
    @hiralchaudhari7448 4 ปีที่แล้ว

    Is it possible to use SD card without using FreeRTOS ? I have already developed bare-metal based application (also using SysTick) and now I want to save some data in SD card. Is it possible? I am using STM32F777.

  • @MrTimeDigger
    @MrTimeDigger 5 ปีที่แล้ว +1

    Great, Thanks alot for the tutorial.
    Help me alot :)

  • @AmitSharma-bm2qj
    @AmitSharma-bm2qj ปีที่แล้ว

    @Mutex_Embedded I want to interface EMMC with STM32H743VIT6 microcontroller. Could you please help me out .

  • @pusatberk4193
    @pusatberk4193 4 ปีที่แล้ว +1

    Hey where are you Muhammed ? I miss you dude.

    • @mutexembedded2206
      @mutexembedded2206  4 ปีที่แล้ว

      Hi Pusat,
      Sounds like you watched all available videos and looking for more?
      I've been busy with business work. I shall be back sometime soon with more videos.

  • @DAMIRSALAKHOV
    @DAMIRSALAKHOV 4 ปีที่แล้ว

    Hi,
    Thanks for good tutorial.
    I tried to measure speed with good cards.
    Both solutions (this and in tutorial 22) are showing similar results.
    For readings of 10MB needs 7-10 seconds.
    It looks too slow.
    How to increase speed?
    F746 disco, 48MHz SDIO clock.

  • @Graham1904
    @Graham1904 3 ปีที่แล้ว

    I see that you use FreeRTOS. I saw another tutorial by Controllers Tech and they didn't use FreeRTOS. Why is this?

  • @arashhashemi7091
    @arashhashemi7091 4 ปีที่แล้ว

    I use Q-IDE Ver 1.2.1
    And
    Q-MX Ver 5.5
    All of my files are uploaded with the latest version.

  • @giulianogmotter7784
    @giulianogmotter7784 5 ปีที่แล้ว +1

    nice video bro

  • @javib8970
    @javib8970 3 ปีที่แล้ว +1

    You are the best!!
    I am trying to replicate this with an st32f4-discovery and SDIO, but i get
    f_mount() FR_OK
    and then..
    f_open() FR_NO_FILESYSTEM
    :(
    if i look inside f_open() i get the FR_NO_FILESYSTEM at line :
    res = find_volume(&path, &fs, mode);
    if i look inside find_volume() the error comes from:
    if (fmt >= 2) return FR_NO_FILESYSTEM; /* No FAT volume is found */
    The card is formatted in FAT32

    • @mutexembedded2206
      @mutexembedded2206  3 ปีที่แล้ว +1

      Hi Javi,
      Check you MX_FATFS_Init()
      Make sure it is called properly beforehand.

    • @javib8970
      @javib8970 3 ปีที่แล้ว

      @@mutexembedded2206 hi :), what do you mean by properly?
      The autogenerated code in cubemx places it right before my code:
      /* Initialize all configured peripherals */
      MX_GPIO_Init();
      MX_DMA_Init();
      MX_USB_DEVICE_Init();
      MX_SDIO_SD_Init();
      MX_FATFS_Init();
      /* USER CODE BEGIN 2 */
      //5. File Operations
      res=f_mount(&SDFatFS, (TCHAR const*)SDPath, 0);
      HAL_Delay(200);
      //Open file for writing (Create)
      res=f_open(&SDFile, "F7FILE2.TXT", FA_CREATE_ALWAYS | FA_WRITE);

  • @user-qp4gs4ky8h
    @user-qp4gs4ky8h 5 ปีที่แล้ว +4

    Thank you for the perfect tutorial!

  • @piyushdatt4964
    @piyushdatt4964 5 ปีที่แล้ว +1

    I have been trying to integrate the BeaglBone with STM32, but the communication from BeagleBone to STM isn't being made possible can you try a video to implement it with the use of free RTOS, using a CAN communication interface.

  • @mr.sandman4782
    @mr.sandman4782 5 ปีที่แล้ว +1

    I know you made a video on FLASH memory on the CPU itself but could you please make a video on SPI FLASH chips like the W25Qxx series. Thank you very much for your videos man, they really help.

  • @srinivas-8339
    @srinivas-8339 5 ปีที่แล้ว +1

    Thanks for the tutorial...................
    Please make a tutorial on STM32 iot (internet of things)

  • @hamidreza7399
    @hamidreza7399 3 ปีที่แล้ว

    Hi, I did it with cubeide, and everything was ok without any error or warning, but after debugging ,after a few second I unplugged the board and faced with nothing , my uSD was still empty . I dont know why? In addition, my realterm software was showing nothing just black . :(

  • @amartuvshinrenchinochir2471
    @amartuvshinrenchinochir2471 4 ปีที่แล้ว +1

    Thank you man, this tutorial was very helpful for me. I very appreciated that you are doing this. Good luck.

  • @kavorka8855
    @kavorka8855 3 ปีที่แล้ว

    Great. But why people go all the way to redirect printf while one can easily write a new function, such as print_f, if people are so attached to that name? Is it because of the format utilities printf? Who uses format when debugging to a uart?!

  • @abdulkadirmuhendis2272
    @abdulkadirmuhendis2272 4 ปีที่แล้ว +1

    If I may to request a new tutorial about PID control please

  • @kinabord4358
    @kinabord4358 ปีที่แล้ว

    Bravo mr mohamad , that is very good , it is usefule for me
    Thank thank thank you

  • @hamidreza7399
    @hamidreza7399 3 ปีที่แล้ว

    Moreover I debugged it with usb cable and usb-stlink on board

  • @showmanshowri2611
    @showmanshowri2611 4 ปีที่แล้ว +1

    Can anyone help me in figuring out how to add .h files from the SD card on the main STM code?
    Like in main.c file i want #include "example_file_in_SD_card.h"
    Because i have a lot of include files and .c files that are not fitting on the flash so i have to move it to an SD card

    • @oubnetabdelhalim5635
      @oubnetabdelhalim5635 4 ปีที่แล้ว

      *.h and *.c files are meant to be compiled by compiler and linked toguether by linker at design time to produce a binary firmware witch have to be burned in flash memory and then executed by MCU ! Even if you put these files on SD card, MCU can't read, undertand and excute them !!!
      If your your program does't fit on flash memory you have 2 solution:
      1- Change MCU model witch have enough memory !
      2- Put your finale firmware in external memory (flash) if your MCU support that and you have to burn a small bootloader to do that in the flash memory of your MCU.

  • @jafarparhaze5015
    @jafarparhaze5015 5 ปีที่แล้ว +1

    hi mr yaqoob.Thank you for the all videos and advices.

  • @bacem1439
    @bacem1439 3 ปีที่แล้ว

    this for .txt file, what about .jpeg or .mp4 file?

  • @bhushanrane13
    @bhushanrane13 4 ปีที่แล้ว +1

    Thank You for this tutorial.
    Can you please help in operating WS2812B leds using SMT32F3 and STM32F4 HAL drivers?

    • @mutexembedded2206
      @mutexembedded2206  4 ปีที่แล้ว +2

      Hi Bhushan,
      I like that. I will consider programming this.

  • @do7de764
    @do7de764 5 ปีที่แล้ว +1

    Hi Mr Yaqoob I am quiet new to the embedded stm32 environment can you please make a video on how to use encoders with a stm32f446RE nucleo board.
    Thanks

    • @mutexembedded2206
      @mutexembedded2206  5 ปีที่แล้ว

      That's a good one,, Encoder is very miscellaneous with STM32 TIM. I will add it to my list of future tutorials.

  • @b30ig
    @b30ig 4 ปีที่แล้ว +1

    Thanks for this tutorial. How to save large files. I am trying to save an image from SDRAM which is 1280x1024 = 1310720 bytes but it does not work.
    f_write(&myFile,(uint8_t*)(SDRAM_SAVE_ADDR),1310720,&myBytes);

    • @mutexembedded2206
      @mutexembedded2206  4 ปีที่แล้ว +1

      Hi
      Good one, I haven't attempted direct access copy from SRAM to SD. But i have tried using a buffer in stack, say of size 4096.where you copy an increment of 4096 from SRAM to array, then to SD card.
      For direct copy from SRAM to SD, I have double check what constraints there are as far as memory mapping and MPU memory regions are concerned.

    • @b30ig
      @b30ig 4 ปีที่แล้ว

      @@mutexembedded2206 thanks, i will do a test.

  • @phonecontacts133
    @phonecontacts133 4 ปีที่แล้ว +1

    Very nice tutorials. Can we use STM32F3 for this tutorial ? Does STM32F3 support for this tutorial ? Please comment. Thank you.

    • @mutexembedded2206
      @mutexembedded2206  4 ปีที่แล้ว +1

      Yes it does

    • @phonecontacts133
      @phonecontacts133 4 ปีที่แล้ว +1

      @@mutexembedded2206 Thank you very much. It means for this whole playlist of STM32F4 we can replace whith STM32F3, can we ?

  • @FunSpark-Horizon
    @FunSpark-Horizon ปีที่แล้ว

    Hi Yaqoob. Thanks for your good tutorial. I am using a sd card with spi and I connected that sd card to an stm32f103rct7 and I want to test it with RTOS V2. But when I am using version 2, I get an error for semaphone as follows:
    undefined reference to `osSemaphoreCreate' syscall.c Middlewares/Third_Party/FatFs/src/option line 45 C/C++ Problem
    undefined reference to `osSemaphoreWait' syscall.c Middlewares/Third_Party/FatFs/src/option line 84
    I searched everywhere for solution but I got nothing! Do you know how I can solve this issue?

  • @Graham1904
    @Graham1904 3 ปีที่แล้ว

    When you set up FATFS you didn't setup "platform settings" and left the warning symbol on the tab?

  • @azizhussain4767
    @azizhussain4767 2 ปีที่แล้ว

    Thanks .

  • @soccererclassic3721
    @soccererclassic3721 4 ปีที่แล้ว

    Hi MYaqoob, I have a request for you put tutorials on STM32F407VET6 development board...
    And these are really really good tutorials.
    Thank you.

  • @arashhashemi7091
    @arashhashemi7091 4 ปีที่แล้ว

    Hi sir,
    Unfortunately, it doesn't work for me,
    I use Q-MX ver 5.5 with FW, for F7 ver 1.15.
    Your hex file works on my Board, but I couldn't run SD Card 💳 by this tutorial...
    Could you please check, why doesn't it work?
    I think it can be related to DMA.

  • @longnguyenthanh7606
    @longnguyenthanh7606 4 ปีที่แล้ว

    Hi Yaqoob,
    You made a very good tutorial and i learn much from them.
    May you make a example how to use USB in mass storage mode?I am trying to write some file from computer to sd-card (like the card reader) with SDIO but i dont know where to start and google about this matter have very limited information.

  • @daringeagle5745
    @daringeagle5745 5 ปีที่แล้ว

    Hello mMuhammad Yaqoob, very nice. Informative, easy to follow to the point with turbo pace. Could not be better.
    Do you have any plan to have tutorials on Bluetooth classic and BLE? And to have wifi module tutorials with st micros?

  • @rubendiaz6108
    @rubendiaz6108 4 ปีที่แล้ว

    Thanks for the tutorial. could you please help me program the str711 microcontroller. I bought the olimex STR-P711 development board but I don't know how to program it.

  • @arashhashemi7091
    @arashhashemi7091 4 ปีที่แล้ว

    Also, I saw that you put a video which was released by DMA Fault of Q-MX.
    How can I get that text file and that pdf which you have?
    And, finally, as you are more strong about this fault, because you found it, please report this issue to ST company, for debug this problem.
    Best regard.

  • @naasikhendricks1501
    @naasikhendricks1501 5 ปีที่แล้ว +1

    Shukran

  • @salehhabibian9262
    @salehhabibian9262 3 ปีที่แล้ว

    Hello Mohamed. Please check if the project still works with the new version of Cube.
    I tested with version 6.0.1 CubeMx and it did not work.

  • @najiranwar4238
    @najiranwar4238 3 ปีที่แล้ว

    Dear Sir,
    you did unbelievable work, Could you please tell me, is it also possible with eMMC?
    I mean, shall I use this lib for also eMMC?
    Thank you

  • @bhuvaneshs.k638
    @bhuvaneshs.k638 4 ปีที่แล้ว

    We need SDCARD SPI Interface. Can u please explain difference between SPI and SDIO ... I know they r almost the same but I'm not tht clear

  • @khajaminhaj1665
    @khajaminhaj1665 4 ปีที่แล้ว

    Hi MYaqoobEmbedded! Nice tutorials.
    Can u post stm32f4 disc interfacing with wifi and cloud connect?

  • @sergeyyakovenko9224
    @sergeyyakovenko9224 3 ปีที่แล้ว

    with new version of freertos you MUST set correct priorities of IRQ, by default they are 0. But freertos require other interrupts to be from 5 to 15.

  • @kakmal5
    @kakmal5 4 ปีที่แล้ว

    Peace be upon you, can I ask you, what to search or learn. If after I write the data into a file inside SD card and I want to switch the USB communication to view the file the same as we view the file inside the USB.

  • @saadi3245
    @saadi3245 3 ปีที่แล้ว

    Thank you for this detailed explanation. Please also make a tutorial for usb mass storage with freeRTOS.

  • @kayipchan832
    @kayipchan832 3 ปีที่แล้ว

    Thank you so much!!! Ive solved my problem by following ur steps!!!

  • @刘先生-z3v
    @刘先生-z3v 4 ปีที่แล้ว +1

    This tutorial is professional, comprehensible and very helful. Thank you very much!

  • @Gkvhkbt
    @Gkvhkbt 5 ปีที่แล้ว

    Best instructor in STM32! Fast and clean! By the way! Can you show how to use bluetooth with STM32?

  • @kakmal5
    @kakmal5 4 ปีที่แล้ว

    Peace be upon you. I just curious, why you use the UART instead of on board USB?

  • @vivekkumar-tu7kg
    @vivekkumar-tu7kg 5 ปีที่แล้ว +2

    Thanks for the tutorial...................
    Please make a tutorial video on GUI with lcd tft.

  • @vijayprakashvj
    @vijayprakashvj 5 ปีที่แล้ว +1

    Hi Mr. Yaqoob, thanks for uploading all the tutorials, it's helped me lots.
    Currently, I am working on a project where I have to configure STM32 I2C works in slave mode, if you have any sample code please share or make a video
    Thanks again for your awesome work