I was able start SPI communication with STM32F4 microcontroller. Saving and loading data is working.
I have two problems:
1) I can’t load the patch. VS1063 stop responding after loading about 300 to 400 words of data. DREQ signal usually goes into and stays low. The system stops responding.
I enclose oscilloscope graph below.

The markings on the chart:
D0 - SCK
D1 - XCS
D2 – SO
D3 – SI
D4 - DREQ
Clock phase: The second clock transition is the first data capture edge.
Record has been tested with different clock frequencies. The result was always the same.
What could be wrong?
2) Which must be the setting for the G.711 and G.722 coding?
I ran the PCM encoder for encoding. It works well.
Using for example G.711coding VS1063 can not keep up. VS1063 encodes about 2 seconds then stops and resumes encoding. As a result, the sound is unreadable.
I enclose the initialisation code for the microcontroller STM32F4:
#define KODER_DEKODER_VS1063_CLOCKF 0x03
#define KODER_DEKODER_VS1063_AICTRL0 0x0C
#define KODER_DEKODER_VS1063_AICTRL1 0x0D
#define KODER_DEKODER_VS1063_AICTRL2 0x0E
#define KODER_DEKODER_VS1063_AICTRL3 0x0F
#define KODER_DEKODER_VS1063_SM_LINE1 0x4000
#define KODER_DEKODER_VS1063_SM_RESET 0x0004
#define KODER_DEKODER_VS1063_SM_ENCODE 0x1000
SPI_VS1063_WriteData(KODER_DEKODER_VS1063_CLOCKF, 0x8BE8);
if (error_SPI == 1 || error_VS1063_BUSY == 1)
return;
SPI_VS1063_WriteData(KODER_DEKODER_VS1063_AICTRL0, 8000U);
if (error_SPI == 1 || error_VS1063_BUSY == 1)
return;
SPI_VS1063_WriteData(KODER_DEKODER_VS1063_AICTRL1, 1024U);
if (error_SPI == 1 || error_VS1063_BUSY == 1)
return;
SPI_VS1063_WriteData(KODER_DEKODER_VS1063_AICTRL3, 0x32); //0x22 G.711 mikro-law, 0x42 G.722 . 0xA PCM
if (error_SPI == 1 || error_VS1063_BUSY == 1)
return;
dane = SPI_VS1063_ReadData(KODER_DEKODER_VS1063_MODE);
if (error_SPI == 1 || error_VS1063_BUSY == 1)
return;
SPI_VS1063_WriteData(KODER_DEKODER_VS1063_MODE, (dane | KODER_DEKODER_VS1063_SM_RESET | KODER_DEKODER_VS1063_SM_ENCODE) & ~KODER_DEKODER_VS1063_SM_LINE1);
if (error_SPI == 1 || error_VS1063_BUSY == 1)
return;
Are all the parameters set correctly?