VS1005 board stuck in a loop

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
Henrik
VLSI Staff
Posts: 1200
Joined: Tue 2010-06-22 14:10

Re: VS1005 board stuck in a loop

Post by Henrik » Wed 2021-02-10 10:34

malcolm.slater wrote:
Tue 2021-02-09 22:07
I prommed with your attachment, upgraded Int and Ext to 3.62.
Ok, in this case the OS will always boot from Internal FLASH, because that is first in boot order.

To delete the Internal FLASH installation of VSOS, you can do something akin to our instructions on how to unbrick a VS1005g board:
viewtopic.php?f=13&t=681&p=10574&hilit=unbrick#p6867

Option 1: Program an empty image

1.1) Go to the VSOS Internal Kernel directory, e.g. VSOS_362g_IntFlash
1.2) Replace eeprom_i.img with anything less than 32 KiB in size that is not a VSOS image file. For instance, delete it, then make a text file with the same name containing "Babylon 5 now available in 1080p!", or anything else you'd like.
1.3) Do not rebuild the project as this would rewrite eeprom_i.img.
1.4) Run the Prommer/Flasher Utility to program this "empty" image to the VS1005 Internal FLASH.
1.5) Reboot.
1.6) Profit! (Should now say "External Flash" when booting.)

Option 2: Remove Internal FLASH with jumpers & boot

This is lifted and modified from the message I quoted above:
2.1) If you have the VS1005 Dev. Board Extension (Hi-Res Recorder) daughterboard connected, remove it first.
2.2) Put jumpers to JP15 pin header pairs 1, 2, 3, 5, and 6 (when counting from top to bottom). Don't connect pin header pairs 4 and 7.
2.3) Push and release RESET.
2.4) LEDs XTFT and XE1 should blink quickly for a second, then XE2 and XE1 should blink more slowly.
2.5) Remove jumpers from JP15
2.6) Now try rebooting by pushing and releasing RESET.
2.7) Profit! (Should now say "External Flash" when booting.)

I still have an issue that the drive when attached as a USB is 1MB not 2, I can't seem to do anything to fix that, is it somehow looking at the internal prom not the external when the USB is attached, is there any way to check? I'm pretty sure I've tried everything, deleted partitions, blown away and reset both on mac and windows. When it loads it always says it's using Internal Flash however, no button combination or boot select sets it to external. I need 2MB so I can run the display and classicplayer I think.
You can run those pieces of software even with 1 MiB Internal FLASH, but you'll have to remove some software first, so it's easier to have the larger 2 MiB space of the External FLASH (see above).
MAC has a util to format to FAT12:

https://www.unix.com/man-page/osx/8/newfs_msdos/

Code: Select all

diskutil unmountDisk disk3s1
sudo newfs_msdos -F 12 disk3s1 # make FAT12
If I read that one right (I am not familiar with the Mac's Unix flavour), that command asks to format disk 3's partition 1. Also, from the man page, I didn't see an option to write the file system to the whole disk, ignoring and overwriting any partition information.

On the other hand, Windows refuses to overwrite any partition tables of removable devices. So, if the Mac creates one (as I suppose it does), Windows can do nothing about it.

You can check the existence of a partition table by installing FatInfo.dl3 to your S:SYS/ directory, then running "FatInfo S:".

If you have (an unnecessary) partition table, the output will start like this:

Code: Select all

FOUND PARTITION TABLE
[... etc ...]
If you don't have a partition table, the output will start like this:

Code: Select all

FAT FOUND IN ROOT BLOCK
  FAT32 SECTOR 0:
[... etc ...]
As it seems to me that the Mac creates a partition table, I recommend formatting the drive only on a Windows machine. Or on a Linux machine, or if it is possible to get mkfs.fat installed to your Mac. mkfs.fat takes slightly different arguments than the Mac's newfs_msdos. If it's any help, this is the Linux spell I use to format my drives and get the maximum amount of space available:

Code: Select all

sudo mkfs.fat -a -r 128 -f 1 -h 0 -s 1 -F 12 -I -n VSOSSYS /dev/sdf; sync
Note that /dev/sdf is the whole disk, overwriting any potential partition tables. If there was a partition table, and if I would want not to reuse that space, the device would be /dev/sdf1. By using this command, I get the following performance from Internal FLASH:

Code: Select all

S:>diskfree -v s:
Drv  Used/KiB   Free/KiB  Total/KiB  Use%  Name
S:        844         44        888   95%  SPI Flash c213
... and this from External FLASH:

Code: Select all

S:>diskfree -v s:
Drv  Used/KiB   Free/KiB  Total/KiB  Use%  Name
S:       1844         68       1912   96%  SPI Flash c814
... the relevant figure being under "Total/KiB".

Ok, this become a very long message. Hope it didn't become too confusing!

Kind regards,
- Henrik
Good signatures never die. They just fade away.

malcolm.slater
User
Posts: 7
Joined: Sun 2021-01-24 21:44

Re: VS1005 board stuck in a loop

Post by malcolm.slater » Wed 2021-02-10 14:49

OK thanks Henrick, that's very informative.

I went for 'trash the internal prom' and now get this - it worked!

Code: Select all

Hello.
VSOS 3.62 build Feb 01 2021 10:27:13
VLSI Solution Oy 2012-2020 - www.vlsi.fi
Starting the kernel..
Starting the kernel..
Starting Devices... 
External SPI Flash
Connected as a USB its size approaches 2MB so that looks right.

I copied VSOS_360_RootAndLibrariesSourceCode\root folder to the ext prom via the usb drive.

I can now get the screen menu up and the player, so I'm fully back to where I started :D - although I have learned a lot, and really appreciate the quality of support that has been given.

Now I can start my project, I may have some more questions, I'm sure it's going to take me back to first programming a ZX80 1k computer in machine code in 1980!

Best Regards and thanks for all the help.

Malc

malcolm.slater
User
Posts: 7
Joined: Sun 2021-01-24 21:44

Re: VS1005 board stuck in a loop

Post by malcolm.slater » Thu 2021-02-11 0:48

Hi Henrik

I thought this may be interesting and useful for you.

I have now successfully reset and formatted the ext prom using my Mac.

I thought it may be helpful to share the instructions.

I don't have any partitions and and run classicplayer etc.

S:>fatinfo s:
FAT FOUND IN ROOT BLOCK
FAT32 SECTOR 0:

I found the name of the disk on a Mac is not related to partitions but is the full disk, mine was called disk2s1 but is now disk3, some drives have postfix numbers, it isn't the partition number.

Cheers

Malc


MAC Instructions

Attach the board via the USB cable to the Mac

Reboot holding S1

run DiskUtility to get the <device_name> e.g. disk3 or disk2s1

run Terminal:

you cant check current state of the disk like this:
sudo newfs_msdos -N <device_name>

To reformat the whole disk:
diskutil unmountDisk <device_name> #must unmount before formatting
sudo newfs_msdos -F 12 <device_name> # make FAT12

results may look like:

2MB external prom:
4096 bytes per physical sector
/dev/rdisk3: 473 sectors in 473 FAT12 clusters (4096 bytes/cluster)
bps=4096 spc=1 res=1 nft=2 rde=512 sec=480 mid=0xf0 spf=1 spt=32 hds=16 hid=0 drv=0x00

473 sectors * 4096 bytes = ~2MB

OR

1MB internal prom:
4096 bytes per physical sector
/dev/rdisk3s1: 201 sectors in 201 FAT12 clusters (4096 bytes/cluster)
bps=4096 spc=1 res=1 nft=2 rde=512 sec=208 mid=0xf8 spf=1 spt=32 hds=16 hid=16 drv=0x80

201 sectors * 4096 bytes = ~1MB


Restart the board holding S1

in DiskUtility you should see the drive, you can rename it here
it will show something like:
Capacity 1.9MB
Available 1.9MB
Type:USB External Physical Volume
Device:disk3

Download VSOS_360_RootAndLibrariesSourceCode from the vsdsp forum.

Copy contents of root
NOTE: don't use Finder or you can get duplicate files prefixed with underscores

For example:
if volume is named VS1005EXT
and path is /Users/malcolmslater/Desktop/VSOS_360_RootAndLibrariesSourceCode/root

then use Terminal to run:
cp -r /Users/malcolmslater/Desktop/VSOS_360_RootAndLibrariesSourceCode/root/* /Volumes/VS1005EXT

reboot board and it should all work.

Post Reply