2012-04-20 07:43 AM
Hello,
I am beginner with STM32F4-Discovery. I loaded some examples to flash, all worked, but can't play ''audio.wav'' wave audio file from USB key nor record ''rec.wav'' with ''audio player and recorder example''. Program goes over USBH_Process(&USB_OTG_Core, &USB_Host) in main.c, and cycles here forever, no blue led ligths up, no sound, no switch to recording mode. It seems like something wrong with usb flash connection initialization, because USBH_Process function in usbh_core.c repeats at ''volatile USBH_Status status = USBH_FAIL'' after ''case HOST_ERROR_STATE:''. How I can fix this, or what I did wrong?2013-01-20 11:30 AM
Hi,
Sorry to start this post again but i was also looking at this example and also wanted to play the audio.wav file from the usb stick. But the example fails to play the audio file. I have been debugging the code and it appears that the fatFS code fails to find the file in the USB stick although the file is present. I have tried changing the file name and also the different type of file ''.txt'' but the problem remains. The code flow fails at line 1411 of the ff.c file which is res = dir_find(dj); This function always returns FR_NO_FILE. Kindly anybody else check this example and if they are having different results then do tell me what i am doing wrong here.2013-01-27 08:40 PM
Hi,
Okay I have found out the problem with the example provided by ST. The problem is that it only supports a maximum size of 2GB for USB Key. If the size of USB Key is greater than 2GB the code fails to find the file. How can I remove this limitation ? Regards2013-01-28 07:25 AM
How can I remove this limitation ?
Recode the routines to be block based instead of byte addresses, I had to do this with the SD Card routines. The FAT file system will still have a 2GB file size limit. 32-bit block addressing should give a 2TB limit. USB Mass Storage Controllers use SCSI Command structures which refer to blocks/sectors, typically 512 bytes each. (CD/DVD are 2KB)2013-01-29 01:32 AM
2013-01-29 04:52 AM
I guess I'd start by looking if the issue is one of enumerating the >2GB sticks, or with FatFs
I'd instrument the reads and initialize for FatFs and identify why/how it's failing and work for there. STM32F4-Discovery_FW_v1.1.0\Libraries\STM32_USB_HOST_Library\Class\MSC\src\usbh_msc_fatfs.c Figure up to and including 2GB will use FAT16, >2GB would be FAT32, maybe the issue is with reading the partition table, perhaps you should look to see if f_mount() or f_open() return errors, and if so track them down.2013-01-29 06:03 AM
Hmmm, well I know for once that f_open() was returning an error that file not found. I will track it down again to figure out at which point the function is failing.
2013-01-29 06:14 AM
Also just a bit off topic. I want to read data from an MP3 file in a USB stick. For that I need an mp3 decoder. I have looked at net and I found here:
http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/DATA_BRIEF/DM00024441.pdf that stm has their own mp3 decoder for STM32 family. but i cant seem to be able to find the lib code2013-01-29 06:41 AM
but i cant seem to be able to find the lib code
Likely because you'll have to license it, and sign an NDA, export regs or whatever ST's legal department wants first. For not finding files, make sure you use 8.3 naming if you don't have LFN (Long File Name) support enabled.2014-08-22 12:17 AM
Hi,
I am a beginner in STM32F4 Discovery. I have tried LED blinking, MP3 playback and all with the help of sample Program. I am stuck with bugs when creating own Project for USB_playback_record using the Sample code provided in (STM32F4-Discovery_FW_V1.1.0\Project\Audio_playback_and_record)Firmware. It works fine when i fuse the hex provided in FW, but throws many error when i create my own in ECLIPSE IDE. I have gone through the forums and came to know that the FW is for Atoillic TrueStudio. Is there any version of FW for ECLIPSE IDE??Please put some light on this!!