STM32F407 uses FSMC problem
Hello everyone, I transplant MicroPython to STM32F407. Now I need to use FSMC of STM32F407. but STM32F407 only has FSMC. I see that STM32F429DISC and STM32F769DISC have FMC support. How can I modify STM32F407 to use FSMC or FMC?
Thanks for your help.
stm32: add sdram support
This PR adds stm32 support for using external SDRAM chip for the micropython GC heap.
On the (included) STM32F429DISC target this means you now have 8MB of ram for python to use!
I expect this PR to need a little further work before merging however. While I believe it's fully operational and stable, I'm pretty sure some of my changes to alternate pin function handling could be done better.
It includes also a rather long list of pins needing to be defined in multiple locations. This is the first time I've worked with the alternate function handling, not sure if I've understood it correctly/efficiently?
In particular I had problems with the FMC perpheral configuration as the existing functionality wants to set it to unit 0 but the register definition is just FMC, hence my change in stm32f4xx_prefix.c. I don't know that this change is safe for all stm32 targets.
Even then I still needed a define in mpconfigboard.h to set the active FMC register #define FMC FMC_SDRAM_DEVICE
This limits the FMC peripheral in alternate function handling to one of the possible memory types, and sets a fairly non-specific define FMC that could conflict elsewhere.
I based the initial driver on an old (unused?) driver from openmv, as such I've referenced where it came from in the initial commit and left their header intact.
I havne't contacted them about this yet, I hope this is ok? I've modified the file fairly significantly from the initial version.