cancel
Showing results for 
Search instead for 
Did you mean: 

FSMC: CubeMX Doesn't initialize GPIO

rsharifi9
Associate III
Posted on July 30, 2017 at 11:36

Hi everybody,

my CubeMX project and the code generated are attached.

GPIO is initialized as bellow:

static void MX_GPIO_Init(void)

{

  /* GPIO Ports Clock Enable */

  __HAL_RCC_GPIOG_CLK_ENABLE();

  __HAL_RCC_GPIOE_CLK_ENABLE();

  __HAL_RCC_GPIOD_CLK_ENABLE();

  __HAL_RCC_GPIOA_CLK_ENABLE();

  __HAL_RCC_GPIOB_CLK_ENABLE();

}

there is no any configuration relating to FSMC.

Regards, Rasool

#stm32 #fsmc #cubemx #cube
1 ACCEPTED SOLUTION

Accepted Solutions
rsharifi9
Associate III
Posted on July 30, 2017 at 12:24

wrong!

the GPIOs are initialized in STM32F4xx_hal_msp.c file and called by HAL_SRAM_Init() function in the main.c

View solution in original post

2 REPLIES 2
rsharifi9
Associate III
Posted on July 30, 2017 at 12:24

wrong!

the GPIOs are initialized in STM32F4xx_hal_msp.c file and called by HAL_SRAM_Init() function in the main.c

Posted on July 30, 2017 at 16:01

CubeMX hides and abstracts things in ways I often find unhelpful.

Generally I want to enable all my clocks early on, then the pins, then the peripherals. This is less prone to error and interplay/sequencing than trying to do them all over the place and immediately prior to configuration for individual interfaces/peripherals. Makes it easier to reorder initialization code, and reduces chance of breaking one interface while initializing another, or merging functionality from multiple examples.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..