VSOS UART Shell

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.
User avatar
Panu
VLSI Staff
Posts: 2418
Joined: Tue 2010-06-22 13:43

VSOS UART Shell

Post by Panu » Wed 2015-05-20 13:26

  • Note: The UART shell extensions have been included in base VSOS installation since kernel version 3.25 and there is no need to download them separately any more.
Dear developers,

This is an alpha release of UART driver and shell utilites for developers, to facilitate development of UART controllable player software running on VSOS.

We've had some requests for easier controlling of VSOS/VS1005 over UART. And while VSOS has always been designed to allow control using various input methods such as UART, and there have been some examples and VSIDE templates to facilitate this, it has never been explored thoroughly. To make things easier for you and for us who are further developing UART and microcontroller control for VSOS systems and players, here's a package of utility programs and VSOS extensions to run a VSOS shell over UART.
voshell.png
voshell.png (24.37 KiB) Viewed 3023 times
VSOS UART shell

This release contains:
- CONFIG.TXT example file to load the UART STDIN driver and the shell
- SHELL.AP3 toplevel shell, may be renamed to INIT.AP3 for systems with only UART control. It implements the "current directory" paradigm and intercepts calls to fopen() so that they look for files from the current directory also (the kernel fopen only accepts file names with absolute paths). It runs GETCMD to get a command line from STDIN (uart) and runs that command. Then it again runs GETCMD to get the next command.
+ Utility programs and libraries in the SYS folder:
- CD, to change current disk and directory.
- DIR, to list files and folders.
- GETCMD, the interactive command line editor called by SHELL.AP3.
- TYPE, to print contents of (ASCII) files.
- PLAYFILE and PLAYFILES to play music files of many formats.
- ID3PRINT to show ID3 tags (this is work in progress).
- UARTIN, the UART interrupt-controlled stdio driver. Handles FIFO buffer and Ctrl-C.

All source code is included in the solutions folder.

In addition, many of the existing utilities such as LIBLIST and LIBLIST2 work readily under the shell, please feel free to experiment.

Some highlights of the properties of the UART shell:
- interactive command line editing
- previous command can be retrieved with up arrow (vt100 terminal)
- concept of current directory
- buffered, interrupt handled UART stdio driver
- Ctrl-C to notify programs that they should close
- Ctrl-CCC to hard reset VS1005 (press Ctrl-C three times)


In the libvs1005g_vsos3 folder, please find the new header file consolestate.h, place it in your vside\libvs1005g_vsos3 folder.

We're looking forward to hearing about your experiences, problems and ideas for this technology. It's rather fun, really. The idea is that it looks and feels like a normal computer shell, but the output of various programs is formatted so that it would be easy to write microcontroller software that can use the system instead of a human. You can experiment (with HyperTerminal etc) what you can do with the system and then transfer that know-how to your microcontroller programs; to add music playing using different storage mediums such as SD cards or USB memory sticks very easily.

Have fun!
-Panu
Attachments
VSOS_UART_Shell_Extensions_1.0.zip
(555.7 KiB) Downloaded 227 times
Info: Line In and Line Out, VS1000 User interface, Overlay howto, Latest VSIDE, MCU Howto, Youtube
Panu-Kristian Poiksalo, VLSI Solution Oy

User avatar
Panu
VLSI Staff
Posts: 2418
Joined: Tue 2010-06-22 13:43

Re: VSOS UART Shell Extensions 1.0

Post by Panu » Fri 2015-05-22 8:47

Hi!

Here's a couple of updates...

- a new version of getcmd with file name autocompletion with the TAB key. 8-)
- a new version of cd, fixed a bug with cd .. to a subdirectory .

-Panu
Attachments
arch-bugfix-2015-05-22-09-46-cd.zip
(48.02 KiB) Downloaded 165 times
cd.dl3
(7.29 KiB) Downloaded 151 times
arch-autocomplete-2015-05-22-09-45-getcmd.zip
(33.27 KiB) Downloaded 156 times
getcmd.dl3
(5.24 KiB) Downloaded 151 times
Info: Line In and Line Out, VS1000 User interface, Overlay howto, Latest VSIDE, MCU Howto, Youtube
Panu-Kristian Poiksalo, VLSI Solution Oy

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

VSOS UART Shell Extensions 1.10

Post by Henrik » Fri 2015-05-29 14:56

Hello!

Here is an update to the VSOS UART Shell Extensions package.

While most of the shell programs have been slightly enhanced, the biggest changes are:
- There is now a PDF file that shows how to install and use the shell environment
- There is a new UART-controlled audio player program PlayDir which can play audio files in file name order

The UART-controlled player makes it now easy to use VS1005 as an independent slave processor, without needing to know any VS1005 C programming skills.

The shell environment is very much a work in progress, so we'd love to hear your feedback!

Kind regards,
- Henrik
Attachments
VSOS_UART_Shell_Extensions_110.zip
VSOS UART Shell Extensions v1.10
(255.58 KiB) Downloaded 167 times
Good signatures never die. They just fade away.

User avatar
Panu
VLSI Staff
Posts: 2418
Joined: Tue 2010-06-22 13:43

Re: VSOS UART Shell Extensions 1.10

Post by Panu » Fri 2015-05-29 18:51

Henrik,

Thank you for your update to the VSOS UART Shell. Your modifications have made it better.

Here's screenshots of my PuTTY configuration which works well with the shell.

-Panu
Attachments
putty1.png
putty1.png (30.88 KiB) Viewed 2953 times
putty2.png
putty2.png (33.73 KiB) Viewed 2953 times
putty3.png
putty3.png (23.27 KiB) Viewed 2953 times
Info: Line In and Line Out, VS1000 User interface, Overlay howto, Latest VSIDE, MCU Howto, Youtube
Panu-Kristian Poiksalo, VLSI Solution Oy

User avatar
Panu
VLSI Staff
Posts: 2418
Joined: Tue 2010-06-22 13:43

Re: VSOS UART Shell Extensions 1.1

Post by Panu » Mon 2015-06-01 14:41

Here's my TeraTerm setup for using the shell.

-Panu
Attachments
tera1.png
tera1.png (11.77 KiB) Viewed 2923 times
tera2.png
tera2.png (7.91 KiB) Viewed 2923 times
tera3.png
tera3.png (8.91 KiB) Viewed 2923 times
Info: Line In and Line Out, VS1000 User interface, Overlay howto, Latest VSIDE, MCU Howto, Youtube
Panu-Kristian Poiksalo, VLSI Solution Oy

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

Re: VSOS UART Shell Extensions 1.11 + UART Player

Post by Henrik » Mon 2015-06-01 15:42

Hello again!

Here is yet another update to the VSOS UART Shell package.

New features are:
- PlayDir can take new commands, and it has a shuffle mode
- Documentation has been enhanced; among other things Panu's screen shots have been included

When you get around to testing it, we'd love to hear some feedback from you!

Enjoy!
- Henrik
Attachments
VSOS_UART_Shell_Extensions_111.zip
VSOS UART Shell Extensions + UART player v1.11
(329.09 KiB) Downloaded 180 times
Good signatures never die. They just fade away.

User avatar
Mark
Senior User
Posts: 22
Joined: Thu 2015-06-04 5:37

Re: VSOS UART Shell Extensions 1.0

Post by Mark » Thu 2015-06-04 5:40

Hello,

I just received the VS1005 development board and breakout board, and just registered on this site. YOU READ MY MIND! This post is exactly how I am looking to control the VS1005 via another (primary) system controller. Thank you for this post and please continue to enhance this UART control capability.

Mark

User avatar
Panu
VLSI Staff
Posts: 2418
Joined: Tue 2010-06-22 13:43

Re: VSOS UART Shell Extensions 1.0

Post by Panu » Thu 2015-06-04 11:31

Hi, Mark, and welcome to the Forum!

Great that you find this approach useful! We're looking forward to hearing about your experiences and ideas!

-Panu

-PS. The last update contained a version of PlayFiles which was not meant to be released.. until the next release, just use the one from the original 1.0 package.
Info: Line In and Line Out, VS1000 User interface, Overlay howto, Latest VSIDE, MCU Howto, Youtube
Panu-Kristian Poiksalo, VLSI Solution Oy

User avatar
Panu
VLSI Staff
Posts: 2418
Joined: Tue 2010-06-22 13:43

UART control package for Breakout Board

Post by Panu » Thu 2015-06-04 14:25

Hi!

I just did a first test of using the VS1005G Breakout Board with the UART shell. Since there's no SD card connector in the breakout board but there is a USB host (A) connector, it made sense to use an USB memory stick to play files from. There's some rough edges and some version clashes, but basically it's working, as you can see from the picture below:
bob_uart.png
bob_uart.png (53.48 KiB) Viewed 2894 times
Here's what I did:

I took a breakout board which had already been prepared for shipping - these are pre-programmed with VSOS 3.10 at the moment. I connected the VSIDE USB Uart Cable to the RX, TX, VHIGH and GND pins. I connected the USB MODE jumper between P1.7 and P1.9 (IOVDD and GPIO0.0). Then I plugged the UART cable and USB mini cable to the PC. At the PC I started some UART terminal software (PuTTY) to see what's going on in the breakout board.

As the board was preprogrammed with VSOS, the internal flash came up to Windows 7 Explorer. Then I dragged and dropped files from the UART Shell package version 1.10 and USBHOST driver and audio decoders from VSOS 3.22 root image. I edited the CONFIG.TXT to load USBHOST driver instead of the SD card driver. Then I removed the jumper and USB cable, and connected a USB memory stick instead. (Please remember that you must NOT connect both the PC cable and any USB memory stick at the same time because the VS1005 only has ONE USB port.) Then I resetted the breakout board (brutally by short circuiting CVDD with GND, not sure if that's really recommended :oops: ).

The board rebooted and the shell came up to the PuTTY terminal as you can see in the screenshot. I changed to the USB flash with D: and used DIR to see that indeed it was reading files from the USB memory stick. And I could use PLAYFILE and PLAYFILES to play MP3 music from the USB flash. Success.
bob_usb.jpg
bob_usb.jpg (64.06 KiB) Viewed 2894 times
Ok. Basically it's working but it's not perfect yet. The 3.10 kernel is quite old, actually almost too old to even attempt this. But for this simple test it seemed to be good enough to function. So the kernel at least should be updated. It displays some unnecessary messages which mess up the screen sometimes. And the USBHOST driver is also a bit old.

Here's the resulting root image for the breakout board so that you can repeat my test.

Good luck!

-Panu
Attachments
bob-uart-root-1.0.zip
Root image for UART control and MP3 playback from USB memory stick with the VS1005 Breakout Board
(182.91 KiB) Downloaded 164 times
Info: Line In and Line Out, VS1000 User interface, Overlay howto, Latest VSIDE, MCU Howto, Youtube
Panu-Kristian Poiksalo, VLSI Solution Oy

User avatar
Mark
Senior User
Posts: 22
Joined: Thu 2015-06-04 5:37

Re: VSOS UART Shell Extensions 1.0

Post by Mark » Fri 2015-06-05 14:30

Hello,

I have started working with the VSOS_UART_Shell_Extensions_111.zip project. I am having some issues operating this project on the development board, most likely due to my inexperience with the system. I cannot get the system to recognize the inserted SD card (that has the WAV files). I have tried to change the drive letter to D, which is how it was recognized with the as shipped demo. I have included the UART output below. Any guidance would be greatly appreciated.

Thank you - Mark

Hello.
VSOS 3.22 build Mar 26 2015 13:50:25
VLSI Solution Oy 2012-2015 - www.vlsi.fi
Starting the kernel.. Starting Devices...
External SPI Flash
Installed system devices:
S: SPI Flash c814, handled by FAT.
Load drivers, config 0...

Driver: SDSD... E'SDSD' E'noLibF' not loaded

Driver: RUN... FC00,D Y:0xfc00: 0x2000-13 -> 0x0
Driver: RUN... FC00,C Y:0xfc00: 0x0-12 -> 0x0
Driver: UARTIN...
Driver:
S:SHELL.AP3...
VSOS SHELL
S:>

Post Reply

Who is online

Users browsing this forum: Baidu [Spider]