Skip to content

Commit 922cc2b

Browse files
committed
DISCO_F413ZH : set default Wifi module SPI state to inactive
1 parent c43a3f4 commit 922cc2b

File tree

1 file changed

+11
-0
lines changed
  • targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F413xH/TARGET_DISCO_F413ZH

1 file changed

+11
-0
lines changed

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F413xH/TARGET_DISCO_F413ZH/system_clock.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,17 @@ void SystemInit(void)
9797
SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */
9898
#endif
9999

100+
/* In DISCO_F413ZH board, Arduino connector and Wifi embeded module are sharing the same SPI pins */
101+
/* We need to set the default SPI SS pin for the Wifi module to the inactive state i.e. 1 */
102+
/* See board User Manual: WIFI_SPI_CS = PG_11*/
103+
__HAL_RCC_GPIOG_CLK_ENABLE();
104+
GPIO_InitTypeDef GPIO_InitStruct;
105+
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
106+
GPIO_InitStruct.Pull = GPIO_NOPULL;
107+
GPIO_InitStruct.Speed = GPIO_SPEED_FAST;
108+
GPIO_InitStruct.Pin = GPIO_PIN_11;
109+
HAL_GPIO_Init(GPIOG, &GPIO_InitStruct);
110+
HAL_GPIO_WritePin(GPIOG, GPIO_PIN_11, GPIO_PIN_SET);
100111
}
101112

102113

0 commit comments

Comments
 (0)