-
Notifications
You must be signed in to change notification settings - Fork 22
Nuvoton M480: Some SPI fixes using test shield #467
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
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.
Thanks for this fix on m480 spi These changes are fine, especially on word size, which has been confusing me since before. For other parts resolved, leave them noted at present
Yes I 100% agree with you that API documentation on word size is/was confusing as hell. I have tried my best to fix it up over the last couple years. |
Summary of changes
For this PR, I ran the M480 via the test shield SPI test suite, and found and fixed a number of bugs, most of which were related to word sizes.
spi_master_block_write()
andspi_master_transfer()
would write garbage if passed a word size greater than 1 byte, because the implementation did not realize the length was passed in bytes, not wordsI also added a few new features:
spi_get_peripheral_name()
now implemented. This allows Mbed applications to use multiple SPI objects referencing the same SPI peripheral without glitching the SPI pins.spi_get_capabilities()
now implemented. This is used by the test suite.Unfortunately there are still five issues happening that I wasn't able to fix after a few hours of trying.
spi_master_transfer()
, before the lineNVIC_SetVector(modinit->irq_n, handler);
. But I'm not 100% sure,spi_frequency()
get stuck inSPI_DISABLE_SYNC()
, where the SPI bus would be busy forever, with no apparent reason (no transfer in progress). But I never saw this one outside of debugging the previous issue so not sure if it was something I was doing.Impact of changes
Migration actions required
Documentation
None
Pull request type
Test results
SPI tests pass except for failures discussed above.