Play RAW from Serial Flash

Status
Not open for further replies.
In this example, the WAV file was already 44100 Hz sample rate. If it had been something else, an additional step in Audacity would have been needed to convert to 44100 Hz. Click the Tracks > Resample menu, and select 44100. This can be done before or after conversion from stereo to mono, but obviously it has to be 44100 Hz before you export to raw format.

If you convert from a higher to lower sample rate, make sure you play it in Audacity (click the green triangle button in the toolbar) to verify the conversion worked properly.
 
void loop() {

//play after some sort of event
//suedo code here

sound1.play(SAMPL);

//testing

}

well, pseudo code isn't very helpful .. but let's assume it's your files; if they're sounding stretched out, that's probably it. if you prefer to use audacity, not sox, it's really as simply as above. of course this assumes your file actually is a) mono and b) the "project rate" is 44100 Hz. the former should be easy enough to ascertain: a stereo file will show two blue wave forms, the left and right channel information. if you have a stereo file, you go to Tracks > Stereo Track to Mono. this will turn a stereo file into mono, just one wave form will remain. the project rate, should it differ, can be adjusted in the left lower corner. then you do File > Export > Other uncompressed files etc. you can check your raw files are ok by clicking File > Import > Raw Data. You should see a mono wave form and when playing, it should sound "normal"; if it does, play_serialflash should sound normal, too. at least it does here.

edit. ups hadn't seen Paul posting ... sorry for the redundancy
 
Thanks for the step by step. That is exactly what I have done the first time. The track appears as one single wav in mono and 44.1.

I will give it a go once again. Will also try the SOX route to see what happens.

Thanks again!
 
I just tried the SOX suggestion as posted earlier. Did not work. Produces the same results.

I am at a loss as to why converting them via Franks tool works, but the others do not.
 
I just got this output when I ran the Raw SerialFlash Hardware Test

Raw SerialFlash Hardware Test

Read Chip Identification:
JEDEC ID: EF 40 18
Part Nummber: W25Q128FV
Memory Size: 16777216 bytes
Block Size: 65536 bytes

Reading Chip...

Writing 7758 signatures
error writing signature at 1085432
Read this: 00 00 00 00 00 00 00 00
Expected: 00 10 8F F8 EA D3 D2 11

Tests Failed :{

The flash chip may be left in an improper state.
You might need to power cycle to return to normal.


Please note, that prior to me posting anything about this, I had successfully loaded RAW audio on to this very same chip and had output with no real issue.

I decided to run the flash test to see if I could find anything wrong. What do you think?
 
I have confirmed that it is NOT the chip. I have flashed the chip once again with a RAW file made from Franks converting application. And it works. But sounds a little dirty.

Also the file size on this one is about half of the other RAWs when converted via SOX or Audacity.
 
I just got this output when I ran the Raw SerialFlash Hardware Test

Raw SerialFlash Hardware Test

Read Chip Identification:
JEDEC ID: EF 40 18
Part Nummber: W25Q128FV
Memory Size: 16777216 bytes
Block Size: 65536 bytes

Reading Chip...

Writing 7758 signatures
error writing signature at 1085432
Read this: 00 00 00 00 00 00 00 00
Expected: 00 10 8F F8 EA D3 D2 11

Tests Failed :{

that'll happen if you used frank's library or have written something to the flash before (see on p. 10); serialflash expects a signature or an empty flash; running EraseEverything.ino should get rid of that error.
 
I tried it just now. Seems to work fine.

Here's what I see when running File > Examples > SerialFlash > EraseEverything

erase.png
(click for full size)

Then when I run File > Examples > SerialFlash > RawHardwareTest

rawtest.png
(click for full size)

Both examples do require a couple lines to be uncommented, if your chip is on the audio adaptor which has SCK on pin 14 and MOSI on pin 7.

Other than that minor detail, I can't understand why it's not working for you. Hopefully these screenshots at least help?
 
Do you have another W25Q128 chip to try?

Honestly I have absolutely no idea why it's not working for you. As you can see in those screenshots, it works when I run it here on a Teensy 3.1 with the audio board and a W25Q128 chip.
 
Could some one please send me a couple of the WAVs they are using that they have converted successfully via SOX or Audacity?

I want to try and convert them on my end and see what happens.

Thank you!
 
Im repeating my previous post in case you all missed it.

"Could some one please send me a couple of the WAVs they are using that they have converted successfully via SOX or Audacity?

I want to try and convert them on my end and see what happens.

Thank you! "


Thanks!
 
Sure, here's a sound I used recently in a project. This absolutely did work, playing from the W25Q128 chip.
 

Attachments

  • 52082_raw.zip
    810.3 KB · Views: 103
  • 52082_wav.zip
    1.6 MB · Views: 109
Hi, I'm having some issues copying raw audio files from the SD card to the SPI flash. When I try to copy, I get this in the serial monitor:

Copy all files from SD Card to SPI Flash

~1.TRA 4096

In addition, I'm having similar issues that @dsparks posted above with the flash chip hardware test. I've ran the EraseEverything sketch which works successfully. What does power cycle mean? Here's what's in the serial monitor:

Raw SerialFlash Hardware Test

Read Chip Identification:
JEDEC ID: 0 0 0
Part Nummber: (unknown chip)
Memory Size: 1048576 bytes
Block Size: 65536 bytes

Reading Chip...
Previous data found at address 0
You must fully erase the chip before this test
found this: 00 00 00 00 00 00 00 00
correct: 00 00 00 00 15 F5 95 4B

Tests Failed :{

The flash chip may be left in an improper state.
You might need to power cycle to return to normal.


I'm trying to upload 9 short audio samples. I ran the SD card hardware test and it was successful. I'm using an 8gb Sandisk Ultra (as per the rec on the audio board page). I'm using files bounced out raw headerless signed 16 bit PCM from Audacity. I've also tried reformatting the card and have wiped everything (flash chip too).
I'm thinking it is a flash problem but am very new to all of this and am not sure how I would go about addressing this issue. Any help would be greatly appreciated!
 
Last edited:
The zeros for the ID and data suggest some sort of hardware error. Which flash chip are you using? Maybe it's not wired up properly?
 
Welp, the flash chip wasn't wired up! I haven't had my coffee yet...

Thanks for the quick response Paul.

Another (newbie) question about flash chips: Are the winbond chips the only ones that are compatible? They are the only ones listed on the audio board page so I figured as much. But I'm trying to buy some more at the moment and need them ASAP, have been browsing by shipping time rather than manufacturer, but don't want to buy the wrong chip! Will any SOIC 8 flash chip work?
 
Last edited:
I must admit it's not quite encouraging post,
but since a few days I'm having trouble with the flash chip too.
I use the flash chip with the audio board.
Both the eraseAll and RawHardwaretest sketches seem to fail.

In both sketches I uncommented:
Code:
SPI.setSCK(14);  // Audio shield has SCK on pin 14
SPI.setMOSI(7);  // Audio shield has MOSI on pin 7

EraseAll test results:

Code:
Flash Memory has 16777216 bytes.
Erasing ALL Flash Memory:
  estimated wait: 40 seconds.
  Yes, full chip erase is SLOW!
Erase completed
  actual wait: 6 seconds.

Suspicious...
After the erase, I ran a RawHardwareTest.
This had the following results

Code:
Raw SerialFlash Hardware Test

Read Chip Identification:
  JEDEC ID:     EF 40 18
  Part Nummber: W25Q128FV
  Memory Size:  16777216 bytes
  Block Size:   65536 bytes

Reading Chip...
  Previous data found at address 0
  You must fully erase the chip before this test
  found this: 44 15 00 00 00 00 06 18 
     correct: 00 00 00 00 15 F5 95 4B 

Tests Failed  :{

The flash chip may be left in an improper state.
You might need to power cycle to return to normal.


My teensy used to work with the audio board and flash chip,
so I assume my flash chip might be broken.


Is anyone else having these issues?
 
Are the winbond chips the only ones that are compatible?

I have personally tested the 7 of the 8 chips listed here, and the W25Q80BV was reported working.

https://github.com/PaulStoffregen/SerialFlash/blob/master/README.md

I've also used the Winbond W25Q64 chip, even though it's not yet on that list.

Will any SOIC 8 flash chip work?

I recently received an email claiming 6 other chips don't work. A followup email said 3 of them actually do, but aren't properly identified by the hardware test. I've ordered all 6 parts and a fresh round of PCBs from OSH Park for more testing. It may be a month or more until those are actually tested. I've got a couple other pretty urgent projects going right now.

Your safest bet would be using one of the 8 chips on the list.
 
I must admit it's not quite encouraging post,
but since a few days I'm having trouble with the flash chip too.
I use the flash chip with the audio board.
Both the eraseAll and RawHardwaretest sketches seem to fail.

In both sketches I uncommented:
Code:
SPI.setSCK(14);  // Audio shield has SCK on pin 14
SPI.setMOSI(7);  // Audio shield has MOSI on pin 7

EraseAll test results:

Code:
Flash Memory has 16777216 bytes.
Erasing ALL Flash Memory:
  estimated wait: 40 seconds.
  Yes, full chip erase is SLOW!
Erase completed
  actual wait: 6 seconds.

Suspicious...
After the erase, I ran a RawHardwareTest.
This had the following results

Code:
Raw SerialFlash Hardware Test

Read Chip Identification:
  JEDEC ID:     EF 40 18
  Part Nummber: W25Q128FV
  Memory Size:  16777216 bytes
  Block Size:   65536 bytes

Reading Chip...
  Previous data found at address 0
  You must fully erase the chip before this test
  found this: 44 15 00 00 00 00 06 18 
     correct: 00 00 00 00 15 F5 95 4B 

Tests Failed  :{

The flash chip may be left in an improper state.
You might need to power cycle to return to normal.


My teensy used to work with the audio board and flash chip,
so I assume my flash chip might be broken.


Is anyone else having these issues?

Do you have additional devices on the spi-bus ?
Was the sd-card inserted ?
 
Hi Frank,

Thanks for your quick reply
It's a good question, I thought of that too.
The SD card was not connected when running the tests.
 
Hm, is this string: "found this: 44 15 00 00 00 00 06 18" the same every time ? Or is it varying ?
And, last question, is the the Audioshield soldered to the teensy, or do you use wires ?
If wires, you could try lower a lower speed (try "CPU Speed 24Mhz") from the menu and shorter connections.
 
I tested it, the string "found this: 44 15 00 00 00 00 06 18" is the same every time I run it.
The audio shield is soldered directly to the teensy.
The flash chip is soldered to the audio shield.
 
I just ran it here.

hwtest.png

This was Teensy 3.1 with the W25Q128 on the audio shield, the first 2 lines uncommented in setup(), and CPU speed at the default 96 MHz.
 
Status
Not open for further replies.
Back
Top