I think I found my answer:
Equalizer doc says:
10 Programming and Running the Standalone Version
1. Read content of X addresses from 0x1800 through 0x18ff (128 16-bit values), using pseudo-code for ReadFilters() presented in Chapter 8.1.3.
Code: Select all
8.1.3 Function ReadFilters() SPI Implementation
// This pseudo-code shows how to read VS10xx's filter
// values through the SPI bus.
// Parameter d must be a pointer to a 128-size vector like below:
// u_int16 data[128];
#define SCI_WRAMADDR 7
#define SCI_WRAM 6
void ReadFilters(u_int16 *d) {
int i;
WriteSci(SCI_WRAMADDR, 0x1800);
for (i=0; i<128; i++) {
d[i] = ReadSci(SCI_WRAM);
}
}
2. Open vs1053b_vs1063a_equ_sa.img with a hex editor or a C program.
Here, a computer is normally used to edit the OTS img file, which is pre-loaded with a flat EQ. Without a computer, we need to store the img file on arduino or eeprom itself, and then edit it as instructed. The img file is 18k (8k compressed).
3. At byte offset 0x10, you will see a two-byte pattern 0x12 0x34 that is repeated 128 times, filling 256 bytes.
4. Copy the data you got earlier to this part of the file. 16-bit numbers are encoded in the big-endian fashion, so number 0xface should be converted to bytes 0xfa 0xce (NOT 0xce 0xfa!).
10.1.3 Standalone Tutorial: Updating Filters to the Image File
You can either drop the resulting vector to the image file with a hex editor to byte offset
0x10, or you can copy the values using the following C code:
Code: Select all
FILE *fp = fopen("vs1053b_vs1063a_equ_sa.img", "r+b");
fseek(fp, 0x10, SEEK_SET);
for (i=0; i<128; i++) {
fputc((filterVector[i]>>8)&0xFF);
fputc((filterVector[i] )&0xFF);
}
fclose(fp);
5. Now you can copy the boot image to the SPI EEPROM / FLASH. If you do this using a VS1053/VS1063 flasher program, remember to pull GPIO0 down before boot with a 10k resistor. This will prevent VS1053/VS1063 from trying to boot from SPI.
See reply below for details on VS1053 flasher program.
6. After programming, pull GPIO0 of VS1053/VS1063 high (e.g. 100k resistor), and reset the IC. Now it will boot from SPI and automatically run the equalizer application with the parameters you set.
Thx