For people in 2019: - Make sure in STM32CubeMX to set USE_LFN to enabled or filenames will be limited to 8 chars! - USBH_Path is renamed to USBHPath (for STM32H7 firmware V1.50 at least, haven't tested for others) - On the NucleoH743ZI, you need to manually set the USB_PowerSwitchOn GPIO pin (PG6) to SET or you won't have USB power Fantastic tutorial and very well explained, thank you good sir for making this
@JerryHoward88
3 жыл бұрын
Great tutorial! After sorting out differences with the clock config, I got it running on my L476 Discovery board.
@vivekkumar-tu7kg
5 жыл бұрын
Great!!!!!!!!!!!!!! thanks a lot for this tutorial its very helpful. Please make a tutorial on firmware update through pendrive.
@MohitKumar-sb7sk
5 жыл бұрын
Thanks for making such a great tutorial on stm32, very helpful and informative videos.
@muhibraza
4 жыл бұрын
Amazing tutorial. Exactly what I was looking for. Thank you so much!
@mutexembedded2206
4 жыл бұрын
Great, enjoy.
@javaddehghan8737
5 жыл бұрын
Perfect Mohammad. Thanks for your great tutorial video
@jagathagurumarimuthu8237
4 жыл бұрын
Very Good.. Thanks Lot for clear information about Text file create and read with organized structure
@vishalchouhan6761
4 жыл бұрын
This is not working, basically i am doing the same what you have said , but in the application APPLICATION READY is not happening so it is stuck in start condtion
@slimtech
2 жыл бұрын
Brilliant tutorial, thank you so much!!!
@ezrakrause9343
4 жыл бұрын
Thanks so much dude! This tutorial is very helpful!
@pusatberk4193
5 жыл бұрын
Wow great things really thank you so much ! I hope your channel will be biggest because deserve that really
@rgorazd
5 жыл бұрын
Hi! Thank you for everything you share with us! Can you make a tutorial involving QSPI FLASH usage? Maybe with a FS. That would be very usfull for logging purposes. Thank you.
@slojanko
4 жыл бұрын
I was following this tutorial but came to a bug in either the STM32CubeIDE which doesn't work the same as CubeMX or something else. Basically the APPLICATION_START case is called constantly, because USBH_UserProcess in usb_host.c fails to update the state. Only when connecting does it receive the id parameter with 4, everytime else its 6 which is HOST USER UNRECOVERED ERROR
@myounghoonshim4672
4 жыл бұрын
Nice tutorial!
@romiolover6852
5 жыл бұрын
excellent video thank you a lot
@omeravci3547
5 жыл бұрын
Can you make a video about how to use the MEMS microphone to record audio to usb and how to play the audio data from usb??
@dipankarpanda8414
4 жыл бұрын
Yes, That Will be a real FUN !!!! @MYaqoobEmbedded kindly make a Demo for this.
@michaelhutterer7084
3 жыл бұрын
I have one question, Is it possible to copy a file from a computer to a USB stick on stm32 ?
@mutexembedded2206
3 жыл бұрын
Yes USB Msc
@johnnyserup5500
3 жыл бұрын
you should close file even if you could not write to it
@miladchalipa2002
5 жыл бұрын
@MYaqoobEmbedded in some devices, there is a feature for update the software and GUI using USB drive by plugging the drive to the USB port and it detects the software automatically and asks for upgrade. how could it be done?
@bora7123
3 жыл бұрын
I am using STM32f767 board. Which pins should I change to make it work for my board? I just need to create txt file in my usb.
@dipankarpanda8414
4 жыл бұрын
Awesome........
@AbdulRehman-gw4bj
3 жыл бұрын
Using Nucleo F429ZI board but my program is not going into switch(Appli_state) case it is skipping switch case completely what could be the reason.
@PrintEngineering
4 жыл бұрын
At 29:45 you add an f_close just before exiting with a successful read. Why didn't you add an f_close in the event of an error for 0 bytes read after f_open was successful? Hypothetically, could this cause an error upon trying to read a second time? Especially if it failed because of a corrupt FS object? (yes I am troubleshooting some issues with code that I inhereted from someone else and I just want to better understand the process).
@mutexembedded2206
4 жыл бұрын
Good point
@yemreikiz
5 жыл бұрын
Hey there, I really like your videos and I learned a lot from them. One question though, when it comes to applying these tutorial methods to actual applications, things start to fail very quickly. One example would be the SDMMC module. The code can do single read and write, but whenever I tried to loop some sequence of r/w's it always returned some hard fault. Is there any chance that you have such a complete example working that you can share with us? Thanks! Quick tip, you might wanna go for a catchy channel name that would help you get more appearance :)
@anshbhatnagar557
3 жыл бұрын
Hi, great tutorial but I have a little confusion I want to ask that stm32 I only complain with USB 2.0 specification if we use a USB with 3.0 USB specification it did not get detected so what your thought on this I have already read the datasheet of stm32 but still what to confirm
@farhadrajaie1501
4 жыл бұрын
Hi dear Mohammad, this is really great work. i tested it and it can read and write .txt files. what should be changed in this codes to read files with other formats, like .hex or .bin. i'll be thankful if you answer me.its very important for me
@pwpolyweld
2 жыл бұрын
Hello How can we create a .pdf file instead of a .txt file. Can you give an idea? Yours truly
@mutexembedded2206
2 жыл бұрын
Hi, I dont know, haven't tried this before. A very interesting one!
@pwpolyweld
2 жыл бұрын
@@mutexembedded2206 Hello For the job of writing a pdf file instead of a txt file i need sample program and library Can you do this program for me with a fee. How much will it cost? respects
@zekisolak4141
4 жыл бұрын
Thanks for this amazing tutorial. I've tested this code on stm32f401RB custom board . I had a strange behaviour. if you can throw some ideas for me: I've got a 32GB Toshiba USB3.0 flash disk and some chinese brand Syrox 16GB Micro SD with a usb To sd card reader. Code successfully writes on SD Card but it gives FR_NO_FILESYSTEM error on Flash disk. I've formatted both SD card and disk FAT32 even tried to divide them in to same size, no matter what, it didn't work for flash disk. Does stm32 have a storage limit above 16GB or my flash disk has some sort of extra features to cause a fault?
@mutexembedded2206
4 жыл бұрын
Right.. I haven't had this before.. have you tried with normal low GB disks?
@furkanozturk8578
4 жыл бұрын
I did whatever you done but everytime red led turns on and ı can not read or write data to usb? What is the problem dou you think?
@nurettinodemis3976
5 жыл бұрын
thanks
@DQMedia
3 жыл бұрын
How fast is the writing and reading in files
@gaetanogallo6436
5 жыл бұрын
Hello! I tried to do this on my STM32F4DISCOVERY board, but I can't create the file on the USB flash drive. Every time I call the USBTest_Write function it return an error (I tried to call the f_open from the main, and it returns an error the same). Someone can give me a reason why?
@mutexembedded2206
5 жыл бұрын
Hi, sometimes CubeMX generated project and Firmware version make slight difference. I might re-do this tutorial with the latest version.
@gaetanogallo6436
5 жыл бұрын
@@mutexembedded2206The f_open function return FR_NOT_ENABLED. Can you just give me some reasons, please? Thank you
@georgetroulis
4 жыл бұрын
@@gaetanogallo6436 Make sure USE_LFN is enabled in the STM32CubeMX config for FatFS. If it is not enabled, then your filenames will be limited to 8 characters.
@silelis1980
4 жыл бұрын
Hello, I have huge problem with this tutorial and or I should better say with USB pen drive initialization. My nucleo board (F411RE as well as F429ZI) newer go in to "APPLICATION_READY" mode. It stocks in "APPLICATION_START" and want go farther. Can You help me with this? What is root cause?? My while(1) routine are like bellow: while (1) { /* USER CODE END WHILE */ MX_USB_HOST_Process(); /* USER CODE BEGIN 3 */ switch (Appli_state) { case APPLICATION_IDLE: break; case APPLICATION_START: HAL_UART_Transmit(&huart2, "USB started ", 13, 200); if (f_mount(&myUsbFatFS, (TCHAR const*)USBHPath, 0) == FR_OK) { HAL_UART_Transmit(&huart2, "FatFS mounted ", 15, 200); } else { HAL_UART_Transmit(&huart2, "FatFS NOT mounted ", 19, 200); } break; case APPLICATION_READY: if (UsbTest_Write()) HAL_UART_Transmit(&huart2, "File written ", 14, 200); else HAL_UART_Transmit(&huart2, "File NOT written ", 18, 200); HAL_Delay(1000); break; case APPLICATION_DISCONNECT: HAL_UART_Transmit(&huart2, "USB disconnected ", 18, 200); break; } } /* USER CODE END 3 */ } And hUsbHostFS value is like on given bellow picture: photos.app.goo.gl/LdFhPjkKpvZUEstF6 PLS help me to find root cause. Is it hw/ sw case or my pendroves?
@mutexembedded2206
4 жыл бұрын
Most common issues: Stack/Heap, pen drive, power pin of USB not active, USB stick.
@silelis1980
4 жыл бұрын
@@mutexembedded2206 Can You expand it (sollutions)?? From my site I can add that: - in F429ZI i have put EN pin of USB LDO to high and powered pendrive - but not working - on F411 there is no USB socket so I made my own module (5V0 is taken directly from nucleo, there is no active VBUS detection) but after I checked pendrive in Windows 10 cmd.exe with command: "chkdsk /X /f G:" it wrote file once and after that I had to use this command (chkdsk /X /f G:) again. Any idea why???
@silelis1980
4 жыл бұрын
I have also noticed that in "build mode" STM32 is writing the file to USB without problems but in debug have problems. ... any idea???
@91beren
3 жыл бұрын
I had the same problem. Solved by checking the HSE input frequency (on my Board is 8 Mhz) in Clock Configuration tool.
@mojtaba.zamani
5 жыл бұрын
Hi MYaqoob Thanks for your fruitful videos a question! how can copy a text file from SD card to USB flash by FATFS?
@mutexembedded2206
5 жыл бұрын
Both need to use FatFS, might need to copy data to temporary space in RAM first to manage Mount/Unmount.
@emreiris114
5 жыл бұрын
U might not realize that you are grow up a generation for embedded software :)
@GurpreetSingh-wo2tz
4 жыл бұрын
Hi Thanks for video.. Can I use FATFS and exFAT File Formats with STM32Cube For microSDCards and USB Mass Storage device? More then 32GB Memory Devices
@GurpreetSingh-wo2tz
4 жыл бұрын
For microSD Card 1-bit Data, Both FATFS and exFAT I have tested and Worked wit STM32Cube_FW_F7_V1.11.0. USB Mass Storage don't tested yet.Actually I have you mount both sdcard and usb msc .
@hazalgodeprovecho
3 жыл бұрын
Hi thanks for the tutorial. Everything works for me, but only with usb EXFAT with usb FAT32 does not work, does anyone else have that problem?
@omerfbingol
5 жыл бұрын
STM32L4 Discovery Board doesn't come with the HSE crystal on, you have to put it on the board yourself.
@bruryuyu
4 жыл бұрын
Hello It's doen't working for me, Appli_state doesn't change state. I using stm32f429I-Dis1. I set PC4 (OTG_FS_PowerSwitchOn) and led5 (green led) turned on. I've try to put a diferents pen drivers and anothers micro usb to usb pls, may you help me?
@bruryuyu
4 жыл бұрын
solved. This board has a kind of bug, vbus=4.0V, so put 5.0V and enjoy ;D
@islamehab2182
4 жыл бұрын
@@bruryuyu could you please explain more because i have the same issue
@sriramretech2003
5 жыл бұрын
sir, please provide USB HS MSC tutorial
@pwpolyweld
2 жыл бұрын
Elektronik Tasarım 8 saat önce @Mutex Embedded - Education Hello For the job of writing a pdf file instead of a txt file i need sample program and library Can you do this program for me with a fee. How much will it cost? respects
Пікірлер: 60