You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2019/03/01 05:53:22 UTC

[GitHub] wes3 commented on issue #1667: NRF52 HAL: Possible SPI lockup issue if switching between blocking and non-blocking API

wes3 commented on issue #1667: NRF52 HAL: Possible SPI lockup issue if switching between blocking and non-blocking API
URL: https://github.com/apache/mynewt-core/issues/1667#issuecomment-468551699
 
 
   Indeed, calling hal_spi_stop_transfer() in hal_spi_txrx() could lock up the SPI. A fix for that particular issue will be committed shortly. However, there are some other issues which need to be addressed. Both of these issues may cause incorrect SPI bytes to be transmitted if the non-blocking driver is used.
   
   1) The current non-blocking API uses the END_START shortcut if the buffer being transferred is > 255 bytes. This will not work if interrupts are disabled or delayed such that the END event occurs before the interrupt handler has time to update the TXD.PTR and and TXD.MAXCNT registers.  If this happens the peripheral will restart the transfer and incorrect bytes will be transmitted. I do not think it possible to guarantee this and thus I think the driver should be rewritten so that it does not use the END_START shortcut. This is not difficult and really the only drawback is that we will have to take the interrupt latency between spi transfers when doing transfers greater than 255 bytes. Note that this applies to the spi master API only (spi slave currently has a 255 byte transfer limit).
   
   2) Anomaly 109 workaround is not present in our hal. This anomaly has to do with DMA possibly sending out an incorrect first byte. I believe that this anomaly should be handled in the non-blocking SPI interface. There will be a syscfg variable that can be turned on/off in order to compile in/out the workaround for this anomaly. Not sure if the default for this variable should be on or off. I am leaning towards off.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services