Hi all!
Here's a nice little VS1010D program for running USB mass storage from the command line or from inside your program.
- Shows VS1010D's SD card or SPI flash to the PC using USB port.
- Does not call reboot.
- System state is not lost during USB operation.
- Uses only 300 words of code memory and 70 words X data memory (also needs one file buffer).
- Can be called from the command line ("UMS D" for SD card, "UMS F" for SPI flash).
- Can be called from user program, (RunLib("UMS","D"); or RunLib("UMS","F");).
- Should safely flush dangling writes.
- Exits if USB cable is disconnected.
- Exits if USB disk is ejected.
- Exits if ESC is received from the UART.
-Panu
User friendly USB mass storage for VS1010D
User friendly USB mass storage for VS1010D
- Attachments
-
- ums.dlx
- USB Mass Storage Device program for VS1010D
- (2.19 KiB) Downloaded 98 times
-
- arch-ums-2019-02-07-13-42-v1.zip
- USB Mass Storage program for VS1010D, Source Code. VSIDE Solution.
- (22.88 KiB) Downloaded 114 times
Info: Line In and Line Out, VS1000 User interface, Overlay howto, Latest VSIDE, MCU Howto, Youtube
Panu-Kristian Poiksalo, VLSI Solution Oy
Panu-Kristian Poiksalo, VLSI Solution Oy
Re: User friendly USB mass storage for VS1010D
Here's another version, optimized for use with SPI flash and software development.
This one checks sdSize to see if SD card is found or not. If not, then it automatically shows the SPI flash in the USB, instead of what parameter the user has given.
One other good feature is that if you send 's' (lower case s) from UART when the mass storage is active, the USB connection is terminated and UART shell is immediately activated. And it also works with VS1010C.
Here's my CONFIG.TXT contents at the moment, in the SPI flash:
This one checks sdSize to see if SD card is found or not. If not, then it automatically shows the SPI flash in the USB, instead of what parameter the user has given.
One other good feature is that if you send 's' (lower case s) from UART when the mass storage is active, the USB connection is terminated and UART shell is immediately activated. And it also works with VS1010C.
Here's my CONFIG.TXT contents at the moment, in the SPI flash:
This way when I boot the board in runlevel 15, the MSC is activated and I can copy new firmware from the PC to the SPI flash (I have no SD card present). Then when I press 's', I get the command prompt and I can run my new firmware from there. Then I say "REBOOT 15" and get the USB disk again, so I can upload new firmware version. And so on.[?]
echo mass storage
ums F
play r:hello.mp3
- Attachments
-
- arch-ums-2019-02-11-15-04-v2-SpiFlash.zip
- UMS Mass Storage, optimized for VS1010C/VS1010D and SPI flash
- (32.41 KiB) Downloaded 96 times
Info: Line In and Line Out, VS1000 User interface, Overlay howto, Latest VSIDE, MCU Howto, Youtube
Panu-Kristian Poiksalo, VLSI Solution Oy
Panu-Kristian Poiksalo, VLSI Solution Oy
Re: User friendly USB mass storage for VS1010D
Hi Panu,
my program uses "reboot" and it works fine.
This version looks very interesting because it gives me the possibility of better control.
USB exits if: USB cable is disconnected /USB disk is ejected / ESC is received from the UART
Q. Can I (or How can I) make a programmed USB exit?
best regards
am
my program uses "reboot" and it works fine.
This version looks very interesting because it gives me the possibility of better control.
USB exits if: USB cable is disconnected /USB disk is ejected / ESC is received from the UART
Q. Can I (or How can I) make a programmed USB exit?
best regards
am
Re: User friendly USB mass storage for VS1010D
Hi,
ok, I've found a solution: "MyUsbHandler".
But... In the include list (UMS c-file) is "vs1010dRom.h included.
I have checked many places in the forum and did not found this header file.
Where can I find "vs1010dRom.h"?
regards
am
ok, I've found a solution: "MyUsbHandler".
But... In the include list (UMS c-file) is "vs1010dRom.h included.
I have checked many places in the forum and did not found this header file.
Where can I find "vs1010dRom.h"?
regards
am
Re: User friendly USB mass storage for VS1010D
Hi!
I placed the updated library files here:
viewtopic.php?f=15&t=2132&p=12557#p12557
Seems like we'll need to release a new VSIDE version soon... in the mean time, please update your libvs1010 contents from the link above.
-Panu
I placed the updated library files here:
viewtopic.php?f=15&t=2132&p=12557#p12557
Seems like we'll need to release a new VSIDE version soon... in the mean time, please update your libvs1010 contents from the link above.
-Panu
Info: Line In and Line Out, VS1000 User interface, Overlay howto, Latest VSIDE, MCU Howto, Youtube
Panu-Kristian Poiksalo, VLSI Solution Oy
Panu-Kristian Poiksalo, VLSI Solution Oy
Re: User friendly USB mass storage for VS1010D
Hi,
I try to compile ums and get message: "Unknown preprocessor control macro"
Any idea to make this "known":).
Library is the new one.
I try to compile ums and get message: "Unknown preprocessor control macro"
Any idea to make this "known":).
Library is the new one.
Build started. Project: ums, configuration: Emulation-Debug
lcc -g -hhw_desc -O6 -fsmall-code -DDEBUG -Iinclude -IC:\Program\ Files\ (x86)\VSIDE\libvs1010 -o Emulation-Debug\main.o E:\Projekte\MP3\VLSI_dat\USB\arch-ums-2019-02-11-15-04-v2-SpiFlash\main.c
C:\Program Files (x86)\VSIDE\libvs1010/usblowlib.h(126) : E:\Projekte\MP3\VLSI_dat\USB\arch-ums-2019-02-11-15-04-v2-SpiFlash\main.c(14) : Unknown preprocessor control macro
C:\Program Files (x86)\VSIDE\libvs1010/usblowlib.h(128) : E:\Projekte\MP3\VLSI_dat\USB\arch-ums-2019-02-11-15-04-v2-SpiFlash\main.c(14) : Unknown preprocessor control endm
C:\Program Files (x86)\VSIDE\libvs1010/usblowlib.h(131) : E:\Projekte\MP3\VLSI_dat\USB\arch-ums-2019-02-11-15-04-v2-SpiFlash\main.c(14) : Unknown preprocessor control macro
C:\Program Files (x86)\VSIDE\libvs1010/usblowlib.h(133) : E:\Projekte\MP3\VLSI_dat\USB\arch-ums-2019-02-11-15-04-v2-SpiFlash\main.c(14) : Unknown preprocessor control endm
C:\Program Files (x86)\VSIDE\libvs1010/usblowlib.h(136) : E:\Projekte\MP3\VLSI_dat\USB\arch-ums-2019-02-11-15-04-v2-SpiFlash\main.c(14) : Unknown preprocessor control macro
C:\Program Files (x86)\VSIDE\libvs1010/usblowlib.h(138) : E:\Projekte\MP3\VLSI_dat\USB\arch-ums-2019-02-11-15-04-v2-SpiFlash\main.c(14) : Unknown preprocessor control endm
optimizing (406): 334 328.328.325.325.325
Successfully compiled 7988 lines (109 in source) with 0 warnings.
C 325 CF 0 X 72 Y 0 F 0
mkabs -f vs1010d_romabs.txt -o Emulation-Debug\vs1010d_romabs.o
mkabs: I have 1 entries to process.
mkabs: writing Emulation-Debug\vs1010d_romabs.o
voplinkg -k -m mem_user -p 2 -t ums vs1010c_romabs.o Emulation-Debug\main.o Emulation-Debug\vs1010d_romabs.o -o Emulation-Debug\ums.coff -L. -Llib -LC:\Program\ Files\ (x86)\VSIDE\libvs1010 -lc
Finished.
Total words: I 325, X 72, Y 0.
copy loadable.ap3 ums.dlx /y
1 Datei(en) kopiert.
Re: User friendly USB mass storage for VS1010D
It's not a problem. Usually it's asm vs c macros in header files, don't worry about it, if it seems to work.
-Panu
-Panu
Info: Line In and Line Out, VS1000 User interface, Overlay howto, Latest VSIDE, MCU Howto, Youtube
Panu-Kristian Poiksalo, VLSI Solution Oy
Panu-Kristian Poiksalo, VLSI Solution Oy