Hi,
I'm working on the communication bus the we implemented between two RM48.
A micro X is master and sends data to micro Y, which is slave, using MibSPI with a layout very similar to the one shown in your application note SPNA231 (High Speed Serial Bus Using the MibSPIP Module on Hercules):
- X use to communicate MibSPI1, Y expect data on MibSPI3, the communication is uni-directional. SOMI is functional but pin is not effectively connected from Y to X (I don't care about data from Y)
- ENA and CS are functional to SPI (like in SPNA231)
- I use on both side the full buffering size (128) (in SPNA231 on slave side the size is different)
- On both side data transfer are managed by DMA: one control packet on X for SRAM>>DMA>>MIBSPI and two control packet on Y for MIBSPI>>DMA>>SRAM (like in SPNA231)
It works well but I'm need to make it more reliable about synchronization: my worry is that X doesn't know if slave have treated the received data. The data are in SRAM thank to DMA but if slave doesn't move DMA destination pointer or move the data, the master could start another transmission overwriting data.
I thought I could use ENA to synchronize even frame transfer. It would work if slave disables its MibSPI transfer group after the transfer. I tried this by manually disabling the group and it works, slave doesn't move ENA and master goes to ENA time out, no data overwrite happens.
Here comes my questions,
- considering that I've set "one shot transfer" in trasfer group configuration, why slave doesn't disable automatically the group after one transfer?
- do you see a better solution to synchronize the communication? As an alternative I've tried with DMACTRL bit "Auto-disable of DMA channel", effectively after the first transfer the transfer mibSPI>>SRAM doesn't happen but slave continues to give its ENA and master side is not notified.
Thanks!!!
PS: To come to a working solution I needed to learn on this forum about undocumented behavior of slave MibSPI (CS encoding, CSHOLD, ...). I pray to update the official TRM to include a section for slave MibSPI, these errata and lacks have been known for years and TRM of RM48 is 4 years old. If only my certification authority knew that my safety critical application is developed leveraging on undocumented features....
PPS: I really want to thank you for the precious and patient assistance you give on this forum
