-
Notifications
You must be signed in to change notification settings - Fork 143
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
[example] Adding SpiFlash FatFs compatibility test #1057
[example] Adding SpiFlash FatFs compatibility test #1057
Conversation
02c3294
to
0f55145
Compare
I am not quite sure what the problem was, but my suggestion is that my local cmake setup did not add the Also, It occured to me that the flipping of the |
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 the super awesome example!!! It's fantastic that this actually works so well! (Sorry that I wasn't helpful here, full-time work keeps me quite busy)
The test I wrote does not catch this mistake because it programs the flash in page size blocks... Sorry for this!
Don't sweat it, I made/make many mistakes too. You're PRs are always very high quality!
0f55145
to
74f9cad
Compare
Thanks for the nice comments! Yeah I am quite happy it was so smoothless. Next step will be to mount the drive and read/write files. I can possibly contribute a rudimentary example of this in a later PR if you wish? |
Sure, that would be great! |
I have experimented with integrating FatFs with the
BdSpiBlockDevice
using fibers as discussed in #893 and #814. The example is for testing the compatibility of the physical drive with FatFs and is adapted from elm-chan. I have tested the example on the STM32G491MET6 on my local setup, but have added the example in the same location as the remaining flash examples.Currently, the example blocks at
disk_read
in the "Single sector write test (unaligned buffer address)". I have tried to debug this issue and have found thatpbuff+3
indr = disk_write(pdrv, pbuff+3, lba, 1);
causes the subsequent call todisk_read
to block insidespiOperation()
and specifically atRF_CALL(Spi::transfer(const_cast<uint8_t*>(tx), rx, length));
. I must admit that I am quite dumbfounded by this bug and do not really know where to start. Do you have any suggestions to why this bug is occring? At this point I am a little bit lost.