VS1000 Audio Module Step-by-Step

Writing software that controls the system and peripherals such as displays, SD cards, Buttons, LEDs, Serial Ports etc.
User avatar
pasi
VLSI Staff
Posts: 1510
Joined: Thu 2010-07-15 16:04

VS1000 Audio Module Step-by-Step

Post by pasi » Thu 2011-11-03 18:38

You can get VSIDE from http://www.vlsi.fi/en/support/software/vside.html . Unfortunately we don't yet have a VSIDE template for the vs1000 audio module (Edit: We do now, see below). It is a bit complicated because the audio module software is actually four separate programs that are each loaded from the SPI FLASH as needed. (usbmass, spiplayer, sdplayer, sdmass). But VSIDE contains the command-line versions of the software tools required to recompile the audio module software.

By Hand
The vs1000 audio module source package provides a Makefile, which contains instructions for the make.exe tool. You need some other tools than make.exe as well in your command search path. You can also copy the required .exe files from vside\bin\ to the audio module source directory. Then you can say
> make
and it will create the separate programs, then create boot images from each separately, and then combines the separate boot images into "spiall.spi". This is the image you need to program into the SPI FLASH.

You need at least make.exe, vcc.exe, vsa.exe, vslink.exe, coff2spiboot.exe, and combineimg.exe.

If you get errors when you say "make", the programs are not in your path or in the working directory.

Using VSIDE
In the VSIDE solution you can edit the configuration from system.h, then select Rebuild. The separate programs will be compiled, boot images generated, and a single combined boot image spiall.spi generated from them.

spiall.spi can then be programmed into the module by
  • using UART and vs3emu.exe -- you need a RS232 adapter or USB-UART cable. "make program" will program the new firmware to the module.
  • using pcflash.exe -- you need a RS232 adapter or USB-UART cable, pcflash.exe can be found from http://www.vlsi.fi/en/support/software/vs1000tools.html
  • using uSD card: if the SPI FLASH already contains a previous firmware, copy spiall.spi to the card and rename to FIRMWARE.RAW, then copy SDUPDATE.PRG to the same card. Power up the audio module, insert the card, and in two seconds the firmware should be updated. Then remove the card, and the update software will restart the module with the new firmware.
If you want to program the firmware to vs1000 audio module using UART,
  • you need a RS232 adapter connected to RX/TX/GND/IOVDD of the module and COM1 in your PC
  • pull down xCS to prevent boot from SPI FLASH, then power up the module, then remove the pull-down
  • the actual programming:
    • By Hand: run "make program", which creates spiall.spi, prommer24.bin, connects to module using vs3emu.exe, loads programmer, which programs the boot image
    • With VSIDE: select "Prommer/Flasher Utility" from the Project menu, then select the "VS1000 SPI Flasher (24-bit) (Writes pre-generated EEPROM..)" version.
    • With pcflash.exe: run pcflash.exe with the suitable options like instructed in its documentation.
Other serial ports can be used by giving the correct port in the following vs3emu command.

Code: Select all

vs3emu -chip vs1000 -s 115200 -p 1 -l prommer24.bin -c run.cmd
If you want to update the firmware using uSD card: (and a previous firmware exists)
  • "make" to build spiall.spi and SDUPDATE.PRG
  • copy SDUPDATE.PRG into the uSD card
  • copy spiall.spi into the uSD card, rename it to FIRMWARE.RAW
  • power up the module,
  • insert the uSD card, wait 2 seconds (if you have headphones/speaker connected you'll hear a beep when the programming has finished), remove card
The firmware should now be updated.

You can also update the audio content using uSD card:
  • Create CONTENT.RAW and put it into the uSD card with SDUPDATE.PRG (and optionally FIRMWARE.RAW)
  • power up the module,
  • insert the uSD card, wait for long enough time (if you have headphones/speaker connected you'll hear a beep when the programming has finished), remove card
It may take a long while to program the whole content.

How do I create my own content.raw file with my own .ogg (and/or .wav) files?

WARNING: this does not work well together with USB mass storage because imggen052 does not make FAT12 images! We need to have some workaround for that!
Download imggen052.zip from http://www.vlsi.fi/en/support/software/vs1000tools.html, uncompress and run imggen052.exe. In imggen052.exe select
  • x no boot code
  • x spi flash
  • set nominal size to the correct size (2MB)
  • x force FAT partition to start at : 0
Then double-click ogg vorbis (or .wav) files in the order you want them to play, and press write image file. Save with some descriptive name and copy it with SDUPDATE.PRG into the uSD card, rename as CONTENT.RAW.

Then power up the module, insert uSD card, wait about 100 seconds for full content and remove card. GPIO0_5 is toggled during programming, so you can monitor the progress.


If you use the VSIDE solution, but can not get the programming to work, try this.

Make sure you program the module with the Prommer/Flasher utility "VS1000 SPI Flasher (24-bit) (Writes pre-generated EEPROM images)" . If you don't have this version, you need to add the following entry to VSIDE\bin\prommer.index:

Code: Select all

[vs1000_spi_flash_24bit_preparedimage]
Name                           = "VS1000 SPI Flasher (24-bit) prepared image"
TargetPlatform                 = "VS1000"
Description                    = "This VS1000 prommer can program SPI Flash memory chips with 24-bit address space. Communication is handled via UART cable. Image file has been prepared already by post-build step."
ImageName                      = "eeprom.img"
UseVs3Emu                      = "1"
PrommerBinary                  = "uniprom1k24.bin"
PrommerMemDesc                 = "prommer24.mem"
Then select this new configuration when you program using VSIDE. This prevents the VSIDE from automatically generating the image from the executable of the active project and overwriting the correct combined image file that the post-build step of the project creates.
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook

User avatar
pasi
VLSI Staff
Posts: 1510
Joined: Thu 2010-07-15 16:04

Re: VS1000 Audio Module Step-by-Step

Post by pasi » Fri 2011-12-09 15:58

You can now get VSIDE Solution of the VS1000 Audio Module firmware (UART-controlled version 0.72) from http://www.vlsi.fi/en/support/software/ ... tions.html .
  • Decompress the packet to your solution directory. Copy coff2allboot.exe to VSIDE\bin\ if you haven't already. -- Not needed for the latest VSIDE version
  • (first time only) Edit VSIDE\bin\prommer.index, make a copy of VS1000 SPI Flasher (24-bit) with a different name (pre-generated image), and set ImageCommandLine = "". Use this prommer when programming the module. -- Not needed for the latest VSIDE version
  • Start VSIDE and open VS1000AudioModule.solution.
  • Run Build, spiall.spi will be created (and copied to eeprom.img)
  • Select Prommer/Flasher Utility from the Project menu (ctrl-shift-W) to program the image (remember to power up the module with xCS grounded), select the flasher with "pre-generated image" and run it.
  • Instant success!:-)
If you need more space to SDPlayer for your own code, you can disable USB functionality by just commenting out #define USE_USB from sdplayer.c .
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook

User avatar
MacTuxLin
Senior User
Posts: 21
Joined: Fri 2010-09-10 17:22

Re: VS1000 Audio Module Step-by-Step

Post by MacTuxLin » Sun 2012-04-29 18:54

Hello Pasi,

I've downloaded the VS1000AudioModule v0.5 solution, disabled USB support in SDplayer & enabled WAV using CodMiniWav but having build problem. VSlink has memory allocation problem?

Thanks.

User avatar
pasi
VLSI Staff
Posts: 1510
Joined: Thu 2010-07-15 16:04

Re: VS1000 Audio Module Step-by-Step

Post by pasi » Thu 2012-05-03 19:55

Probably the spiplayer program gets too large, so add #undef USE_WAV to spiplayer.c (after the includes), or add the #define USE_WAV to just sdplayer.c .
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook

User avatar
MacTuxLin
Senior User
Posts: 21
Joined: Fri 2010-09-10 17:22

Re: VS1000 Audio Module Step-by-Step

Post by MacTuxLin » Sat 2012-05-05 11:29

Pardon me but I don't get it. In spiplayer.c, the USE_WAV is already commented out (I don't need spi portion anyway). I'm trying to enable the USE_WAV in sdplayer.c but these messages appeared.

Code: Select all

ERROR: vslink: could not allocate 0:memory for section CodMiniWavDecode (623 words)
ERROR: vslink: relocation failed
C:\Program Files (x86)\VSIDE\bin\make.exe: *** [Emulation-Debug/SDPlayer.coff] Error 10

Build failed!
I have already commented out the USE_USB but still memory is insufficient? :( What I have in sdplayer.c are:

Code: Select all

#define USE_WAV /* Play linear wav files using CodMiniWav from libdev1000. */
#define USE_HC      /* Support SD-HC cards. */
#define PATCH_UNIT_READY /* detects card removed during USB mode */
#define PATCH_SENSE      /* patches REQUEST_SENSE */
May I know if the problem has anything to do with this thread? viewtopic.php?f=9&t=484

User avatar
MacTuxLin
Senior User
Posts: 21
Joined: Fri 2010-09-10 17:22

Re: VS1000 Audio Module Step-by-Step

Post by MacTuxLin » Fri 2012-05-11 3:52

Hello Pasi,

Any advice on this?

Thanks.

IPSOUND
User
Posts: 7
Joined: Sun 2012-01-15 0:20

Re: VS1000 Audio Module Step-by-Step

Post by IPSOUND » Wed 2012-05-23 22:01

Hello Pasi, All,

I am just facing the same problem ...! It would be very nice if you could give us a further hint. Many friens of me awaiting for confirmation of WAV player functionality working. We need it for our model tracks ...!

Is it a big issue to help, please ?

Regards

IPSOUND

User avatar
pasi
VLSI Staff
Posts: 1510
Joined: Thu 2010-07-15 16:04

Re: VS1000 Audio Module Step-by-Step

Post by pasi » Thu 2012-05-24 23:41

Hi, sorry for not having a good solution. The wav decoder seems to be just too large, but it also probably contains many things you are not needing. (But you would need the source to strip unneeded code.)

Could you use raw files with a fixed rate? Then you could just ReadFile() the data (if big-endian) and AudioOutputSamples() it directly.
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook

User avatar
pasi
VLSI Staff
Posts: 1510
Joined: Thu 2010-07-15 16:04

Re: VS1000 Audio Module Step-by-Step

Post by pasi » Fri 2013-03-01 16:04

There is now (or has been for a while) a 0.6 version of the Audio Module software at http://www.vlsi.fi/fi/support/software/ ... tions.html . It has been very much optimized, so you can have a simple wav decoder while retaining the USB mode. Or you can disable both and add more of your own stuff in.

Let us know of your experience with this code.
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook

jcristiano
User
Posts: 2
Joined: Wed 2013-03-06 19:50

Re: VS1000 Audio Module Step-by-Step

Post by jcristiano » Wed 2013-03-06 21:33

Hello,

Where in the VS1000audiomodule060-VSIDE.zip code ( using VSIDE ) can I

1. change the default volume

2. while keeping the continuous playing of sound files, have it
play the files randomly.

One mistake in the readme file. It says to "copy spiall.spi to FIRMWARE.RAW". It should
be "rename spiall.spi to FIRMWARE.RAW".

Thanks,

Jim

Post Reply