cancel
Showing results for 
Search instead for 
Did you mean: 

Stm32Cube FSMC address pin definiton bug

totti001
Associate II
Posted on March 17, 2014 at 16:18

Hello everybody!

I check the Stm32Cube graphical pin definition. I want to use FSMC bus SRAM1, with 16 bit bus, and 1 address bit. The address pin I want is PE3, but the cube not allowing use this. If i use 1 bit addressing only the PF0 can select for FSMC address pin. This is a bug or what?

Thanks
3 REPLIES 3
Amel NASRI
ST Employee
Posted on March 18, 2014 at 10:39

Hi Janos,

What part number are you selecting exactly?

-Mayla-

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

totti001
Associate II
Posted on March 18, 2014 at 10:53

Stm32f407ig controller.

stm32cube-t
Senior III
Posted on March 19, 2014 at 12:19

Hi Janos,

STM32CubeMX does not support this configuration.

However, you can follow the following procedure to obtain the code you want:

[Note: your application will need to manage the offset introduced by using FSMC_A19 instead of FSMC_A0: when using 8 bit data, this means for example considering 0x7FFFF as the base adress and 0x8000 as the second adress.]

Use STM32CubeMX and configure the FSMC for 20 bit address (pinout tab) in order to reserve the PE3 pin:

0690X00000605dlQAA.png

0690X00000605SjQAI.png

Configure the Project options from the Project menu to generate peripheral initialization code as peripheral dedicated .c/.h files :

0690X00000605dqQAA.png

In the inc/src folders you will find the fsmc initialization code.

Modify the function HAL_FSMC_MspInit in the fsmc.c file to configure only the GPIO PE3 (i.e. comment all other GPIO initialization code) as shown in example below [Warning: this modification will be overwritten if regenerating the code with STM32CubeMX. So you should copy the code to a dedicated project folder]:

0690X00000605e0QAA.png