cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7 Enabling and disabling FMC

Alex_J
Associate II

Hello,

I'm using a specific board where the STM32 cohabit with another "master" device on the parralel bus.

One time the STM32 is the master and "drive" the external RAM and one time the other device "drive" this RAM.

My first thought was to disable the FMC and put all pins in disable (input ?) mode when the STM32 is not the master.

And when the STM32 become the master again, put th GPIO back in alternate mode and re enable the FMC.

Something like this to disable the FMC:

__FMC_DISABLE();
LL_GPIO_SetPinMode(GPIO_FMC_A0_Port,GPIO_FMC_A0_Pin,LL_GPIO_MODE_INPUT);
LL_GPIO_SetPinMode(GPIO_FMC_A1_Port,GPIO_FMC_A1_Pin,LL_GPIO_MODE_INPUT);
.....

 

And to reenable it, something like :

LL_GPIO_SetPinMode(GPIO_FMC_A0_Port,GPIO_FMC_A0_Pin,LL_GPIO_MODE_ALTERNATE);
LL_GPIO_SetPinMode(GPIO_FMC_A1_Port,GPIO_FMC_A1_Pin,LL_GPIO_MODE_ALTERNATE);
.....
__FMC_ENABLE();

 

Obviously, if I'm here this is because it's not working as expected...

When the FMC is disabled, the other device canno't access the RAM. Looks like the pins are not released from FMC mode.

This is not an hardware issue because if the FMC is not intialized (MX_FMC_Init() not launched), the other device can access the RAM. And if I didn't try to disable the FMC, the STM32 is always capable of accessing the RAM.

I've searched more than a week or two and canno't find what could be wrong.

Any advice ? I know that my usage could be a little weird but I canno't to otherwise.

Thanks

0 REPLIES 0