USB Mass Storage Device doesn't work.

Discussion about writing software for VS1005 and the VSOS Operating System. Also posts about VS1005-related hardware design and device drivers should be posted here.
FelixKunzJr
User
Posts: 11
Joined: Thu 2020-04-02 11:28

USB Mass Storage Device doesn't work.

Post by FelixKunzJr »

Hi,
I just got the PCB i've designed for the VS1005. Naturally i soldered it together and wanted to give it a try.
The first thing i tried is to connect the VS1005 to my computer in order to load libraries to the internal flash. I made sure GPIO0_6 is low, so the Chip should show as Mass storage device.
But when i connect it to the computer the VS1005 shows as Audio device. The audio device works, i can play audio from my computer, and the VS1005 will play it.

I tried to investigate the issue a bit, and discovered that some other pins also don't work. When i pull up the GPIO0_7, the IOVDD should rise to 3.3V. But it doesn't.

Does anyone have an idea why? I'm not sure if the correct Firmware is on the chip.
User avatar
Panu
VSDSP Expert
Posts: 2829
Joined: Tue 2010-06-22 13:43

Re: USB Mass Storage Device doesn't work.

Post by Panu »

Hi!

New PCBs are often tricky to get working in the start... but let's see.

Which VS1005 version do you have? What is printed on the top of the IC?
As you power up the IC, what is printed to the UART0 console? Please connect a terminal to it with 115200 bps baudrate.

-Panu

--
Flashing new or bricked VS1005 board: http://www.vsdsp-forum.com/phpbb/viewto ... f=13&t=681
Important tips and guidelines for VS1005 products: http://www.vsdsp-forum.com/phpbb/viewto ... =13&t=1500
FelixKunzJr
User
Posts: 11
Joined: Thu 2020-04-02 11:28

Re: USB Mass Storage Device doesn't work.

Post by FelixKunzJr »

I have a VS1005G. There is also the number "8171720" and "1902" printed on top.

Sadly i don't get any message on the UART line. This made me suspicious, if the chip is working or not. But it shows up as an USB-Audio device, so it can't be all broken.
User avatar
Panu
VSDSP Expert
Posts: 2829
Joined: Tue 2010-06-22 13:43

Re: USB Mass Storage Device doesn't work.

Post by Panu »

Ok, thank you. Now, if it shows up as USB audio device, that means that it's running ROM code and it has not booted the OS. You must write the VSOS kernel to the flash. Please see the link that I gave you about flashing a new or bricked VS1005 board.

This post in that thread: http://www.vsdsp-forum.com/phpbb/viewto ... =30#p11834 is applicable to your situation. When you have successfully written the internal flash rescue image to the flash, the board should stabilize and you can make more sense of what's going on. The first critical step is to get the VS1005g to boot so that it responds to the programmer and you can write the internal flash rescue image to the flash.

TLDR: If you use PROM9 from http://www.vsdsp-forum.com/phpbb/viewto ... =10#p11097 to breathe life into your board, write Hires-Internal-v0.1.bin from http://www.vsdsp-forum.com/phpbb/viewto ... 831#p11831 to the SPI0 Internal Flash (24-bit address). That Hires-Internal-v0.1.bin just contains the vs1005 boot stabilizing rescue image, which should always be in the first block of the VS1005g internal flash.

Then you can write the VSOS kernel into your board and you can start enjoying life.
FelixKunzJr
User
Posts: 11
Joined: Thu 2020-04-02 11:28

Re: USB Mass Storage Device doesn't work.

Post by FelixKunzJr »

Did it, and it seems like it worked... but now when i want to flash a new kernel i get following error:

Code: Select all

Starting VS1005g internal SPI Flash prommer v2016-11-03...
  Default SPI speed 39.9 Mbit/s
  Serial Flash RDID: manufacturer  0 (C2), type  0 (20), density  0 (14)
Bad RDID, quitting
Failed in 0.71 seconds. Press Close/Cancel on VSIDE.
User avatar
Panu
VSDSP Expert
Posts: 2829
Joined: Tue 2010-06-22 13:43

Re: USB Mass Storage Device doesn't work.

Post by Panu »

This is asked a lot, and it's probably not applicable to your VS1005g version, but do you have FVDD (IOVDD2) connected to IOVDD?
If you connect it now to VSPROM9, how often do you get a good connection, e.g. the board is detected correctly?
When you connect VSPROM9, does it show manufacturer ID, device ID and size of the internal flash?

-Panu
FelixKunzJr
User
Posts: 11
Joined: Thu 2020-04-02 11:28

Re: USB Mass Storage Device doesn't work.

Post by FelixKunzJr »

Yes FVDD is connected to IOVDD.
I have to correct myself, it seems like the VSPROM9 didn't do it's thing. It doesn't even show a flash/memory. Upon further investigation i found out, that my VS1005 doesn't seem to have an internal flash, which i assumed it had.
So i hooked up an 25LC640 Eeprom to the SPI0 (XCS0, MOSI0, MISO0, SCLK0). When i press connect on the Prommer i see movement on the MOSI and SCL lines. The XCS is always low, which is fine i guess. But the eeprom doesn't respond, and therefore the prommer says:

Code: Select all

VS3EMU Connection 0xFE: VS1000, VS1005 or VS1010
Found VS1005G, rev. G0 at COM3
Uploading program vsprom9-vs1005g.bin to on-chip RAM..
Execute loaded binary from address 128
 Board says: VSPROM9 V1, VS1005 READY
This prommer can handle 3 buses
Selected bus: SPI0 External
Trying to detect SPI flash with RDID method 0x9F
Selected bus: SPI0 Internal
Trying to detect SPI flash with RDID method 0x9F
Selected bus: SPI1 Auxiliary
Trying to detect SPI flash with RDID method 0x9F
Ready.

Why doesn't it detect the eeprom?
User avatar
Panu
VSDSP Expert
Posts: 2829
Joined: Tue 2010-06-22 13:43

Re: USB Mass Storage Device doesn't work.

Post by Panu »

Hi!

Ok, things are starting to make more sense step by step. Hmm.. does your IC have VS1005G or VS1005GF marking?
The XCS is always low, which is fine i guess.
You should definitely see proper XCS access cycles when the prommer tries to detect the flash. And pull-up on the XCS line is needed to attempt SPI booting when the VS1005 resets. Can you try to check that you have a good connection of the XCS pin?

You need an external SPI flash with recommended capacity of at least 2 megabytes (16 megabits) to run VSOS. EEPROM programming is not really supported on the VS1005, although it's technically possible. EEPROMs are too small and slow to run any meaningful softare on the VS1005.

You might find a suitable flash memory from here, perhaps:
https://www.digikey.com/products/en/int ... ageSize=25

-Panu
User avatar
Henrik
VLSI Staff
Posts: 1294
Joined: Tue 2010-06-22 14:10

Re: USB Mass Storage Device doesn't work.

Post by Henrik »

Hello!

Ok, let's try another way to see if we can get more information out of your IC.

First, as Panu asked, is your IC marking VS1005G or VS1005GF? VS1005G doesn't have an internal SPI flash, the VS1005GF has it.

If your IC is VS1005GF, let's see if we can get more information out of it.

I have attached two ZIP files to this message. First unzip intflash1005g.zip which contains one file, intflash1005g.bin. Copy this file to your VSIDE installation bin/ folder. Rename first the original intflash1005g.bin so that you can return to it if needed.

Then unzip Program_VSOS357IntFlash_Config0_Image.zip. It contains a VSIDE Solution that attempts to copy a complete VSIDE image to Internal Flash, including the file system and user programs. The instructions (which are also included in a README.TXT file inside the Solution) are as follows:
  1. Connect a the USB/UART converter cable between the PC and the VS1005g board.
  2. Close any terminal emulation program that may use the UART.
  3. Boot the VS1005g board. If running a board with getcmd.dl3 that is from 2020-06-01 or newer, it is ok for the board to go into the Shell, with older versions that will prevent following steps.
  4. Open this project (Program_VSOS357IntFlash_Config0) in VSIDE.
  5. In VSIDE, Select menu Project -> Prommer/Flasher Utility.
  6. Select "VS1005g Internal Flash Prommer".
  7. Let "Select image file to write" be "eeprom.img".
  8. Push Start. If you don't get a connection, try Settings + Autodetect.
  9. eeprom.img is programmed to the internal FLASH memory. This may take a couple of minutes.
  10. After programming, you may reboot the board and close the project.
If everything goes well, the print-out should be like this:

Code: Select all

Starting VS1005g internal SPI Flash prommer v2020-06-01...
  Access to Internal Flash is Enabled
  Default SPI speed 39.9 Mbit/s
  Serial Flash RDID: manufacturer c2 (C2), type 20 (20), density 14 (14)
  Serial Flash REMS: c213 (c213)

Opened map file "eeprom_i.map"
  Programming file "eeprom.img" (0x100000 bytes) to addr 0x000000 (0)
    Erase whole flash... Ok
    Program: ................................................................
    Program: ................................................................
    Program: ................................................................
    Program: ................................................................
  Ok
ok.
Resetting...
Now you may start your terminal progran. When resetting or powering the unit down/up, you should see the following boot messages:

Code: Select all

Hello.
VSOS 3.57 (No Boot Modes) build Jun 01 2020 09:44:51
VLSI Solution Oy 2012-2020 - www.vlsi.fi

Starting the kernel..
Starting Devices... 
Internal Flash

Installed system devices:
S: SPI Flash c213, handled by FAT.
Load drivers, config 0...
Driver: AUODAC... 
Driver: AUIADC...   Input 0x0440  Rate 48000
Driver: UARTIN... 
Driver: SDSDMONO... D: SD/SD Card

Driver: AUXPLAY... 
Driver: RUN... echo -w \nStarting shell.
Starting shell.

Driver: RUN... echo -w \nType VS3EMUC to connect with VSIDE,
Type VS3EMUC to connect with VSIDE,

Driver: RUN... echo -w \nUSBMSC S to show system disk on USB
USBMSC S to show system disk on USB

Driver: S:SHELL.AP3... 
VSOS SHELL
S:>
Note: if you don't have an SD card in your system, you will get an error message from the SD driver. That is not a fatal error.

If this method fails, please give us the whole message log (screen dump or text copy). Particularly the line about access to internal flash is interesting.

Kind regards,
- Henrik
Attachments
intflash1005g.zip
Copy to your VSIDE's bin folder.
(27.86 KiB) Downloaded 210 times
Program_VSOS357IntFlash_Config0_Image.zip
Open this solution in VSIDE and follow the instructions of the README.TXT file.
(380.21 KiB) Downloaded 219 times
Good signatures never die. They just fade away.
FelixKunzJr
User
Posts: 11
Joined: Thu 2020-04-02 11:28

Re: USB Mass Storage Device doesn't work.

Post by FelixKunzJr »

I could solve many problems by now. Indeed, i have a VS1005G without internal flash. This explains a lot. I've added an SST25VF016B SPI flash, and flashed it with the prommer from vside. I now have the Kernel 3.50.
During the Flash prommer process i got a small error about "auto increment", but i think its insignificant.

Starting VS1005g external SPI Flash prommer v2016-08-19...
Default SPI speed 0.5 Mbit/s
Serial Flash RDID: manufacturer bf, type 25, density 41
Serial Flash REMS: bf41

Opened map file "eeprom_e.map"
Set SPI speed to 10.0 Mbit/s
Programming file "eeprom_e.img" (0x00964b bytes) to addr 0x000000 (0)
Erasing: ..........
VERIFY ERROR block 0 (addr 0 - 255)!
Looks like this IC doesn't have working auto-increment.
Retrying with option +b (byte addressing). Writing data
Program: ..........
Ok
ok.
Resetting...



When i start the uart monitor i got messages, so i thought it worked more or less.

Here the startup message:
Hello.
VSOS 3.50 build May 28 2020 14:05:11
VLSI Solution Oy 2012-2017 - www.vlsi.fi

Starting the kernel..
Starting Devices...
External SPI Flash

Installed system devices:
S: SPI Flash bf41.
E'Device not open'

0 driver(s) loaded.

VSOS running with 5 tasks:
Task I/O Stack:0010-020f (512w), free:333
Task Int Stack:0210-024f ( 64w), free:28
Task Net Stack:0250-0251 ( 2w), free:1
Task UI Stack:0252-0253 ( 2w), free:1
Task DECOD Stack:0254-03cf (380w), free:379

Interrupts: INT0_DAC:2->37765 INT13_RX:1->32923 INT15_TI1:1->525 INT16_TI2:1->29307

Load S:INIT.AP3...E'Device not open'

S:INIT.AP3 not found.
Nothing to do.USB publishing disk: SPI Flash bf41.
Size 1.9 MB.
SCSI START
BRST
Then i see the USB Mass storage on my computer. Then i get the message that i should Format the disk. Nothing unexpected. So i tried to format the disk with the usual parameters (1.87MB, FAT, 4096 Bytes) and started the process. After a few seconds i get a windows error which says "Windows was unable to complete the format." In addition i don't even get the uart messages anymore. I think when you format the disk, the kernel gets corrupted.

Any idea why i can't format the disk?
Post Reply