The current SPI protocol works pretty well, but it falls short in one key respect: the slave needs to buffer the entire outbound and inbound frames, which means that nominally there is a lot of wasted RAM.
Fragmentation of larger frames (say, >256 bytes) would allow for much smaller buffers to be used, significantly improving SPI memory usage.
I believe this can be implemented with a light-weight fragmentation layer on top of the existing framing protocol. Then this protocol could be easily applied to UART/HDLC-lite connections as well.
Great idea, but please define fragmentation for frames >255 bytes, NOT 256 as often counter register for SPI peripheral is one byte.
Here is a quick straw-man fragmentation protocol (assumes a reliable frame transport under the hood):
FLAG_MORE_FRAG_PEND). All other bits are reserved and set to zero.FLAG_MORE_FRAG_PEND cleared.Alternatively, we could re-purpose one of the bits in the SPI header byte. But then we lose our layered approach (not that big of a deal)
Most helpful comment
Great idea, but please define fragmentation for frames >255 bytes, NOT 256 as often counter register for SPI peripheral is one byte.