In AUTOSAR_MCAL_TMS570LSx-05.30.00,
We are facing issue with SPI Handler/Driver chip select while interfacing external flash driver. Below are the details.
Please check and provide your comments.
Attached is the open point issue list for your reference.
For communication with the external Flash Chip, several SpiChannels need to be transmitted sequentially. The Chip Select must be pulled LOW throughout the entire sequence. Therefore, the CsMode has been configured to CONTINOUS [sic!].
However, when measuring the SPI bus, we can see that the Chip Select Line is released for a short period of time during the transmission:
At first we thought that the Chip Select is released in between the transmitted channels. But actually that’s not the case. In the picture above, the first channel transmits one byte (0x9F) and the second channel transmits four bytes (0xFF). In short, the Chip Select toggle is seen before the last transmitted byte. We tried different scenarios and this seems to be the case always.
From our point of view, the SPI Handler/Driver violates AUTOSAR requirements. According to the Release Notes, the AUTOSAR_MCAL_TMS570LSx-05.30.00 supports AUTOSAR specification version 4.0.3. Within the “Requirements on SPI Handler/Driver” for this AUTOSAR Release, we found the following requirement:
[BSW12033] Chip select mode – hold mode
For an SPI channel assigned to an SPI HW Unit the chip select mode “hold” shall be available:
Selection of the assigned chip select pin before the transfer starts. If the transfer has been finished, the chip select is kept active. The SPI HW is kept allocated.
This seems not to be fulfilled by the driver properly and this deviation from AUTOSAR is also not stated in the Release Notes.
We considered using CS_VIA_GPIO instead of CS_VIA_PERIPHERAL_ENGINE to check if it makes a difference. But according to Texas Instruments, the MCAL does not support CS_VIA_GPIO at all (please refer to Open Point #1 in OPL_TI).
The “Specification of SPI Handler/Driver” states:
[SPI370] ⌈It shall be possible to define if the Chip Select handling is managed autonomously by the HW peripheral, without explicit chip select control by the driver, or the SPI driver shall drive the chip select lines explicitly as DIO […].⌋()