Commit 8c74ea2a authored by Mark J. Blair's avatar Mark J. Blair

First draft of schematic completed.

parent 291cef1b
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -46,6 +46,8 @@
/* USER CODE END Includes */
extern SRAM_HandleTypeDef hsram1;
extern SRAM_HandleTypeDef hsram2;
extern SRAM_HandleTypeDef hsram3;
extern void Error_Handler(void);
/* USER CODE BEGIN Private defines */
......
......@@ -3,6 +3,8 @@ FREERTOS.FootprintOK=true
FREERTOS.IPParameters=Tasks01,configUSE_IDLE_HOOK,FootprintOK
FREERTOS.Tasks01=defaultTask,0,128,StartDefaultTask,Default
FREERTOS.configUSE_IDLE_HOOK=1
FSMC.IPParameters=WriteOperation1
FSMC.WriteOperation1=FSMC_WRITE_OPERATION_DISABLE
File.Version=6
KeepUserPlacement=false
Mcu.Family=STM32F4
......@@ -55,16 +57,19 @@ Mcu.Pin40=PD1
Mcu.Pin41=PD4
Mcu.Pin42=PD5
Mcu.Pin43=PD7
Mcu.Pin44=PB5
Mcu.Pin45=VP_FREERTOS_VS_ENABLE
Mcu.Pin46=VP_SYS_VS_tim14
Mcu.Pin47=VP_USB_DEVICE_VS_USB_DEVICE_MSC_HS
Mcu.Pin44=PG9
Mcu.Pin45=PG10
Mcu.Pin46=PB3
Mcu.Pin47=PB5
Mcu.Pin48=VP_FREERTOS_VS_ENABLE
Mcu.Pin49=VP_SYS_VS_tim14
Mcu.Pin5=PF5
Mcu.Pin50=VP_USB_DEVICE_VS_USB_DEVICE_MSC_HS
Mcu.Pin6=PH0-OSC_IN
Mcu.Pin7=PH1-OSC_OUT
Mcu.Pin8=PC0
Mcu.Pin9=PC2
Mcu.PinsNb=48
Mcu.PinsNb=51
Mcu.UserConstants=
Mcu.UserName=STM32F407ZETx
MxCube.Version=4.16.1
......@@ -83,9 +88,9 @@ NVIC.TIM8_TRG_COM_TIM14_IRQn=true\:0\:0\:false\:false\:true\:false
NVIC.TimeBase=TIM8_TRG_COM_TIM14_IRQn
NVIC.TimeBaseIP=TIM14
NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false
PA13.Mode=Serial_Wire
PA13.Mode=Trace_Asynchronous_SW
PA13.Signal=SYS_JTMS-SWDIO
PA14.Mode=Serial_Wire
PA14.Mode=Trace_Asynchronous_SW
PA14.Signal=SYS_JTCK-SWCLK
PA3.Mode=Device_HS
PA3.Signal=USB_OTG_HS_ULPI_D0
......@@ -105,6 +110,8 @@ PB12.Mode=Device_HS
PB12.Signal=USB_OTG_HS_ULPI_D5
PB13.Mode=Device_HS
PB13.Signal=USB_OTG_HS_ULPI_D6
PB3.Mode=Trace_Asynchronous_SW
PB3.Signal=SYS_JTDO-SWO
PB5.Mode=Device_HS
PB5.Signal=USB_OTG_HS_ULPI_D7
PC0.Mode=Device_HS
......@@ -148,10 +155,14 @@ PF4.Signal=FSMC_A4
PF5.Signal=FSMC_A5
PG0.Signal=FSMC_A10
PG1.Signal=FSMC_A11
PG10.Mode=NorPsramChipSelect3_3
PG10.Signal=FSMC_NE3
PG2.Signal=FSMC_A12
PG3.Signal=FSMC_A13
PG4.Signal=FSMC_A14
PG5.Signal=FSMC_A15
PG9.Mode=NorPsramChipSelect2_2
PG9.Signal=FSMC_NE2
PH0-OSC_IN.Mode=HSE-External-Oscillator
PH0-OSC_IN.Signal=RCC_OSC_IN
PH1-OSC_OUT.Mode=HSE-External-Oscillator
......@@ -194,14 +205,14 @@ RCC.FamilyName=M
RCC.HCLKFreq_Value=168000000
RCC.HSE_VALUE=24000000
RCC.HSI_VALUE=16000000
RCC.I2SClocksFreq_Value=32800000
RCC.IPParameters=48MHZClocksFreq_Value,AHBFreq_Value,APB1CLKDivider,APB1Freq_Value,APB1TimFreq_Value,APB2CLKDivider,APB2Freq_Value,APB2TimFreq_Value,CortexFreq_Value,EthernetFreq_Value,FCLKCortexFreq_Value,FamilyName,HCLKFreq_Value,HSE_VALUE,HSI_VALUE,I2SClocksFreq_Value,LSE_VALUE,LSI_VALUE,MCO1PinFreq_Value,MCO2PinFreq_Value,PLLCLKFreq_Value,PLLI2SN,PLLI2SR,PLLM,PLLN,PLLQ,PLLQCLKFreq_Value,PLLSourceVirtual,RCC_MCO1Source,RCC_MCO2Source,RCC_MCODiv2,RTCFreq_Value,RTCHSEDivFreq_Value,SYSCLKFreq_VALUE,SYSCLKSource,VCOI2SOutputFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VcooutputI2S
RCC.I2SClocksFreq_Value=65600000
RCC.IPParameters=48MHZClocksFreq_Value,AHBFreq_Value,APB1CLKDivider,APB1Freq_Value,APB1TimFreq_Value,APB2CLKDivider,APB2Freq_Value,APB2TimFreq_Value,CortexFreq_Value,EthernetFreq_Value,FCLKCortexFreq_Value,FamilyName,HCLKFreq_Value,HSE_VALUE,HSI_VALUE,I2SClocksFreq_Value,LSE_VALUE,LSI_VALUE,MCO1PinFreq_Value,MCO2PinFreq_Value,PLLCLKFreq_Value,PLLI2SN,PLLI2SR,PLLM,PLLN,PLLQ,PLLQCLKFreq_Value,PLLSourceVirtual,RCC_MCO1Source,RCC_MCO2Source,RTCFreq_Value,RTCHSEDivFreq_Value,SYSCLKFreq_VALUE,SYSCLKSource,VCOI2SOutputFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VcooutputI2S
RCC.LSE_VALUE=32768
RCC.LSI_VALUE=32000
RCC.MCO1PinFreq_Value=24000000
RCC.MCO2PinFreq_Value=8200000
RCC.MCO2PinFreq_Value=65600000
RCC.PLLCLKFreq_Value=168000000
RCC.PLLI2SN=164
RCC.PLLI2SN=328
RCC.PLLI2SR=5
RCC.PLLM=24
RCC.PLLN=336
......@@ -210,67 +221,103 @@ RCC.PLLQCLKFreq_Value=48000000
RCC.PLLSourceVirtual=RCC_PLLSOURCE_HSE
RCC.RCC_MCO1Source=RCC_MCO1SOURCE_HSE
RCC.RCC_MCO2Source=RCC_MCO2SOURCE_PLLI2SCLK
RCC.RCC_MCODiv2=RCC_MCODIV_4
RCC.RTCFreq_Value=32000
RCC.RTCHSEDivFreq_Value=12000000
RCC.SYSCLKFreq_VALUE=168000000
RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK
RCC.VCOI2SOutputFreq_Value=164000000
RCC.VCOI2SOutputFreq_Value=328000000
RCC.VCOInputFreq_Value=1000000
RCC.VCOOutputFreq_Value=336000000
RCC.VcooutputI2S=32800000
RCC.VcooutputI2S=65600000
SH.FSMC_A0.0=FSMC_A0,16b-a1
SH.FSMC_A0.ConfNb=1
SH.FSMC_A0.1=FSMC_A0,16b-a2
SH.FSMC_A0.2=FSMC_A0,A0_3
SH.FSMC_A0.ConfNb=3
SH.FSMC_A1.0=FSMC_A1,16b-a1
SH.FSMC_A1.ConfNb=1
SH.FSMC_A1.1=FSMC_A1,16b-a2
SH.FSMC_A1.ConfNb=2
SH.FSMC_A10.0=FSMC_A10,16b-a1
SH.FSMC_A10.ConfNb=1
SH.FSMC_A10.1=FSMC_A10,16b-a2
SH.FSMC_A10.ConfNb=2
SH.FSMC_A11.0=FSMC_A11,16b-a1
SH.FSMC_A11.ConfNb=1
SH.FSMC_A11.1=FSMC_A11,16b-a2
SH.FSMC_A11.ConfNb=2
SH.FSMC_A12.0=FSMC_A12,16b-a1
SH.FSMC_A12.ConfNb=1
SH.FSMC_A12.1=FSMC_A12,16b-a2
SH.FSMC_A12.ConfNb=2
SH.FSMC_A13.0=FSMC_A13,16b-a1
SH.FSMC_A13.ConfNb=1
SH.FSMC_A13.1=FSMC_A13,16b-a2
SH.FSMC_A13.ConfNb=2
SH.FSMC_A14.0=FSMC_A14,16b-a1
SH.FSMC_A14.ConfNb=1
SH.FSMC_A14.1=FSMC_A14,16b-a2
SH.FSMC_A14.ConfNb=2
SH.FSMC_A15.0=FSMC_A15,16b-a1
SH.FSMC_A15.ConfNb=1
SH.FSMC_A15.1=FSMC_A15,16b-a2
SH.FSMC_A15.ConfNb=2
SH.FSMC_A2.0=FSMC_A2,16b-a1
SH.FSMC_A2.ConfNb=1
SH.FSMC_A2.1=FSMC_A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AME-MSC_HS=MSC
USB_DEVICE.IPParameters=VirtualMode-MSC_HS,VirtualModeHS,USBD_HandleTypeDef-MSC_HS,CLASS_NAME-MSC_HS,MANUFACTURER_STRING-MSC_HS,PRODUCT_STRING_MSC_HS,MSC_MEDIA_PACKET-MSC_HS
USB_DEVICE.MANUFACTURER_STRING-MSC_HS=NF6X
......
Configuration RL02-USB
STM32CubeMX 4.16.1
Date 10/01/2016
Date 10/15/2016
MCU STM32F407ZETx
......@@ -33,12 +33,52 @@ FSMC:NOR Flash/PSRAM/SRAM/ROM/LCD 1 8 bits FSMC_D4 PE7
FSMC:NOR Flash/PSRAM/SRAM/ROM/LCD 1 8 bits FSMC_D5 PE8
FSMC:NOR Flash/PSRAM/SRAM/ROM/LCD 1 8 bits FSMC_D6 PE9
FSMC:NOR Flash/PSRAM/SRAM/ROM/LCD 1 8 bits FSMC_D7 PE10
FSMC:NOR Flash/PSRAM/SRAM/ROM/LCD 2 NE2 FSMC_NE2 PG9
FSMC:NOR Flash/PSRAM/SRAM/ROM/LCD 2 SRAM FSMC_NOE PD4
FSMC:NOR Flash/PSRAM/SRAM/ROM/LCD 2 SRAM FSMC_NWE PD5
FSMC:NOR Flash/PSRAM/SRAM/ROM/LCD 2 16 bits FSMC_A0 PF0
FSMC:NOR Flash/PSRAM/SRAM/ROM/LCD 2 16 bits FSMC_A1 PF1
FSMC:NOR Flash/PSRAM/SRAM/ROM/LCD 2 16 bits FSMC_A2 PF2
FSMC:NOR Flash/PSRAM/SRAM/ROM/LCD 2 16 bits FSMC_A3 PF3
FSMC:NOR Flash/PSRAM/SRAM/ROM/LCD 2 16 bits FSMC_A4 PF4
FSMC:NOR Flash/PSRAM/SRAM/ROM/LCD 2 16 bits FSMC_A5 PF5
FSMC:NOR Flash/PSRAM/SRAM/ROM/LCD 2 16 bits FSMC_A6 PF12
FSMC:NOR Flash/PSRAM/SRAM/ROM/LCD 2 16 bits FSMC_A7 PF13
FSMC:NOR Flash/PSRAM/SRAM/ROM/LCD 2 16 bits FSMC_A8 PF14
FSMC:NOR Flash/PSRAM/SRAM/ROM/LCD 2 16 bits FSMC_A9 PF15
FSMC:NOR Flash/PSRAM/SRAM/ROM/LCD 2 16 bits FSMC_A10 PG0
FSMC:NOR Flash/PSRAM/SRAM/ROM/LCD 2 16 bits FSMC_A11 PG1
FSMC:NOR Flash/PSRAM/SRAM/ROM/LCD 2 16 bits FSMC_A12 PG2
FSMC:NOR Flash/PSRAM/SRAM/ROM/LCD 2 16 bits FSMC_A13 PG3
FSMC:NOR Flash/PSRAM/SRAM/ROM/LCD 2 16 bits FSMC_A14 PG4
FSMC:NOR Flash/PSRAM/SRAM/ROM/LCD 2 16 bits FSMC_A15 PG5
FSMC:NOR Flash/PSRAM/SRAM/ROM/LCD 2 8 bits FSMC_D0 PD14
FSMC:NOR Flash/PSRAM/SRAM/ROM/LCD 2 8 bits FSMC_D1 PD15
FSMC:NOR Flash/PSRAM/SRAM/ROM/LCD 2 8 bits FSMC_D2 PD0
FSMC:NOR Flash/PSRAM/SRAM/ROM/LCD 2 8 bits FSMC_D3 PD1
FSMC:NOR Flash/PSRAM/SRAM/ROM/LCD 2 8 bits FSMC_D4 PE7
FSMC:NOR Flash/PSRAM/SRAM/ROM/LCD 2 8 bits FSMC_D5 PE8
FSMC:NOR Flash/PSRAM/SRAM/ROM/LCD 2 8 bits FSMC_D6 PE9
FSMC:NOR Flash/PSRAM/SRAM/ROM/LCD 2 8 bits FSMC_D7 PE10
FSMC:NOR Flash/PSRAM/SRAM/ROM/LCD 3 NE3 FSMC_NE3 PG10
FSMC:NOR Flash/PSRAM/SRAM/ROM/LCD 3 LCD Interface FSMC_NOE PD4
FSMC:NOR Flash/PSRAM/SRAM/ROM/LCD 3 LCD Interface FSMC_NWE PD5
FSMC:NOR Flash/PSRAM/SRAM/ROM/LCD 3 A0 FSMC_A0 PF0
FSMC:NOR Flash/PSRAM/SRAM/ROM/LCD 3 8 bits FSMC_D0 PD14
FSMC:NOR Flash/PSRAM/SRAM/ROM/LCD 3 8 bits FSMC_D1 PD15
FSMC:NOR Flash/PSRAM/SRAM/ROM/LCD 3 8 bits FSMC_D2 PD0
FSMC:NOR Flash/PSRAM/SRAM/ROM/LCD 3 8 bits FSMC_D3 PD1
FSMC:NOR Flash/PSRAM/SRAM/ROM/LCD 3 8 bits FSMC_D4 PE7
FSMC:NOR Flash/PSRAM/SRAM/ROM/LCD 3 8 bits FSMC_D5 PE8
FSMC:NOR Flash/PSRAM/SRAM/ROM/LCD 3 8 bits FSMC_D6 PE9
FSMC:NOR Flash/PSRAM/SRAM/ROM/LCD 3 8 bits FSMC_D7 PE10
RCC Crystal/Ceramic Resonator RCC_OSC_IN PH0-OSC_IN
RCC Crystal/Ceramic Resonator RCC_OSC_OUT PH1-OSC_OUT
RCC Clock-out-1 RCC_MCO_1 PA8
RCC Clock-out-2 RCC_MCO_2 PC9
SYS Serial Wire SYS_JTCK-SWCLK PA14
SYS Serial Wire SYS_JTMS-SWDIO PA13
SYS Trace Asynchronous Sw SYS_JTMS-SWDIO PA13
SYS Trace Asynchronous Sw SYS_JTCK-SWCLK PA14
SYS Trace Asynchronous Sw SYS_JTDO-SWO PB3
SYS TIM14 SYS_VS_tim14 VP_SYS_VS_tim14
USB_OTG_HS Device_Only USB_OTG_HS_ULPI_CK PA5
USB_OTG_HS Device_Only USB_OTG_HS_ULPI_D0 PA3
......@@ -100,6 +140,9 @@ Pin Nb PINs FUNCTIONs LABELs
118 PD4 FSMC_NOE
119 PD5 FSMC_NWE
123 PD7 FSMC_NE1
124 PG9 FSMC_NE2
125 PG10 FSMC_NE3
133 PB3 SYS_JTDO-SWO
135 PB5 USB_OTG_HS_ULPI_D7
......
......@@ -41,6 +41,8 @@
/* USER CODE END 0 */
SRAM_HandleTypeDef hsram1;
SRAM_HandleTypeDef hsram2;
SRAM_HandleTypeDef hsram3;
/* FSMC initialization function */
void MX_FSMC_Init(void)
......@@ -81,6 +83,74 @@ void MX_FSMC_Init(void)
Error_Handler();
}
/** Perform the SRAM2 memory initialization sequence
*/
hsram2.Instance = FSMC_NORSRAM_DEVICE;
hsram2.Extended = FSMC_NORSRAM_EXTENDED_DEVICE;
/* hsram2.Init */
hsram2.Init.NSBank = FSMC_NORSRAM_BANK2;
hsram2.Init.DataAddressMux = FSMC_DATA_ADDRESS_MUX_DISABLE;
hsram2.Init.MemoryType = FSMC_MEMORY_TYPE_SRAM;
hsram2.Init.MemoryDataWidth = FSMC_NORSRAM_MEM_BUS_WIDTH_8;
hsram2.Init.BurstAccessMode = FSMC_BURST_ACCESS_MODE_DISABLE;
hsram2.Init.WaitSignalPolarity = FSMC_WAIT_SIGNAL_POLARITY_LOW;
hsram2.Init.WrapMode = FSMC_WRAP_MODE_DISABLE;
hsram2.Init.WaitSignalActive = FSMC_WAIT_TIMING_BEFORE_WS;
hsram2.Init.WriteOperation = FSMC_WRITE_OPERATION_DISABLE;
hsram2.Init.WaitSignal = FSMC_WAIT_SIGNAL_DISABLE;
hsram2.Init.ExtendedMode = FSMC_EXTENDED_MODE_DISABLE;
hsram2.Init.AsynchronousWait = FSMC_ASYNCHRONOUS_WAIT_DISABLE;
hsram2.Init.WriteBurst = FSMC_WRITE_BURST_DISABLE;
hsram2.Init.PageSize = FSMC_PAGE_SIZE_NONE;
/* Timing */
Timing.AddressSetupTime = 15;
Timing.AddressHoldTime = 15;
Timing.DataSetupTime = 255;
Timing.BusTurnAroundDuration = 15;
Timing.CLKDivision = 16;
Timing.DataLatency = 17;
Timing.AccessMode = FSMC_ACCESS_MODE_A;
/* ExtTiming */
if (HAL_SRAM_Init(&hsram2, &Timing, NULL) != HAL_OK)
{
Error_Handler();
}
/** Perform the SRAM3 memory initialization sequence
*/
hsram3.Instance = FSMC_NORSRAM_DEVICE;
hsram3.Extended = FSMC_NORSRAM_EXTENDED_DEVICE;
/* hsram3.Init */
hsram3.Init.NSBank = FSMC_NORSRAM_BANK3;
hsram3.Init.DataAddressMux = FSMC_DATA_ADDRESS_MUX_DISABLE;
hsram3.Init.MemoryType = FSMC_MEMORY_TYPE_SRAM;
hsram3.Init.MemoryDataWidth = FSMC_NORSRAM_MEM_BUS_WIDTH_8;
hsram3.Init.BurstAccessMode = FSMC_BURST_ACCESS_MODE_DISABLE;
hsram3.Init.WaitSignalPolarity = FSMC_WAIT_SIGNAL_POLARITY_LOW;
hsram3.Init.WrapMode = FSMC_WRAP_MODE_DISABLE;
hsram3.Init.WaitSignalActive = FSMC_WAIT_TIMING_BEFORE_WS;
hsram3.Init.WriteOperation = FSMC_WRITE_OPERATION_ENABLE;
hsram3.Init.WaitSignal = FSMC_WAIT_SIGNAL_DISABLE;
hsram3.Init.ExtendedMode = FSMC_EXTENDED_MODE_DISABLE;
hsram3.Init.AsynchronousWait = FSMC_ASYNCHRONOUS_WAIT_DISABLE;
hsram3.Init.WriteBurst = FSMC_WRITE_BURST_DISABLE;
hsram3.Init.PageSize = FSMC_PAGE_SIZE_NONE;
/* Timing */
Timing.AddressSetupTime = 15;
Timing.AddressHoldTime = 15;
Timing.DataSetupTime = 255;
Timing.BusTurnAroundDuration = 15;
Timing.CLKDivision = 16;
Timing.DataLatency = 17;
Timing.AccessMode = FSMC_ACCESS_MODE_A;
/* ExtTiming */
if (HAL_SRAM_Init(&hsram3, &Timing, NULL) != HAL_OK)
{
Error_Handler();
}
}
static uint32_t FSMC_Initialized = 0;
......@@ -125,6 +195,8 @@ static void HAL_FSMC_MspInit(void){
PD4 ------> FSMC_NOE
PD5 ------> FSMC_NWE
PD7 ------> FSMC_NE1
PG9 ------> FSMC_NE2
PG10 ------> FSMC_NE3
*/
/* GPIO_InitStruct */
GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3
......@@ -139,7 +211,7 @@ static void HAL_FSMC_MspInit(void){
/* GPIO_InitStruct */
GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3
|GPIO_PIN_4|GPIO_PIN_5;
|GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_9|GPIO_PIN_10;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
......@@ -222,6 +294,8 @@ static void HAL_FSMC_MspDeInit(void){
PD4 ------> FSMC_NOE
PD5 ------> FSMC_NWE
PD7 ------> FSMC_NE1
PG9 ------> FSMC_NE2
PG10 ------> FSMC_NE3
*/
HAL_GPIO_DeInit(GPIOF, GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3
......@@ -229,7 +303,7 @@ static void HAL_FSMC_MspDeInit(void){
|GPIO_PIN_14|GPIO_PIN_15);
HAL_GPIO_DeInit(GPIOG, GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3
|GPIO_PIN_4|GPIO_PIN_5);
|GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_9|GPIO_PIN_10);
HAL_GPIO_DeInit(GPIOE, GPIO_PIN_7|GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_10);
......
......@@ -109,12 +109,10 @@ void MX_GPIO_Init(void)
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
/*Configure GPIO pins : PB2 PB14 PB15 PB3
PB4 PB6 PB7 PB8
PB9 */
GPIO_InitStruct.Pin = GPIO_PIN_2|GPIO_PIN_14|GPIO_PIN_15|GPIO_PIN_3
|GPIO_PIN_4|GPIO_PIN_6|GPIO_PIN_7|GPIO_PIN_8
|GPIO_PIN_9;
/*Configure GPIO pins : PB2 PB14 PB15 PB4
PB6 PB7 PB8 PB9 */
GPIO_InitStruct.Pin = GPIO_PIN_2|GPIO_PIN_14|GPIO_PIN_15|GPIO_PIN_4
|GPIO_PIN_6|GPIO_PIN_7|GPIO_PIN_8|GPIO_PIN_9;
GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
......@@ -129,12 +127,10 @@ void MX_GPIO_Init(void)
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
/*Configure GPIO pins : PG6 PG7 PG8 PG9
PG10 PG11 PG12 PG13
PG14 PG15 */
GPIO_InitStruct.Pin = GPIO_PIN_6|GPIO_PIN_7|GPIO_PIN_8|GPIO_PIN_9
|GPIO_PIN_10|GPIO_PIN_11|GPIO_PIN_12|GPIO_PIN_13
|GPIO_PIN_14|GPIO_PIN_15;
/*Configure GPIO pins : PG6 PG7 PG8 PG11
PG12 PG13 PG14 PG15 */
GPIO_InitStruct.Pin = GPIO_PIN_6|GPIO_PIN_7|GPIO_PIN_8|GPIO_PIN_11
|GPIO_PIN_12|GPIO_PIN_13|GPIO_PIN_14|GPIO_PIN_15;
GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOG, &GPIO_InitStruct);
......
......@@ -144,7 +144,7 @@ void SystemClock_Config(void)
}
PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_PLLI2S;
PeriphClkInitStruct.PLLI2S.PLLI2SN = 164;
PeriphClkInitStruct.PLLI2S.PLLI2SN = 328;
PeriphClkInitStruct.PLLI2S.PLLI2SR = 5;
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)
{
......@@ -153,7 +153,7 @@ void SystemClock_Config(void)
HAL_RCC_MCOConfig(RCC_MCO1, RCC_MCO1SOURCE_HSE, RCC_MCODIV_1);
HAL_RCC_MCOConfig(RCC_MCO2, RCC_MCO2SOURCE_PLLI2SCLK, RCC_MCODIV_4);
HAL_RCC_MCOConfig(RCC_MCO2, RCC_MCO2SOURCE_PLLI2SCLK, RCC_MCODIV_1);
HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq()/1000);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment