Other Parts Discussed in Thread: C2000WARE
Tool/software:
We need to update and program the DSP via SPI via ESP 32.
Firstly, there's a SPI bootloader inbuilt in the DSP , which saves the program into RAM. We first transfer our flash kernel , and once that runs, it saves our actual working program into the flash. The flash kernel is very much like SCI flash kernel example but with SPI, with checksum, and we even added our own delays between SPI byte by byte transfer.
The problem with the bootloader is , as it is inbuilt we cannot add features to it, nor can we debug it step by step. It is also written for SPI EEPROM Flash, and not a microcontroller like the ESP. It is very difficult to match timing of the bootloader to the ESP. The ESP misses the timing and the transfer fails. The only way we have been successful is by loading the entire file buffer into an array and sending it via ESP. If the ESP is even a microsecond late in processing , the transfer fails.
There is also no checksum or any acknolwdgement that lets us know the DSP was programmed successfully.
The flash kernel is about 15-16 kB, if we make a smaller SPI buffer ( eg of 16 bytes ) and keep reloading that, it misses timing.
Another idea was to have the SPI flash kernel be a part of our main program. But if it corrupts we have no way to update it in the field.
Is there a better way to utilise the SPI bootloader? What is the proper way to set it up with an ESP 32 ?