Skip to main content
rsharifi9
Associate III
July 30, 2017
Solved

FSMC: CubeMX Doesn't initialize GPIO

  • July 30, 2017
  • 2 replies
  • 768 views
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
This topic has been closed for replies.
Best answer by rsharifi9
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

2 replies

rsharifi9
rsharifi9AuthorBest answer
Associate III
July 30, 2017
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

Tesla DeLorean
Guru
July 30, 2017
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 (See Profile) Up vote any posts that you find helpful, it shows what's working..