10 years, 8 months ago.  This question has been closed. Reason: No additional info required.

First mbed project: Big Mouth Billy Bass

Hello all,

I am new to mbed. I am trying to put together Steve Ravet's Big Mouth Billy Bass, but my project seems to be floundering. :-)

Import programbilly

The Big Mouth Billy Bass program

I've double and triple checked my wiring and it looks correct (It's pretty simple). I have compiled the code and copied it to the mbed. It seems to load fine since I get the following output from my tty connection:

Hello, world!
                                                    Waiting for button push
                                                                           Button pushed
        No disk, or could not put SD card in to SPI idle state
                                                              Didn't get a response from the disk
                 Set 512-byte block timed out
                                             Unable to open command file '/sd/fish.txt'

It is detecting my button push correctly, but accessing the SD card does not appear to be functioning. My SD card is a 4GB SanDisk Micro SD HC that I formatted as a FAT16 using WinXP. I can put the card in my Mac and play the 4 WAV files off it, so I am sure the file system is ok. Is there something else I should check or could do to test my SD functionality? It is wired exactly per the Notebook and I am also using the SparkFun microSD breakout as listed. I have read that some SD cards are better than others, so if I need to pick up a new one, which brand/model/size is recommended? My samples could be crap since they are just WAV's from the internet, but I don't think I am at that point yet, unless the error reported is very generic. The samples are 22KHz.

I am not sure what is supposed to be contained in the "/sd/fish.txt" file (not that I could access it anyway). My code reading skills are not quite there yet. I assume it will be the motor control commands, but I am not sure of the file format. Is this the movement file alluded to in the BMBB Notebook?

I have 4 wav files on the SD. I assume it will process through each one for every button press, so I am not sure how one movement file can accommodate multiple WAVs, but watching the YouTube video demo, he only presses the button once, so is that performance all one huge WAV file?

The WAV and fish.txt used in the demo would be very helpful, but apparently are not in the files section (probably due to copyright nonsense. I would argue this is fair use!).

A little nudge in the right direction would be appreciated.

-Ken

2 Answers

10 years, 8 months ago.

First of all, in general it is handy to link something if you are using it as basis. Now it was in the related subjects, so found it easily, but for a next time it is handy :).

The problem here is it really cannot access the SD card. Formatting it with for example FAT32 also won't help, since it doesn't arrive at that stage. Some possible ideas:

Quad-check your wiring. Do you have a multimeter? Check if it gets its 3.3V power. You connected the ground pin to mbed ground pin? (Sounds stupid I ask this probably, but it is a quite often made error when there is also for example a battery, that the grounds aren't shorted). CS should also read 3.3V is you measure it. Check the resistance is close to 0 ohm between mbed/SD breakout board.

Try this code: http://mbed.org/cookbook/SD-Card-File-System (with the correct pins for your setup). It is a much newer version of the SDCard library. Since it fails almost directly in your case I doubt it helps, but is worth trying. If it is easy to rewire (for example if you used a breadboard) you can also try reconnecting it using another SPI port. And in general it might then be useful to move your mbed to another position since breadboards sometimes have connection issues.

And of course, simply try another SD card. They are practically free anyway. Maybe you have a spare one yourself. Phones will have micro SD, so you need an adapter for them. But cameras generally will have an SD card.

Accepted Answer

Thank you for the response. I have added the project link. :-)

Wiring check completed. Voltage at Vcc and CS is +3.3v. Resistance between all SD breakout pins and mbed connections is less than 0.5 ohms. SD ground is to the same breadboard ground rail as the mbed. Since I verified all the way to the top of the mbed, I don't think repositioning the mbed on the breadboard will help in this case.

Tomorrow I will try the new SD filesystem you linked and try to scrounge up another SD card somewhere.

posted by Ken Kirchner 02 Aug 2013

I tried both of these:

Import programSDFileSystem_HelloWorld

SD File System Hello World

Import programSDCardTest

and had no luck on my existing 4GB card or a new 4GB card (PNY) that I picked up today. I am going to scrounge around on ebay since nobody carries 2GB or lower micro SD around here.

posted by Ken Kirchner 03 Aug 2013

They should also work fine on SDJC cards (well the top one, the bottom one probably not). Although I also wouldn't know what the issue is if that didn't work.

posted by Erik - 03 Aug 2013

So I was able to pick up three 1GB SD cards from ebay pretty cheap and they all 3 appear to work fine. I am no longer getting the "no response..." error, now I am only getting the "unable to open command file /sd/fish.txt"

Since the sample files appear to no longer be included with the package, I have no idea what the format of this command file should be. I tried to create an empty file called fish.txt in the "/sd/" folder, but that wasnt fooling it.

posted by Ken Kirchner 06 Aug 2013

Quick question, where did you make the fish.txt file? It should be in the root folder of the SD file system. If you made the empty file with the mbed it should be in /sd/, but not if you make it on your PC. The /sd/ part is the libraries way of telling it should be searched on the SD card.

Regarding the required format of the files, it should be possible to in the end find out what he did. But did you try sending him a private message?

posted by Erik - 06 Aug 2013

Thank you Erik! One of my next questions was going to be about the actual root of the file system. Using what you just told me I was able to run the WavePlayer_HelloWorld app with no problem. So now I know everything is wired up correctly, my SD card works, my audio amp works, now it's just futzing with the fish.txt.

No, I have not directly contacted Steve about this. I was hoping I would not have to bug him directly and the community (you) have gotten me this far. :-) I have not seen any account activity for him for the last 7 months, but I will try a private message and update the BMBB project wiki with what I have discovered thus far and anything else he tells me.

posted by Ken Kirchner 06 Aug 2013

Nice to hear :).

I consider it a very healthy habit to first try to work it out yourself, with some help if needed, before contacting the owner. But with what you have now it probably is for him just a matter of sending you a file and you can go further with your project.

posted by Erik - 06 Aug 2013

I did get a response from Steve today. He's kind of tied up at the moment, but he will provide me with the sample files when he gets a chance.

Thanks again for all your help, Erik!

posted by Ken Kirchner 06 Aug 2013
10 years, 5 months ago.

For anyone having issues with the fish.txt file, please see this forum post:

https://mbed.org/questions/1681/Need-some-reverse-engineering-help/