-
-
Notifications
You must be signed in to change notification settings - Fork 318
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
feat(color): Use DMA for SPI flash access #4478
Conversation
@raphaelcoeffic I am not sure why I need to force to use the scratch buffer in your SPI driver for this to work properly. Need your input for this. |
0212a8b
to
d8ada33
Compare
@raphaelcoeffic I figured out that DMA to SDRAM will be failed with FIFO mode, and I have added changes so that the FIFO mode can be selected for DMA configuration, please check if this change good for you.
|
After some testing, this PR will boost the R/W performance of the SPI flash to 3-4 times and free the MCU from a lot of works, it is quite promising. Will do more tests to see if this change can resolve the sound hiccup problem. |
@pfeerick I am doing some extensive tests to see if this PR is stable enough for production. |
c8c3ba0
to
b9a52c8
Compare
I have added the use of block erase to further improve write performance. The change in FrFTL already passes all integrity checks. And seems everything is stable, I tried to copy, overwrite, delete, format in many different sequences and did not found any data corruptions. |
I'll play with it tomorrow then. And hopefully that unnamed french dude will be happy with it also 🤭 |
@pfeerick And you can spot that I have added some handling during erase flash in BL, because the FTL can get corrupted if user did not reboot after erase flash and plugin USB to access the filesystem immediately. |
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.
Yes, indeed... I saw that last change doing SD re-init ;)
Functionally seems to be working just great on PL18EV. Was able to do exactly what you implied... erase and write to the SPI flash without needing to reboot. Copied part of the audio pack onto the SPI flash while main firmware was running... ran at a perfectly reasonable speed. LGTM
@pfeerick @raphaelcoeffic I managed to make FIFO mode works properly as well, and configured to align with SDRAM data width for best performance. |
ccb6c4b
to
1e97478
Compare
I suspected that this issue may related to DMA settings, since it make use of SPI SD card driver and I think the DMA settings is wrong. I changed the settings, and see if it can resolve the problem. |
@pfeerick I have finished some extensive tests with DMA FIFO enabled, seems it is stable in my PL18EV and TX16S, in which these 2 models use different flash chips. 128MB and 32MB. |
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.
Looks good to me, if everyone is ok with it, let's merge. Thx for all the digging into the datasheets :-D
Let me clean up the No sdcard tests commits first. |
1fe1a44
to
2796d06
Compare
Cleaned up, ready for merge. |
Not seeing any issues on a variety of B&W and colorlcd radios, with assortment of SD cards. PL18EV w/ internal SPI flash looking good also. |
does this apply to SD cards as well?! |
SD card access is DMA anyways, this is for SPI attached flash chips, not SD cards |
This may somehow solve the sound hiccup problem.