riscv/bl602: Enable SPI Master in SPI Poll Send #5869
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
SPI Poll Send
bl602_spi_poll_send()
doesn't send any SPI Data because it doesn't enable SPI Master and it doesn't clear the SPI FIFO. Also it hangs because it loops forever waiting for the FIFO.We fix this problem by moving the code that enables SPI Master and clears the FIFO, from SPI Poll Exchange
bl602_spi_poll_exchange()
to SPI Poll Send. (Note that SPI Poll Exchange calls SPI Poll Send)More Details Here
Impact
This problem affects all NuttX Drivers that call
SPI_SEND()
on BL602, including the ST7789 Display Driver.Previously
SPI_SEND()
didn't send any SPI Data and never returns, because it loops forever waiting to receive data.Now
SPI_SEND()
sends data and returns correctly.More Details Here
Testing
We tested the modified SPI Poll Send with NuttX ST7789 Driver and a Logic Analyser on PineCone BL602:
We also tested LVGL with ST7789 on PineCone BL602:
As for the modified SPI Poll Exchange, we tested with Semtech SX1262 SPI Transceiver on PineCone BL602: