Spliiting SPI flash to firmware and user area

Designing hardware and software for systems that use the VS1010 MP3 Audio DSP Microcontroller.
Post Reply
Hannu
VLSI Staff
Posts: 532
Joined: Mon 2016-05-30 11:54
Location: Finland
Contact:

Spliiting SPI flash to firmware and user area

Post by Hannu »

Dear VS1010 users,

I have written a driver which splits SPI flash to two drives. One for firmware and other which can be published through USB.
It should work but it is only lightly tested. Read the documentation and report bugs if you found them.

Below is how I got it working. I used Linux, but I believe, other OSs can also create FAT filesystems.

USB and UART cable were connected. Then I started the installer.

Code: Select all

VS1010>flshsplt


VS1010D patch SPI split flash write
Publishing FIRMWARE disk to USB
Create a filesystem and copy the spltdrvr.dlx to root of it as boot.dlx
Relocked (3006)
C#0d1d
VS1010D VSOS 4.20
Files:6. Buffers:3.
Runlevel 15
SPIF:c214, 2048K
SD:968 MiB

VS1010D patch SPI split flash write
When the empty flash appeared, I created a filesystem.

Code: Select all

$ lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sdc           8:32   1   448K  0 disk  
$ sudo mkfs.fat -a -r 128 -f 1 -h 0 -s 1 -F 12 -I -n VSOSSYS /dev/sdc;sync
mkfs.fat 3.0.28 (2015-05-16)
$
The published device size is 448k while there is 2M flash assembled to my board.

Then I mounted the disk, copied the spldrvr as a boot.dlx and created sys directory to the disk.

After unmounting I (safely remove device) hit CTRL-C on serial terminal. Notice that the patch is split flash write.

Code: Select all

VS1010>devices
A: User disk
D: SD/SD Card
F: SPI Flash c214
I: STREAM
R: ROMDISK
S: SPI Flash c214
Now there is a new drive A:. Let's create a filsystem to it. Commanding reboot 4 publishes the user area, so that boot mode pins can be also uised to do that.

Code: Select all

$ lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sdc           8:32   1     1M  0 disk  
$ sudo mkfs.fat -a -r 128 -f 1 -h 0 -s 1 -F 12 -I -n USERDATA /dev/sdc;sync
mkfs.fat 3.0.28 (2015-05-16)
$ 
Notice that now the disk size is 1M.

Code: Select all

VS1010>reboot 4
C#0d1d at runlevel 4
VS1010D VSOS 4.20
Files:6. Buffers:3.
Runlevel 4
SPIF:c214, 2048K
SD:968 MiB

VS1010D patch SPI split flash write
Relocked (3006)
C#0d1d
VS1010D VSOS 4.20
Files:6. Buffers:3.
Runlevel 15
SPIF:c214, 2048K
SD:968 MiB

VS1010D patch SPI split flash write
I also created some very important content to user data area.

Code: Select all

VS1010>dir a:
File list of User disk a:*
     1: hello.txt
 1 file(s) found.

VS1010>type a:*.txt
Hello World!
Attachments
flshsplt-2023-09-01.zip
Splitting SPI flash driver
(27.97 KiB) Downloaded 62 times
README.txt
Documentation for flshsplt
(1.85 KiB) Downloaded 56 times
Post Reply