YX5200 (DFPlayer chip) Naked with FLASH SPI NOR - Page 1
Forum section: electronics / general

author: embed4
author_rank: Newbie
timestamp: November 29, 2022, 08:55:19 am
content: Hi.I have a YX5200 naked design with Micro SD and SPI FLASH NOR. The Micro SD works fine. I have an image of of the micro SD (formatted 7Mb partition) on the 64Mbit FL064 FLASH device. The YX5200 reports the FLASH as being present and returns the correct number of files in the root. So I know that the YX5200 SPI comms are working correctly and the file system is valid. The SPI signals all look good on the scope. However the device will not play any track. There is absolutely no activity on the SPI bus on the play track command. I know from above the SPI comms are good, so I am wondering if there are clones of the YX5200 designed for DFPplayer (SD micro) and the SPI interface is bugged?Thanks

author: drvtech
author_rank: Regular Contributor
timestamp: November 29, 2022, 09:06:01 am
content: Can't answer your question directly but I bought a batch of DFPlayer minis on eBay (okay okay...) and they did behave differently from ones bought from Digikey. For me the problem was that there was a significant delay (300-500mS IIRC) from sending a serial 'Play Track n' command to the audio starting. They were easily identifiable by the silkscreen which didn't actually say DFPlayer on them, even though they were sold as such.

author: DavidAlfa
author_rank: Super Contributor
timestamp: November 29, 2022, 09:44:10 am
content: Search is your friend:https://www.eevblog.com/forum/beginners/spi-flash-with-an-mp3-chip/https://www.eevblog.com/forum/microcontrollers/mp3-files-on-spi-flash-for-yx5200-24ss-mp3-chip/

author: embed4
author_rank: Newbie
timestamp: November 29, 2022, 10:01:19 am
content: Thanks -yes seen these and they helped me earlier. However still stuck on the main issue.

author: DavidAlfa
author_rank: Super Contributor
timestamp: November 29, 2022, 10:15:32 am
content: Of course, everything is possible with Chinaland parts.I have a dfplayer somewhere, will check later.

author: DavidAlfa
author_rank: Super Contributor
timestamp: November 29, 2022, 08:07:30 pm
content: Well:- Made a 16MB FAT filesystem in linux, copied some MP3 files.Code:dd if=/dev/zero of=fs.bin bs=1M count=16sudo mkfs.vfat fs.binmkdir fssudo mount fs.bin fssudo cp /some_folder/*.mp3 fs/syncsudo umount fs- Wrote fs.bin into a 25Q128.- Connected as shown in the pictures, even simpler, SDO+SDI connected together without resistor.- Sent Play command: "7Eh FFh 06h 0Dh 00h 00h 00h FEh EEh EFh"- Audio started playing. SPI activity, 12MHz clock, transfers every 25ms.- Queried number of files in flash: "7Eh FFh 06h 49h 00h 00h 00h FEh B2h EFh"Response: "7Eh FFh 06h 49h 00h 00h0AhFEh A8h EFh", 0xA=10 files (Correct)Attached some commands, layout forYAT.Actually it seems there're fakes:https://forum.arduino.cc/t/dfplayer-play-file/468612/11Edit:I remembered the checksum examples to be wrong in the datasheet, so I will save you the struggle.(Well, that's not a even a datasheet, just some loose information packed together.)For custom commands checksum calculation is as follows.For example, Play cmd:Code:Start Ver Len Cmd Ack DH DL sumH sumL Stop7E FF 06 0D 00 00 00 FE EE EFChecksum = 0x0000 - (1+2+3+4+5+6)Checksum = 0x0000 - (0xFF + 0x06 + 0x0D + 0x00 + 0x00 + 0x00) = 0xFEEEsumH = 0xFE, sumL = 0xEE

author: embed4
author_rank: Newbie
timestamp: November 30, 2022, 06:15:24 pm
content: Thanks - worked it out. The play command 0x0D works on the SPI FLASH as found above. However the command I was using CMD_PLAY_MP3_FOLDER 0x12 works on SD micro, but not SPI FLASH despite identical partition images.