Making a factory programming with flshtool is one of its targets. For it a SD card is needed and proper config.txt in there.
This post is on the longer side as I try to cover many scenarios.
The contens of the SD-card are flshtool.dlx and paramspl.dlx in sys directory. Also production test programs should be there.
The procedure of making master image from golden sample is
- Plug in the SD card
- Connect uart cable
- Reset VS1010
- Get control of VS1010
- Copy flash as image to your programming SD card
- Write correct config.txt
- Flash the rest of the devices
Steps 1, 2 and 3 are self explaining.
Step 4 depends on your software.
If there is left some way to exit to shell use it.
If your software runs only on specific runlevel, reboot to another runlevel (Automatic start is done with config.txt)
If you have no other choice get to the command prompt, do the steps like you were unbricking the device (short MISO pull-up resistor, short XCS0 to ground, flshtool -f)
In the case of exiting from SPI flash program to command prompt, it is much likely that the S device is pointing to SPI flash. Use attached copydev tool to change D: (sd card) to point S: device with command "D:sys/copydev.dlx D S"
A sample usage of copydev tool is below. I had D: as S: drive so I copied for demonstration D: to T:
Code: Select all
VS1010>devices
D: SD/SD Card
F: SPI Flash c214
I: STREAM
R: ROMDISK
S: SD/SD Card
VS1010>d:sys/copydev.dlx D T
Copied D to T
VS1010>devices
D: SD/SD Card
F: SPI Flash c214
I: STREAM
R: ROMDISK
S: SD/SD Card
T: SD/SD Card
Step 5
Make filesystem image with "flshtool -u D:fs.img"
Step 6
Next is to write correct config.txt, which would automatically flash your device. The given sample would be perfectly good for VS1010minidemoboard. It would test audio and USB connector.
Below is simple config.txt which makes small test by playing hello.mp3 from ROM. Use your production test programs in here
next it flashes the SPI flash file system area
Last it prints done and reboots VS1010 as flash USB disk
Code: Select all
play r:hello.mp3
flshtool -B D:fs.img
echo done
reboot 4
Step 7
Insert SD card to the new devices, reset, hear "Hello" and see how the filesystem appears to USB.
Remember to have boot.dlx patch for your flash in SD card and also in system SPI flash.
In the rare case you need to have some boot program, use "flshtool -S D:full.img" to generate full SPI flash image which would consist boot program area and filesystem. Then use "flhstool -b full.img" for flashing.
If image has to be updated, insert the SD card to computer (don't use VS1010 as SD card reader) and rename the config.txt and image to something else. Then update the image with instructions on this post.
I attached also production programming SD card contents. The config.txt shown here is provided as template_config.txt Add your tests and rename the template_config.txt to config.txt