-
Notifications
You must be signed in to change notification settings - Fork 3k
Nuvoton: Fix issues with SPI #6466
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
Conversation
…le/disable control
…ronous transfer is on-going (spi_active)
1. Disable unnecessary TX/RX threshold interrupts to avoid potential trap in DMA transfer 2. Start TX/RX DMA transfer simultaneously to fit H/W spec and avoid potential RX FIFO overflow issue
1. Remove dead code 2. Remove space in empty lines 3. Fix compile warnings 4. Fix some comments
* user shall clear the SPIEN (SPIx_CTL[0]) and confirm the SPIENSTS (SPIx_STATUS[15]) is 0 | ||
* (by SPI_DISABLE_SYNC here). | ||
*/ | ||
__STATIC_INLINE void SPI_ENABLE_SYNC(SPI_T *spi_base) |
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.
static inline should do the job here (all compilers)
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.
@0xc0170 Could you give more details?
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.
@0xc0170 I don't know your point. Could you explain it?
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.
static inline
should do the job. I believe this macro comes from CMSIS that is also valid so no biggy
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.
If you want to update your PR , let us know. We shall trigger CI asap
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.
@0xc0170 Yes, __STATIC_INLINE
comes from CMSIS. I won't make change about it. Just trigger CI.
* To fix it, we don't enable SPI TX/RX threshold interrupts but keep SPI vector handler set to be called | ||
* in PDMA TX/RX transfer done interrupt handlers (spi_dma_handler_tx/spi_dma_handler_rx). | ||
*/ | ||
#if 0 |
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.
Can we remove these, we should not leave #if 0 in the code.
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.
* To fix it, we don't enable SPI TX/RX threshold interrupts but keep SPI vector handler set to be called | ||
* in PDMA TX/RX transfer done interrupt handlers (spi_dma_handler_tx/spi_dma_handler_rx). | ||
*/ | ||
#if 0 |
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.
same as previously for #if 0
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.
@0xc0170 Same as above for #if 0
.
/morph build |
Build : SUCCESSBuild number : 1721 Triggering tests/morph test |
Exporter Build : SUCCESSBuild number : 1357 |
Test : SUCCESSBuild number : 1526 |
Description
This PR includes fixes with SPI for Nuvoton targets.
Target
Update
spi_active
).Pull request type
[x] Fix
[ ] Refactor
[ ] New target
[ ] Feature
[ ] Breaking change