-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KSDK2 fixes #1817
KSDK2 fixes #1817
Conversation
On repeated starts the flag to indicate this is not being set properly. Because of this the transfer fails. This patch keeps track of the last transfer to determine if a repeated start should be sent and sets the KSDK flags appropriately.
Address passed into the mbed I2C API are expected to be 8 bit and include the read/write flag. KSDK2 expects a 7 bit address without this flag. This patch shifts the address passed into the KSDK by 1 so it is in the correct format.
@mbed-bot: TEST HOST_OSES=windows |
[Build 419] |
@@ -108,7 +108,7 @@ int spi_master_write(spi_t *obj, int value) { | |||
// wait rx buffer full | |||
while (!spi_readable(obj)); | |||
rx_data = DSPI_ReadData(spi_address[obj->instance]); | |||
DSPI_ClearStatusFlags(spi_address[obj->instance], kDSPI_RxFifoDrainRequestFlag); | |||
DSPI_ClearStatusFlags(spi_address[obj->instance], kDSPI_RxFifoDrainRequestFlag | kDSPI_EndOfQueueFlag); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fix should be applied to K22F as well, they share the same peripheral
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, I'll update it
When the function spi_master_write is called a transfer will occur and set the end of queue flag. This disables further SPI transfers which causes the next SPI transfer to hang forever. This patch clears the end of queue flag so SPI does not hang after the first transfer.
LGTM |
Fix SPI and IIC problems introduced with the switch to KSDK2.