-
Notifications
You must be signed in to change notification settings - Fork 217
QSPI overhaul and QSPI ClockV2 #926
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
base: feat/clock-v2
Are you sure you want to change the base?
Conversation
|
@rnd-ash I don't know much about the QSPI, but evidently it has two AHB clock buses, |
|
@kyp44 I had a talk with @bradleyharden about this in Matrix. It seems that 2x AHB clock is only used for DDR mode QSPI. So I added a comment to the QSPI peripheral saying for now DDR is not supported. As the AHB clock system will need to be rewritten to allow the QSPI module to enable/disable the 2x clock at will. We never supported DDR in the first place with the QSPI module, so we are not loosing any functionality we had before with this PR. |
|
@rnd-ash Gotcha, it's fine to not offer DDR support at this point. I just wanted the rationale to be documented here. |
|
@kyp44 A thought, I don't have a pygamer. Could you test the QSPI example on it as I know you have one? - I verified this PR works on my own custom board, but that has a different QSPI chip. Once done, should we merge this to our V2 branch since it doesn't break anything? |
…s#958) The circuit-playground-express uses these pads as the Sda/Scl pads.
* chore: release * Minor version bump for all T1 boards --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Justin Beaurivage <[email protected]>
* chore(circuit_playground_express): release v0.12.0 --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Justin Beaurivage <[email protected]>
|
@rnd-ash Sorry for the delayed response, but I was finally able to test this. The first assertion fails, where left side I also noticed that the |
|
@kyp44 no problem. I have updated the code, it should work now, and hopefully removed the warnings in the pygamer example. The issue was simply down to the QSPI peripheral being clocked too fast. I've now updated the documentation and builder function to prevent someone seeing a QSPI freq of > 0.5x CPU freq |
|
Ok, so I tested again and at the same assert I no longer get all zeros but it still fails with the left side being I went back and ran the same test with the current I dug into this a bit. The command being sent to get the JEDEC IDs is So it's unclear what exactly is going on here or why the two builds produce differerent orders. Any ideas here? Lastly, if I comment out this JEDEC ID assertaion, the rest of the example executes to completion without an issue in the release build, but somehow is getting stuck in an infinite loop in the debug build. I've seen strange differences between the two builds for other programs in the past, and it's always disconcerting. |
|
Thanks for finding all this out! I'll do some more testing tomorrow then. I currently have this QSPI branch working such that I can share a fat32 FS over USB to the QSPI chip, so I know read and write and erase work perfectly. The Chip ID check I think we should remove from this example completely. As it would cause a panic if the pygamer ever came with a different branch of QSPI chip, or if someone replaces the chip. It seems like an unnecessary reason to panic. Maybe we can just print it out instead? One side note. I'm only ever running my code in release profile. So that's super strange that we get timing issues with debug builds. I think I'll dig some more tomorrow. Lastly. One thing I think I'll try and do (if it's a reasonable idea) would be to convert the erase command execution in the HAL to firstly switch the QSPI module to normal SPI. This way, erasing does not block the CPU, and can instead be polled. |
|
No problem. I think probably the order we are getting in the release build is the correct one, which seems to match the order from the datasheet. We could simply check the correct order in the assert, but I'm also not opposed to removing the JEDEC ID check from the example or just printing them out somehow. Printing them to the display would be the best since, like me, I'm sure many people do not have a debugger, but that does require some code to setup the display and print text to it using I see that the example does erase the flash chip, so I'll stand by to retest things once you make the changes. |
Summary
As part of #912 , this PR overhauls the QSPI module (Only used for ThumbV7 targets) to use the ClockV2 API. In doing so, I have also overhauled the module such that it no longer goes on assumptions like it did before.
New features
Improvements
Marked as a draft at the moment as examples are broken.