Part Number: RM46L852
Hi !
I'm trying to use the slave mode of the SPI controller (multi-buffer mode).
I observed a strange data corruption on the customer board and so I broke it down to a simple test with the LAUNCHPAD-XL2-RM46 development board.
To me, it seems the SPI only works correctly if you don't touch the SPI-RAM during the transfer.
Reading or writing even to an unused TG will lead to data corruption. It is usually observed in the form of
- insertion of one word, often 0x000F or 0x001F
- one missing word
- one word with wrong MSB, the other 15 bits are ok
You will find a demo project attached to this topic.
To test it, you need to connect SPI1 to SPI3 with 4 wires. I tamed down the speed to 11 MHz and added delays between CS and CLK so that you can use normal short arduino-style wires.
According to the manual, there is an arbitration between the CPU-Core and the SPI-Core to this RAM and the SPI-Core has priority so it should never break the transfer when you access the RAM.
For performance reasons, I want to read from a TG0 while a transfer with TG1 is running, if I ever get TG1 to work.
Most of the code is in sys_main.c and I also added a lot of comments to make it as easy and obvious as possible for you guys.
SPI1 is used as master and SPI3 is the slave. TG0 and TG1 are configured absolutely the same, but only TG0 is used for the transfer.
During the transfer, if you access TG1 data, the corruption occurs and most likely the slave will not complete the transfer because one or more words are missing.
If you turn it around and use TG1 for transferring (see MY_TG define), it won't work at all, even with no accesses during the transfer.
Any explanation? I can't find anything in the errata.
Reliable SPI transfers are absolutely crucial for this project. Corrupted data are unacceptable for safety applications.
Best regards,
Manuel
https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/312/8865.spi_5F00_test_5F00_2020_2D00_10_2D00_20.7z