Author Topic: YX5200 (DFPlayer chip) Naked with FLASH SPI NOR  (Read 697 times)

0 Members and 1 Guest are viewing this topic.

Offline embed4Topic starter

  • Newbie
  • Posts: 8
  • Country: gb
YX5200 (DFPlayer chip) Naked with FLASH SPI NOR
« on: November 29, 2022, 08:55:19 am »
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

 

Offline drvtech

  • Regular Contributor
  • *
  • Posts: 111
  • Country: gb
Re: YX5200 (DFPlayer chip) Naked with FLASH SPI NOR
« Reply #1 on: November 29, 2022, 09:06:01 am »
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.
 

Offline DavidAlfa

  • Super Contributor
  • ***
  • Posts: 5835
  • Country: es
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline embed4Topic starter

  • Newbie
  • Posts: 8
  • Country: gb
Re: YX5200 (DFPlayer chip) Naked with FLASH SPI NOR
« Reply #3 on: November 29, 2022, 10:01:19 am »
Thanks -yes seen these and they helped me earlier. However still stuck on the main issue.
 

Offline DavidAlfa

  • Super Contributor
  • ***
  • Posts: 5835
  • Country: es
Re: YX5200 (DFPlayer chip) Naked with FLASH SPI NOR
« Reply #4 on: November 29, 2022, 10:15:32 am »
Of course, everything is possible with Chinaland parts.
I have a dfplayer somewhere, will check later.
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline DavidAlfa

  • Super Contributor
  • ***
  • Posts: 5835
  • Country: es
Re: YX5200 (DFPlayer chip) Naked with FLASH SPI NOR
« Reply #5 on: November 29, 2022, 08:07:30 pm »
Well:
- Made a 16MB FAT filesystem in linux, copied some MP3 files.
Code: [Select]
dd if=/dev/zero of=fs.bin bs=1M count=16
sudo mkfs.vfat fs.bin
mkdir fs
sudo mount fs.bin fs
sudo cp /some_folder/*.mp3 fs/
sync
sudo 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 00h 0Ah FEh A8h EFh", 0xA=10 files (Correct)

Attached some commands, layout for YAT.
Actually it seems there're fakes: https://forum.arduino.cc/t/dfplayer-play-file/468612/11

Edit:
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: [Select]
Start[0]  Ver[1]  Len[2]  Cmd[3]  Ack[4]  DH[5]   DL[6]   sumH[7]   sumL[8]   Stop[9]
  7E        FF      06      0D      00      00      00      FE        EE        EF

Checksum = 0x0000 - (1+2+3+4+5+6)
Checksum = 0x0000 - (0xFF + 0x06 + 0x0D + 0x00 + 0x00 + 0x00) = 0xFEEE
sumH = 0xFE, sumL = 0xEE

« Last Edit: October 11, 2023, 09:24:10 pm by DavidAlfa »
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 
The following users thanked this post: embed4

Offline embed4Topic starter

  • Newbie
  • Posts: 8
  • Country: gb
Re: YX5200 (DFPlayer chip) Naked with FLASH SPI NOR
« Reply #6 on: November 30, 2022, 06:15:24 pm »
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.

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf