diff --git a/.cproject b/.cproject
new file mode 100644
index 0000000..5cc5cf7
--- /dev/null
+++ b/.cproject
@@ -0,0 +1,191 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.mxproject b/.mxproject
new file mode 100644
index 0000000..32908f8
--- /dev/null
+++ b/.mxproject
@@ -0,0 +1,35 @@
+[PreviousLibFiles]
+LibFiles=Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_hcd.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_usb.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ramfunc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_cortex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal.h;Drivers/STM32F4xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_exti.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_spi.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_uart.h;Middlewares/ST/STM32_USB_Host_Library/Core/Inc/usbh_core.h;Middlewares/ST/STM32_USB_Host_Library/Core/Inc/usbh_ctlreq.h;Middlewares/ST/STM32_USB_Host_Library/Core/Inc/usbh_def.h;Middlewares/ST/STM32_USB_Host_Library/Core/Inc/usbh_ioreq.h;Middlewares/ST/STM32_USB_Host_Library/Core/Inc/usbh_pipes.h;Middlewares/ST/STM32_USB_Host_Library/Class/CDC/Inc/usbh_cdc.h;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_hcd.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_exti.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2s.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2s_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spi.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c;Middlewares/ST/STM32_USB_Host_Library/Core/Src/usbh_core.c;Middlewares/ST/STM32_USB_Host_Library/Core/Src/usbh_ctlreq.c;Middlewares/ST/STM32_USB_Host_Library/Core/Src/usbh_ioreq.c;Middlewares/ST/STM32_USB_Host_Library/Core/Src/usbh_pipes.c;Middlewares/ST/STM32_USB_Host_Library/Class/CDC/Src/usbh_cdc.c;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_hcd.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_usb.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ramfunc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_cortex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal.h;Drivers/STM32F4xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_exti.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_spi.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_uart.h;Middlewares/ST/STM32_USB_Host_Library/Core/Inc/usbh_core.h;Middlewares/ST/STM32_USB_Host_Library/Core/Inc/usbh_ctlreq.h;Middlewares/ST/STM32_USB_Host_Library/Core/Inc/usbh_def.h;Middlewares/ST/STM32_USB_Host_Library/Core/Inc/usbh_ioreq.h;Middlewares/ST/STM32_USB_Host_Library/Core/Inc/usbh_pipes.h;Middlewares/ST/STM32_USB_Host_Library/Class/CDC/Inc/usbh_cdc.h;Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f401xc.h;Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h;Drivers/CMSIS/Device/ST/STM32F4xx/Include/system_stm32f4xx.h;Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c;Drivers/CMSIS/Include/cmsis_armcc.h;Drivers/CMSIS/Include/cmsis_armclang.h;Drivers/CMSIS/Include/cmsis_compiler.h;Drivers/CMSIS/Include/cmsis_gcc.h;Drivers/CMSIS/Include/cmsis_iccarm.h;Drivers/CMSIS/Include/cmsis_version.h;Drivers/CMSIS/Include/core_armv8mbl.h;Drivers/CMSIS/Include/core_armv8mml.h;Drivers/CMSIS/Include/core_cm0.h;Drivers/CMSIS/Include/core_cm0plus.h;Drivers/CMSIS/Include/core_cm1.h;Drivers/CMSIS/Include/core_cm23.h;Drivers/CMSIS/Include/core_cm3.h;Drivers/CMSIS/Include/core_cm33.h;Drivers/CMSIS/Include/core_cm4.h;Drivers/CMSIS/Include/core_cm7.h;Drivers/CMSIS/Include/core_sc000.h;Drivers/CMSIS/Include/core_sc300.h;Drivers/CMSIS/Include/mpu_armv7.h;Drivers/CMSIS/Include/mpu_armv8.h;Drivers/CMSIS/Include/tz_context.h;
+
+[PreviousUsedCubeIDEFiles]
+SourceFiles=Core\Src\main.c;USB_HOST\App\usb_host.c;USB_HOST\Target\usbh_conf.c;USB_HOST\Target\usbh_platform.c;Core\Src\stm32f4xx_it.c;Core\Src\stm32f4xx_hal_msp.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_hcd.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_exti.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2s.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2s_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spi.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c;Middlewares/ST/STM32_USB_Host_Library/Core/Src/usbh_core.c;Middlewares/ST/STM32_USB_Host_Library/Core/Src/usbh_ctlreq.c;Middlewares/ST/STM32_USB_Host_Library/Core/Src/usbh_ioreq.c;Middlewares/ST/STM32_USB_Host_Library/Core/Src/usbh_pipes.c;Middlewares/ST/STM32_USB_Host_Library/Class/CDC/Src/usbh_cdc.c;Core\Src/system_stm32f4xx.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_hcd.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_exti.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2s.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2s_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spi.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c;Middlewares/ST/STM32_USB_Host_Library/Core/Src/usbh_core.c;Middlewares/ST/STM32_USB_Host_Library/Core/Src/usbh_ctlreq.c;Middlewares/ST/STM32_USB_Host_Library/Core/Src/usbh_ioreq.c;Middlewares/ST/STM32_USB_Host_Library/Core/Src/usbh_pipes.c;Middlewares/ST/STM32_USB_Host_Library/Class/CDC/Src/usbh_cdc.c;Core\Src/system_stm32f4xx.c;Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c;;Middlewares/ST/STM32_USB_Host_Library/Core/Src/usbh_core.c;Middlewares/ST/STM32_USB_Host_Library/Core/Src/usbh_ctlreq.c;Middlewares/ST/STM32_USB_Host_Library/Core/Src/usbh_ioreq.c;Middlewares/ST/STM32_USB_Host_Library/Core/Src/usbh_pipes.c;Middlewares/ST/STM32_USB_Host_Library/Class/CDC/Src/usbh_cdc.c;
+HeaderPath=Drivers\STM32F4xx_HAL_Driver\Inc;Drivers\STM32F4xx_HAL_Driver\Inc\Legacy;Middlewares\ST\STM32_USB_Host_Library\Core\Inc;Middlewares\ST\STM32_USB_Host_Library\Class\CDC\Inc;Drivers\CMSIS\Device\ST\STM32F4xx\Include;Drivers\CMSIS\Include;USB_HOST\App;USB_HOST\Target;Core\Inc;
+CDefines=USE_HAL_DRIVER;STM32F401xC;USE_HAL_DRIVER;USE_HAL_DRIVER;
+
+[PreviousGenFiles]
+AdvancedFolderStructure=true
+HeaderFileListSize=6
+HeaderFiles#0=D:/Users/Think/Programmation/STM32CUBEIDE/AudioDAC/USB_HOST/App/usb_host.h
+HeaderFiles#1=D:/Users/Think/Programmation/STM32CUBEIDE/AudioDAC/USB_HOST/Target/usbh_conf.h
+HeaderFiles#2=D:/Users/Think/Programmation/STM32CUBEIDE/AudioDAC/USB_HOST/Target/usbh_platform.h
+HeaderFiles#3=D:/Users/Think/Programmation/STM32CUBEIDE/AudioDAC/Core/Inc/stm32f4xx_it.h
+HeaderFiles#4=D:/Users/Think/Programmation/STM32CUBEIDE/AudioDAC/Core/Inc/stm32f4xx_hal_conf.h
+HeaderFiles#5=D:/Users/Think/Programmation/STM32CUBEIDE/AudioDAC/Core/Inc/main.h
+HeaderFolderListSize=3
+HeaderPath#0=D:/Users/Think/Programmation/STM32CUBEIDE/AudioDAC/USB_HOST/App
+HeaderPath#1=D:/Users/Think/Programmation/STM32CUBEIDE/AudioDAC/USB_HOST/Target
+HeaderPath#2=D:/Users/Think/Programmation/STM32CUBEIDE/AudioDAC/Core/Inc
+HeaderFiles=;
+SourceFileListSize=6
+SourceFiles#0=D:/Users/Think/Programmation/STM32CUBEIDE/AudioDAC/USB_HOST/App/usb_host.c
+SourceFiles#1=D:/Users/Think/Programmation/STM32CUBEIDE/AudioDAC/USB_HOST/Target/usbh_conf.c
+SourceFiles#2=D:/Users/Think/Programmation/STM32CUBEIDE/AudioDAC/USB_HOST/Target/usbh_platform.c
+SourceFiles#3=D:/Users/Think/Programmation/STM32CUBEIDE/AudioDAC/Core/Src/stm32f4xx_it.c
+SourceFiles#4=D:/Users/Think/Programmation/STM32CUBEIDE/AudioDAC/Core/Src/stm32f4xx_hal_msp.c
+SourceFiles#5=D:/Users/Think/Programmation/STM32CUBEIDE/AudioDAC/Core/Src/main.c
+SourceFolderListSize=3
+SourcePath#0=D:/Users/Think/Programmation/STM32CUBEIDE/AudioDAC/USB_HOST/App
+SourcePath#1=D:/Users/Think/Programmation/STM32CUBEIDE/AudioDAC/USB_HOST/Target
+SourcePath#2=D:/Users/Think/Programmation/STM32CUBEIDE/AudioDAC/Core/Src
+SourceFiles=;
+
diff --git a/.project b/.project
new file mode 100644
index 0000000..0bc078e
--- /dev/null
+++ b/.project
@@ -0,0 +1,33 @@
+
+
+ AudioDAC
+
+
+
+
+
+ org.eclipse.cdt.managedbuilder.core.genmakebuilder
+ clean,full,incremental,
+
+
+
+
+ org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder
+ full,incremental,
+
+
+
+
+
+ com.st.stm32cube.ide.mcu.MCUProjectNature
+ com.st.stm32cube.ide.mcu.MCUCubeProjectNature
+ org.eclipse.cdt.core.cnature
+ com.st.stm32cube.ide.mcu.MCUCubeIdeServicesRevAev2ProjectNature
+ com.st.stm32cube.ide.mcu.MCUAdvancedStructureProjectNature
+ com.st.stm32cube.ide.mcu.MCUEndUserDisabledTrustZoneProjectNature
+ com.st.stm32cube.ide.mcu.MCUSingleCpuProjectNature
+ com.st.stm32cube.ide.mcu.MCURootProjectNature
+ org.eclipse.cdt.managedbuilder.core.managedBuildNature
+ org.eclipse.cdt.managedbuilder.core.ScannerConfigNature
+
+
diff --git a/.settings/language.settings.xml b/.settings/language.settings.xml
new file mode 100644
index 0000000..a2794c4
--- /dev/null
+++ b/.settings/language.settings.xml
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.settings/stm32cubeide.project.prefs b/.settings/stm32cubeide.project.prefs
new file mode 100644
index 0000000..df27a66
--- /dev/null
+++ b/.settings/stm32cubeide.project.prefs
@@ -0,0 +1,3 @@
+8DF89ED150041C4CBC7CB9A9CAA90856=0200E7423990B2759ED933AA554D57BA
+DC22A860405A8BF2F2C095E5B6529F12=0200E7423990B2759ED933AA554D57BA
+eclipse.preferences.version=1
diff --git a/AudioDAC Debug.launch b/AudioDAC Debug.launch
new file mode 100644
index 0000000..1471182
--- /dev/null
+++ b/AudioDAC Debug.launch
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/AudioDAC.ioc b/AudioDAC.ioc
new file mode 100644
index 0000000..30e37d0
--- /dev/null
+++ b/AudioDAC.ioc
@@ -0,0 +1,381 @@
+#MicroXplorer Configuration settings - do not modify
+File.Version=6
+I2S2.ErrorAudioFreq=0.0 %
+I2S2.FullDuplexMode=I2S_FULLDUPLEXMODE_DISABLE
+I2S2.IPParameters=RealAudioFreq,ErrorAudioFreq,Instance,VirtualMode,FullDuplexMode
+I2S2.Instance=SPI$Index
+I2S2.RealAudioFreq=8.0 KHz
+I2S2.VirtualMode=I2S_MODE_MASTER
+I2S3.AudioFreq=I2S_AUDIOFREQ_96K
+I2S3.ErrorAudioFreq=-2.34 %
+I2S3.FullDuplexMode=I2S_FULLDUPLEXMODE_DISABLE
+I2S3.IPParameters=AudioFreq,RealAudioFreq,ErrorAudioFreq,Instance,VirtualMode,FullDuplexMode
+I2S3.Instance=SPI$Index
+I2S3.RealAudioFreq=93.75 KHz
+I2S3.VirtualMode=I2S_MODE_MASTER
+KeepUserPlacement=false
+Mcu.Family=STM32F4
+Mcu.IP0=I2C1
+Mcu.IP1=I2S2
+Mcu.IP2=I2S3
+Mcu.IP3=NVIC
+Mcu.IP4=RCC
+Mcu.IP5=SPI1
+Mcu.IP6=SYS
+Mcu.IP7=USART2
+Mcu.IP8=USB_HOST
+Mcu.IP9=USB_OTG_FS
+Mcu.IPNb=10
+Mcu.Name=STM32F401V(B-C)Tx
+Mcu.Package=LQFP100
+Mcu.Pin0=PE2
+Mcu.Pin1=PE3
+Mcu.Pin10=PA0-WKUP
+Mcu.Pin11=PA2
+Mcu.Pin12=PA3
+Mcu.Pin13=PA4
+Mcu.Pin14=PA5
+Mcu.Pin15=PA6
+Mcu.Pin16=PA7
+Mcu.Pin17=PB10
+Mcu.Pin18=PB12
+Mcu.Pin19=PD12
+Mcu.Pin2=PE4
+Mcu.Pin20=PD13
+Mcu.Pin21=PD14
+Mcu.Pin22=PD15
+Mcu.Pin23=PC7
+Mcu.Pin24=PA9
+Mcu.Pin25=PA10
+Mcu.Pin26=PA11
+Mcu.Pin27=PA12
+Mcu.Pin28=PA13
+Mcu.Pin29=PA14
+Mcu.Pin3=PE5
+Mcu.Pin30=PC10
+Mcu.Pin31=PC12
+Mcu.Pin32=PD4
+Mcu.Pin33=PD5
+Mcu.Pin34=PB3
+Mcu.Pin35=PB6
+Mcu.Pin36=PB9
+Mcu.Pin37=PE1
+Mcu.Pin38=VP_SYS_VS_Systick
+Mcu.Pin39=VP_USB_HOST_VS_USB_HOST_CDC_FS
+Mcu.Pin4=PC14-OSC32_IN
+Mcu.Pin5=PC15-OSC32_OUT
+Mcu.Pin6=PH0 - OSC_IN
+Mcu.Pin7=PH1 - OSC_OUT
+Mcu.Pin8=PC0
+Mcu.Pin9=PC3
+Mcu.PinsNb=40
+Mcu.ThirdPartyNb=0
+Mcu.UserConstants=
+Mcu.UserName=STM32F401VCTx
+MxCube.Version=6.1.1
+MxDb.Version=DB.6.0.10
+NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:true\:false
+NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:true\:false
+NVIC.ForceEnableDMAVector=true
+NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:true\:false
+NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:true\:false
+NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:true\:false
+NVIC.OTG_FS_IRQn=true\:0\:0\:false\:false\:true\:true\:true
+NVIC.PendSV_IRQn=true\:0\:0\:false\:false\:true\:true\:false
+NVIC.PriorityGroup=NVIC_PRIORITYGROUP_0
+NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:true\:true\:false
+NVIC.SysTick_IRQn=true\:0\:0\:false\:false\:true\:true\:true
+NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:true\:false
+PA0-WKUP.GPIOParameters=GPIO_Label,GPIO_ModeDefaultEXTI
+PA0-WKUP.GPIO_Label=B1 [Blue PushButton]
+PA0-WKUP.GPIO_ModeDefaultEXTI=GPIO_MODE_EVT_RISING
+PA0-WKUP.Locked=true
+PA0-WKUP.Signal=GPXTI0
+PA10.GPIOParameters=GPIO_Label
+PA10.GPIO_Label=OTG_FS_ID
+PA10.Locked=true
+PA10.Signal=USB_OTG_FS_ID
+PA11.GPIOParameters=GPIO_Label
+PA11.GPIO_Label=OTG_FS_DM
+PA11.Locked=true
+PA11.Mode=Host_Only
+PA11.Signal=USB_OTG_FS_DM
+PA12.GPIOParameters=GPIO_Label
+PA12.GPIO_Label=OTG_FS_DP
+PA12.Locked=true
+PA12.Mode=Host_Only
+PA12.Signal=USB_OTG_FS_DP
+PA13.GPIOParameters=GPIO_Label
+PA13.GPIO_Label=SWDIO
+PA13.Locked=true
+PA13.Mode=Serial_Wire
+PA13.Signal=SYS_JTMS-SWDIO
+PA14.GPIOParameters=GPIO_Label
+PA14.GPIO_Label=SWCLK
+PA14.Locked=true
+PA14.Mode=Serial_Wire
+PA14.Signal=SYS_JTCK-SWCLK
+PA2.Mode=Asynchronous
+PA2.Signal=USART2_TX
+PA3.Mode=Asynchronous
+PA3.Signal=USART2_RX
+PA4.GPIOParameters=GPIO_Speed,GPIO_PuPd,GPIO_Label,GPIO_Mode
+PA4.GPIO_Label=I2S3_WS [CS43L22_LRCK]
+PA4.GPIO_Mode=GPIO_MODE_AF_PP
+PA4.GPIO_PuPd=GPIO_NOPULL
+PA4.GPIO_Speed=GPIO_SPEED_FREQ_LOW
+PA4.Locked=true
+PA4.Mode=Half_Duplex_Master
+PA4.Signal=I2S3_WS
+PA5.GPIOParameters=GPIO_Label
+PA5.GPIO_Label=SPI1_SCK [L3GD20_SC/SPC]
+PA5.Locked=true
+PA5.Mode=Full_Duplex_Master
+PA5.Signal=SPI1_SCK
+PA6.GPIOParameters=GPIO_Label
+PA6.GPIO_Label=SPI1_MISO [L3GD20_AS0/SDO]
+PA6.Locked=true
+PA6.Mode=Full_Duplex_Master
+PA6.Signal=SPI1_MISO
+PA7.GPIOParameters=GPIO_Label
+PA7.GPIO_Label=SPI1_MISO [L3GD20_SDA/SDI/SDO]
+PA7.Locked=true
+PA7.Mode=Full_Duplex_Master
+PA7.Signal=SPI1_MOSI
+PA9.GPIOParameters=GPIO_Label
+PA9.GPIO_Label=VBUS_FS
+PA9.Locked=true
+PA9.Mode=Activate_VBUS
+PA9.Signal=USB_OTG_FS_VBUS
+PB10.GPIOParameters=GPIO_Label
+PB10.GPIO_Label=CLK_IN [MP45DT02_CLK]
+PB10.Locked=true
+PB10.Mode=Half_Duplex_Master
+PB10.Signal=I2S2_CK
+PB12.Locked=true
+PB12.Mode=Half_Duplex_Master
+PB12.Signal=I2S2_WS
+PB3.GPIOParameters=GPIO_Label
+PB3.GPIO_Label=SWO
+PB3.Locked=true
+PB3.Signal=SYS_JTDO-SWO
+PB6.GPIOParameters=GPIO_Speed,GPIO_PuPd,GPIO_Label,GPIO_Mode
+PB6.GPIO_Label=Audio_SCL [CS43L22_SCL]
+PB6.GPIO_Mode=GPIO_MODE_AF_OD
+PB6.GPIO_PuPd=GPIO_NOPULL
+PB6.GPIO_Speed=GPIO_SPEED_FREQ_LOW
+PB6.Locked=true
+PB6.Mode=I2C
+PB6.Signal=I2C1_SCL
+PB9.GPIOParameters=GPIO_Speed,GPIO_PuPd,GPIO_Label,GPIO_Mode
+PB9.GPIO_Label=Audio_SDA [CS43L22_SDA]
+PB9.GPIO_Mode=GPIO_MODE_AF_OD
+PB9.GPIO_PuPd=GPIO_NOPULL
+PB9.GPIO_Speed=GPIO_SPEED_FREQ_LOW
+PB9.Locked=true
+PB9.Mode=I2C
+PB9.Signal=I2C1_SDA
+PC0.GPIOParameters=PinState,GPIO_Label
+PC0.GPIO_Label=OTG_FS_PowerSwitchOn
+PC0.Locked=true
+PC0.PinState=GPIO_PIN_SET
+PC0.Signal=GPIO_Output
+PC10.GPIOParameters=GPIO_Speed,GPIO_PuPd,GPIO_Label,GPIO_Mode
+PC10.GPIO_Label=I2S3_SCK [CS43L22_SCLK]
+PC10.GPIO_Mode=GPIO_MODE_AF_PP
+PC10.GPIO_PuPd=GPIO_NOPULL
+PC10.GPIO_Speed=GPIO_SPEED_FREQ_LOW
+PC10.Locked=true
+PC10.Mode=Half_Duplex_Master
+PC10.Signal=I2S3_CK
+PC12.GPIOParameters=GPIO_Speed,GPIO_PuPd,GPIO_Label,GPIO_Mode
+PC12.GPIO_Label=I2S3_SD [CS43L22_SDIN]
+PC12.GPIO_Mode=GPIO_MODE_AF_PP
+PC12.GPIO_PuPd=GPIO_NOPULL
+PC12.GPIO_Speed=GPIO_SPEED_FREQ_LOW
+PC12.Locked=true
+PC12.Mode=Half_Duplex_Master
+PC12.Signal=I2S3_SD
+PC14-OSC32_IN.GPIOParameters=GPIO_Label
+PC14-OSC32_IN.GPIO_Label=PC14-OSC32_IN
+PC14-OSC32_IN.Locked=true
+PC14-OSC32_IN.Mode=LSE-External-Oscillator
+PC14-OSC32_IN.Signal=RCC_OSC32_IN
+PC15-OSC32_OUT.GPIOParameters=GPIO_Label
+PC15-OSC32_OUT.GPIO_Label=PC15-OSC32_OUT
+PC15-OSC32_OUT.Locked=true
+PC15-OSC32_OUT.Mode=LSE-External-Oscillator
+PC15-OSC32_OUT.Signal=RCC_OSC32_OUT
+PC3.GPIOParameters=GPIO_Label
+PC3.GPIO_Label=PDM_OUT [MP45DT02_DOUT]
+PC3.Locked=true
+PC3.Mode=Half_Duplex_Master
+PC3.Signal=I2S2_SD
+PC7.GPIOParameters=GPIO_Speed,GPIO_PuPd,GPIO_Label,GPIO_Mode
+PC7.GPIO_Label=I2S3_MCK [CS43L22_MCLK]
+PC7.GPIO_Mode=GPIO_MODE_AF_PP
+PC7.GPIO_PuPd=GPIO_NOPULL
+PC7.GPIO_Speed=GPIO_SPEED_FREQ_LOW
+PC7.Locked=true
+PC7.Mode=Master_Clock_Activated
+PC7.Signal=I2S3_MCK
+PD12.GPIOParameters=GPIO_Speed,GPIO_PuPd,GPIO_Label
+PD12.GPIO_Label=LD4 [Green Led]
+PD12.GPIO_PuPd=GPIO_NOPULL
+PD12.GPIO_Speed=GPIO_SPEED_FREQ_LOW
+PD12.Locked=true
+PD12.Signal=GPIO_Output
+PD13.GPIOParameters=GPIO_Speed,GPIO_PuPd,GPIO_Label
+PD13.GPIO_Label=LD3 [Orange Led]
+PD13.GPIO_PuPd=GPIO_NOPULL
+PD13.GPIO_Speed=GPIO_SPEED_FREQ_LOW
+PD13.Locked=true
+PD13.Signal=GPIO_Output
+PD14.GPIOParameters=GPIO_Speed,GPIO_PuPd,GPIO_Label
+PD14.GPIO_Label=LD5 [Red Led]
+PD14.GPIO_PuPd=GPIO_NOPULL
+PD14.GPIO_Speed=GPIO_SPEED_FREQ_LOW
+PD14.Locked=true
+PD14.Signal=GPIO_Output
+PD15.GPIOParameters=GPIO_Speed,GPIO_PuPd,GPIO_Label
+PD15.GPIO_Label=LD6 [Blue Led]
+PD15.GPIO_PuPd=GPIO_NOPULL
+PD15.GPIO_Speed=GPIO_SPEED_FREQ_LOW
+PD15.Locked=true
+PD15.Signal=GPIO_Output
+PD4.GPIOParameters=GPIO_Label
+PD4.GPIO_Label=Audio_RST [CS43L22_RESET]
+PD4.Locked=true
+PD4.Signal=GPIO_Output
+PD5.GPIOParameters=GPIO_Label
+PD5.GPIO_Label=OTG_FS_OverCurrent
+PD5.Locked=true
+PD5.Signal=GPIO_Input
+PE1.GPIOParameters=GPIO_Label,GPIO_ModeDefaultEXTI
+PE1.GPIO_Label=MEMS_INT2 [L3GD20_INT2]
+PE1.GPIO_ModeDefaultEXTI=GPIO_MODE_EVT_RISING
+PE1.Locked=true
+PE1.Signal=GPXTI1
+PE2.Locked=true
+PE2.Signal=GPIO_Input
+PE3.GPIOParameters=GPIO_Label
+PE3.GPIO_Label=CS_I2C/SPI [L3GD20_CS_I2C/SPI]
+PE3.Locked=true
+PE3.Signal=GPIO_Output
+PE4.GPIOParameters=GPIO_ModeDefaultEXTI
+PE4.GPIO_ModeDefaultEXTI=GPIO_MODE_EVT_RISING
+PE4.Locked=true
+PE4.Signal=GPXTI4
+PE5.GPIOParameters=GPIO_ModeDefaultEXTI
+PE5.GPIO_ModeDefaultEXTI=GPIO_MODE_EVT_RISING
+PE5.Locked=true
+PE5.Signal=GPXTI5
+PH0\ -\ OSC_IN.GPIOParameters=GPIO_Label
+PH0\ -\ OSC_IN.GPIO_Label=PH0-OSC_IN
+PH0\ -\ OSC_IN.Locked=true
+PH0\ -\ OSC_IN.Mode=HSE-External-Oscillator
+PH0\ -\ OSC_IN.Signal=RCC_OSC_IN
+PH1\ -\ OSC_OUT.GPIOParameters=GPIO_Label
+PH1\ -\ OSC_OUT.GPIO_Label=PH1-OSC_OUT
+PH1\ -\ OSC_OUT.Locked=true
+PH1\ -\ OSC_OUT.Mode=HSE-External-Oscillator
+PH1\ -\ OSC_OUT.Signal=RCC_OSC_OUT
+PinOutPanel.RotationAngle=0
+ProjectManager.AskForMigrate=true
+ProjectManager.BackupPrevious=false
+ProjectManager.CompilerOptimize=6
+ProjectManager.ComputerToolchain=false
+ProjectManager.CoupleFile=false
+ProjectManager.CustomerFirmwarePackage=
+ProjectManager.DefaultFWLocation=true
+ProjectManager.DeletePrevious=true
+ProjectManager.DeviceId=STM32F401VCTx
+ProjectManager.FirmwarePackage=STM32Cube FW_F4 V1.25.2
+ProjectManager.FreePins=false
+ProjectManager.HalAssertFull=false
+ProjectManager.HeapSize=0x200
+ProjectManager.KeepUserCode=true
+ProjectManager.LastFirmware=true
+ProjectManager.LibraryCopy=1
+ProjectManager.MainLocation=Core/Src
+ProjectManager.NoMain=false
+ProjectManager.PreviousToolchain=
+ProjectManager.ProjectBuild=false
+ProjectManager.ProjectFileName=AudioDAC.ioc
+ProjectManager.ProjectName=AudioDAC
+ProjectManager.RegisterCallBack=
+ProjectManager.StackSize=0x400
+ProjectManager.TargetToolchain=STM32CubeIDE
+ProjectManager.ToolChainLocation=
+ProjectManager.UnderRoot=true
+ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-SystemClock_Config-RCC-false-HAL-false,3-MX_I2C1_Init-I2C1-false-HAL-true,4-MX_I2S2_Init-I2S2-false-HAL-true,5-MX_I2S3_Init-I2S3-false-HAL-true,6-MX_SPI1_Init-SPI1-false-HAL-true,7-MX_USB_HOST_Init-USB_HOST-false-HAL-false
+RCC.AHBFreq_Value=84000000
+RCC.APB1CLKDivider=RCC_HCLK_DIV2
+RCC.APB1Freq_Value=42000000
+RCC.APB1TimFreq_Value=84000000
+RCC.APB2Freq_Value=84000000
+RCC.APB2TimFreq_Value=84000000
+RCC.CortexFreq_Value=84000000
+RCC.FCLKCortexFreq_Value=84000000
+RCC.HCLKFreq_Value=84000000
+RCC.HSE_VALUE=8000000
+RCC.HSI_VALUE=16000000
+RCC.I2SClocksFreq_Value=96000000
+RCC.IPParameters=AHBFreq_Value,APB1CLKDivider,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,CortexFreq_Value,FCLKCortexFreq_Value,HCLKFreq_Value,HSE_VALUE,HSI_VALUE,I2SClocksFreq_Value,LSI_VALUE,MCO2PinFreq_Value,PLLCLKFreq_Value,PLLM,PLLN,PLLP,PLLQ,PLLQCLKFreq_Value,RTCFreq_Value,RTCHSEDivFreq_Value,SYSCLKFreq_VALUE,SYSCLKSource,VCOI2SOutputFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VcooutputI2S
+RCC.LSI_VALUE=32000
+RCC.MCO2PinFreq_Value=84000000
+RCC.PLLCLKFreq_Value=84000000
+RCC.PLLM=8
+RCC.PLLN=336
+RCC.PLLP=RCC_PLLP_DIV4
+RCC.PLLQ=7
+RCC.PLLQCLKFreq_Value=48000000
+RCC.RTCFreq_Value=32000
+RCC.RTCHSEDivFreq_Value=4000000
+RCC.SYSCLKFreq_VALUE=84000000
+RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK
+RCC.VCOI2SOutputFreq_Value=192000000
+RCC.VCOInputFreq_Value=1000000
+RCC.VCOOutputFreq_Value=336000000
+RCC.VcooutputI2S=96000000
+SH.GPXTI0.0=GPIO_EXTI0
+SH.GPXTI0.ConfNb=1
+SH.GPXTI1.0=GPIO_EXTI1
+SH.GPXTI1.ConfNb=1
+SH.GPXTI4.0=GPIO_EXTI4
+SH.GPXTI4.ConfNb=1
+SH.GPXTI5.0=GPIO_EXTI5
+SH.GPXTI5.ConfNb=1
+SPI1.CalculateBaudRate=42.0 MBits/s
+SPI1.Direction=SPI_DIRECTION_2LINES
+SPI1.IPParameters=Mode,CalculateBaudRate,VirtualType,Direction
+SPI1.Mode=SPI_MODE_MASTER
+SPI1.VirtualType=VM_MASTER
+USART2.IPParameters=VirtualMode
+USART2.VirtualMode=VM_ASYNC
+USB_HOST.BSP.number=1
+USB_HOST.IPParameters=VirtualModeFS,USBH_HandleTypeDef
+USB_HOST.USBH_HandleTypeDef=hUsbHostFS
+USB_HOST.VirtualModeFS=Cdc
+USB_HOST0.BSP.STBoard=false
+USB_HOST0.BSP.api=Unknown
+USB_HOST0.BSP.component=
+USB_HOST0.BSP.condition=
+USB_HOST0.BSP.i2caddr=0
+USB_HOST0.BSP.i2creg=0
+USB_HOST0.BSP.instance=PC0
+USB_HOST0.BSP.ip=GPIO
+USB_HOST0.BSP.mode=Output
+USB_HOST0.BSP.name=Drive_VBUS_FS
+USB_HOST0.BSP.semaphore=
+USB_HOST0.BSP.solution=PC0
+USB_OTG_FS.IPParameters=phy_itface,VirtualMode
+USB_OTG_FS.VirtualMode=Host_Only
+USB_OTG_FS.phy_itface=HCD_PHY_EMBEDDED
+VP_SYS_VS_Systick.Mode=SysTick
+VP_SYS_VS_Systick.Signal=SYS_VS_Systick
+VP_USB_HOST_VS_USB_HOST_CDC_FS.Mode=CDC_FS
+VP_USB_HOST_VS_USB_HOST_CDC_FS.Signal=USB_HOST_VS_USB_HOST_CDC_FS
+board=STM32F401C-DISCO
+boardIOC=true
+isbadioc=false
diff --git a/Core/Inc/app.h b/Core/Inc/app.h
new file mode 100644
index 0000000..0b34d71
--- /dev/null
+++ b/Core/Inc/app.h
@@ -0,0 +1,14 @@
+/*
+ * app.h
+ *
+ * Created on: Apr 3, 2021
+ * Author: Think
+ */
+
+#ifndef INC_APP_H_
+#define INC_APP_H_
+
+void setup(void);
+void loop(void);
+
+#endif /* INC_APP_H_ */
diff --git a/Core/Inc/main.h b/Core/Inc/main.h
new file mode 100644
index 0000000..8020901
--- /dev/null
+++ b/Core/Inc/main.h
@@ -0,0 +1,135 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file : main.h
+ * @brief : Header for main.c file.
+ * This file contains the common defines of the application.
+ ******************************************************************************
+ * @attention
+ *
+ *
© Copyright (c) 2021 STMicroelectronics.
+ * All rights reserved.
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __MAIN_H
+#define __MAIN_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Includes ------------------------------------------------------------------*/
+#include "stm32f4xx_hal.h"
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+/* Exported types ------------------------------------------------------------*/
+/* USER CODE BEGIN ET */
+
+/* USER CODE END ET */
+
+/* Exported constants --------------------------------------------------------*/
+/* USER CODE BEGIN EC */
+
+/* USER CODE END EC */
+
+/* Exported macro ------------------------------------------------------------*/
+/* USER CODE BEGIN EM */
+
+/* USER CODE END EM */
+
+/* Exported functions prototypes ---------------------------------------------*/
+void Error_Handler(void);
+
+/* USER CODE BEGIN EFP */
+
+/* USER CODE END EFP */
+
+/* Private defines -----------------------------------------------------------*/
+#define CS_I2C_SPI_Pin GPIO_PIN_3
+#define CS_I2C_SPI_GPIO_Port GPIOE
+#define PC14_OSC32_IN_Pin GPIO_PIN_14
+#define PC14_OSC32_IN_GPIO_Port GPIOC
+#define PC15_OSC32_OUT_Pin GPIO_PIN_15
+#define PC15_OSC32_OUT_GPIO_Port GPIOC
+#define PH0_OSC_IN_Pin GPIO_PIN_0
+#define PH0_OSC_IN_GPIO_Port GPIOH
+#define PH1_OSC_OUT_Pin GPIO_PIN_1
+#define PH1_OSC_OUT_GPIO_Port GPIOH
+#define OTG_FS_PowerSwitchOn_Pin GPIO_PIN_0
+#define OTG_FS_PowerSwitchOn_GPIO_Port GPIOC
+#define PDM_OUT_Pin GPIO_PIN_3
+#define PDM_OUT_GPIO_Port GPIOC
+#define B1_Pin GPIO_PIN_0
+#define B1_GPIO_Port GPIOA
+#define I2S3_WS_Pin GPIO_PIN_4
+#define I2S3_WS_GPIO_Port GPIOA
+#define SPI1_SCK_Pin GPIO_PIN_5
+#define SPI1_SCK_GPIO_Port GPIOA
+#define SPI1_MISO_Pin GPIO_PIN_6
+#define SPI1_MISO_GPIO_Port GPIOA
+#define SPI1_MISOA7_Pin GPIO_PIN_7
+#define SPI1_MISOA7_GPIO_Port GPIOA
+#define CLK_IN_Pin GPIO_PIN_10
+#define CLK_IN_GPIO_Port GPIOB
+#define LD4_Pin GPIO_PIN_12
+#define LD4_GPIO_Port GPIOD
+#define LD3_Pin GPIO_PIN_13
+#define LD3_GPIO_Port GPIOD
+#define LD5_Pin GPIO_PIN_14
+#define LD5_GPIO_Port GPIOD
+#define LD6_Pin GPIO_PIN_15
+#define LD6_GPIO_Port GPIOD
+#define I2S3_MCK_Pin GPIO_PIN_7
+#define I2S3_MCK_GPIO_Port GPIOC
+#define VBUS_FS_Pin GPIO_PIN_9
+#define VBUS_FS_GPIO_Port GPIOA
+#define OTG_FS_ID_Pin GPIO_PIN_10
+#define OTG_FS_ID_GPIO_Port GPIOA
+#define OTG_FS_DM_Pin GPIO_PIN_11
+#define OTG_FS_DM_GPIO_Port GPIOA
+#define OTG_FS_DP_Pin GPIO_PIN_12
+#define OTG_FS_DP_GPIO_Port GPIOA
+#define SWDIO_Pin GPIO_PIN_13
+#define SWDIO_GPIO_Port GPIOA
+#define SWCLK_Pin GPIO_PIN_14
+#define SWCLK_GPIO_Port GPIOA
+#define I2S3_SCK_Pin GPIO_PIN_10
+#define I2S3_SCK_GPIO_Port GPIOC
+#define I2S3_SD_Pin GPIO_PIN_12
+#define I2S3_SD_GPIO_Port GPIOC
+#define Audio_RST_Pin GPIO_PIN_4
+#define Audio_RST_GPIO_Port GPIOD
+#define OTG_FS_OverCurrent_Pin GPIO_PIN_5
+#define OTG_FS_OverCurrent_GPIO_Port GPIOD
+#define SWO_Pin GPIO_PIN_3
+#define SWO_GPIO_Port GPIOB
+#define Audio_SCL_Pin GPIO_PIN_6
+#define Audio_SCL_GPIO_Port GPIOB
+#define Audio_SDA_Pin GPIO_PIN_9
+#define Audio_SDA_GPIO_Port GPIOB
+#define MEMS_INT2_Pin GPIO_PIN_1
+#define MEMS_INT2_GPIO_Port GPIOE
+/* USER CODE BEGIN Private defines */
+
+/* USER CODE END Private defines */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __MAIN_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Core/Inc/stm32f4xx_hal_conf.h b/Core/Inc/stm32f4xx_hal_conf.h
new file mode 100644
index 0000000..f6735b1
--- /dev/null
+++ b/Core/Inc/stm32f4xx_hal_conf.h
@@ -0,0 +1,486 @@
+/**
+ ******************************************************************************
+ * @file stm32f4xx_hal_conf_template.h
+ * @author MCD Application Team
+ * @brief HAL configuration template file.
+ * This file should be copied to the application folder and renamed
+ * to stm32f4xx_hal_conf.h.
+ ******************************************************************************
+ * @attention
+ *
+ * © Copyright (c) 2017 STMicroelectronics.
+ * All rights reserved.
+ *
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
+ *
+ ******************************************************************************
+ */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __STM32F4xx_HAL_CONF_H
+#define __STM32F4xx_HAL_CONF_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+/* Exported types ------------------------------------------------------------*/
+/* Exported constants --------------------------------------------------------*/
+
+/* ########################## Module Selection ############################## */
+/**
+ * @brief This is the list of modules to be used in the HAL driver
+ */
+#define HAL_MODULE_ENABLED
+
+ /* #define HAL_ADC_MODULE_ENABLED */
+/* #define HAL_CRYP_MODULE_ENABLED */
+/* #define HAL_CAN_MODULE_ENABLED */
+/* #define HAL_CRC_MODULE_ENABLED */
+/* #define HAL_CAN_LEGACY_MODULE_ENABLED */
+/* #define HAL_CRYP_MODULE_ENABLED */
+/* #define HAL_DAC_MODULE_ENABLED */
+/* #define HAL_DCMI_MODULE_ENABLED */
+/* #define HAL_DMA2D_MODULE_ENABLED */
+/* #define HAL_ETH_MODULE_ENABLED */
+/* #define HAL_NAND_MODULE_ENABLED */
+/* #define HAL_NOR_MODULE_ENABLED */
+/* #define HAL_PCCARD_MODULE_ENABLED */
+/* #define HAL_SRAM_MODULE_ENABLED */
+/* #define HAL_SDRAM_MODULE_ENABLED */
+/* #define HAL_HASH_MODULE_ENABLED */
+#define HAL_I2C_MODULE_ENABLED
+#define HAL_I2S_MODULE_ENABLED
+/* #define HAL_IWDG_MODULE_ENABLED */
+/* #define HAL_LTDC_MODULE_ENABLED */
+/* #define HAL_RNG_MODULE_ENABLED */
+/* #define HAL_RTC_MODULE_ENABLED */
+/* #define HAL_SAI_MODULE_ENABLED */
+/* #define HAL_SD_MODULE_ENABLED */
+/* #define HAL_MMC_MODULE_ENABLED */
+#define HAL_SPI_MODULE_ENABLED
+/* #define HAL_TIM_MODULE_ENABLED */
+#define HAL_UART_MODULE_ENABLED
+/* #define HAL_USART_MODULE_ENABLED */
+/* #define HAL_IRDA_MODULE_ENABLED */
+/* #define HAL_SMARTCARD_MODULE_ENABLED */
+/* #define HAL_SMBUS_MODULE_ENABLED */
+/* #define HAL_WWDG_MODULE_ENABLED */
+/* #define HAL_PCD_MODULE_ENABLED */
+#define HAL_HCD_MODULE_ENABLED
+/* #define HAL_DSI_MODULE_ENABLED */
+/* #define HAL_QSPI_MODULE_ENABLED */
+/* #define HAL_QSPI_MODULE_ENABLED */
+/* #define HAL_CEC_MODULE_ENABLED */
+/* #define HAL_FMPI2C_MODULE_ENABLED */
+/* #define HAL_SPDIFRX_MODULE_ENABLED */
+/* #define HAL_DFSDM_MODULE_ENABLED */
+/* #define HAL_LPTIM_MODULE_ENABLED */
+#define HAL_GPIO_MODULE_ENABLED
+#define HAL_EXTI_MODULE_ENABLED
+#define HAL_DMA_MODULE_ENABLED
+#define HAL_RCC_MODULE_ENABLED
+#define HAL_FLASH_MODULE_ENABLED
+#define HAL_PWR_MODULE_ENABLED
+#define HAL_CORTEX_MODULE_ENABLED
+
+/* ########################## HSE/HSI Values adaptation ##################### */
+/**
+ * @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
+ * This value is used by the RCC HAL module to compute the system frequency
+ * (when HSE is used as system clock source, directly or through the PLL).
+ */
+#if !defined (HSE_VALUE)
+ #define HSE_VALUE ((uint32_t)8000000U) /*!< Value of the External oscillator in Hz */
+#endif /* HSE_VALUE */
+
+#if !defined (HSE_STARTUP_TIMEOUT)
+ #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */
+#endif /* HSE_STARTUP_TIMEOUT */
+
+/**
+ * @brief Internal High Speed oscillator (HSI) value.
+ * This value is used by the RCC HAL module to compute the system frequency
+ * (when HSI is used as system clock source, directly or through the PLL).
+ */
+#if !defined (HSI_VALUE)
+ #define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/
+#endif /* HSI_VALUE */
+
+/**
+ * @brief Internal Low Speed oscillator (LSI) value.
+ */
+#if !defined (LSI_VALUE)
+ #define LSI_VALUE ((uint32_t)32000U) /*!< LSI Typical Value in Hz*/
+#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
+ The real value may vary depending on the variations
+ in voltage and temperature.*/
+/**
+ * @brief External Low Speed oscillator (LSE) value.
+ */
+#if !defined (LSE_VALUE)
+ #define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External Low Speed oscillator in Hz */
+#endif /* LSE_VALUE */
+
+#if !defined (LSE_STARTUP_TIMEOUT)
+ #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */
+#endif /* LSE_STARTUP_TIMEOUT */
+
+/**
+ * @brief External clock source for I2S peripheral
+ * This value is used by the I2S HAL module to compute the I2S clock source
+ * frequency, this source is inserted directly through I2S_CKIN pad.
+ */
+#if !defined (EXTERNAL_CLOCK_VALUE)
+ #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/
+#endif /* EXTERNAL_CLOCK_VALUE */
+
+/* Tip: To avoid modifying this file each time you need to use different HSE,
+ === you can define the HSE value in your toolchain compiler preprocessor. */
+
+/* ########################### System Configuration ######################### */
+/**
+ * @brief This is the HAL system configuration section
+ */
+#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */
+#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */
+#define USE_RTOS 0U
+#define PREFETCH_ENABLE 1U
+#define INSTRUCTION_CACHE_ENABLE 1U
+#define DATA_CACHE_ENABLE 1U
+
+#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */
+#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */
+#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */
+#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U /* CRYP register callback disabled */
+#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */
+#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U /* DCMI register callback disabled */
+#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U /* DFSDM register callback disabled */
+#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U /* DMA2D register callback disabled */
+#define USE_HAL_DSI_REGISTER_CALLBACKS 0U /* DSI register callback disabled */
+#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */
+#define USE_HAL_HASH_REGISTER_CALLBACKS 0U /* HASH register callback disabled */
+#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */
+#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */
+#define USE_HAL_FMPI2C_REGISTER_CALLBACKS 0U /* FMPI2C register callback disabled */
+#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */
+#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */
+#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U /* LPTIM register callback disabled */
+#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U /* LTDC register callback disabled */
+#define USE_HAL_MMC_REGISTER_CALLBACKS 0U /* MMC register callback disabled */
+#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */
+#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */
+#define USE_HAL_PCCARD_REGISTER_CALLBACKS 0U /* PCCARD register callback disabled */
+#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */
+#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U /* QSPI register callback disabled */
+#define USE_HAL_RNG_REGISTER_CALLBACKS 0U /* RNG register callback disabled */
+#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */
+#define USE_HAL_SAI_REGISTER_CALLBACKS 0U /* SAI register callback disabled */
+#define USE_HAL_SD_REGISTER_CALLBACKS 0U /* SD register callback disabled */
+#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */
+#define USE_HAL_SDRAM_REGISTER_CALLBACKS 0U /* SDRAM register callback disabled */
+#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */
+#define USE_HAL_SPDIFRX_REGISTER_CALLBACKS 0U /* SPDIFRX register callback disabled */
+#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */
+#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */
+#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */
+#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */
+#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */
+#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */
+
+/* ########################## Assert Selection ############################## */
+/**
+ * @brief Uncomment the line below to expanse the "assert_param" macro in the
+ * HAL drivers code
+ */
+/* #define USE_FULL_ASSERT 1U */
+
+/* ################## Ethernet peripheral configuration ##################### */
+
+/* Section 1 : Ethernet peripheral configuration */
+
+/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */
+#define MAC_ADDR0 2U
+#define MAC_ADDR1 0U
+#define MAC_ADDR2 0U
+#define MAC_ADDR3 0U
+#define MAC_ADDR4 0U
+#define MAC_ADDR5 0U
+
+/* Definition of the Ethernet driver buffers size and count */
+#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */
+#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */
+#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */
+#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */
+
+/* Section 2: PHY configuration section */
+
+/* DP83848_PHY_ADDRESS Address*/
+#define DP83848_PHY_ADDRESS 0x01U
+/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/
+#define PHY_RESET_DELAY ((uint32_t)0x000000FFU)
+/* PHY Configuration delay */
+#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU)
+
+#define PHY_READ_TO ((uint32_t)0x0000FFFFU)
+#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU)
+
+/* Section 3: Common PHY Registers */
+
+#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */
+#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */
+
+#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */
+#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */
+#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */
+#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */
+#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */
+#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */
+#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */
+#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */
+#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */
+#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */
+
+#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */
+#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */
+#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */
+
+/* Section 4: Extended PHY Registers */
+#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */
+
+#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */
+#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */
+
+/* ################## SPI peripheral configuration ########################## */
+
+/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
+* Activated: CRC code is present inside driver
+* Deactivated: CRC code cleaned from driver
+*/
+
+#define USE_SPI_CRC 0U
+
+/* Includes ------------------------------------------------------------------*/
+/**
+ * @brief Include module's header file
+ */
+
+#ifdef HAL_RCC_MODULE_ENABLED
+ #include "stm32f4xx_hal_rcc.h"
+#endif /* HAL_RCC_MODULE_ENABLED */
+
+#ifdef HAL_GPIO_MODULE_ENABLED
+ #include "stm32f4xx_hal_gpio.h"
+#endif /* HAL_GPIO_MODULE_ENABLED */
+
+#ifdef HAL_EXTI_MODULE_ENABLED
+ #include "stm32f4xx_hal_exti.h"
+#endif /* HAL_EXTI_MODULE_ENABLED */
+
+#ifdef HAL_DMA_MODULE_ENABLED
+ #include "stm32f4xx_hal_dma.h"
+#endif /* HAL_DMA_MODULE_ENABLED */
+
+#ifdef HAL_CORTEX_MODULE_ENABLED
+ #include "stm32f4xx_hal_cortex.h"
+#endif /* HAL_CORTEX_MODULE_ENABLED */
+
+#ifdef HAL_ADC_MODULE_ENABLED
+ #include "stm32f4xx_hal_adc.h"
+#endif /* HAL_ADC_MODULE_ENABLED */
+
+#ifdef HAL_CAN_MODULE_ENABLED
+ #include "stm32f4xx_hal_can.h"
+#endif /* HAL_CAN_MODULE_ENABLED */
+
+#ifdef HAL_CAN_LEGACY_MODULE_ENABLED
+ #include "stm32f4xx_hal_can_legacy.h"
+#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */
+
+#ifdef HAL_CRC_MODULE_ENABLED
+ #include "stm32f4xx_hal_crc.h"
+#endif /* HAL_CRC_MODULE_ENABLED */
+
+#ifdef HAL_CRYP_MODULE_ENABLED
+ #include "stm32f4xx_hal_cryp.h"
+#endif /* HAL_CRYP_MODULE_ENABLED */
+
+#ifdef HAL_DMA2D_MODULE_ENABLED
+ #include "stm32f4xx_hal_dma2d.h"
+#endif /* HAL_DMA2D_MODULE_ENABLED */
+
+#ifdef HAL_DAC_MODULE_ENABLED
+ #include "stm32f4xx_hal_dac.h"
+#endif /* HAL_DAC_MODULE_ENABLED */
+
+#ifdef HAL_DCMI_MODULE_ENABLED
+ #include "stm32f4xx_hal_dcmi.h"
+#endif /* HAL_DCMI_MODULE_ENABLED */
+
+#ifdef HAL_ETH_MODULE_ENABLED
+ #include "stm32f4xx_hal_eth.h"
+#endif /* HAL_ETH_MODULE_ENABLED */
+
+#ifdef HAL_FLASH_MODULE_ENABLED
+ #include "stm32f4xx_hal_flash.h"
+#endif /* HAL_FLASH_MODULE_ENABLED */
+
+#ifdef HAL_SRAM_MODULE_ENABLED
+ #include "stm32f4xx_hal_sram.h"
+#endif /* HAL_SRAM_MODULE_ENABLED */
+
+#ifdef HAL_NOR_MODULE_ENABLED
+ #include "stm32f4xx_hal_nor.h"
+#endif /* HAL_NOR_MODULE_ENABLED */
+
+#ifdef HAL_NAND_MODULE_ENABLED
+ #include "stm32f4xx_hal_nand.h"
+#endif /* HAL_NAND_MODULE_ENABLED */
+
+#ifdef HAL_PCCARD_MODULE_ENABLED
+ #include "stm32f4xx_hal_pccard.h"
+#endif /* HAL_PCCARD_MODULE_ENABLED */
+
+#ifdef HAL_SDRAM_MODULE_ENABLED
+ #include "stm32f4xx_hal_sdram.h"
+#endif /* HAL_SDRAM_MODULE_ENABLED */
+
+#ifdef HAL_HASH_MODULE_ENABLED
+ #include "stm32f4xx_hal_hash.h"
+#endif /* HAL_HASH_MODULE_ENABLED */
+
+#ifdef HAL_I2C_MODULE_ENABLED
+ #include "stm32f4xx_hal_i2c.h"
+#endif /* HAL_I2C_MODULE_ENABLED */
+
+#ifdef HAL_SMBUS_MODULE_ENABLED
+ #include "stm32f4xx_hal_smbus.h"
+#endif /* HAL_SMBUS_MODULE_ENABLED */
+
+#ifdef HAL_I2S_MODULE_ENABLED
+ #include "stm32f4xx_hal_i2s.h"
+#endif /* HAL_I2S_MODULE_ENABLED */
+
+#ifdef HAL_IWDG_MODULE_ENABLED
+ #include "stm32f4xx_hal_iwdg.h"
+#endif /* HAL_IWDG_MODULE_ENABLED */
+
+#ifdef HAL_LTDC_MODULE_ENABLED
+ #include "stm32f4xx_hal_ltdc.h"
+#endif /* HAL_LTDC_MODULE_ENABLED */
+
+#ifdef HAL_PWR_MODULE_ENABLED
+ #include "stm32f4xx_hal_pwr.h"
+#endif /* HAL_PWR_MODULE_ENABLED */
+
+#ifdef HAL_RNG_MODULE_ENABLED
+ #include "stm32f4xx_hal_rng.h"
+#endif /* HAL_RNG_MODULE_ENABLED */
+
+#ifdef HAL_RTC_MODULE_ENABLED
+ #include "stm32f4xx_hal_rtc.h"
+#endif /* HAL_RTC_MODULE_ENABLED */
+
+#ifdef HAL_SAI_MODULE_ENABLED
+ #include "stm32f4xx_hal_sai.h"
+#endif /* HAL_SAI_MODULE_ENABLED */
+
+#ifdef HAL_SD_MODULE_ENABLED
+ #include "stm32f4xx_hal_sd.h"
+#endif /* HAL_SD_MODULE_ENABLED */
+
+#ifdef HAL_SPI_MODULE_ENABLED
+ #include "stm32f4xx_hal_spi.h"
+#endif /* HAL_SPI_MODULE_ENABLED */
+
+#ifdef HAL_TIM_MODULE_ENABLED
+ #include "stm32f4xx_hal_tim.h"
+#endif /* HAL_TIM_MODULE_ENABLED */
+
+#ifdef HAL_UART_MODULE_ENABLED
+ #include "stm32f4xx_hal_uart.h"
+#endif /* HAL_UART_MODULE_ENABLED */
+
+#ifdef HAL_USART_MODULE_ENABLED
+ #include "stm32f4xx_hal_usart.h"
+#endif /* HAL_USART_MODULE_ENABLED */
+
+#ifdef HAL_IRDA_MODULE_ENABLED
+ #include "stm32f4xx_hal_irda.h"
+#endif /* HAL_IRDA_MODULE_ENABLED */
+
+#ifdef HAL_SMARTCARD_MODULE_ENABLED
+ #include "stm32f4xx_hal_smartcard.h"
+#endif /* HAL_SMARTCARD_MODULE_ENABLED */
+
+#ifdef HAL_WWDG_MODULE_ENABLED
+ #include "stm32f4xx_hal_wwdg.h"
+#endif /* HAL_WWDG_MODULE_ENABLED */
+
+#ifdef HAL_PCD_MODULE_ENABLED
+ #include "stm32f4xx_hal_pcd.h"
+#endif /* HAL_PCD_MODULE_ENABLED */
+
+#ifdef HAL_HCD_MODULE_ENABLED
+ #include "stm32f4xx_hal_hcd.h"
+#endif /* HAL_HCD_MODULE_ENABLED */
+
+#ifdef HAL_DSI_MODULE_ENABLED
+ #include "stm32f4xx_hal_dsi.h"
+#endif /* HAL_DSI_MODULE_ENABLED */
+
+#ifdef HAL_QSPI_MODULE_ENABLED
+ #include "stm32f4xx_hal_qspi.h"
+#endif /* HAL_QSPI_MODULE_ENABLED */
+
+#ifdef HAL_CEC_MODULE_ENABLED
+ #include "stm32f4xx_hal_cec.h"
+#endif /* HAL_CEC_MODULE_ENABLED */
+
+#ifdef HAL_FMPI2C_MODULE_ENABLED
+ #include "stm32f4xx_hal_fmpi2c.h"
+#endif /* HAL_FMPI2C_MODULE_ENABLED */
+
+#ifdef HAL_SPDIFRX_MODULE_ENABLED
+ #include "stm32f4xx_hal_spdifrx.h"
+#endif /* HAL_SPDIFRX_MODULE_ENABLED */
+
+#ifdef HAL_DFSDM_MODULE_ENABLED
+ #include "stm32f4xx_hal_dfsdm.h"
+#endif /* HAL_DFSDM_MODULE_ENABLED */
+
+#ifdef HAL_LPTIM_MODULE_ENABLED
+ #include "stm32f4xx_hal_lptim.h"
+#endif /* HAL_LPTIM_MODULE_ENABLED */
+
+#ifdef HAL_MMC_MODULE_ENABLED
+ #include "stm32f4xx_hal_mmc.h"
+#endif /* HAL_MMC_MODULE_ENABLED */
+
+/* Exported macro ------------------------------------------------------------*/
+#ifdef USE_FULL_ASSERT
+/**
+ * @brief The assert_param macro is used for function's parameters check.
+ * @param expr If expr is false, it calls assert_failed function
+ * which reports the name of the source file and the source
+ * line number of the call that failed.
+ * If expr is true, it returns no value.
+ * @retval None
+ */
+ #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
+/* Exported functions ------------------------------------------------------- */
+ void assert_failed(uint8_t* file, uint32_t line);
+#else
+ #define assert_param(expr) ((void)0U)
+#endif /* USE_FULL_ASSERT */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __STM32F4xx_HAL_CONF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Core/Inc/stm32f4xx_it.h b/Core/Inc/stm32f4xx_it.h
new file mode 100644
index 0000000..86b00e6
--- /dev/null
+++ b/Core/Inc/stm32f4xx_it.h
@@ -0,0 +1,70 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file stm32f4xx_it.h
+ * @brief This file contains the headers of the interrupt handlers.
+ ******************************************************************************
+ * @attention
+ *
+ * © Copyright (c) 2021 STMicroelectronics.
+ * All rights reserved.
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __STM32F4xx_IT_H
+#define __STM32F4xx_IT_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+/* Exported types ------------------------------------------------------------*/
+/* USER CODE BEGIN ET */
+
+/* USER CODE END ET */
+
+/* Exported constants --------------------------------------------------------*/
+/* USER CODE BEGIN EC */
+
+/* USER CODE END EC */
+
+/* Exported macro ------------------------------------------------------------*/
+/* USER CODE BEGIN EM */
+
+/* USER CODE END EM */
+
+/* Exported functions prototypes ---------------------------------------------*/
+void NMI_Handler(void);
+void HardFault_Handler(void);
+void MemManage_Handler(void);
+void BusFault_Handler(void);
+void UsageFault_Handler(void);
+void SVC_Handler(void);
+void DebugMon_Handler(void);
+void PendSV_Handler(void);
+void SysTick_Handler(void);
+void OTG_FS_IRQHandler(void);
+/* USER CODE BEGIN EFP */
+
+/* USER CODE END EFP */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __STM32F4xx_IT_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Core/Src/app.c b/Core/Src/app.c
new file mode 100644
index 0000000..1f6c9bc
--- /dev/null
+++ b/Core/Src/app.c
@@ -0,0 +1,45 @@
+/*
+ * app.c
+ *
+ * Created on: Apr 3, 2021
+ * Author: Think
+ */
+#include
+#include
+#include
+#include
+#include "app.h"
+#include "stm32f4xx_hal.h"
+#include "CS43L22.h"
+
+#define HEARTBEAT 1000
+
+extern I2C_HandleTypeDef hi2c1;
+CS43L22 cs43l22;
+
+GPIO_InitTypeDef heartBeatLed = {.Pin = GPIO_PIN_13, .Mode = GPIO_MODE_OUTPUT_PP, .Speed = GPIO_SPEED_LOW};
+uint32_t ts_blink = 0;
+uint8_t chipID = 0, revID = 0;
+
+
+void setup(void)
+{
+ HAL_GPIO_Init(GPIOD, &heartBeatLed);
+ CS43L22_Init(&cs43l22, &hi2c1);
+}
+
+void loop(void)
+{
+ if(HAL_GetTick() - ts_blink > HEARTBEAT)
+ {
+ HAL_GPIO_TogglePin(GPIOD, GPIO_PIN_13);
+
+ if(!CS43L22_GetDeviceID(&cs43l22, &chipID, &revID))
+ printf("Failed to retrieve CS43L22 ID\r\n");
+ else
+ printf("Device id : %u, revID : %u\r\n", chipID, revID);
+
+ ts_blink = HAL_GetTick();
+ }
+}
+
diff --git a/Core/Src/main.c b/Core/Src/main.c
new file mode 100644
index 0000000..dc26a25
--- /dev/null
+++ b/Core/Src/main.c
@@ -0,0 +1,467 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file : main.c
+ * @brief : Main program body
+ ******************************************************************************
+ * @attention
+ *
+ * © Copyright (c) 2021 STMicroelectronics.
+ * All rights reserved.
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+/* Includes ------------------------------------------------------------------*/
+#include "main.h"
+#include "usb_host.h"
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+#include "app.h"
+/* USER CODE END Includes */
+
+/* Private typedef -----------------------------------------------------------*/
+/* USER CODE BEGIN PTD */
+
+/* USER CODE END PTD */
+
+/* Private define ------------------------------------------------------------*/
+/* USER CODE BEGIN PD */
+/* USER CODE END PD */
+
+/* Private macro -------------------------------------------------------------*/
+/* USER CODE BEGIN PM */
+
+/* USER CODE END PM */
+
+/* Private variables ---------------------------------------------------------*/
+I2C_HandleTypeDef hi2c1;
+
+I2S_HandleTypeDef hi2s2;
+I2S_HandleTypeDef hi2s3;
+
+SPI_HandleTypeDef hspi1;
+
+UART_HandleTypeDef huart2;
+
+/* USER CODE BEGIN PV */
+
+/* USER CODE END PV */
+
+/* Private function prototypes -----------------------------------------------*/
+void SystemClock_Config(void);
+static void MX_GPIO_Init(void);
+static void MX_I2C1_Init(void);
+static void MX_I2S2_Init(void);
+static void MX_I2S3_Init(void);
+static void MX_SPI1_Init(void);
+static void MX_USART2_UART_Init(void);
+void MX_USB_HOST_Process(void);
+
+/* USER CODE BEGIN PFP */
+
+/* USER CODE END PFP */
+
+/* Private user code ---------------------------------------------------------*/
+/* USER CODE BEGIN 0 */
+int __io_putchar(int ch)
+{
+ HAL_UART_Transmit(&huart2, (uint8_t*)&ch, 1, HAL_MAX_DELAY);
+ return ch;
+}
+/* USER CODE END 0 */
+
+/**
+ * @brief The application entry point.
+ * @retval int
+ */
+int main(void)
+{
+ /* USER CODE BEGIN 1 */
+
+ /* USER CODE END 1 */
+
+ /* MCU Configuration--------------------------------------------------------*/
+
+ /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
+ HAL_Init();
+
+ /* USER CODE BEGIN Init */
+
+ /* USER CODE END Init */
+
+ /* Configure the system clock */
+ SystemClock_Config();
+
+ /* USER CODE BEGIN SysInit */
+
+ /* USER CODE END SysInit */
+
+ /* Initialize all configured peripherals */
+ MX_GPIO_Init();
+ MX_I2C1_Init();
+ MX_I2S2_Init();
+ MX_I2S3_Init();
+ MX_SPI1_Init();
+ MX_USB_HOST_Init();
+ MX_USART2_UART_Init();
+ /* USER CODE BEGIN 2 */
+ setup();
+ /* USER CODE END 2 */
+
+ /* Infinite loop */
+ /* USER CODE BEGIN WHILE */
+ while (1)
+ {
+ /* USER CODE END WHILE */
+ MX_USB_HOST_Process();
+
+ /* USER CODE BEGIN 3 */
+ loop();
+ }
+ /* USER CODE END 3 */
+}
+
+/**
+ * @brief System Clock Configuration
+ * @retval None
+ */
+void SystemClock_Config(void)
+{
+ RCC_OscInitTypeDef RCC_OscInitStruct = {0};
+ RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
+ RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
+
+ /** Configure the main internal regulator output voltage
+ */
+ __HAL_RCC_PWR_CLK_ENABLE();
+ __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE2);
+ /** Initializes the RCC Oscillators according to the specified parameters
+ * in the RCC_OscInitTypeDef structure.
+ */
+ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
+ RCC_OscInitStruct.HSEState = RCC_HSE_ON;
+ RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
+ RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
+ RCC_OscInitStruct.PLL.PLLM = 8;
+ RCC_OscInitStruct.PLL.PLLN = 336;
+ RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV4;
+ RCC_OscInitStruct.PLL.PLLQ = 7;
+ if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ /** Initializes the CPU, AHB and APB buses clocks
+ */
+ RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
+ |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
+ RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
+ RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
+ RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;
+ RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
+
+ if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_I2S;
+ PeriphClkInitStruct.PLLI2S.PLLI2SN = 192;
+ PeriphClkInitStruct.PLLI2S.PLLI2SR = 2;
+ if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)
+ {
+ Error_Handler();
+ }
+}
+
+/**
+ * @brief I2C1 Initialization Function
+ * @param None
+ * @retval None
+ */
+static void MX_I2C1_Init(void)
+{
+
+ /* USER CODE BEGIN I2C1_Init 0 */
+
+ /* USER CODE END I2C1_Init 0 */
+
+ /* USER CODE BEGIN I2C1_Init 1 */
+
+ /* USER CODE END I2C1_Init 1 */
+ hi2c1.Instance = I2C1;
+ hi2c1.Init.ClockSpeed = 100000;
+ hi2c1.Init.DutyCycle = I2C_DUTYCYCLE_2;
+ hi2c1.Init.OwnAddress1 = 0;
+ hi2c1.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT;
+ hi2c1.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE;
+ hi2c1.Init.OwnAddress2 = 0;
+ hi2c1.Init.GeneralCallMode = I2C_GENERALCALL_DISABLE;
+ hi2c1.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE;
+ if (HAL_I2C_Init(&hi2c1) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ /* USER CODE BEGIN I2C1_Init 2 */
+
+ /* USER CODE END I2C1_Init 2 */
+
+}
+
+/**
+ * @brief I2S2 Initialization Function
+ * @param None
+ * @retval None
+ */
+static void MX_I2S2_Init(void)
+{
+
+ /* USER CODE BEGIN I2S2_Init 0 */
+
+ /* USER CODE END I2S2_Init 0 */
+
+ /* USER CODE BEGIN I2S2_Init 1 */
+
+ /* USER CODE END I2S2_Init 1 */
+ hi2s2.Instance = SPI2;
+ hi2s2.Init.Mode = I2S_MODE_MASTER_TX;
+ hi2s2.Init.Standard = I2S_STANDARD_PHILIPS;
+ hi2s2.Init.DataFormat = I2S_DATAFORMAT_16B;
+ hi2s2.Init.MCLKOutput = I2S_MCLKOUTPUT_DISABLE;
+ hi2s2.Init.AudioFreq = I2S_AUDIOFREQ_8K;
+ hi2s2.Init.CPOL = I2S_CPOL_LOW;
+ hi2s2.Init.ClockSource = I2S_CLOCK_PLL;
+ hi2s2.Init.FullDuplexMode = I2S_FULLDUPLEXMODE_DISABLE;
+ if (HAL_I2S_Init(&hi2s2) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ /* USER CODE BEGIN I2S2_Init 2 */
+
+ /* USER CODE END I2S2_Init 2 */
+
+}
+
+/**
+ * @brief I2S3 Initialization Function
+ * @param None
+ * @retval None
+ */
+static void MX_I2S3_Init(void)
+{
+
+ /* USER CODE BEGIN I2S3_Init 0 */
+
+ /* USER CODE END I2S3_Init 0 */
+
+ /* USER CODE BEGIN I2S3_Init 1 */
+
+ /* USER CODE END I2S3_Init 1 */
+ hi2s3.Instance = SPI3;
+ hi2s3.Init.Mode = I2S_MODE_MASTER_TX;
+ hi2s3.Init.Standard = I2S_STANDARD_PHILIPS;
+ hi2s3.Init.DataFormat = I2S_DATAFORMAT_16B;
+ hi2s3.Init.MCLKOutput = I2S_MCLKOUTPUT_ENABLE;
+ hi2s3.Init.AudioFreq = I2S_AUDIOFREQ_96K;
+ hi2s3.Init.CPOL = I2S_CPOL_LOW;
+ hi2s3.Init.ClockSource = I2S_CLOCK_PLL;
+ hi2s3.Init.FullDuplexMode = I2S_FULLDUPLEXMODE_DISABLE;
+ if (HAL_I2S_Init(&hi2s3) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ /* USER CODE BEGIN I2S3_Init 2 */
+
+ /* USER CODE END I2S3_Init 2 */
+
+}
+
+/**
+ * @brief SPI1 Initialization Function
+ * @param None
+ * @retval None
+ */
+static void MX_SPI1_Init(void)
+{
+
+ /* USER CODE BEGIN SPI1_Init 0 */
+
+ /* USER CODE END SPI1_Init 0 */
+
+ /* USER CODE BEGIN SPI1_Init 1 */
+
+ /* USER CODE END SPI1_Init 1 */
+ /* SPI1 parameter configuration*/
+ hspi1.Instance = SPI1;
+ hspi1.Init.Mode = SPI_MODE_MASTER;
+ hspi1.Init.Direction = SPI_DIRECTION_2LINES;
+ hspi1.Init.DataSize = SPI_DATASIZE_8BIT;
+ hspi1.Init.CLKPolarity = SPI_POLARITY_LOW;
+ hspi1.Init.CLKPhase = SPI_PHASE_1EDGE;
+ hspi1.Init.NSS = SPI_NSS_SOFT;
+ hspi1.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_2;
+ hspi1.Init.FirstBit = SPI_FIRSTBIT_MSB;
+ hspi1.Init.TIMode = SPI_TIMODE_DISABLE;
+ hspi1.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;
+ hspi1.Init.CRCPolynomial = 10;
+ if (HAL_SPI_Init(&hspi1) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ /* USER CODE BEGIN SPI1_Init 2 */
+
+ /* USER CODE END SPI1_Init 2 */
+
+}
+
+/**
+ * @brief USART2 Initialization Function
+ * @param None
+ * @retval None
+ */
+static void MX_USART2_UART_Init(void)
+{
+
+ /* USER CODE BEGIN USART2_Init 0 */
+
+ /* USER CODE END USART2_Init 0 */
+
+ /* USER CODE BEGIN USART2_Init 1 */
+
+ /* USER CODE END USART2_Init 1 */
+ huart2.Instance = USART2;
+ huart2.Init.BaudRate = 115200;
+ huart2.Init.WordLength = UART_WORDLENGTH_8B;
+ huart2.Init.StopBits = UART_STOPBITS_1;
+ huart2.Init.Parity = UART_PARITY_NONE;
+ huart2.Init.Mode = UART_MODE_TX_RX;
+ huart2.Init.HwFlowCtl = UART_HWCONTROL_NONE;
+ huart2.Init.OverSampling = UART_OVERSAMPLING_16;
+ if (HAL_UART_Init(&huart2) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ /* USER CODE BEGIN USART2_Init 2 */
+
+ /* USER CODE END USART2_Init 2 */
+
+}
+
+/**
+ * @brief GPIO Initialization Function
+ * @param None
+ * @retval None
+ */
+static void MX_GPIO_Init(void)
+{
+ GPIO_InitTypeDef GPIO_InitStruct = {0};
+
+ /* GPIO Ports Clock Enable */
+ __HAL_RCC_GPIOE_CLK_ENABLE();
+ __HAL_RCC_GPIOC_CLK_ENABLE();
+ __HAL_RCC_GPIOH_CLK_ENABLE();
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ __HAL_RCC_GPIOB_CLK_ENABLE();
+ __HAL_RCC_GPIOD_CLK_ENABLE();
+
+ /*Configure GPIO pin Output Level */
+ HAL_GPIO_WritePin(CS_I2C_SPI_GPIO_Port, CS_I2C_SPI_Pin, GPIO_PIN_RESET);
+
+ /*Configure GPIO pin Output Level */
+ HAL_GPIO_WritePin(OTG_FS_PowerSwitchOn_GPIO_Port, OTG_FS_PowerSwitchOn_Pin, GPIO_PIN_SET);
+
+ /*Configure GPIO pin Output Level */
+ HAL_GPIO_WritePin(GPIOD, LD4_Pin|LD3_Pin|LD5_Pin|LD6_Pin
+ |Audio_RST_Pin, GPIO_PIN_RESET);
+
+ /*Configure GPIO pin : PE2 */
+ GPIO_InitStruct.Pin = GPIO_PIN_2;
+ GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);
+
+ /*Configure GPIO pin : CS_I2C_SPI_Pin */
+ GPIO_InitStruct.Pin = CS_I2C_SPI_Pin;
+ GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
+ HAL_GPIO_Init(CS_I2C_SPI_GPIO_Port, &GPIO_InitStruct);
+
+ /*Configure GPIO pins : PE4 PE5 MEMS_INT2_Pin */
+ GPIO_InitStruct.Pin = GPIO_PIN_4|GPIO_PIN_5|MEMS_INT2_Pin;
+ GPIO_InitStruct.Mode = GPIO_MODE_EVT_RISING;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);
+
+ /*Configure GPIO pin : OTG_FS_PowerSwitchOn_Pin */
+ GPIO_InitStruct.Pin = OTG_FS_PowerSwitchOn_Pin;
+ GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
+ HAL_GPIO_Init(OTG_FS_PowerSwitchOn_GPIO_Port, &GPIO_InitStruct);
+
+ /*Configure GPIO pin : B1_Pin */
+ GPIO_InitStruct.Pin = B1_Pin;
+ GPIO_InitStruct.Mode = GPIO_MODE_EVT_RISING;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ HAL_GPIO_Init(B1_GPIO_Port, &GPIO_InitStruct);
+
+ /*Configure GPIO pins : LD4_Pin LD3_Pin LD5_Pin LD6_Pin
+ Audio_RST_Pin */
+ GPIO_InitStruct.Pin = LD4_Pin|LD3_Pin|LD5_Pin|LD6_Pin
+ |Audio_RST_Pin;
+ GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
+ HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
+
+ /*Configure GPIO pin : OTG_FS_OverCurrent_Pin */
+ GPIO_InitStruct.Pin = OTG_FS_OverCurrent_Pin;
+ GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ HAL_GPIO_Init(OTG_FS_OverCurrent_GPIO_Port, &GPIO_InitStruct);
+
+}
+
+/* USER CODE BEGIN 4 */
+
+/* USER CODE END 4 */
+
+/**
+ * @brief This function is executed in case of error occurrence.
+ * @retval None
+ */
+void Error_Handler(void)
+{
+ /* USER CODE BEGIN Error_Handler_Debug */
+ /* User can add his own implementation to report the HAL error return state */
+ __disable_irq();
+ while (1)
+ {
+ }
+ /* USER CODE END Error_Handler_Debug */
+}
+
+#ifdef USE_FULL_ASSERT
+/**
+ * @brief Reports the name of the source file and the source line number
+ * where the assert_param error has occurred.
+ * @param file: pointer to the source file name
+ * @param line: assert_param error line source number
+ * @retval None
+ */
+void assert_failed(uint8_t *file, uint32_t line)
+{
+ /* USER CODE BEGIN 6 */
+ /* User can add his own implementation to report the file name and line number,
+ ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
+ /* USER CODE END 6 */
+}
+#endif /* USE_FULL_ASSERT */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Core/Src/stm32f4xx_hal_msp.c b/Core/Src/stm32f4xx_hal_msp.c
new file mode 100644
index 0000000..2b74e2a
--- /dev/null
+++ b/Core/Src/stm32f4xx_hal_msp.c
@@ -0,0 +1,418 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file stm32f4xx_hal_msp.c
+ * @brief This file provides code for the MSP Initialization
+ * and de-Initialization codes.
+ ******************************************************************************
+ * @attention
+ *
+ * © Copyright (c) 2021 STMicroelectronics.
+ * All rights reserved.
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Includes ------------------------------------------------------------------*/
+#include "main.h"
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+/* Private typedef -----------------------------------------------------------*/
+/* USER CODE BEGIN TD */
+
+/* USER CODE END TD */
+
+/* Private define ------------------------------------------------------------*/
+/* USER CODE BEGIN Define */
+
+/* USER CODE END Define */
+
+/* Private macro -------------------------------------------------------------*/
+/* USER CODE BEGIN Macro */
+
+/* USER CODE END Macro */
+
+/* Private variables ---------------------------------------------------------*/
+/* USER CODE BEGIN PV */
+
+/* USER CODE END PV */
+
+/* Private function prototypes -----------------------------------------------*/
+/* USER CODE BEGIN PFP */
+
+/* USER CODE END PFP */
+
+/* External functions --------------------------------------------------------*/
+/* USER CODE BEGIN ExternalFunctions */
+
+/* USER CODE END ExternalFunctions */
+
+/* USER CODE BEGIN 0 */
+
+/* USER CODE END 0 */
+/**
+ * Initializes the Global MSP.
+ */
+void HAL_MspInit(void)
+{
+ /* USER CODE BEGIN MspInit 0 */
+
+ /* USER CODE END MspInit 0 */
+
+ __HAL_RCC_SYSCFG_CLK_ENABLE();
+ __HAL_RCC_PWR_CLK_ENABLE();
+
+ HAL_NVIC_SetPriorityGrouping(NVIC_PRIORITYGROUP_0);
+
+ /* System interrupt init*/
+
+ /* USER CODE BEGIN MspInit 1 */
+
+ /* USER CODE END MspInit 1 */
+}
+
+/**
+* @brief I2C MSP Initialization
+* This function configures the hardware resources used in this example
+* @param hi2c: I2C handle pointer
+* @retval None
+*/
+void HAL_I2C_MspInit(I2C_HandleTypeDef* hi2c)
+{
+ GPIO_InitTypeDef GPIO_InitStruct = {0};
+ if(hi2c->Instance==I2C1)
+ {
+ /* USER CODE BEGIN I2C1_MspInit 0 */
+
+ /* USER CODE END I2C1_MspInit 0 */
+
+ __HAL_RCC_GPIOB_CLK_ENABLE();
+ /**I2C1 GPIO Configuration
+ PB6 ------> I2C1_SCL
+ PB9 ------> I2C1_SDA
+ */
+ GPIO_InitStruct.Pin = Audio_SCL_Pin|Audio_SDA_Pin;
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_OD;
+ GPIO_InitStruct.Pull = GPIO_PULLUP;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
+ GPIO_InitStruct.Alternate = GPIO_AF4_I2C1;
+ HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
+
+ /* Peripheral clock enable */
+ __HAL_RCC_I2C1_CLK_ENABLE();
+ /* USER CODE BEGIN I2C1_MspInit 1 */
+
+ /* USER CODE END I2C1_MspInit 1 */
+ }
+
+}
+
+/**
+* @brief I2C MSP De-Initialization
+* This function freeze the hardware resources used in this example
+* @param hi2c: I2C handle pointer
+* @retval None
+*/
+void HAL_I2C_MspDeInit(I2C_HandleTypeDef* hi2c)
+{
+ if(hi2c->Instance==I2C1)
+ {
+ /* USER CODE BEGIN I2C1_MspDeInit 0 */
+
+ /* USER CODE END I2C1_MspDeInit 0 */
+ /* Peripheral clock disable */
+ __HAL_RCC_I2C1_CLK_DISABLE();
+
+ /**I2C1 GPIO Configuration
+ PB6 ------> I2C1_SCL
+ PB9 ------> I2C1_SDA
+ */
+ HAL_GPIO_DeInit(Audio_SCL_GPIO_Port, Audio_SCL_Pin);
+
+ HAL_GPIO_DeInit(Audio_SDA_GPIO_Port, Audio_SDA_Pin);
+
+ /* USER CODE BEGIN I2C1_MspDeInit 1 */
+
+ /* USER CODE END I2C1_MspDeInit 1 */
+ }
+
+}
+
+/**
+* @brief I2S MSP Initialization
+* This function configures the hardware resources used in this example
+* @param hi2s: I2S handle pointer
+* @retval None
+*/
+void HAL_I2S_MspInit(I2S_HandleTypeDef* hi2s)
+{
+ GPIO_InitTypeDef GPIO_InitStruct = {0};
+ if(hi2s->Instance==SPI2)
+ {
+ /* USER CODE BEGIN SPI2_MspInit 0 */
+
+ /* USER CODE END SPI2_MspInit 0 */
+ /* Peripheral clock enable */
+ __HAL_RCC_SPI2_CLK_ENABLE();
+
+ __HAL_RCC_GPIOC_CLK_ENABLE();
+ __HAL_RCC_GPIOB_CLK_ENABLE();
+ /**I2S2 GPIO Configuration
+ PC3 ------> I2S2_SD
+ PB10 ------> I2S2_CK
+ PB12 ------> I2S2_WS
+ */
+ GPIO_InitStruct.Pin = PDM_OUT_Pin;
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
+ GPIO_InitStruct.Alternate = GPIO_AF5_SPI2;
+ HAL_GPIO_Init(PDM_OUT_GPIO_Port, &GPIO_InitStruct);
+
+ GPIO_InitStruct.Pin = CLK_IN_Pin|GPIO_PIN_12;
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
+ GPIO_InitStruct.Alternate = GPIO_AF5_SPI2;
+ HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
+
+ /* USER CODE BEGIN SPI2_MspInit 1 */
+
+ /* USER CODE END SPI2_MspInit 1 */
+ }
+ else if(hi2s->Instance==SPI3)
+ {
+ /* USER CODE BEGIN SPI3_MspInit 0 */
+
+ /* USER CODE END SPI3_MspInit 0 */
+ /* Peripheral clock enable */
+ __HAL_RCC_SPI3_CLK_ENABLE();
+
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ __HAL_RCC_GPIOC_CLK_ENABLE();
+ /**I2S3 GPIO Configuration
+ PA4 ------> I2S3_WS
+ PC7 ------> I2S3_MCK
+ PC10 ------> I2S3_CK
+ PC12 ------> I2S3_SD
+ */
+ GPIO_InitStruct.Pin = I2S3_WS_Pin;
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
+ GPIO_InitStruct.Alternate = GPIO_AF6_SPI3;
+ HAL_GPIO_Init(I2S3_WS_GPIO_Port, &GPIO_InitStruct);
+
+ GPIO_InitStruct.Pin = I2S3_MCK_Pin|I2S3_SCK_Pin|I2S3_SD_Pin;
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
+ GPIO_InitStruct.Alternate = GPIO_AF6_SPI3;
+ HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
+
+ /* USER CODE BEGIN SPI3_MspInit 1 */
+
+ /* USER CODE END SPI3_MspInit 1 */
+ }
+
+}
+
+/**
+* @brief I2S MSP De-Initialization
+* This function freeze the hardware resources used in this example
+* @param hi2s: I2S handle pointer
+* @retval None
+*/
+void HAL_I2S_MspDeInit(I2S_HandleTypeDef* hi2s)
+{
+ if(hi2s->Instance==SPI2)
+ {
+ /* USER CODE BEGIN SPI2_MspDeInit 0 */
+
+ /* USER CODE END SPI2_MspDeInit 0 */
+ /* Peripheral clock disable */
+ __HAL_RCC_SPI2_CLK_DISABLE();
+
+ /**I2S2 GPIO Configuration
+ PC3 ------> I2S2_SD
+ PB10 ------> I2S2_CK
+ PB12 ------> I2S2_WS
+ */
+ HAL_GPIO_DeInit(PDM_OUT_GPIO_Port, PDM_OUT_Pin);
+
+ HAL_GPIO_DeInit(GPIOB, CLK_IN_Pin|GPIO_PIN_12);
+
+ /* USER CODE BEGIN SPI2_MspDeInit 1 */
+
+ /* USER CODE END SPI2_MspDeInit 1 */
+ }
+ else if(hi2s->Instance==SPI3)
+ {
+ /* USER CODE BEGIN SPI3_MspDeInit 0 */
+
+ /* USER CODE END SPI3_MspDeInit 0 */
+ /* Peripheral clock disable */
+ __HAL_RCC_SPI3_CLK_DISABLE();
+
+ /**I2S3 GPIO Configuration
+ PA4 ------> I2S3_WS
+ PC7 ------> I2S3_MCK
+ PC10 ------> I2S3_CK
+ PC12 ------> I2S3_SD
+ */
+ HAL_GPIO_DeInit(I2S3_WS_GPIO_Port, I2S3_WS_Pin);
+
+ HAL_GPIO_DeInit(GPIOC, I2S3_MCK_Pin|I2S3_SCK_Pin|I2S3_SD_Pin);
+
+ /* USER CODE BEGIN SPI3_MspDeInit 1 */
+
+ /* USER CODE END SPI3_MspDeInit 1 */
+ }
+
+}
+
+/**
+* @brief SPI MSP Initialization
+* This function configures the hardware resources used in this example
+* @param hspi: SPI handle pointer
+* @retval None
+*/
+void HAL_SPI_MspInit(SPI_HandleTypeDef* hspi)
+{
+ GPIO_InitTypeDef GPIO_InitStruct = {0};
+ if(hspi->Instance==SPI1)
+ {
+ /* USER CODE BEGIN SPI1_MspInit 0 */
+
+ /* USER CODE END SPI1_MspInit 0 */
+ /* Peripheral clock enable */
+ __HAL_RCC_SPI1_CLK_ENABLE();
+
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ /**SPI1 GPIO Configuration
+ PA5 ------> SPI1_SCK
+ PA6 ------> SPI1_MISO
+ PA7 ------> SPI1_MOSI
+ */
+ GPIO_InitStruct.Pin = SPI1_SCK_Pin|SPI1_MISO_Pin|SPI1_MISOA7_Pin;
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
+ GPIO_InitStruct.Alternate = GPIO_AF5_SPI1;
+ HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
+
+ /* USER CODE BEGIN SPI1_MspInit 1 */
+
+ /* USER CODE END SPI1_MspInit 1 */
+ }
+
+}
+
+/**
+* @brief SPI MSP De-Initialization
+* This function freeze the hardware resources used in this example
+* @param hspi: SPI handle pointer
+* @retval None
+*/
+void HAL_SPI_MspDeInit(SPI_HandleTypeDef* hspi)
+{
+ if(hspi->Instance==SPI1)
+ {
+ /* USER CODE BEGIN SPI1_MspDeInit 0 */
+
+ /* USER CODE END SPI1_MspDeInit 0 */
+ /* Peripheral clock disable */
+ __HAL_RCC_SPI1_CLK_DISABLE();
+
+ /**SPI1 GPIO Configuration
+ PA5 ------> SPI1_SCK
+ PA6 ------> SPI1_MISO
+ PA7 ------> SPI1_MOSI
+ */
+ HAL_GPIO_DeInit(GPIOA, SPI1_SCK_Pin|SPI1_MISO_Pin|SPI1_MISOA7_Pin);
+
+ /* USER CODE BEGIN SPI1_MspDeInit 1 */
+
+ /* USER CODE END SPI1_MspDeInit 1 */
+ }
+
+}
+
+/**
+* @brief UART MSP Initialization
+* This function configures the hardware resources used in this example
+* @param huart: UART handle pointer
+* @retval None
+*/
+void HAL_UART_MspInit(UART_HandleTypeDef* huart)
+{
+ GPIO_InitTypeDef GPIO_InitStruct = {0};
+ if(huart->Instance==USART2)
+ {
+ /* USER CODE BEGIN USART2_MspInit 0 */
+
+ /* USER CODE END USART2_MspInit 0 */
+ /* Peripheral clock enable */
+ __HAL_RCC_USART2_CLK_ENABLE();
+
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ /**USART2 GPIO Configuration
+ PA2 ------> USART2_TX
+ PA3 ------> USART2_RX
+ */
+ GPIO_InitStruct.Pin = GPIO_PIN_2|GPIO_PIN_3;
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
+ GPIO_InitStruct.Alternate = GPIO_AF7_USART2;
+ HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
+
+ /* USER CODE BEGIN USART2_MspInit 1 */
+
+ /* USER CODE END USART2_MspInit 1 */
+ }
+
+}
+
+/**
+* @brief UART MSP De-Initialization
+* This function freeze the hardware resources used in this example
+* @param huart: UART handle pointer
+* @retval None
+*/
+void HAL_UART_MspDeInit(UART_HandleTypeDef* huart)
+{
+ if(huart->Instance==USART2)
+ {
+ /* USER CODE BEGIN USART2_MspDeInit 0 */
+
+ /* USER CODE END USART2_MspDeInit 0 */
+ /* Peripheral clock disable */
+ __HAL_RCC_USART2_CLK_DISABLE();
+
+ /**USART2 GPIO Configuration
+ PA2 ------> USART2_TX
+ PA3 ------> USART2_RX
+ */
+ HAL_GPIO_DeInit(GPIOA, GPIO_PIN_2|GPIO_PIN_3);
+
+ /* USER CODE BEGIN USART2_MspDeInit 1 */
+
+ /* USER CODE END USART2_MspDeInit 1 */
+ }
+
+}
+
+/* USER CODE BEGIN 1 */
+
+/* USER CODE END 1 */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Core/Src/stm32f4xx_it.c b/Core/Src/stm32f4xx_it.c
new file mode 100644
index 0000000..a134e3d
--- /dev/null
+++ b/Core/Src/stm32f4xx_it.c
@@ -0,0 +1,219 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file stm32f4xx_it.c
+ * @brief Interrupt Service Routines.
+ ******************************************************************************
+ * @attention
+ *
+ * © Copyright (c) 2021 STMicroelectronics.
+ * All rights reserved.
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Includes ------------------------------------------------------------------*/
+#include "main.h"
+#include "stm32f4xx_it.h"
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+/* USER CODE END Includes */
+
+/* Private typedef -----------------------------------------------------------*/
+/* USER CODE BEGIN TD */
+
+/* USER CODE END TD */
+
+/* Private define ------------------------------------------------------------*/
+/* USER CODE BEGIN PD */
+
+/* USER CODE END PD */
+
+/* Private macro -------------------------------------------------------------*/
+/* USER CODE BEGIN PM */
+
+/* USER CODE END PM */
+
+/* Private variables ---------------------------------------------------------*/
+/* USER CODE BEGIN PV */
+
+/* USER CODE END PV */
+
+/* Private function prototypes -----------------------------------------------*/
+/* USER CODE BEGIN PFP */
+
+/* USER CODE END PFP */
+
+/* Private user code ---------------------------------------------------------*/
+/* USER CODE BEGIN 0 */
+
+/* USER CODE END 0 */
+
+/* External variables --------------------------------------------------------*/
+extern HCD_HandleTypeDef hhcd_USB_OTG_FS;
+/* USER CODE BEGIN EV */
+
+/* USER CODE END EV */
+
+/******************************************************************************/
+/* Cortex-M4 Processor Interruption and Exception Handlers */
+/******************************************************************************/
+/**
+ * @brief This function handles Non maskable interrupt.
+ */
+void NMI_Handler(void)
+{
+ /* USER CODE BEGIN NonMaskableInt_IRQn 0 */
+
+ /* USER CODE END NonMaskableInt_IRQn 0 */
+ /* USER CODE BEGIN NonMaskableInt_IRQn 1 */
+ while (1)
+ {
+ }
+ /* USER CODE END NonMaskableInt_IRQn 1 */
+}
+
+/**
+ * @brief This function handles Hard fault interrupt.
+ */
+void HardFault_Handler(void)
+{
+ /* USER CODE BEGIN HardFault_IRQn 0 */
+
+ /* USER CODE END HardFault_IRQn 0 */
+ while (1)
+ {
+ /* USER CODE BEGIN W1_HardFault_IRQn 0 */
+ /* USER CODE END W1_HardFault_IRQn 0 */
+ }
+}
+
+/**
+ * @brief This function handles Memory management fault.
+ */
+void MemManage_Handler(void)
+{
+ /* USER CODE BEGIN MemoryManagement_IRQn 0 */
+
+ /* USER CODE END MemoryManagement_IRQn 0 */
+ while (1)
+ {
+ /* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */
+ /* USER CODE END W1_MemoryManagement_IRQn 0 */
+ }
+}
+
+/**
+ * @brief This function handles Pre-fetch fault, memory access fault.
+ */
+void BusFault_Handler(void)
+{
+ /* USER CODE BEGIN BusFault_IRQn 0 */
+
+ /* USER CODE END BusFault_IRQn 0 */
+ while (1)
+ {
+ /* USER CODE BEGIN W1_BusFault_IRQn 0 */
+ /* USER CODE END W1_BusFault_IRQn 0 */
+ }
+}
+
+/**
+ * @brief This function handles Undefined instruction or illegal state.
+ */
+void UsageFault_Handler(void)
+{
+ /* USER CODE BEGIN UsageFault_IRQn 0 */
+
+ /* USER CODE END UsageFault_IRQn 0 */
+ while (1)
+ {
+ /* USER CODE BEGIN W1_UsageFault_IRQn 0 */
+ /* USER CODE END W1_UsageFault_IRQn 0 */
+ }
+}
+
+/**
+ * @brief This function handles System service call via SWI instruction.
+ */
+void SVC_Handler(void)
+{
+ /* USER CODE BEGIN SVCall_IRQn 0 */
+
+ /* USER CODE END SVCall_IRQn 0 */
+ /* USER CODE BEGIN SVCall_IRQn 1 */
+
+ /* USER CODE END SVCall_IRQn 1 */
+}
+
+/**
+ * @brief This function handles Debug monitor.
+ */
+void DebugMon_Handler(void)
+{
+ /* USER CODE BEGIN DebugMonitor_IRQn 0 */
+
+ /* USER CODE END DebugMonitor_IRQn 0 */
+ /* USER CODE BEGIN DebugMonitor_IRQn 1 */
+
+ /* USER CODE END DebugMonitor_IRQn 1 */
+}
+
+/**
+ * @brief This function handles Pendable request for system service.
+ */
+void PendSV_Handler(void)
+{
+ /* USER CODE BEGIN PendSV_IRQn 0 */
+
+ /* USER CODE END PendSV_IRQn 0 */
+ /* USER CODE BEGIN PendSV_IRQn 1 */
+
+ /* USER CODE END PendSV_IRQn 1 */
+}
+
+/**
+ * @brief This function handles System tick timer.
+ */
+void SysTick_Handler(void)
+{
+ /* USER CODE BEGIN SysTick_IRQn 0 */
+
+ /* USER CODE END SysTick_IRQn 0 */
+ HAL_IncTick();
+ /* USER CODE BEGIN SysTick_IRQn 1 */
+
+ /* USER CODE END SysTick_IRQn 1 */
+}
+
+/******************************************************************************/
+/* STM32F4xx Peripheral Interrupt Handlers */
+/* Add here the Interrupt Handlers for the used peripherals. */
+/* For the available peripheral interrupt handler names, */
+/* please refer to the startup file (startup_stm32f4xx.s). */
+/******************************************************************************/
+
+/**
+ * @brief This function handles USB On The Go FS global interrupt.
+ */
+void OTG_FS_IRQHandler(void)
+{
+ /* USER CODE BEGIN OTG_FS_IRQn 0 */
+
+ /* USER CODE END OTG_FS_IRQn 0 */
+ HAL_HCD_IRQHandler(&hhcd_USB_OTG_FS);
+ /* USER CODE BEGIN OTG_FS_IRQn 1 */
+
+ /* USER CODE END OTG_FS_IRQn 1 */
+}
+
+/* USER CODE BEGIN 1 */
+
+/* USER CODE END 1 */
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Core/Src/syscalls.c b/Core/Src/syscalls.c
new file mode 100644
index 0000000..4ec9584
--- /dev/null
+++ b/Core/Src/syscalls.c
@@ -0,0 +1,159 @@
+/**
+ ******************************************************************************
+ * @file syscalls.c
+ * @author Auto-generated by STM32CubeIDE
+ * @brief STM32CubeIDE Minimal System calls file
+ *
+ * For more information about which c-functions
+ * need which of these lowlevel functions
+ * please consult the Newlib libc-manual
+ ******************************************************************************
+ * @attention
+ *
+ * © Copyright (c) 2020 STMicroelectronics.
+ * All rights reserved.
+ *
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
+ *
+ ******************************************************************************
+ */
+
+/* Includes */
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+
+/* Variables */
+//#undef errno
+extern int errno;
+extern int __io_putchar(int ch) __attribute__((weak));
+extern int __io_getchar(void) __attribute__((weak));
+
+register char * stack_ptr asm("sp");
+
+char *__env[1] = { 0 };
+char **environ = __env;
+
+
+/* Functions */
+void initialise_monitor_handles()
+{
+}
+
+int _getpid(void)
+{
+ return 1;
+}
+
+int _kill(int pid, int sig)
+{
+ errno = EINVAL;
+ return -1;
+}
+
+void _exit (int status)
+{
+ _kill(status, -1);
+ while (1) {} /* Make sure we hang here */
+}
+
+__attribute__((weak)) int _read(int file, char *ptr, int len)
+{
+ int DataIdx;
+
+ for (DataIdx = 0; DataIdx < len; DataIdx++)
+ {
+ *ptr++ = __io_getchar();
+ }
+
+return len;
+}
+
+__attribute__((weak)) int _write(int file, char *ptr, int len)
+{
+ int DataIdx;
+
+ for (DataIdx = 0; DataIdx < len; DataIdx++)
+ {
+ __io_putchar(*ptr++);
+ }
+ return len;
+}
+
+int _close(int file)
+{
+ return -1;
+}
+
+
+int _fstat(int file, struct stat *st)
+{
+ st->st_mode = S_IFCHR;
+ return 0;
+}
+
+int _isatty(int file)
+{
+ return 1;
+}
+
+int _lseek(int file, int ptr, int dir)
+{
+ return 0;
+}
+
+int _open(char *path, int flags, ...)
+{
+ /* Pretend like we always fail */
+ return -1;
+}
+
+int _wait(int *status)
+{
+ errno = ECHILD;
+ return -1;
+}
+
+int _unlink(char *name)
+{
+ errno = ENOENT;
+ return -1;
+}
+
+int _times(struct tms *buf)
+{
+ return -1;
+}
+
+int _stat(char *file, struct stat *st)
+{
+ st->st_mode = S_IFCHR;
+ return 0;
+}
+
+int _link(char *old, char *new)
+{
+ errno = EMLINK;
+ return -1;
+}
+
+int _fork(void)
+{
+ errno = EAGAIN;
+ return -1;
+}
+
+int _execve(char *name, char **argv, char **env)
+{
+ errno = ENOMEM;
+ return -1;
+}
diff --git a/Core/Src/sysmem.c b/Core/Src/sysmem.c
new file mode 100644
index 0000000..d7cc52c
--- /dev/null
+++ b/Core/Src/sysmem.c
@@ -0,0 +1,80 @@
+/**
+ ******************************************************************************
+ * @file sysmem.c
+ * @author Generated by STM32CubeIDE
+ * @brief STM32CubeIDE System Memory calls file
+ *
+ * For more information about which C functions
+ * need which of these lowlevel functions
+ * please consult the newlib libc manual
+ ******************************************************************************
+ * @attention
+ *
+ * © Copyright (c) 2020 STMicroelectronics.
+ * All rights reserved.
+ *
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
+ *
+ ******************************************************************************
+ */
+
+/* Includes */
+#include
+#include
+
+/**
+ * Pointer to the current high watermark of the heap usage
+ */
+static uint8_t *__sbrk_heap_end = NULL;
+
+/**
+ * @brief _sbrk() allocates memory to the newlib heap and is used by malloc
+ * and others from the C library
+ *
+ * @verbatim
+ * ############################################################################
+ * # .data # .bss # newlib heap # MSP stack #
+ * # # # # Reserved by _Min_Stack_Size #
+ * ############################################################################
+ * ^-- RAM start ^-- _end _estack, RAM end --^
+ * @endverbatim
+ *
+ * This implementation starts allocating at the '_end' linker symbol
+ * The '_Min_Stack_Size' linker symbol reserves a memory for the MSP stack
+ * The implementation considers '_estack' linker symbol to be RAM end
+ * NOTE: If the MSP stack, at any point during execution, grows larger than the
+ * reserved size, please increase the '_Min_Stack_Size'.
+ *
+ * @param incr Memory size
+ * @return Pointer to allocated memory
+ */
+void *_sbrk(ptrdiff_t incr)
+{
+ extern uint8_t _end; /* Symbol defined in the linker script */
+ extern uint8_t _estack; /* Symbol defined in the linker script */
+ extern uint32_t _Min_Stack_Size; /* Symbol defined in the linker script */
+ const uint32_t stack_limit = (uint32_t)&_estack - (uint32_t)&_Min_Stack_Size;
+ const uint8_t *max_heap = (uint8_t *)stack_limit;
+ uint8_t *prev_heap_end;
+
+ /* Initialize heap end at first call */
+ if (NULL == __sbrk_heap_end)
+ {
+ __sbrk_heap_end = &_end;
+ }
+
+ /* Protect heap from growing into the reserved MSP stack */
+ if (__sbrk_heap_end + incr > max_heap)
+ {
+ errno = ENOMEM;
+ return (void *)-1;
+ }
+
+ prev_heap_end = __sbrk_heap_end;
+ __sbrk_heap_end += incr;
+
+ return (void *)prev_heap_end;
+}
diff --git a/Core/Src/system_stm32f4xx.c b/Core/Src/system_stm32f4xx.c
new file mode 100644
index 0000000..bcb2b9f
--- /dev/null
+++ b/Core/Src/system_stm32f4xx.c
@@ -0,0 +1,727 @@
+/**
+ ******************************************************************************
+ * @file system_stm32f4xx.c
+ * @author MCD Application Team
+ * @brief CMSIS Cortex-M4 Device Peripheral Access Layer System Source File.
+ *
+ * This file provides two functions and one global variable to be called from
+ * user application:
+ * - SystemInit(): This function is called at startup just after reset and
+ * before branch to main program. This call is made inside
+ * the "startup_stm32f4xx.s" file.
+ *
+ * - SystemCoreClock variable: Contains the core clock (HCLK), it can be used
+ * by the user application to setup the SysTick
+ * timer or configure other parameters.
+ *
+ * - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must
+ * be called whenever the core clock is changed
+ * during program execution.
+ *
+ *
+ ******************************************************************************
+ * @attention
+ *
+ * © Copyright (c) 2017 STMicroelectronics.
+ * All rights reserved.
+ *
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
+ *
+ ******************************************************************************
+ */
+
+/** @addtogroup CMSIS
+ * @{
+ */
+
+/** @addtogroup stm32f4xx_system
+ * @{
+ */
+
+/** @addtogroup STM32F4xx_System_Private_Includes
+ * @{
+ */
+
+
+#include "stm32f4xx.h"
+
+#if !defined (HSE_VALUE)
+ #define HSE_VALUE ((uint32_t)25000000) /*!< Default value of the External oscillator in Hz */
+#endif /* HSE_VALUE */
+
+#if !defined (HSI_VALUE)
+ #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/
+#endif /* HSI_VALUE */
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32F4xx_System_Private_TypesDefinitions
+ * @{
+ */
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32F4xx_System_Private_Defines
+ * @{
+ */
+
+/************************* Miscellaneous Configuration ************************/
+/*!< Uncomment the following line if you need to use external SRAM or SDRAM as data memory */
+#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx)\
+ || defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx)\
+ || defined(STM32F469xx) || defined(STM32F479xx) || defined(STM32F412Zx) || defined(STM32F412Vx)
+/* #define DATA_IN_ExtSRAM */
+#endif /* STM32F40xxx || STM32F41xxx || STM32F42xxx || STM32F43xxx || STM32F469xx || STM32F479xx ||\
+ STM32F412Zx || STM32F412Vx */
+
+#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx)\
+ || defined(STM32F446xx) || defined(STM32F469xx) || defined(STM32F479xx)
+/* #define DATA_IN_ExtSDRAM */
+#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx || STM32F469xx ||\
+ STM32F479xx */
+
+/*!< Uncomment the following line if you need to relocate your vector Table in
+ Internal SRAM. */
+/* #define VECT_TAB_SRAM */
+#define VECT_TAB_OFFSET 0x00 /*!< Vector Table base offset field.
+ This value must be a multiple of 0x200. */
+/******************************************************************************/
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32F4xx_System_Private_Macros
+ * @{
+ */
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32F4xx_System_Private_Variables
+ * @{
+ */
+ /* This variable is updated in three ways:
+ 1) by calling CMSIS function SystemCoreClockUpdate()
+ 2) by calling HAL API function HAL_RCC_GetHCLKFreq()
+ 3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency
+ Note: If you use this function to configure the system clock; then there
+ is no need to call the 2 first functions listed above, since SystemCoreClock
+ variable is updated automatically.
+ */
+uint32_t SystemCoreClock = 16000000;
+const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9};
+const uint8_t APBPrescTable[8] = {0, 0, 0, 0, 1, 2, 3, 4};
+/**
+ * @}
+ */
+
+/** @addtogroup STM32F4xx_System_Private_FunctionPrototypes
+ * @{
+ */
+
+#if defined (DATA_IN_ExtSRAM) || defined (DATA_IN_ExtSDRAM)
+ static void SystemInit_ExtMemCtl(void);
+#endif /* DATA_IN_ExtSRAM || DATA_IN_ExtSDRAM */
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32F4xx_System_Private_Functions
+ * @{
+ */
+
+/**
+ * @brief Setup the microcontroller system
+ * Initialize the FPU setting, vector table location and External memory
+ * configuration.
+ * @param None
+ * @retval None
+ */
+void SystemInit(void)
+{
+ /* FPU settings ------------------------------------------------------------*/
+ #if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
+ SCB->CPACR |= ((3UL << 10*2)|(3UL << 11*2)); /* set CP10 and CP11 Full Access */
+ #endif
+
+#if defined (DATA_IN_ExtSRAM) || defined (DATA_IN_ExtSDRAM)
+ SystemInit_ExtMemCtl();
+#endif /* DATA_IN_ExtSRAM || DATA_IN_ExtSDRAM */
+
+ /* Configure the Vector Table location add offset address ------------------*/
+#ifdef VECT_TAB_SRAM
+ SCB->VTOR = SRAM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */
+#else
+ SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */
+#endif
+}
+
+/**
+ * @brief Update SystemCoreClock variable according to Clock Register Values.
+ * The SystemCoreClock variable contains the core clock (HCLK), it can
+ * be used by the user application to setup the SysTick timer or configure
+ * other parameters.
+ *
+ * @note Each time the core clock (HCLK) changes, this function must be called
+ * to update SystemCoreClock variable value. Otherwise, any configuration
+ * based on this variable will be incorrect.
+ *
+ * @note - The system frequency computed by this function is not the real
+ * frequency in the chip. It is calculated based on the predefined
+ * constant and the selected clock source:
+ *
+ * - If SYSCLK source is HSI, SystemCoreClock will contain the HSI_VALUE(*)
+ *
+ * - If SYSCLK source is HSE, SystemCoreClock will contain the HSE_VALUE(**)
+ *
+ * - If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(**)
+ * or HSI_VALUE(*) multiplied/divided by the PLL factors.
+ *
+ * (*) HSI_VALUE is a constant defined in stm32f4xx_hal_conf.h file (default value
+ * 16 MHz) but the real value may vary depending on the variations
+ * in voltage and temperature.
+ *
+ * (**) HSE_VALUE is a constant defined in stm32f4xx_hal_conf.h file (its value
+ * depends on the application requirements), user has to ensure that HSE_VALUE
+ * is same as the real frequency of the crystal used. Otherwise, this function
+ * may have wrong result.
+ *
+ * - The result of this function could be not correct when using fractional
+ * value for HSE crystal.
+ *
+ * @param None
+ * @retval None
+ */
+void SystemCoreClockUpdate(void)
+{
+ uint32_t tmp = 0, pllvco = 0, pllp = 2, pllsource = 0, pllm = 2;
+
+ /* Get SYSCLK source -------------------------------------------------------*/
+ tmp = RCC->CFGR & RCC_CFGR_SWS;
+
+ switch (tmp)
+ {
+ case 0x00: /* HSI used as system clock source */
+ SystemCoreClock = HSI_VALUE;
+ break;
+ case 0x04: /* HSE used as system clock source */
+ SystemCoreClock = HSE_VALUE;
+ break;
+ case 0x08: /* PLL used as system clock source */
+
+ /* PLL_VCO = (HSE_VALUE or HSI_VALUE / PLL_M) * PLL_N
+ SYSCLK = PLL_VCO / PLL_P
+ */
+ pllsource = (RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC) >> 22;
+ pllm = RCC->PLLCFGR & RCC_PLLCFGR_PLLM;
+
+ if (pllsource != 0)
+ {
+ /* HSE used as PLL clock source */
+ pllvco = (HSE_VALUE / pllm) * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> 6);
+ }
+ else
+ {
+ /* HSI used as PLL clock source */
+ pllvco = (HSI_VALUE / pllm) * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> 6);
+ }
+
+ pllp = (((RCC->PLLCFGR & RCC_PLLCFGR_PLLP) >>16) + 1 ) *2;
+ SystemCoreClock = pllvco/pllp;
+ break;
+ default:
+ SystemCoreClock = HSI_VALUE;
+ break;
+ }
+ /* Compute HCLK frequency --------------------------------------------------*/
+ /* Get HCLK prescaler */
+ tmp = AHBPrescTable[((RCC->CFGR & RCC_CFGR_HPRE) >> 4)];
+ /* HCLK frequency */
+ SystemCoreClock >>= tmp;
+}
+
+#if defined (DATA_IN_ExtSRAM) && defined (DATA_IN_ExtSDRAM)
+#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx)\
+ || defined(STM32F469xx) || defined(STM32F479xx)
+/**
+ * @brief Setup the external memory controller.
+ * Called in startup_stm32f4xx.s before jump to main.
+ * This function configures the external memories (SRAM/SDRAM)
+ * This SRAM/SDRAM will be used as program data memory (including heap and stack).
+ * @param None
+ * @retval None
+ */
+void SystemInit_ExtMemCtl(void)
+{
+ __IO uint32_t tmp = 0x00;
+
+ register uint32_t tmpreg = 0, timeout = 0xFFFF;
+ register __IO uint32_t index;
+
+ /* Enable GPIOC, GPIOD, GPIOE, GPIOF, GPIOG, GPIOH and GPIOI interface clock */
+ RCC->AHB1ENR |= 0x000001F8;
+
+ /* Delay after an RCC peripheral clock enabling */
+ tmp = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOCEN);
+
+ /* Connect PDx pins to FMC Alternate function */
+ GPIOD->AFR[0] = 0x00CCC0CC;
+ GPIOD->AFR[1] = 0xCCCCCCCC;
+ /* Configure PDx pins in Alternate function mode */
+ GPIOD->MODER = 0xAAAA0A8A;
+ /* Configure PDx pins speed to 100 MHz */
+ GPIOD->OSPEEDR = 0xFFFF0FCF;
+ /* Configure PDx pins Output type to push-pull */
+ GPIOD->OTYPER = 0x00000000;
+ /* No pull-up, pull-down for PDx pins */
+ GPIOD->PUPDR = 0x00000000;
+
+ /* Connect PEx pins to FMC Alternate function */
+ GPIOE->AFR[0] = 0xC00CC0CC;
+ GPIOE->AFR[1] = 0xCCCCCCCC;
+ /* Configure PEx pins in Alternate function mode */
+ GPIOE->MODER = 0xAAAA828A;
+ /* Configure PEx pins speed to 100 MHz */
+ GPIOE->OSPEEDR = 0xFFFFC3CF;
+ /* Configure PEx pins Output type to push-pull */
+ GPIOE->OTYPER = 0x00000000;
+ /* No pull-up, pull-down for PEx pins */
+ GPIOE->PUPDR = 0x00000000;
+
+ /* Connect PFx pins to FMC Alternate function */
+ GPIOF->AFR[0] = 0xCCCCCCCC;
+ GPIOF->AFR[1] = 0xCCCCCCCC;
+ /* Configure PFx pins in Alternate function mode */
+ GPIOF->MODER = 0xAA800AAA;
+ /* Configure PFx pins speed to 50 MHz */
+ GPIOF->OSPEEDR = 0xAA800AAA;
+ /* Configure PFx pins Output type to push-pull */
+ GPIOF->OTYPER = 0x00000000;
+ /* No pull-up, pull-down for PFx pins */
+ GPIOF->PUPDR = 0x00000000;
+
+ /* Connect PGx pins to FMC Alternate function */
+ GPIOG->AFR[0] = 0xCCCCCCCC;
+ GPIOG->AFR[1] = 0xCCCCCCCC;
+ /* Configure PGx pins in Alternate function mode */
+ GPIOG->MODER = 0xAAAAAAAA;
+ /* Configure PGx pins speed to 50 MHz */
+ GPIOG->OSPEEDR = 0xAAAAAAAA;
+ /* Configure PGx pins Output type to push-pull */
+ GPIOG->OTYPER = 0x00000000;
+ /* No pull-up, pull-down for PGx pins */
+ GPIOG->PUPDR = 0x00000000;
+
+ /* Connect PHx pins to FMC Alternate function */
+ GPIOH->AFR[0] = 0x00C0CC00;
+ GPIOH->AFR[1] = 0xCCCCCCCC;
+ /* Configure PHx pins in Alternate function mode */
+ GPIOH->MODER = 0xAAAA08A0;
+ /* Configure PHx pins speed to 50 MHz */
+ GPIOH->OSPEEDR = 0xAAAA08A0;
+ /* Configure PHx pins Output type to push-pull */
+ GPIOH->OTYPER = 0x00000000;
+ /* No pull-up, pull-down for PHx pins */
+ GPIOH->PUPDR = 0x00000000;
+
+ /* Connect PIx pins to FMC Alternate function */
+ GPIOI->AFR[0] = 0xCCCCCCCC;
+ GPIOI->AFR[1] = 0x00000CC0;
+ /* Configure PIx pins in Alternate function mode */
+ GPIOI->MODER = 0x0028AAAA;
+ /* Configure PIx pins speed to 50 MHz */
+ GPIOI->OSPEEDR = 0x0028AAAA;
+ /* Configure PIx pins Output type to push-pull */
+ GPIOI->OTYPER = 0x00000000;
+ /* No pull-up, pull-down for PIx pins */
+ GPIOI->PUPDR = 0x00000000;
+
+/*-- FMC Configuration -------------------------------------------------------*/
+ /* Enable the FMC interface clock */
+ RCC->AHB3ENR |= 0x00000001;
+ /* Delay after an RCC peripheral clock enabling */
+ tmp = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN);
+
+ FMC_Bank5_6->SDCR[0] = 0x000019E4;
+ FMC_Bank5_6->SDTR[0] = 0x01115351;
+
+ /* SDRAM initialization sequence */
+ /* Clock enable command */
+ FMC_Bank5_6->SDCMR = 0x00000011;
+ tmpreg = FMC_Bank5_6->SDSR & 0x00000020;
+ while((tmpreg != 0) && (timeout-- > 0))
+ {
+ tmpreg = FMC_Bank5_6->SDSR & 0x00000020;
+ }
+
+ /* Delay */
+ for (index = 0; index<1000; index++);
+
+ /* PALL command */
+ FMC_Bank5_6->SDCMR = 0x00000012;
+ timeout = 0xFFFF;
+ while((tmpreg != 0) && (timeout-- > 0))
+ {
+ tmpreg = FMC_Bank5_6->SDSR & 0x00000020;
+ }
+
+ /* Auto refresh command */
+ FMC_Bank5_6->SDCMR = 0x00000073;
+ timeout = 0xFFFF;
+ while((tmpreg != 0) && (timeout-- > 0))
+ {
+ tmpreg = FMC_Bank5_6->SDSR & 0x00000020;
+ }
+
+ /* MRD register program */
+ FMC_Bank5_6->SDCMR = 0x00046014;
+ timeout = 0xFFFF;
+ while((tmpreg != 0) && (timeout-- > 0))
+ {
+ tmpreg = FMC_Bank5_6->SDSR & 0x00000020;
+ }
+
+ /* Set refresh count */
+ tmpreg = FMC_Bank5_6->SDRTR;
+ FMC_Bank5_6->SDRTR = (tmpreg | (0x0000027C<<1));
+
+ /* Disable write protection */
+ tmpreg = FMC_Bank5_6->SDCR[0];
+ FMC_Bank5_6->SDCR[0] = (tmpreg & 0xFFFFFDFF);
+
+#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx)
+ /* Configure and enable Bank1_SRAM2 */
+ FMC_Bank1->BTCR[2] = 0x00001011;
+ FMC_Bank1->BTCR[3] = 0x00000201;
+ FMC_Bank1E->BWTR[2] = 0x0fffffff;
+#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */
+#if defined(STM32F469xx) || defined(STM32F479xx)
+ /* Configure and enable Bank1_SRAM2 */
+ FMC_Bank1->BTCR[2] = 0x00001091;
+ FMC_Bank1->BTCR[3] = 0x00110212;
+ FMC_Bank1E->BWTR[2] = 0x0fffffff;
+#endif /* STM32F469xx || STM32F479xx */
+
+ (void)(tmp);
+}
+#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx */
+#elif defined (DATA_IN_ExtSRAM) || defined (DATA_IN_ExtSDRAM)
+/**
+ * @brief Setup the external memory controller.
+ * Called in startup_stm32f4xx.s before jump to main.
+ * This function configures the external memories (SRAM/SDRAM)
+ * This SRAM/SDRAM will be used as program data memory (including heap and stack).
+ * @param None
+ * @retval None
+ */
+void SystemInit_ExtMemCtl(void)
+{
+ __IO uint32_t tmp = 0x00;
+#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx)\
+ || defined(STM32F446xx) || defined(STM32F469xx) || defined(STM32F479xx)
+#if defined (DATA_IN_ExtSDRAM)
+ register uint32_t tmpreg = 0, timeout = 0xFFFF;
+ register __IO uint32_t index;
+
+#if defined(STM32F446xx)
+ /* Enable GPIOA, GPIOC, GPIOD, GPIOE, GPIOF, GPIOG interface
+ clock */
+ RCC->AHB1ENR |= 0x0000007D;
+#else
+ /* Enable GPIOC, GPIOD, GPIOE, GPIOF, GPIOG, GPIOH and GPIOI interface
+ clock */
+ RCC->AHB1ENR |= 0x000001F8;
+#endif /* STM32F446xx */
+ /* Delay after an RCC peripheral clock enabling */
+ tmp = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOCEN);
+
+#if defined(STM32F446xx)
+ /* Connect PAx pins to FMC Alternate function */
+ GPIOA->AFR[0] |= 0xC0000000;
+ GPIOA->AFR[1] |= 0x00000000;
+ /* Configure PDx pins in Alternate function mode */
+ GPIOA->MODER |= 0x00008000;
+ /* Configure PDx pins speed to 50 MHz */
+ GPIOA->OSPEEDR |= 0x00008000;
+ /* Configure PDx pins Output type to push-pull */
+ GPIOA->OTYPER |= 0x00000000;
+ /* No pull-up, pull-down for PDx pins */
+ GPIOA->PUPDR |= 0x00000000;
+
+ /* Connect PCx pins to FMC Alternate function */
+ GPIOC->AFR[0] |= 0x00CC0000;
+ GPIOC->AFR[1] |= 0x00000000;
+ /* Configure PDx pins in Alternate function mode */
+ GPIOC->MODER |= 0x00000A00;
+ /* Configure PDx pins speed to 50 MHz */
+ GPIOC->OSPEEDR |= 0x00000A00;
+ /* Configure PDx pins Output type to push-pull */
+ GPIOC->OTYPER |= 0x00000000;
+ /* No pull-up, pull-down for PDx pins */
+ GPIOC->PUPDR |= 0x00000000;
+#endif /* STM32F446xx */
+
+ /* Connect PDx pins to FMC Alternate function */
+ GPIOD->AFR[0] = 0x000000CC;
+ GPIOD->AFR[1] = 0xCC000CCC;
+ /* Configure PDx pins in Alternate function mode */
+ GPIOD->MODER = 0xA02A000A;
+ /* Configure PDx pins speed to 50 MHz */
+ GPIOD->OSPEEDR = 0xA02A000A;
+ /* Configure PDx pins Output type to push-pull */
+ GPIOD->OTYPER = 0x00000000;
+ /* No pull-up, pull-down for PDx pins */
+ GPIOD->PUPDR = 0x00000000;
+
+ /* Connect PEx pins to FMC Alternate function */
+ GPIOE->AFR[0] = 0xC00000CC;
+ GPIOE->AFR[1] = 0xCCCCCCCC;
+ /* Configure PEx pins in Alternate function mode */
+ GPIOE->MODER = 0xAAAA800A;
+ /* Configure PEx pins speed to 50 MHz */
+ GPIOE->OSPEEDR = 0xAAAA800A;
+ /* Configure PEx pins Output type to push-pull */
+ GPIOE->OTYPER = 0x00000000;
+ /* No pull-up, pull-down for PEx pins */
+ GPIOE->PUPDR = 0x00000000;
+
+ /* Connect PFx pins to FMC Alternate function */
+ GPIOF->AFR[0] = 0xCCCCCCCC;
+ GPIOF->AFR[1] = 0xCCCCCCCC;
+ /* Configure PFx pins in Alternate function mode */
+ GPIOF->MODER = 0xAA800AAA;
+ /* Configure PFx pins speed to 50 MHz */
+ GPIOF->OSPEEDR = 0xAA800AAA;
+ /* Configure PFx pins Output type to push-pull */
+ GPIOF->OTYPER = 0x00000000;
+ /* No pull-up, pull-down for PFx pins */
+ GPIOF->PUPDR = 0x00000000;
+
+ /* Connect PGx pins to FMC Alternate function */
+ GPIOG->AFR[0] = 0xCCCCCCCC;
+ GPIOG->AFR[1] = 0xCCCCCCCC;
+ /* Configure PGx pins in Alternate function mode */
+ GPIOG->MODER = 0xAAAAAAAA;
+ /* Configure PGx pins speed to 50 MHz */
+ GPIOG->OSPEEDR = 0xAAAAAAAA;
+ /* Configure PGx pins Output type to push-pull */
+ GPIOG->OTYPER = 0x00000000;
+ /* No pull-up, pull-down for PGx pins */
+ GPIOG->PUPDR = 0x00000000;
+
+#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx)\
+ || defined(STM32F469xx) || defined(STM32F479xx)
+ /* Connect PHx pins to FMC Alternate function */
+ GPIOH->AFR[0] = 0x00C0CC00;
+ GPIOH->AFR[1] = 0xCCCCCCCC;
+ /* Configure PHx pins in Alternate function mode */
+ GPIOH->MODER = 0xAAAA08A0;
+ /* Configure PHx pins speed to 50 MHz */
+ GPIOH->OSPEEDR = 0xAAAA08A0;
+ /* Configure PHx pins Output type to push-pull */
+ GPIOH->OTYPER = 0x00000000;
+ /* No pull-up, pull-down for PHx pins */
+ GPIOH->PUPDR = 0x00000000;
+
+ /* Connect PIx pins to FMC Alternate function */
+ GPIOI->AFR[0] = 0xCCCCCCCC;
+ GPIOI->AFR[1] = 0x00000CC0;
+ /* Configure PIx pins in Alternate function mode */
+ GPIOI->MODER = 0x0028AAAA;
+ /* Configure PIx pins speed to 50 MHz */
+ GPIOI->OSPEEDR = 0x0028AAAA;
+ /* Configure PIx pins Output type to push-pull */
+ GPIOI->OTYPER = 0x00000000;
+ /* No pull-up, pull-down for PIx pins */
+ GPIOI->PUPDR = 0x00000000;
+#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx */
+
+/*-- FMC Configuration -------------------------------------------------------*/
+ /* Enable the FMC interface clock */
+ RCC->AHB3ENR |= 0x00000001;
+ /* Delay after an RCC peripheral clock enabling */
+ tmp = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN);
+
+ /* Configure and enable SDRAM bank1 */
+#if defined(STM32F446xx)
+ FMC_Bank5_6->SDCR[0] = 0x00001954;
+#else
+ FMC_Bank5_6->SDCR[0] = 0x000019E4;
+#endif /* STM32F446xx */
+ FMC_Bank5_6->SDTR[0] = 0x01115351;
+
+ /* SDRAM initialization sequence */
+ /* Clock enable command */
+ FMC_Bank5_6->SDCMR = 0x00000011;
+ tmpreg = FMC_Bank5_6->SDSR & 0x00000020;
+ while((tmpreg != 0) && (timeout-- > 0))
+ {
+ tmpreg = FMC_Bank5_6->SDSR & 0x00000020;
+ }
+
+ /* Delay */
+ for (index = 0; index<1000; index++);
+
+ /* PALL command */
+ FMC_Bank5_6->SDCMR = 0x00000012;
+ timeout = 0xFFFF;
+ while((tmpreg != 0) && (timeout-- > 0))
+ {
+ tmpreg = FMC_Bank5_6->SDSR & 0x00000020;
+ }
+
+ /* Auto refresh command */
+#if defined(STM32F446xx)
+ FMC_Bank5_6->SDCMR = 0x000000F3;
+#else
+ FMC_Bank5_6->SDCMR = 0x00000073;
+#endif /* STM32F446xx */
+ timeout = 0xFFFF;
+ while((tmpreg != 0) && (timeout-- > 0))
+ {
+ tmpreg = FMC_Bank5_6->SDSR & 0x00000020;
+ }
+
+ /* MRD register program */
+#if defined(STM32F446xx)
+ FMC_Bank5_6->SDCMR = 0x00044014;
+#else
+ FMC_Bank5_6->SDCMR = 0x00046014;
+#endif /* STM32F446xx */
+ timeout = 0xFFFF;
+ while((tmpreg != 0) && (timeout-- > 0))
+ {
+ tmpreg = FMC_Bank5_6->SDSR & 0x00000020;
+ }
+
+ /* Set refresh count */
+ tmpreg = FMC_Bank5_6->SDRTR;
+#if defined(STM32F446xx)
+ FMC_Bank5_6->SDRTR = (tmpreg | (0x0000050C<<1));
+#else
+ FMC_Bank5_6->SDRTR = (tmpreg | (0x0000027C<<1));
+#endif /* STM32F446xx */
+
+ /* Disable write protection */
+ tmpreg = FMC_Bank5_6->SDCR[0];
+ FMC_Bank5_6->SDCR[0] = (tmpreg & 0xFFFFFDFF);
+#endif /* DATA_IN_ExtSDRAM */
+#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx || STM32F469xx || STM32F479xx */
+
+#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx)\
+ || defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx)\
+ || defined(STM32F469xx) || defined(STM32F479xx) || defined(STM32F412Zx) || defined(STM32F412Vx)
+
+#if defined(DATA_IN_ExtSRAM)
+/*-- GPIOs Configuration -----------------------------------------------------*/
+ /* Enable GPIOD, GPIOE, GPIOF and GPIOG interface clock */
+ RCC->AHB1ENR |= 0x00000078;
+ /* Delay after an RCC peripheral clock enabling */
+ tmp = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIODEN);
+
+ /* Connect PDx pins to FMC Alternate function */
+ GPIOD->AFR[0] = 0x00CCC0CC;
+ GPIOD->AFR[1] = 0xCCCCCCCC;
+ /* Configure PDx pins in Alternate function mode */
+ GPIOD->MODER = 0xAAAA0A8A;
+ /* Configure PDx pins speed to 100 MHz */
+ GPIOD->OSPEEDR = 0xFFFF0FCF;
+ /* Configure PDx pins Output type to push-pull */
+ GPIOD->OTYPER = 0x00000000;
+ /* No pull-up, pull-down for PDx pins */
+ GPIOD->PUPDR = 0x00000000;
+
+ /* Connect PEx pins to FMC Alternate function */
+ GPIOE->AFR[0] = 0xC00CC0CC;
+ GPIOE->AFR[1] = 0xCCCCCCCC;
+ /* Configure PEx pins in Alternate function mode */
+ GPIOE->MODER = 0xAAAA828A;
+ /* Configure PEx pins speed to 100 MHz */
+ GPIOE->OSPEEDR = 0xFFFFC3CF;
+ /* Configure PEx pins Output type to push-pull */
+ GPIOE->OTYPER = 0x00000000;
+ /* No pull-up, pull-down for PEx pins */
+ GPIOE->PUPDR = 0x00000000;
+
+ /* Connect PFx pins to FMC Alternate function */
+ GPIOF->AFR[0] = 0x00CCCCCC;
+ GPIOF->AFR[1] = 0xCCCC0000;
+ /* Configure PFx pins in Alternate function mode */
+ GPIOF->MODER = 0xAA000AAA;
+ /* Configure PFx pins speed to 100 MHz */
+ GPIOF->OSPEEDR = 0xFF000FFF;
+ /* Configure PFx pins Output type to push-pull */
+ GPIOF->OTYPER = 0x00000000;
+ /* No pull-up, pull-down for PFx pins */
+ GPIOF->PUPDR = 0x00000000;
+
+ /* Connect PGx pins to FMC Alternate function */
+ GPIOG->AFR[0] = 0x00CCCCCC;
+ GPIOG->AFR[1] = 0x000000C0;
+ /* Configure PGx pins in Alternate function mode */
+ GPIOG->MODER = 0x00085AAA;
+ /* Configure PGx pins speed to 100 MHz */
+ GPIOG->OSPEEDR = 0x000CAFFF;
+ /* Configure PGx pins Output type to push-pull */
+ GPIOG->OTYPER = 0x00000000;
+ /* No pull-up, pull-down for PGx pins */
+ GPIOG->PUPDR = 0x00000000;
+
+/*-- FMC/FSMC Configuration --------------------------------------------------*/
+ /* Enable the FMC/FSMC interface clock */
+ RCC->AHB3ENR |= 0x00000001;
+
+#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx)
+ /* Delay after an RCC peripheral clock enabling */
+ tmp = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN);
+ /* Configure and enable Bank1_SRAM2 */
+ FMC_Bank1->BTCR[2] = 0x00001011;
+ FMC_Bank1->BTCR[3] = 0x00000201;
+ FMC_Bank1E->BWTR[2] = 0x0fffffff;
+#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */
+#if defined(STM32F469xx) || defined(STM32F479xx)
+ /* Delay after an RCC peripheral clock enabling */
+ tmp = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN);
+ /* Configure and enable Bank1_SRAM2 */
+ FMC_Bank1->BTCR[2] = 0x00001091;
+ FMC_Bank1->BTCR[3] = 0x00110212;
+ FMC_Bank1E->BWTR[2] = 0x0fffffff;
+#endif /* STM32F469xx || STM32F479xx */
+#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx)|| defined(STM32F417xx)\
+ || defined(STM32F412Zx) || defined(STM32F412Vx)
+ /* Delay after an RCC peripheral clock enabling */
+ tmp = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FSMCEN);
+ /* Configure and enable Bank1_SRAM2 */
+ FSMC_Bank1->BTCR[2] = 0x00001011;
+ FSMC_Bank1->BTCR[3] = 0x00000201;
+ FSMC_Bank1E->BWTR[2] = 0x0FFFFFFF;
+#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F412Zx || STM32F412Vx */
+
+#endif /* DATA_IN_ExtSRAM */
+#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx ||\
+ STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx || STM32F412Zx || STM32F412Vx */
+ (void)(tmp);
+}
+#endif /* DATA_IN_ExtSRAM && DATA_IN_ExtSDRAM */
+/**
+ * @}
+ */
+
+/**
+ * @}
+ */
+
+/**
+ * @}
+ */
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Core/Startup/startup_stm32f401vctx.s b/Core/Startup/startup_stm32f401vctx.s
new file mode 100644
index 0000000..10ad298
--- /dev/null
+++ b/Core/Startup/startup_stm32f401vctx.s
@@ -0,0 +1,432 @@
+/**
+ ******************************************************************************
+ * @file startup_stm32f401xc.s
+ * @author MCD Application Team
+ * @brief STM32F401xCxx Devices vector table for GCC based toolchains.
+ * This module performs:
+ * - Set the initial SP
+ * - Set the initial PC == Reset_Handler,
+ * - Set the vector table entries with the exceptions ISR address
+ * - Branches to main in the C library (which eventually
+ * calls main()).
+ * After Reset the Cortex-M4 processor is in Thread mode,
+ * priority is Privileged, and the Stack is set to Main.
+ ******************************************************************************
+ * @attention
+ *
+ * © Copyright (c) 2017 STMicroelectronics.
+ * All rights reserved.
+ *
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
+ *
+ ******************************************************************************
+ */
+
+ .syntax unified
+ .cpu cortex-m4
+ .fpu softvfp
+ .thumb
+
+.global g_pfnVectors
+.global Default_Handler
+
+/* start address for the initialization values of the .data section.
+defined in linker script */
+.word _sidata
+/* start address for the .data section. defined in linker script */
+.word _sdata
+/* end address for the .data section. defined in linker script */
+.word _edata
+/* start address for the .bss section. defined in linker script */
+.word _sbss
+/* end address for the .bss section. defined in linker script */
+.word _ebss
+/* stack used for SystemInit_ExtMemCtl; always internal RAM used */
+
+/**
+ * @brief This is the code that gets called when the processor first
+ * starts execution following a reset event. Only the absolutely
+ * necessary set is performed, after which the application
+ * supplied main() routine is called.
+ * @param None
+ * @retval : None
+*/
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr sp, =_estack /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ movs r1, #0
+ b LoopCopyDataInit
+
+CopyDataInit:
+ ldr r3, =_sidata
+ ldr r3, [r3, r1]
+ str r3, [r0, r1]
+ adds r1, r1, #4
+
+LoopCopyDataInit:
+ ldr r0, =_sdata
+ ldr r3, =_edata
+ adds r2, r0, r1
+ cmp r2, r3
+ bcc CopyDataInit
+ ldr r2, =_sbss
+ b LoopFillZerobss
+/* Zero fill the bss segment. */
+FillZerobss:
+ movs r3, #0
+ str r3, [r2], #4
+
+LoopFillZerobss:
+ ldr r3, = _ebss
+ cmp r2, r3
+ bcc FillZerobss
+
+/* Call the clock system intitialization function.*/
+ bl SystemInit
+/* Call static constructors */
+ bl __libc_init_array
+/* Call the application's entry point.*/
+ bl main
+ bx lr
+.size Reset_Handler, .-Reset_Handler
+
+/**
+ * @brief This is the code that gets called when the processor receives an
+ * unexpected interrupt. This simply enters an infinite loop, preserving
+ * the system state for examination by a debugger.
+ * @param None
+ * @retval None
+*/
+ .section .text.Default_Handler,"ax",%progbits
+Default_Handler:
+Infinite_Loop:
+ b Infinite_Loop
+ .size Default_Handler, .-Default_Handler
+/******************************************************************************
+*
+* The minimal vector table for a Cortex M3. Note that the proper constructs
+* must be placed on this to ensure that it ends up at physical address
+* 0x0000.0000.
+*
+*******************************************************************************/
+ .section .isr_vector,"a",%progbits
+ .type g_pfnVectors, %object
+ .size g_pfnVectors, .-g_pfnVectors
+
+g_pfnVectors:
+ .word _estack
+ .word Reset_Handler
+ .word NMI_Handler
+ .word HardFault_Handler
+ .word MemManage_Handler
+ .word BusFault_Handler
+ .word UsageFault_Handler
+ .word 0
+ .word 0
+ .word 0
+ .word 0
+ .word SVC_Handler
+ .word DebugMon_Handler
+ .word 0
+ .word PendSV_Handler
+ .word SysTick_Handler
+
+ /* External Interrupts */
+ .word WWDG_IRQHandler /* Window WatchDog */
+ .word PVD_IRQHandler /* PVD through EXTI Line detection */
+ .word TAMP_STAMP_IRQHandler /* Tamper and TimeStamps through the EXTI line */
+ .word RTC_WKUP_IRQHandler /* RTC Wakeup through the EXTI line */
+ .word FLASH_IRQHandler /* FLASH */
+ .word RCC_IRQHandler /* RCC */
+ .word EXTI0_IRQHandler /* EXTI Line0 */
+ .word EXTI1_IRQHandler /* EXTI Line1 */
+ .word EXTI2_IRQHandler /* EXTI Line2 */
+ .word EXTI3_IRQHandler /* EXTI Line3 */
+ .word EXTI4_IRQHandler /* EXTI Line4 */
+ .word DMA1_Stream0_IRQHandler /* DMA1 Stream 0 */
+ .word DMA1_Stream1_IRQHandler /* DMA1 Stream 1 */
+ .word DMA1_Stream2_IRQHandler /* DMA1 Stream 2 */
+ .word DMA1_Stream3_IRQHandler /* DMA1 Stream 3 */
+ .word DMA1_Stream4_IRQHandler /* DMA1 Stream 4 */
+ .word DMA1_Stream5_IRQHandler /* DMA1 Stream 5 */
+ .word DMA1_Stream6_IRQHandler /* DMA1 Stream 6 */
+ .word ADC_IRQHandler /* ADC1 */
+ .word 0 /* Reserved */
+ .word 0 /* Reserved */
+ .word 0 /* Reserved */
+ .word 0 /* Reserved */
+ .word EXTI9_5_IRQHandler /* External Line[9:5]s */
+ .word TIM1_BRK_TIM9_IRQHandler /* TIM1 Break and TIM9 */
+ .word TIM1_UP_TIM10_IRQHandler /* TIM1 Update and TIM10 */
+ .word TIM1_TRG_COM_TIM11_IRQHandler /* TIM1 Trigger and Commutation and TIM11 */
+ .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */
+ .word TIM2_IRQHandler /* TIM2 */
+ .word TIM3_IRQHandler /* TIM3 */
+ .word TIM4_IRQHandler /* TIM4 */
+ .word I2C1_EV_IRQHandler /* I2C1 Event */
+ .word I2C1_ER_IRQHandler /* I2C1 Error */
+ .word I2C2_EV_IRQHandler /* I2C2 Event */
+ .word I2C2_ER_IRQHandler /* I2C2 Error */
+ .word SPI1_IRQHandler /* SPI1 */
+ .word SPI2_IRQHandler /* SPI2 */
+ .word USART1_IRQHandler /* USART1 */
+ .word USART2_IRQHandler /* USART2 */
+ .word 0 /* Reserved */
+ .word EXTI15_10_IRQHandler /* External Line[15:10]s */
+ .word RTC_Alarm_IRQHandler /* RTC Alarm (A and B) through EXTI Line */
+ .word OTG_FS_WKUP_IRQHandler /* USB OTG FS Wakeup through EXTI line */
+ .word 0 /* Reserved */
+ .word 0 /* Reserved */
+ .word 0 /* Reserved */
+ .word 0 /* Reserved */
+ .word DMA1_Stream7_IRQHandler /* DMA1 Stream7 */
+ .word 0 /* Reserved */
+ .word SDIO_IRQHandler /* SDIO */
+ .word TIM5_IRQHandler /* TIM5 */
+ .word SPI3_IRQHandler /* SPI3 */
+ .word 0 /* Reserved */
+ .word 0 /* Reserved */
+ .word 0 /* Reserved */
+ .word 0 /* Reserved */
+ .word DMA2_Stream0_IRQHandler /* DMA2 Stream 0 */
+ .word DMA2_Stream1_IRQHandler /* DMA2 Stream 1 */
+ .word DMA2_Stream2_IRQHandler /* DMA2 Stream 2 */
+ .word DMA2_Stream3_IRQHandler /* DMA2 Stream 3 */
+ .word DMA2_Stream4_IRQHandler /* DMA2 Stream 4 */
+ .word 0 /* Reserved */
+ .word 0 /* Reserved */
+ .word 0 /* Reserved */
+ .word 0 /* Reserved */
+ .word 0 /* Reserved */
+ .word 0 /* Reserved */
+ .word OTG_FS_IRQHandler /* USB OTG FS */
+ .word DMA2_Stream5_IRQHandler /* DMA2 Stream 5 */
+ .word DMA2_Stream6_IRQHandler /* DMA2 Stream 6 */
+ .word DMA2_Stream7_IRQHandler /* DMA2 Stream 7 */
+ .word USART6_IRQHandler /* USART6 */
+ .word I2C3_EV_IRQHandler /* I2C3 event */
+ .word I2C3_ER_IRQHandler /* I2C3 error */
+ .word 0 /* Reserved */
+ .word 0 /* Reserved */
+ .word 0 /* Reserved */
+ .word 0 /* Reserved */
+ .word 0 /* Reserved */
+ .word 0 /* Reserved */
+ .word 0 /* Reserved */
+ .word FPU_IRQHandler /* FPU */
+ .word 0 /* Reserved */
+ .word 0 /* Reserved */
+ .word SPI4_IRQHandler /* SPI4 */
+
+/*******************************************************************************
+*
+* Provide weak aliases for each Exception handler to the Default_Handler.
+* As they are weak aliases, any function with the same name will override
+* this definition.
+*
+*******************************************************************************/
+ .weak NMI_Handler
+ .thumb_set NMI_Handler,Default_Handler
+
+ .weak HardFault_Handler
+ .thumb_set HardFault_Handler,Default_Handler
+
+ .weak MemManage_Handler
+ .thumb_set MemManage_Handler,Default_Handler
+
+ .weak BusFault_Handler
+ .thumb_set BusFault_Handler,Default_Handler
+
+ .weak UsageFault_Handler
+ .thumb_set UsageFault_Handler,Default_Handler
+
+ .weak SVC_Handler
+ .thumb_set SVC_Handler,Default_Handler
+
+ .weak DebugMon_Handler
+ .thumb_set DebugMon_Handler,Default_Handler
+
+ .weak PendSV_Handler
+ .thumb_set PendSV_Handler,Default_Handler
+
+ .weak SysTick_Handler
+ .thumb_set SysTick_Handler,Default_Handler
+
+ .weak WWDG_IRQHandler
+ .thumb_set WWDG_IRQHandler,Default_Handler
+
+ .weak PVD_IRQHandler
+ .thumb_set PVD_IRQHandler,Default_Handler
+
+ .weak TAMP_STAMP_IRQHandler
+ .thumb_set TAMP_STAMP_IRQHandler,Default_Handler
+
+ .weak RTC_WKUP_IRQHandler
+ .thumb_set RTC_WKUP_IRQHandler,Default_Handler
+
+ .weak FLASH_IRQHandler
+ .thumb_set FLASH_IRQHandler,Default_Handler
+
+ .weak RCC_IRQHandler
+ .thumb_set RCC_IRQHandler,Default_Handler
+
+ .weak EXTI0_IRQHandler
+ .thumb_set EXTI0_IRQHandler,Default_Handler
+
+ .weak EXTI1_IRQHandler
+ .thumb_set EXTI1_IRQHandler,Default_Handler
+
+ .weak EXTI2_IRQHandler
+ .thumb_set EXTI2_IRQHandler,Default_Handler
+
+ .weak EXTI3_IRQHandler
+ .thumb_set EXTI3_IRQHandler,Default_Handler
+
+ .weak EXTI4_IRQHandler
+ .thumb_set EXTI4_IRQHandler,Default_Handler
+
+ .weak DMA1_Stream0_IRQHandler
+ .thumb_set DMA1_Stream0_IRQHandler,Default_Handler
+
+ .weak DMA1_Stream1_IRQHandler
+ .thumb_set DMA1_Stream1_IRQHandler,Default_Handler
+
+ .weak DMA1_Stream2_IRQHandler
+ .thumb_set DMA1_Stream2_IRQHandler,Default_Handler
+
+ .weak DMA1_Stream3_IRQHandler
+ .thumb_set DMA1_Stream3_IRQHandler,Default_Handler
+
+ .weak DMA1_Stream4_IRQHandler
+ .thumb_set DMA1_Stream4_IRQHandler,Default_Handler
+
+ .weak DMA1_Stream5_IRQHandler
+ .thumb_set DMA1_Stream5_IRQHandler,Default_Handler
+
+ .weak DMA1_Stream6_IRQHandler
+ .thumb_set DMA1_Stream6_IRQHandler,Default_Handler
+
+ .weak ADC_IRQHandler
+ .thumb_set ADC_IRQHandler,Default_Handler
+
+ .weak EXTI9_5_IRQHandler
+ .thumb_set EXTI9_5_IRQHandler,Default_Handler
+
+ .weak TIM1_BRK_TIM9_IRQHandler
+ .thumb_set TIM1_BRK_TIM9_IRQHandler,Default_Handler
+
+ .weak TIM1_UP_TIM10_IRQHandler
+ .thumb_set TIM1_UP_TIM10_IRQHandler,Default_Handler
+
+ .weak TIM1_TRG_COM_TIM11_IRQHandler
+ .thumb_set TIM1_TRG_COM_TIM11_IRQHandler,Default_Handler
+
+ .weak TIM1_CC_IRQHandler
+ .thumb_set TIM1_CC_IRQHandler,Default_Handler
+
+ .weak TIM2_IRQHandler
+ .thumb_set TIM2_IRQHandler,Default_Handler
+
+ .weak TIM3_IRQHandler
+ .thumb_set TIM3_IRQHandler,Default_Handler
+
+ .weak TIM4_IRQHandler
+ .thumb_set TIM4_IRQHandler,Default_Handler
+
+ .weak I2C1_EV_IRQHandler
+ .thumb_set I2C1_EV_IRQHandler,Default_Handler
+
+ .weak I2C1_ER_IRQHandler
+ .thumb_set I2C1_ER_IRQHandler,Default_Handler
+
+ .weak I2C2_EV_IRQHandler
+ .thumb_set I2C2_EV_IRQHandler,Default_Handler
+
+ .weak I2C2_ER_IRQHandler
+ .thumb_set I2C2_ER_IRQHandler,Default_Handler
+
+ .weak SPI1_IRQHandler
+ .thumb_set SPI1_IRQHandler,Default_Handler
+
+ .weak SPI2_IRQHandler
+ .thumb_set SPI2_IRQHandler,Default_Handler
+
+ .weak USART1_IRQHandler
+ .thumb_set USART1_IRQHandler,Default_Handler
+
+ .weak USART2_IRQHandler
+ .thumb_set USART2_IRQHandler,Default_Handler
+
+ .weak EXTI15_10_IRQHandler
+ .thumb_set EXTI15_10_IRQHandler,Default_Handler
+
+ .weak RTC_Alarm_IRQHandler
+ .thumb_set RTC_Alarm_IRQHandler,Default_Handler
+
+ .weak OTG_FS_WKUP_IRQHandler
+ .thumb_set OTG_FS_WKUP_IRQHandler,Default_Handler
+
+ .weak DMA1_Stream7_IRQHandler
+ .thumb_set DMA1_Stream7_IRQHandler,Default_Handler
+
+ .weak SDIO_IRQHandler
+ .thumb_set SDIO_IRQHandler,Default_Handler
+
+ .weak TIM5_IRQHandler
+ .thumb_set TIM5_IRQHandler,Default_Handler
+
+ .weak SPI3_IRQHandler
+ .thumb_set SPI3_IRQHandler,Default_Handler
+
+ .weak DMA2_Stream0_IRQHandler
+ .thumb_set DMA2_Stream0_IRQHandler,Default_Handler
+
+ .weak DMA2_Stream1_IRQHandler
+ .thumb_set DMA2_Stream1_IRQHandler,Default_Handler
+
+ .weak DMA2_Stream2_IRQHandler
+ .thumb_set DMA2_Stream2_IRQHandler,Default_Handler
+
+ .weak DMA2_Stream3_IRQHandler
+ .thumb_set DMA2_Stream3_IRQHandler,Default_Handler
+
+ .weak DMA2_Stream4_IRQHandler
+ .thumb_set DMA2_Stream4_IRQHandler,Default_Handler
+
+ .weak OTG_FS_IRQHandler
+ .thumb_set OTG_FS_IRQHandler,Default_Handler
+
+ .weak DMA2_Stream5_IRQHandler
+ .thumb_set DMA2_Stream5_IRQHandler,Default_Handler
+
+ .weak DMA2_Stream6_IRQHandler
+ .thumb_set DMA2_Stream6_IRQHandler,Default_Handler
+
+ .weak DMA2_Stream7_IRQHandler
+ .thumb_set DMA2_Stream7_IRQHandler,Default_Handler
+
+ .weak USART6_IRQHandler
+ .thumb_set USART6_IRQHandler,Default_Handler
+
+ .weak I2C3_EV_IRQHandler
+ .thumb_set I2C3_EV_IRQHandler,Default_Handler
+
+ .weak I2C3_ER_IRQHandler
+ .thumb_set I2C3_ER_IRQHandler,Default_Handler
+
+ .weak FPU_IRQHandler
+ .thumb_set FPU_IRQHandler,Default_Handler
+
+ .weak SPI4_IRQHandler
+ .thumb_set SPI4_IRQHandler,Default_Handler
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
+
diff --git a/Debug/AudioDAC.bin b/Debug/AudioDAC.bin
new file mode 100644
index 0000000..70ef3b9
Binary files /dev/null and b/Debug/AudioDAC.bin differ
diff --git a/Debug/AudioDAC.list b/Debug/AudioDAC.list
new file mode 100644
index 0000000..d480245
--- /dev/null
+++ b/Debug/AudioDAC.list
@@ -0,0 +1,25821 @@
+
+AudioDAC.elf: file format elf32-littlearm
+
+Sections:
+Idx Name Size VMA LMA File off Algn
+ 0 .isr_vector 00000194 08000000 08000000 00010000 2**0
+ CONTENTS, ALLOC, LOAD, READONLY, DATA
+ 1 .text 0000a01c 080001a0 080001a0 000101a0 2**4
+ CONTENTS, ALLOC, LOAD, READONLY, CODE
+ 2 .rodata 000000f4 0800a1bc 0800a1bc 0001a1bc 2**2
+ CONTENTS, ALLOC, LOAD, READONLY, DATA
+ 3 .ARM.extab 00000000 0800a2b0 0800a2b0 000200a4 2**0
+ CONTENTS
+ 4 .ARM 00000008 0800a2b0 0800a2b0 0001a2b0 2**2
+ CONTENTS, ALLOC, LOAD, READONLY, DATA
+ 5 .preinit_array 00000000 0800a2b8 0800a2b8 000200a4 2**0
+ CONTENTS, ALLOC, LOAD, DATA
+ 6 .init_array 00000004 0800a2b8 0800a2b8 0001a2b8 2**2
+ CONTENTS, ALLOC, LOAD, DATA
+ 7 .fini_array 00000004 0800a2bc 0800a2bc 0001a2bc 2**2
+ CONTENTS, ALLOC, LOAD, DATA
+ 8 .data 000000a4 20000000 0800a2c0 00020000 2**2
+ CONTENTS, ALLOC, LOAD, DATA
+ 9 .bss 0000085c 200000a4 0800a364 000200a4 2**2
+ ALLOC
+ 10 ._user_heap_stack 00000600 20000900 0800a364 00020900 2**0
+ ALLOC
+ 11 .ARM.attributes 00000030 00000000 00000000 000200a4 2**0
+ CONTENTS, READONLY
+ 12 .debug_info 0001c5f4 00000000 00000000 000200d4 2**0
+ CONTENTS, READONLY, DEBUGGING
+ 13 .debug_abbrev 00003e07 00000000 00000000 0003c6c8 2**0
+ CONTENTS, READONLY, DEBUGGING
+ 14 .debug_aranges 00001410 00000000 00000000 000404d0 2**3
+ CONTENTS, READONLY, DEBUGGING
+ 15 .debug_ranges 00001270 00000000 00000000 000418e0 2**3
+ CONTENTS, READONLY, DEBUGGING
+ 16 .debug_macro 0001b56c 00000000 00000000 00042b50 2**0
+ CONTENTS, READONLY, DEBUGGING
+ 17 .debug_line 00013cb9 00000000 00000000 0005e0bc 2**0
+ CONTENTS, READONLY, DEBUGGING
+ 18 .debug_str 00091e28 00000000 00000000 00071d75 2**0
+ CONTENTS, READONLY, DEBUGGING
+ 19 .comment 0000007b 00000000 00000000 00103b9d 2**0
+ CONTENTS, READONLY
+ 20 .debug_frame 00005a48 00000000 00000000 00103c18 2**2
+ CONTENTS, READONLY, DEBUGGING
+
+Disassembly of section .text:
+
+080001a0 <__do_global_dtors_aux>:
+ 80001a0: b510 push {r4, lr}
+ 80001a2: 4c05 ldr r4, [pc, #20] ; (80001b8 <__do_global_dtors_aux+0x18>)
+ 80001a4: 7823 ldrb r3, [r4, #0]
+ 80001a6: b933 cbnz r3, 80001b6 <__do_global_dtors_aux+0x16>
+ 80001a8: 4b04 ldr r3, [pc, #16] ; (80001bc <__do_global_dtors_aux+0x1c>)
+ 80001aa: b113 cbz r3, 80001b2 <__do_global_dtors_aux+0x12>
+ 80001ac: 4804 ldr r0, [pc, #16] ; (80001c0 <__do_global_dtors_aux+0x20>)
+ 80001ae: f3af 8000 nop.w
+ 80001b2: 2301 movs r3, #1
+ 80001b4: 7023 strb r3, [r4, #0]
+ 80001b6: bd10 pop {r4, pc}
+ 80001b8: 200000a4 .word 0x200000a4
+ 80001bc: 00000000 .word 0x00000000
+ 80001c0: 0800a1a4 .word 0x0800a1a4
+
+080001c4 :
+ 80001c4: b508 push {r3, lr}
+ 80001c6: 4b03 ldr r3, [pc, #12] ; (80001d4 )
+ 80001c8: b11b cbz r3, 80001d2
+ 80001ca: 4903 ldr r1, [pc, #12] ; (80001d8 )
+ 80001cc: 4803 ldr r0, [pc, #12] ; (80001dc )
+ 80001ce: f3af 8000 nop.w
+ 80001d2: bd08 pop {r3, pc}
+ 80001d4: 00000000 .word 0x00000000
+ 80001d8: 200000a8 .word 0x200000a8
+ 80001dc: 0800a1a4 .word 0x0800a1a4
+
+080001e0 :
+ 80001e0: f001 01ff and.w r1, r1, #255 ; 0xff
+ 80001e4: 2a10 cmp r2, #16
+ 80001e6: db2b blt.n 8000240
+ 80001e8: f010 0f07 tst.w r0, #7
+ 80001ec: d008 beq.n 8000200
+ 80001ee: f810 3b01 ldrb.w r3, [r0], #1
+ 80001f2: 3a01 subs r2, #1
+ 80001f4: 428b cmp r3, r1
+ 80001f6: d02d beq.n 8000254
+ 80001f8: f010 0f07 tst.w r0, #7
+ 80001fc: b342 cbz r2, 8000250
+ 80001fe: d1f6 bne.n 80001ee
+ 8000200: b4f0 push {r4, r5, r6, r7}
+ 8000202: ea41 2101 orr.w r1, r1, r1, lsl #8
+ 8000206: ea41 4101 orr.w r1, r1, r1, lsl #16
+ 800020a: f022 0407 bic.w r4, r2, #7
+ 800020e: f07f 0700 mvns.w r7, #0
+ 8000212: 2300 movs r3, #0
+ 8000214: e8f0 5602 ldrd r5, r6, [r0], #8
+ 8000218: 3c08 subs r4, #8
+ 800021a: ea85 0501 eor.w r5, r5, r1
+ 800021e: ea86 0601 eor.w r6, r6, r1
+ 8000222: fa85 f547 uadd8 r5, r5, r7
+ 8000226: faa3 f587 sel r5, r3, r7
+ 800022a: fa86 f647 uadd8 r6, r6, r7
+ 800022e: faa5 f687 sel r6, r5, r7
+ 8000232: b98e cbnz r6, 8000258
+ 8000234: d1ee bne.n 8000214
+ 8000236: bcf0 pop {r4, r5, r6, r7}
+ 8000238: f001 01ff and.w r1, r1, #255 ; 0xff
+ 800023c: f002 0207 and.w r2, r2, #7
+ 8000240: b132 cbz r2, 8000250
+ 8000242: f810 3b01 ldrb.w r3, [r0], #1
+ 8000246: 3a01 subs r2, #1
+ 8000248: ea83 0301 eor.w r3, r3, r1
+ 800024c: b113 cbz r3, 8000254
+ 800024e: d1f8 bne.n 8000242
+ 8000250: 2000 movs r0, #0
+ 8000252: 4770 bx lr
+ 8000254: 3801 subs r0, #1
+ 8000256: 4770 bx lr
+ 8000258: 2d00 cmp r5, #0
+ 800025a: bf06 itte eq
+ 800025c: 4635 moveq r5, r6
+ 800025e: 3803 subeq r0, #3
+ 8000260: 3807 subne r0, #7
+ 8000262: f015 0f01 tst.w r5, #1
+ 8000266: d107 bne.n 8000278
+ 8000268: 3001 adds r0, #1
+ 800026a: f415 7f80 tst.w r5, #256 ; 0x100
+ 800026e: bf02 ittt eq
+ 8000270: 3001 addeq r0, #1
+ 8000272: f415 3fc0 tsteq.w r5, #98304 ; 0x18000
+ 8000276: 3001 addeq r0, #1
+ 8000278: bcf0 pop {r4, r5, r6, r7}
+ 800027a: 3801 subs r0, #1
+ 800027c: 4770 bx lr
+ 800027e: bf00 nop
+
+08000280 <__aeabi_uldivmod>:
+ 8000280: b953 cbnz r3, 8000298 <__aeabi_uldivmod+0x18>
+ 8000282: b94a cbnz r2, 8000298 <__aeabi_uldivmod+0x18>
+ 8000284: 2900 cmp r1, #0
+ 8000286: bf08 it eq
+ 8000288: 2800 cmpeq r0, #0
+ 800028a: bf1c itt ne
+ 800028c: f04f 31ff movne.w r1, #4294967295
+ 8000290: f04f 30ff movne.w r0, #4294967295
+ 8000294: f000 b972 b.w 800057c <__aeabi_idiv0>
+ 8000298: f1ad 0c08 sub.w ip, sp, #8
+ 800029c: e96d ce04 strd ip, lr, [sp, #-16]!
+ 80002a0: f000 f806 bl 80002b0 <__udivmoddi4>
+ 80002a4: f8dd e004 ldr.w lr, [sp, #4]
+ 80002a8: e9dd 2302 ldrd r2, r3, [sp, #8]
+ 80002ac: b004 add sp, #16
+ 80002ae: 4770 bx lr
+
+080002b0 <__udivmoddi4>:
+ 80002b0: e92d 47f0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, lr}
+ 80002b4: 9e08 ldr r6, [sp, #32]
+ 80002b6: 4604 mov r4, r0
+ 80002b8: 4688 mov r8, r1
+ 80002ba: 2b00 cmp r3, #0
+ 80002bc: d14b bne.n 8000356 <__udivmoddi4+0xa6>
+ 80002be: 428a cmp r2, r1
+ 80002c0: 4615 mov r5, r2
+ 80002c2: d967 bls.n 8000394 <__udivmoddi4+0xe4>
+ 80002c4: fab2 f282 clz r2, r2
+ 80002c8: b14a cbz r2, 80002de <__udivmoddi4+0x2e>
+ 80002ca: f1c2 0720 rsb r7, r2, #32
+ 80002ce: fa01 f302 lsl.w r3, r1, r2
+ 80002d2: fa20 f707 lsr.w r7, r0, r7
+ 80002d6: 4095 lsls r5, r2
+ 80002d8: ea47 0803 orr.w r8, r7, r3
+ 80002dc: 4094 lsls r4, r2
+ 80002de: ea4f 4e15 mov.w lr, r5, lsr #16
+ 80002e2: 0c23 lsrs r3, r4, #16
+ 80002e4: fbb8 f7fe udiv r7, r8, lr
+ 80002e8: fa1f fc85 uxth.w ip, r5
+ 80002ec: fb0e 8817 mls r8, lr, r7, r8
+ 80002f0: ea43 4308 orr.w r3, r3, r8, lsl #16
+ 80002f4: fb07 f10c mul.w r1, r7, ip
+ 80002f8: 4299 cmp r1, r3
+ 80002fa: d909 bls.n 8000310 <__udivmoddi4+0x60>
+ 80002fc: 18eb adds r3, r5, r3
+ 80002fe: f107 30ff add.w r0, r7, #4294967295
+ 8000302: f080 811b bcs.w 800053c <__udivmoddi4+0x28c>
+ 8000306: 4299 cmp r1, r3
+ 8000308: f240 8118 bls.w 800053c <__udivmoddi4+0x28c>
+ 800030c: 3f02 subs r7, #2
+ 800030e: 442b add r3, r5
+ 8000310: 1a5b subs r3, r3, r1
+ 8000312: b2a4 uxth r4, r4
+ 8000314: fbb3 f0fe udiv r0, r3, lr
+ 8000318: fb0e 3310 mls r3, lr, r0, r3
+ 800031c: ea44 4403 orr.w r4, r4, r3, lsl #16
+ 8000320: fb00 fc0c mul.w ip, r0, ip
+ 8000324: 45a4 cmp ip, r4
+ 8000326: d909 bls.n 800033c <__udivmoddi4+0x8c>
+ 8000328: 192c adds r4, r5, r4
+ 800032a: f100 33ff add.w r3, r0, #4294967295
+ 800032e: f080 8107 bcs.w 8000540 <__udivmoddi4+0x290>
+ 8000332: 45a4 cmp ip, r4
+ 8000334: f240 8104 bls.w 8000540 <__udivmoddi4+0x290>
+ 8000338: 3802 subs r0, #2
+ 800033a: 442c add r4, r5
+ 800033c: ea40 4007 orr.w r0, r0, r7, lsl #16
+ 8000340: eba4 040c sub.w r4, r4, ip
+ 8000344: 2700 movs r7, #0
+ 8000346: b11e cbz r6, 8000350 <__udivmoddi4+0xa0>
+ 8000348: 40d4 lsrs r4, r2
+ 800034a: 2300 movs r3, #0
+ 800034c: e9c6 4300 strd r4, r3, [r6]
+ 8000350: 4639 mov r1, r7
+ 8000352: e8bd 87f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, pc}
+ 8000356: 428b cmp r3, r1
+ 8000358: d909 bls.n 800036e <__udivmoddi4+0xbe>
+ 800035a: 2e00 cmp r6, #0
+ 800035c: f000 80eb beq.w 8000536 <__udivmoddi4+0x286>
+ 8000360: 2700 movs r7, #0
+ 8000362: e9c6 0100 strd r0, r1, [r6]
+ 8000366: 4638 mov r0, r7
+ 8000368: 4639 mov r1, r7
+ 800036a: e8bd 87f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, pc}
+ 800036e: fab3 f783 clz r7, r3
+ 8000372: 2f00 cmp r7, #0
+ 8000374: d147 bne.n 8000406 <__udivmoddi4+0x156>
+ 8000376: 428b cmp r3, r1
+ 8000378: d302 bcc.n 8000380 <__udivmoddi4+0xd0>
+ 800037a: 4282 cmp r2, r0
+ 800037c: f200 80fa bhi.w 8000574 <__udivmoddi4+0x2c4>
+ 8000380: 1a84 subs r4, r0, r2
+ 8000382: eb61 0303 sbc.w r3, r1, r3
+ 8000386: 2001 movs r0, #1
+ 8000388: 4698 mov r8, r3
+ 800038a: 2e00 cmp r6, #0
+ 800038c: d0e0 beq.n 8000350 <__udivmoddi4+0xa0>
+ 800038e: e9c6 4800 strd r4, r8, [r6]
+ 8000392: e7dd b.n 8000350 <__udivmoddi4+0xa0>
+ 8000394: b902 cbnz r2, 8000398 <__udivmoddi4+0xe8>
+ 8000396: deff udf #255 ; 0xff
+ 8000398: fab2 f282 clz r2, r2
+ 800039c: 2a00 cmp r2, #0
+ 800039e: f040 808f bne.w 80004c0 <__udivmoddi4+0x210>
+ 80003a2: 1b49 subs r1, r1, r5
+ 80003a4: ea4f 4e15 mov.w lr, r5, lsr #16
+ 80003a8: fa1f f885 uxth.w r8, r5
+ 80003ac: 2701 movs r7, #1
+ 80003ae: fbb1 fcfe udiv ip, r1, lr
+ 80003b2: 0c23 lsrs r3, r4, #16
+ 80003b4: fb0e 111c mls r1, lr, ip, r1
+ 80003b8: ea43 4301 orr.w r3, r3, r1, lsl #16
+ 80003bc: fb08 f10c mul.w r1, r8, ip
+ 80003c0: 4299 cmp r1, r3
+ 80003c2: d907 bls.n 80003d4 <__udivmoddi4+0x124>
+ 80003c4: 18eb adds r3, r5, r3
+ 80003c6: f10c 30ff add.w r0, ip, #4294967295
+ 80003ca: d202 bcs.n 80003d2 <__udivmoddi4+0x122>
+ 80003cc: 4299 cmp r1, r3
+ 80003ce: f200 80cd bhi.w 800056c <__udivmoddi4+0x2bc>
+ 80003d2: 4684 mov ip, r0
+ 80003d4: 1a59 subs r1, r3, r1
+ 80003d6: b2a3 uxth r3, r4
+ 80003d8: fbb1 f0fe udiv r0, r1, lr
+ 80003dc: fb0e 1410 mls r4, lr, r0, r1
+ 80003e0: ea43 4404 orr.w r4, r3, r4, lsl #16
+ 80003e4: fb08 f800 mul.w r8, r8, r0
+ 80003e8: 45a0 cmp r8, r4
+ 80003ea: d907 bls.n 80003fc <__udivmoddi4+0x14c>
+ 80003ec: 192c adds r4, r5, r4
+ 80003ee: f100 33ff add.w r3, r0, #4294967295
+ 80003f2: d202 bcs.n 80003fa <__udivmoddi4+0x14a>
+ 80003f4: 45a0 cmp r8, r4
+ 80003f6: f200 80b6 bhi.w 8000566 <__udivmoddi4+0x2b6>
+ 80003fa: 4618 mov r0, r3
+ 80003fc: eba4 0408 sub.w r4, r4, r8
+ 8000400: ea40 400c orr.w r0, r0, ip, lsl #16
+ 8000404: e79f b.n 8000346 <__udivmoddi4+0x96>
+ 8000406: f1c7 0c20 rsb ip, r7, #32
+ 800040a: 40bb lsls r3, r7
+ 800040c: fa22 fe0c lsr.w lr, r2, ip
+ 8000410: ea4e 0e03 orr.w lr, lr, r3
+ 8000414: fa01 f407 lsl.w r4, r1, r7
+ 8000418: fa20 f50c lsr.w r5, r0, ip
+ 800041c: fa21 f30c lsr.w r3, r1, ip
+ 8000420: ea4f 481e mov.w r8, lr, lsr #16
+ 8000424: 4325 orrs r5, r4
+ 8000426: fbb3 f9f8 udiv r9, r3, r8
+ 800042a: 0c2c lsrs r4, r5, #16
+ 800042c: fb08 3319 mls r3, r8, r9, r3
+ 8000430: fa1f fa8e uxth.w sl, lr
+ 8000434: ea44 4303 orr.w r3, r4, r3, lsl #16
+ 8000438: fb09 f40a mul.w r4, r9, sl
+ 800043c: 429c cmp r4, r3
+ 800043e: fa02 f207 lsl.w r2, r2, r7
+ 8000442: fa00 f107 lsl.w r1, r0, r7
+ 8000446: d90b bls.n 8000460 <__udivmoddi4+0x1b0>
+ 8000448: eb1e 0303 adds.w r3, lr, r3
+ 800044c: f109 30ff add.w r0, r9, #4294967295
+ 8000450: f080 8087 bcs.w 8000562 <__udivmoddi4+0x2b2>
+ 8000454: 429c cmp r4, r3
+ 8000456: f240 8084 bls.w 8000562 <__udivmoddi4+0x2b2>
+ 800045a: f1a9 0902 sub.w r9, r9, #2
+ 800045e: 4473 add r3, lr
+ 8000460: 1b1b subs r3, r3, r4
+ 8000462: b2ad uxth r5, r5
+ 8000464: fbb3 f0f8 udiv r0, r3, r8
+ 8000468: fb08 3310 mls r3, r8, r0, r3
+ 800046c: ea45 4403 orr.w r4, r5, r3, lsl #16
+ 8000470: fb00 fa0a mul.w sl, r0, sl
+ 8000474: 45a2 cmp sl, r4
+ 8000476: d908 bls.n 800048a <__udivmoddi4+0x1da>
+ 8000478: eb1e 0404 adds.w r4, lr, r4
+ 800047c: f100 33ff add.w r3, r0, #4294967295
+ 8000480: d26b bcs.n 800055a <__udivmoddi4+0x2aa>
+ 8000482: 45a2 cmp sl, r4
+ 8000484: d969 bls.n 800055a <__udivmoddi4+0x2aa>
+ 8000486: 3802 subs r0, #2
+ 8000488: 4474 add r4, lr
+ 800048a: ea40 4009 orr.w r0, r0, r9, lsl #16
+ 800048e: fba0 8902 umull r8, r9, r0, r2
+ 8000492: eba4 040a sub.w r4, r4, sl
+ 8000496: 454c cmp r4, r9
+ 8000498: 46c2 mov sl, r8
+ 800049a: 464b mov r3, r9
+ 800049c: d354 bcc.n 8000548 <__udivmoddi4+0x298>
+ 800049e: d051 beq.n 8000544 <__udivmoddi4+0x294>
+ 80004a0: 2e00 cmp r6, #0
+ 80004a2: d069 beq.n 8000578 <__udivmoddi4+0x2c8>
+ 80004a4: ebb1 050a subs.w r5, r1, sl
+ 80004a8: eb64 0403 sbc.w r4, r4, r3
+ 80004ac: fa04 fc0c lsl.w ip, r4, ip
+ 80004b0: 40fd lsrs r5, r7
+ 80004b2: 40fc lsrs r4, r7
+ 80004b4: ea4c 0505 orr.w r5, ip, r5
+ 80004b8: e9c6 5400 strd r5, r4, [r6]
+ 80004bc: 2700 movs r7, #0
+ 80004be: e747 b.n 8000350 <__udivmoddi4+0xa0>
+ 80004c0: f1c2 0320 rsb r3, r2, #32
+ 80004c4: fa20 f703 lsr.w r7, r0, r3
+ 80004c8: 4095 lsls r5, r2
+ 80004ca: fa01 f002 lsl.w r0, r1, r2
+ 80004ce: fa21 f303 lsr.w r3, r1, r3
+ 80004d2: ea4f 4e15 mov.w lr, r5, lsr #16
+ 80004d6: 4338 orrs r0, r7
+ 80004d8: 0c01 lsrs r1, r0, #16
+ 80004da: fbb3 f7fe udiv r7, r3, lr
+ 80004de: fa1f f885 uxth.w r8, r5
+ 80004e2: fb0e 3317 mls r3, lr, r7, r3
+ 80004e6: ea41 4103 orr.w r1, r1, r3, lsl #16
+ 80004ea: fb07 f308 mul.w r3, r7, r8
+ 80004ee: 428b cmp r3, r1
+ 80004f0: fa04 f402 lsl.w r4, r4, r2
+ 80004f4: d907 bls.n 8000506 <__udivmoddi4+0x256>
+ 80004f6: 1869 adds r1, r5, r1
+ 80004f8: f107 3cff add.w ip, r7, #4294967295
+ 80004fc: d22f bcs.n 800055e <__udivmoddi4+0x2ae>
+ 80004fe: 428b cmp r3, r1
+ 8000500: d92d bls.n 800055e <__udivmoddi4+0x2ae>
+ 8000502: 3f02 subs r7, #2
+ 8000504: 4429 add r1, r5
+ 8000506: 1acb subs r3, r1, r3
+ 8000508: b281 uxth r1, r0
+ 800050a: fbb3 f0fe udiv r0, r3, lr
+ 800050e: fb0e 3310 mls r3, lr, r0, r3
+ 8000512: ea41 4103 orr.w r1, r1, r3, lsl #16
+ 8000516: fb00 f308 mul.w r3, r0, r8
+ 800051a: 428b cmp r3, r1
+ 800051c: d907 bls.n 800052e <__udivmoddi4+0x27e>
+ 800051e: 1869 adds r1, r5, r1
+ 8000520: f100 3cff add.w ip, r0, #4294967295
+ 8000524: d217 bcs.n 8000556 <__udivmoddi4+0x2a6>
+ 8000526: 428b cmp r3, r1
+ 8000528: d915 bls.n 8000556 <__udivmoddi4+0x2a6>
+ 800052a: 3802 subs r0, #2
+ 800052c: 4429 add r1, r5
+ 800052e: 1ac9 subs r1, r1, r3
+ 8000530: ea40 4707 orr.w r7, r0, r7, lsl #16
+ 8000534: e73b b.n 80003ae <__udivmoddi4+0xfe>
+ 8000536: 4637 mov r7, r6
+ 8000538: 4630 mov r0, r6
+ 800053a: e709 b.n 8000350 <__udivmoddi4+0xa0>
+ 800053c: 4607 mov r7, r0
+ 800053e: e6e7 b.n 8000310 <__udivmoddi4+0x60>
+ 8000540: 4618 mov r0, r3
+ 8000542: e6fb b.n 800033c <__udivmoddi4+0x8c>
+ 8000544: 4541 cmp r1, r8
+ 8000546: d2ab bcs.n 80004a0 <__udivmoddi4+0x1f0>
+ 8000548: ebb8 0a02 subs.w sl, r8, r2
+ 800054c: eb69 020e sbc.w r2, r9, lr
+ 8000550: 3801 subs r0, #1
+ 8000552: 4613 mov r3, r2
+ 8000554: e7a4 b.n 80004a0 <__udivmoddi4+0x1f0>
+ 8000556: 4660 mov r0, ip
+ 8000558: e7e9 b.n 800052e <__udivmoddi4+0x27e>
+ 800055a: 4618 mov r0, r3
+ 800055c: e795 b.n 800048a <__udivmoddi4+0x1da>
+ 800055e: 4667 mov r7, ip
+ 8000560: e7d1 b.n 8000506 <__udivmoddi4+0x256>
+ 8000562: 4681 mov r9, r0
+ 8000564: e77c b.n 8000460 <__udivmoddi4+0x1b0>
+ 8000566: 3802 subs r0, #2
+ 8000568: 442c add r4, r5
+ 800056a: e747 b.n 80003fc <__udivmoddi4+0x14c>
+ 800056c: f1ac 0c02 sub.w ip, ip, #2
+ 8000570: 442b add r3, r5
+ 8000572: e72f b.n 80003d4 <__udivmoddi4+0x124>
+ 8000574: 4638 mov r0, r7
+ 8000576: e708 b.n 800038a <__udivmoddi4+0xda>
+ 8000578: 4637 mov r7, r6
+ 800057a: e6e9 b.n 8000350 <__udivmoddi4+0xa0>
+
+0800057c <__aeabi_idiv0>:
+ 800057c: 4770 bx lr
+ 800057e: bf00 nop
+
+08000580 :
+uint32_t ts_blink = 0;
+uint8_t chipID = 0, revID = 0;
+
+
+void setup(void)
+{
+ 8000580: b580 push {r7, lr}
+ 8000582: af00 add r7, sp, #0
+ HAL_GPIO_Init(GPIOD, &heartBeatLed);
+ 8000584: 4904 ldr r1, [pc, #16] ; (8000598 )
+ 8000586: 4805 ldr r0, [pc, #20] ; (800059c )
+ 8000588: f000 ffa6 bl 80014d8
+ CS43L22_Init(&cs43l22, &hi2c1);
+ 800058c: 4904 ldr r1, [pc, #16] ; (80005a0 )
+ 800058e: 4805 ldr r0, [pc, #20] ; (80005a4 )
+ 8000590: f000 fd96 bl 80010c0
+}
+ 8000594: bf00 nop
+ 8000596: bd80 pop {r7, pc}
+ 8000598: 20000000 .word 0x20000000
+ 800059c: 40020c00 .word 0x40020c00
+ 80005a0: 200000e0 .word 0x200000e0
+ 80005a4: 200000dc .word 0x200000dc
+
+080005a8 :
+
+void loop(void)
+{
+ 80005a8: b580 push {r7, lr}
+ 80005aa: af00 add r7, sp, #0
+ if(HAL_GetTick() - ts_blink > HEARTBEAT)
+ 80005ac: f000 fe54 bl 8001258
+ 80005b0: 4602 mov r2, r0
+ 80005b2: 4b13 ldr r3, [pc, #76] ; (8000600 )
+ 80005b4: 681b ldr r3, [r3, #0]
+ 80005b6: 1ad3 subs r3, r2, r3
+ 80005b8: f5b3 7f7a cmp.w r3, #1000 ; 0x3e8
+ 80005bc: d91e bls.n 80005fc
+ {
+ HAL_GPIO_TogglePin(GPIOD, GPIO_PIN_13);
+ 80005be: f44f 5100 mov.w r1, #8192 ; 0x2000
+ 80005c2: 4810 ldr r0, [pc, #64] ; (8000604 )
+ 80005c4: f001 f923 bl 800180e
+
+ if(!CS43L22_GetDeviceID(&cs43l22, &chipID, &revID))
+ 80005c8: 4a0f ldr r2, [pc, #60] ; (8000608 )
+ 80005ca: 4910 ldr r1, [pc, #64] ; (800060c )
+ 80005cc: 4810 ldr r0, [pc, #64] ; (8000610 )
+ 80005ce: f000 fd8b bl 80010e8
+ 80005d2: 4603 mov r3, r0
+ 80005d4: 2b00 cmp r3, #0
+ 80005d6: d103 bne.n 80005e0
+ printf("Failed to retrieve CS43L22 ID\r\n");
+ 80005d8: 480e ldr r0, [pc, #56] ; (8000614 )
+ 80005da: f008 ffb7 bl 800954c
+ 80005de: e008 b.n 80005f2
+ else
+ printf("Device id : %u, revID : %u\r\n", chipID, revID);
+ 80005e0: 4b0a ldr r3, [pc, #40] ; (800060c )
+ 80005e2: 781b ldrb r3, [r3, #0]
+ 80005e4: 4619 mov r1, r3
+ 80005e6: 4b08 ldr r3, [pc, #32] ; (8000608 )
+ 80005e8: 781b ldrb r3, [r3, #0]
+ 80005ea: 461a mov r2, r3
+ 80005ec: 480a ldr r0, [pc, #40] ; (8000618 )
+ 80005ee: f008 ff39 bl 8009464
+
+ ts_blink = HAL_GetTick();
+ 80005f2: f000 fe31 bl 8001258
+ 80005f6: 4602 mov r2, r0
+ 80005f8: 4b01 ldr r3, [pc, #4] ; (8000600 )
+ 80005fa: 601a str r2, [r3, #0]
+ }
+}
+ 80005fc: bf00 nop
+ 80005fe: bd80 pop {r7, pc}
+ 8000600: 200000c0 .word 0x200000c0
+ 8000604: 40020c00 .word 0x40020c00
+ 8000608: 200000c5 .word 0x200000c5
+ 800060c: 200000c4 .word 0x200000c4
+ 8000610: 200000dc .word 0x200000dc
+ 8000614: 0800a1bc .word 0x0800a1bc
+ 8000618: 0800a1dc .word 0x0800a1dc
+
+0800061c <__io_putchar>:
+/* USER CODE END PFP */
+
+/* Private user code ---------------------------------------------------------*/
+/* USER CODE BEGIN 0 */
+int __io_putchar(int ch)
+{
+ 800061c: b580 push {r7, lr}
+ 800061e: b082 sub sp, #8
+ 8000620: af00 add r7, sp, #0
+ 8000622: 6078 str r0, [r7, #4]
+ HAL_UART_Transmit(&huart2, (uint8_t*)&ch, 1, HAL_MAX_DELAY);
+ 8000624: 1d39 adds r1, r7, #4
+ 8000626: f04f 33ff mov.w r3, #4294967295
+ 800062a: 2201 movs r2, #1
+ 800062c: 4803 ldr r0, [pc, #12] ; (800063c <__io_putchar+0x20>)
+ 800062e: f005 f882 bl 8005736
+ return ch;
+ 8000632: 687b ldr r3, [r7, #4]
+}
+ 8000634: 4618 mov r0, r3
+ 8000636: 3708 adds r7, #8
+ 8000638: 46bd mov sp, r7
+ 800063a: bd80 pop {r7, pc}
+ 800063c: 2000018c .word 0x2000018c
+
+08000640 :
+/**
+ * @brief The application entry point.
+ * @retval int
+ */
+int main(void)
+{
+ 8000640: b580 push {r7, lr}
+ 8000642: af00 add r7, sp, #0
+ /* USER CODE END 1 */
+
+ /* MCU Configuration--------------------------------------------------------*/
+
+ /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
+ HAL_Init();
+ 8000644: f000 fda2 bl 800118c
+ /* USER CODE BEGIN Init */
+
+ /* USER CODE END Init */
+
+ /* Configure the system clock */
+ SystemClock_Config();
+ 8000648: f000 f816 bl 8000678
+ /* USER CODE BEGIN SysInit */
+
+ /* USER CODE END SysInit */
+
+ /* Initialize all configured peripherals */
+ MX_GPIO_Init();
+ 800064c: f000 f984 bl 8000958
+ MX_I2C1_Init();
+ 8000650: f000 f896 bl 8000780
+ MX_I2S2_Init();
+ 8000654: f000 f8c2 bl 80007dc
+ MX_I2S3_Init();
+ 8000658: f000 f8ee bl 8000838
+ MX_SPI1_Init();
+ 800065c: f000 f91c bl 8000898
+ MX_USB_HOST_Init();
+ 8000660: f008 fb0e bl 8008c80
+ MX_USART2_UART_Init();
+ 8000664: f000 f94e bl 8000904
+ /* USER CODE BEGIN 2 */
+ setup();
+ 8000668: f7ff ff8a bl 8000580
+ /* Infinite loop */
+ /* USER CODE BEGIN WHILE */
+ while (1)
+ {
+ /* USER CODE END WHILE */
+ MX_USB_HOST_Process();
+ 800066c: f008 fb2e bl 8008ccc
+
+ /* USER CODE BEGIN 3 */
+ loop();
+ 8000670: f7ff ff9a bl 80005a8
+ MX_USB_HOST_Process();
+ 8000674: e7fa b.n 800066c
+ ...
+
+08000678 :
+/**
+ * @brief System Clock Configuration
+ * @retval None
+ */
+void SystemClock_Config(void)
+{
+ 8000678: b580 push {r7, lr}
+ 800067a: b098 sub sp, #96 ; 0x60
+ 800067c: af00 add r7, sp, #0
+ RCC_OscInitTypeDef RCC_OscInitStruct = {0};
+ 800067e: f107 0330 add.w r3, r7, #48 ; 0x30
+ 8000682: 2230 movs r2, #48 ; 0x30
+ 8000684: 2100 movs r1, #0
+ 8000686: 4618 mov r0, r3
+ 8000688: f008 fe3c bl 8009304
+ RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
+ 800068c: f107 031c add.w r3, r7, #28
+ 8000690: 2200 movs r2, #0
+ 8000692: 601a str r2, [r3, #0]
+ 8000694: 605a str r2, [r3, #4]
+ 8000696: 609a str r2, [r3, #8]
+ 8000698: 60da str r2, [r3, #12]
+ 800069a: 611a str r2, [r3, #16]
+ RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
+ 800069c: f107 0308 add.w r3, r7, #8
+ 80006a0: 2200 movs r2, #0
+ 80006a2: 601a str r2, [r3, #0]
+ 80006a4: 605a str r2, [r3, #4]
+ 80006a6: 609a str r2, [r3, #8]
+ 80006a8: 60da str r2, [r3, #12]
+ 80006aa: 611a str r2, [r3, #16]
+
+ /** Configure the main internal regulator output voltage
+ */
+ __HAL_RCC_PWR_CLK_ENABLE();
+ 80006ac: 2300 movs r3, #0
+ 80006ae: 607b str r3, [r7, #4]
+ 80006b0: 4b31 ldr r3, [pc, #196] ; (8000778 )
+ 80006b2: 6c1b ldr r3, [r3, #64] ; 0x40
+ 80006b4: 4a30 ldr r2, [pc, #192] ; (8000778 )
+ 80006b6: f043 5380 orr.w r3, r3, #268435456 ; 0x10000000
+ 80006ba: 6413 str r3, [r2, #64] ; 0x40
+ 80006bc: 4b2e ldr r3, [pc, #184] ; (8000778 )
+ 80006be: 6c1b ldr r3, [r3, #64] ; 0x40
+ 80006c0: f003 5380 and.w r3, r3, #268435456 ; 0x10000000
+ 80006c4: 607b str r3, [r7, #4]
+ 80006c6: 687b ldr r3, [r7, #4]
+ __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE2);
+ 80006c8: 2300 movs r3, #0
+ 80006ca: 603b str r3, [r7, #0]
+ 80006cc: 4b2b ldr r3, [pc, #172] ; (800077c )
+ 80006ce: 681b ldr r3, [r3, #0]
+ 80006d0: f423 4340 bic.w r3, r3, #49152 ; 0xc000
+ 80006d4: 4a29 ldr r2, [pc, #164] ; (800077c )
+ 80006d6: f443 4300 orr.w r3, r3, #32768 ; 0x8000
+ 80006da: 6013 str r3, [r2, #0]
+ 80006dc: 4b27 ldr r3, [pc, #156] ; (800077c )
+ 80006de: 681b ldr r3, [r3, #0]
+ 80006e0: f403 4340 and.w r3, r3, #49152 ; 0xc000
+ 80006e4: 603b str r3, [r7, #0]
+ 80006e6: 683b ldr r3, [r7, #0]
+ /** Initializes the RCC Oscillators according to the specified parameters
+ * in the RCC_OscInitTypeDef structure.
+ */
+ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
+ 80006e8: 2301 movs r3, #1
+ 80006ea: 633b str r3, [r7, #48] ; 0x30
+ RCC_OscInitStruct.HSEState = RCC_HSE_ON;
+ 80006ec: f44f 3380 mov.w r3, #65536 ; 0x10000
+ 80006f0: 637b str r3, [r7, #52] ; 0x34
+ RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
+ 80006f2: 2302 movs r3, #2
+ 80006f4: 64bb str r3, [r7, #72] ; 0x48
+ RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
+ 80006f6: f44f 0380 mov.w r3, #4194304 ; 0x400000
+ 80006fa: 64fb str r3, [r7, #76] ; 0x4c
+ RCC_OscInitStruct.PLL.PLLM = 8;
+ 80006fc: 2308 movs r3, #8
+ 80006fe: 653b str r3, [r7, #80] ; 0x50
+ RCC_OscInitStruct.PLL.PLLN = 336;
+ 8000700: f44f 73a8 mov.w r3, #336 ; 0x150
+ 8000704: 657b str r3, [r7, #84] ; 0x54
+ RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV4;
+ 8000706: 2304 movs r3, #4
+ 8000708: 65bb str r3, [r7, #88] ; 0x58
+ RCC_OscInitStruct.PLL.PLLQ = 7;
+ 800070a: 2307 movs r3, #7
+ 800070c: 65fb str r3, [r7, #92] ; 0x5c
+ if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
+ 800070e: f107 0330 add.w r3, r7, #48 ; 0x30
+ 8000712: 4618 mov r0, r3
+ 8000714: f004 f9b2 bl 8004a7c
+ 8000718: 4603 mov r3, r0
+ 800071a: 2b00 cmp r3, #0
+ 800071c: d001 beq.n 8000722
+ {
+ Error_Handler();
+ 800071e: f000 f9f5 bl 8000b0c
+ }
+ /** Initializes the CPU, AHB and APB buses clocks
+ */
+ RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
+ 8000722: 230f movs r3, #15
+ 8000724: 61fb str r3, [r7, #28]
+ |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
+ RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
+ 8000726: 2302 movs r3, #2
+ 8000728: 623b str r3, [r7, #32]
+ RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
+ 800072a: 2300 movs r3, #0
+ 800072c: 627b str r3, [r7, #36] ; 0x24
+ RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;
+ 800072e: f44f 5380 mov.w r3, #4096 ; 0x1000
+ 8000732: 62bb str r3, [r7, #40] ; 0x28
+ RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
+ 8000734: 2300 movs r3, #0
+ 8000736: 62fb str r3, [r7, #44] ; 0x2c
+
+ if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK)
+ 8000738: f107 031c add.w r3, r7, #28
+ 800073c: 2102 movs r1, #2
+ 800073e: 4618 mov r0, r3
+ 8000740: f004 fc0c bl 8004f5c
+ 8000744: 4603 mov r3, r0
+ 8000746: 2b00 cmp r3, #0
+ 8000748: d001 beq.n 800074e
+ {
+ Error_Handler();
+ 800074a: f000 f9df bl 8000b0c
+ }
+ PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_I2S;
+ 800074e: 2301 movs r3, #1
+ 8000750: 60bb str r3, [r7, #8]
+ PeriphClkInitStruct.PLLI2S.PLLI2SN = 192;
+ 8000752: 23c0 movs r3, #192 ; 0xc0
+ 8000754: 60fb str r3, [r7, #12]
+ PeriphClkInitStruct.PLLI2S.PLLI2SR = 2;
+ 8000756: 2302 movs r3, #2
+ 8000758: 613b str r3, [r7, #16]
+ if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)
+ 800075a: f107 0308 add.w r3, r7, #8
+ 800075e: 4618 mov r0, r3
+ 8000760: f004 fdee bl 8005340
+ 8000764: 4603 mov r3, r0
+ 8000766: 2b00 cmp r3, #0
+ 8000768: d001 beq.n 800076e
+ {
+ Error_Handler();
+ 800076a: f000 f9cf bl 8000b0c
+ }
+}
+ 800076e: bf00 nop
+ 8000770: 3760 adds r7, #96 ; 0x60
+ 8000772: 46bd mov sp, r7
+ 8000774: bd80 pop {r7, pc}
+ 8000776: bf00 nop
+ 8000778: 40023800 .word 0x40023800
+ 800077c: 40007000 .word 0x40007000
+
+08000780 :
+ * @brief I2C1 Initialization Function
+ * @param None
+ * @retval None
+ */
+static void MX_I2C1_Init(void)
+{
+ 8000780: b580 push {r7, lr}
+ 8000782: af00 add r7, sp, #0
+ /* USER CODE END I2C1_Init 0 */
+
+ /* USER CODE BEGIN I2C1_Init 1 */
+
+ /* USER CODE END I2C1_Init 1 */
+ hi2c1.Instance = I2C1;
+ 8000784: 4b12 ldr r3, [pc, #72] ; (80007d0 )
+ 8000786: 4a13 ldr r2, [pc, #76] ; (80007d4 )
+ 8000788: 601a str r2, [r3, #0]
+ hi2c1.Init.ClockSpeed = 100000;
+ 800078a: 4b11 ldr r3, [pc, #68] ; (80007d0 )
+ 800078c: 4a12 ldr r2, [pc, #72] ; (80007d8 )
+ 800078e: 605a str r2, [r3, #4]
+ hi2c1.Init.DutyCycle = I2C_DUTYCYCLE_2;
+ 8000790: 4b0f ldr r3, [pc, #60] ; (80007d0 )
+ 8000792: 2200 movs r2, #0
+ 8000794: 609a str r2, [r3, #8]
+ hi2c1.Init.OwnAddress1 = 0;
+ 8000796: 4b0e ldr r3, [pc, #56] ; (80007d0 )
+ 8000798: 2200 movs r2, #0
+ 800079a: 60da str r2, [r3, #12]
+ hi2c1.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT;
+ 800079c: 4b0c ldr r3, [pc, #48] ; (80007d0 )
+ 800079e: f44f 4280 mov.w r2, #16384 ; 0x4000
+ 80007a2: 611a str r2, [r3, #16]
+ hi2c1.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE;
+ 80007a4: 4b0a ldr r3, [pc, #40] ; (80007d0 )
+ 80007a6: 2200 movs r2, #0
+ 80007a8: 615a str r2, [r3, #20]
+ hi2c1.Init.OwnAddress2 = 0;
+ 80007aa: 4b09 ldr r3, [pc, #36] ; (80007d0 )
+ 80007ac: 2200 movs r2, #0
+ 80007ae: 619a str r2, [r3, #24]
+ hi2c1.Init.GeneralCallMode = I2C_GENERALCALL_DISABLE;
+ 80007b0: 4b07 ldr r3, [pc, #28] ; (80007d0 )
+ 80007b2: 2200 movs r2, #0
+ 80007b4: 61da str r2, [r3, #28]
+ hi2c1.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE;
+ 80007b6: 4b06 ldr r3, [pc, #24] ; (80007d0 )
+ 80007b8: 2200 movs r2, #0
+ 80007ba: 621a str r2, [r3, #32]
+ if (HAL_I2C_Init(&hi2c1) != HAL_OK)
+ 80007bc: 4804 ldr r0, [pc, #16] ; (80007d0 )
+ 80007be: f002 fd33 bl 8003228
+ 80007c2: 4603 mov r3, r0
+ 80007c4: 2b00 cmp r3, #0
+ 80007c6: d001 beq.n 80007cc
+ {
+ Error_Handler();
+ 80007c8: f000 f9a0 bl 8000b0c
+ }
+ /* USER CODE BEGIN I2C1_Init 2 */
+
+ /* USER CODE END I2C1_Init 2 */
+
+}
+ 80007cc: bf00 nop
+ 80007ce: bd80 pop {r7, pc}
+ 80007d0: 200000e0 .word 0x200000e0
+ 80007d4: 40005400 .word 0x40005400
+ 80007d8: 000186a0 .word 0x000186a0
+
+080007dc :
+ * @brief I2S2 Initialization Function
+ * @param None
+ * @retval None
+ */
+static void MX_I2S2_Init(void)
+{
+ 80007dc: b580 push {r7, lr}
+ 80007de: af00 add r7, sp, #0
+ /* USER CODE END I2S2_Init 0 */
+
+ /* USER CODE BEGIN I2S2_Init 1 */
+
+ /* USER CODE END I2S2_Init 1 */
+ hi2s2.Instance = SPI2;
+ 80007e0: 4b13 ldr r3, [pc, #76] ; (8000830 )
+ 80007e2: 4a14 ldr r2, [pc, #80] ; (8000834 )
+ 80007e4: 601a str r2, [r3, #0]
+ hi2s2.Init.Mode = I2S_MODE_MASTER_TX;
+ 80007e6: 4b12 ldr r3, [pc, #72] ; (8000830 )
+ 80007e8: f44f 7200 mov.w r2, #512 ; 0x200
+ 80007ec: 605a str r2, [r3, #4]
+ hi2s2.Init.Standard = I2S_STANDARD_PHILIPS;
+ 80007ee: 4b10 ldr r3, [pc, #64] ; (8000830 )
+ 80007f0: 2200 movs r2, #0
+ 80007f2: 609a str r2, [r3, #8]
+ hi2s2.Init.DataFormat = I2S_DATAFORMAT_16B;
+ 80007f4: 4b0e ldr r3, [pc, #56] ; (8000830 )
+ 80007f6: 2200 movs r2, #0
+ 80007f8: 60da str r2, [r3, #12]
+ hi2s2.Init.MCLKOutput = I2S_MCLKOUTPUT_DISABLE;
+ 80007fa: 4b0d ldr r3, [pc, #52] ; (8000830 )
+ 80007fc: 2200 movs r2, #0
+ 80007fe: 611a str r2, [r3, #16]
+ hi2s2.Init.AudioFreq = I2S_AUDIOFREQ_8K;
+ 8000800: 4b0b ldr r3, [pc, #44] ; (8000830 )
+ 8000802: f44f 52fa mov.w r2, #8000 ; 0x1f40
+ 8000806: 615a str r2, [r3, #20]
+ hi2s2.Init.CPOL = I2S_CPOL_LOW;
+ 8000808: 4b09 ldr r3, [pc, #36] ; (8000830 )
+ 800080a: 2200 movs r2, #0
+ 800080c: 619a str r2, [r3, #24]
+ hi2s2.Init.ClockSource = I2S_CLOCK_PLL;
+ 800080e: 4b08 ldr r3, [pc, #32] ; (8000830 )
+ 8000810: 2200 movs r2, #0
+ 8000812: 61da str r2, [r3, #28]
+ hi2s2.Init.FullDuplexMode = I2S_FULLDUPLEXMODE_DISABLE;
+ 8000814: 4b06 ldr r3, [pc, #24] ; (8000830 )
+ 8000816: 2200 movs r2, #0
+ 8000818: 621a str r2, [r3, #32]
+ if (HAL_I2S_Init(&hi2s2) != HAL_OK)
+ 800081a: 4805 ldr r0, [pc, #20] ; (8000830 )
+ 800081c: f003 fc8e bl 800413c
+ 8000820: 4603 mov r3, r0
+ 8000822: 2b00 cmp r3, #0
+ 8000824: d001 beq.n 800082a
+ {
+ Error_Handler();
+ 8000826: f000 f971 bl 8000b0c
+ }
+ /* USER CODE BEGIN I2S2_Init 2 */
+
+ /* USER CODE END I2S2_Init 2 */
+
+}
+ 800082a: bf00 nop
+ 800082c: bd80 pop {r7, pc}
+ 800082e: bf00 nop
+ 8000830: 200001cc .word 0x200001cc
+ 8000834: 40003800 .word 0x40003800
+
+08000838 :
+ * @brief I2S3 Initialization Function
+ * @param None
+ * @retval None
+ */
+static void MX_I2S3_Init(void)
+{
+ 8000838: b580 push {r7, lr}
+ 800083a: af00 add r7, sp, #0
+ /* USER CODE END I2S3_Init 0 */
+
+ /* USER CODE BEGIN I2S3_Init 1 */
+
+ /* USER CODE END I2S3_Init 1 */
+ hi2s3.Instance = SPI3;
+ 800083c: 4b13 ldr r3, [pc, #76] ; (800088c )
+ 800083e: 4a14 ldr r2, [pc, #80] ; (8000890 )
+ 8000840: 601a str r2, [r3, #0]
+ hi2s3.Init.Mode = I2S_MODE_MASTER_TX;
+ 8000842: 4b12 ldr r3, [pc, #72] ; (800088c )
+ 8000844: f44f 7200 mov.w r2, #512 ; 0x200
+ 8000848: 605a str r2, [r3, #4]
+ hi2s3.Init.Standard = I2S_STANDARD_PHILIPS;
+ 800084a: 4b10 ldr r3, [pc, #64] ; (800088c )
+ 800084c: 2200 movs r2, #0
+ 800084e: 609a str r2, [r3, #8]
+ hi2s3.Init.DataFormat = I2S_DATAFORMAT_16B;
+ 8000850: 4b0e ldr r3, [pc, #56] ; (800088c )
+ 8000852: 2200 movs r2, #0
+ 8000854: 60da str r2, [r3, #12]
+ hi2s3.Init.MCLKOutput = I2S_MCLKOUTPUT_ENABLE;
+ 8000856: 4b0d ldr r3, [pc, #52] ; (800088c )
+ 8000858: f44f 7200 mov.w r2, #512 ; 0x200
+ 800085c: 611a str r2, [r3, #16]
+ hi2s3.Init.AudioFreq = I2S_AUDIOFREQ_96K;
+ 800085e: 4b0b ldr r3, [pc, #44] ; (800088c )
+ 8000860: 4a0c ldr r2, [pc, #48] ; (8000894 )
+ 8000862: 615a str r2, [r3, #20]
+ hi2s3.Init.CPOL = I2S_CPOL_LOW;
+ 8000864: 4b09 ldr r3, [pc, #36] ; (800088c )
+ 8000866: 2200 movs r2, #0
+ 8000868: 619a str r2, [r3, #24]
+ hi2s3.Init.ClockSource = I2S_CLOCK_PLL;
+ 800086a: 4b08 ldr r3, [pc, #32] ; (800088c )
+ 800086c: 2200 movs r2, #0
+ 800086e: 61da str r2, [r3, #28]
+ hi2s3.Init.FullDuplexMode = I2S_FULLDUPLEXMODE_DISABLE;
+ 8000870: 4b06 ldr r3, [pc, #24] ; (800088c )
+ 8000872: 2200 movs r2, #0
+ 8000874: 621a str r2, [r3, #32]
+ if (HAL_I2S_Init(&hi2s3) != HAL_OK)
+ 8000876: 4805 ldr r0, [pc, #20] ; (800088c )
+ 8000878: f003 fc60 bl 800413c
+ 800087c: 4603 mov r3, r0
+ 800087e: 2b00 cmp r3, #0
+ 8000880: d001 beq.n 8000886
+ {
+ Error_Handler();
+ 8000882: f000 f943 bl 8000b0c
+ }
+ /* USER CODE BEGIN I2S3_Init 2 */
+
+ /* USER CODE END I2S3_Init 2 */
+
+}
+ 8000886: bf00 nop
+ 8000888: bd80 pop {r7, pc}
+ 800088a: bf00 nop
+ 800088c: 20000214 .word 0x20000214
+ 8000890: 40003c00 .word 0x40003c00
+ 8000894: 00017700 .word 0x00017700
+
+08000898 :
+ * @brief SPI1 Initialization Function
+ * @param None
+ * @retval None
+ */
+static void MX_SPI1_Init(void)
+{
+ 8000898: b580 push {r7, lr}
+ 800089a: af00 add r7, sp, #0
+
+ /* USER CODE BEGIN SPI1_Init 1 */
+
+ /* USER CODE END SPI1_Init 1 */
+ /* SPI1 parameter configuration*/
+ hspi1.Instance = SPI1;
+ 800089c: 4b17 ldr r3, [pc, #92] ; (80008fc )
+ 800089e: 4a18 ldr r2, [pc, #96] ; (8000900 )
+ 80008a0: 601a str r2, [r3, #0]
+ hspi1.Init.Mode = SPI_MODE_MASTER;
+ 80008a2: 4b16 ldr r3, [pc, #88] ; (80008fc )
+ 80008a4: f44f 7282 mov.w r2, #260 ; 0x104
+ 80008a8: 605a str r2, [r3, #4]
+ hspi1.Init.Direction = SPI_DIRECTION_2LINES;
+ 80008aa: 4b14 ldr r3, [pc, #80] ; (80008fc )
+ 80008ac: 2200 movs r2, #0
+ 80008ae: 609a str r2, [r3, #8]
+ hspi1.Init.DataSize = SPI_DATASIZE_8BIT;
+ 80008b0: 4b12 ldr r3, [pc, #72] ; (80008fc )
+ 80008b2: 2200 movs r2, #0
+ 80008b4: 60da str r2, [r3, #12]
+ hspi1.Init.CLKPolarity = SPI_POLARITY_LOW;
+ 80008b6: 4b11 ldr r3, [pc, #68] ; (80008fc )
+ 80008b8: 2200 movs r2, #0
+ 80008ba: 611a str r2, [r3, #16]
+ hspi1.Init.CLKPhase = SPI_PHASE_1EDGE;
+ 80008bc: 4b0f ldr r3, [pc, #60] ; (80008fc )
+ 80008be: 2200 movs r2, #0
+ 80008c0: 615a str r2, [r3, #20]
+ hspi1.Init.NSS = SPI_NSS_SOFT;
+ 80008c2: 4b0e ldr r3, [pc, #56] ; (80008fc )
+ 80008c4: f44f 7200 mov.w r2, #512 ; 0x200
+ 80008c8: 619a str r2, [r3, #24]
+ hspi1.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_2;
+ 80008ca: 4b0c ldr r3, [pc, #48] ; (80008fc )
+ 80008cc: 2200 movs r2, #0
+ 80008ce: 61da str r2, [r3, #28]
+ hspi1.Init.FirstBit = SPI_FIRSTBIT_MSB;
+ 80008d0: 4b0a ldr r3, [pc, #40] ; (80008fc )
+ 80008d2: 2200 movs r2, #0
+ 80008d4: 621a str r2, [r3, #32]
+ hspi1.Init.TIMode = SPI_TIMODE_DISABLE;
+ 80008d6: 4b09 ldr r3, [pc, #36] ; (80008fc )
+ 80008d8: 2200 movs r2, #0
+ 80008da: 625a str r2, [r3, #36] ; 0x24
+ hspi1.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;
+ 80008dc: 4b07 ldr r3, [pc, #28] ; (80008fc )
+ 80008de: 2200 movs r2, #0
+ 80008e0: 629a str r2, [r3, #40] ; 0x28
+ hspi1.Init.CRCPolynomial = 10;
+ 80008e2: 4b06 ldr r3, [pc, #24] ; (80008fc )
+ 80008e4: 220a movs r2, #10
+ 80008e6: 62da str r2, [r3, #44] ; 0x2c
+ if (HAL_SPI_Init(&hspi1) != HAL_OK)
+ 80008e8: 4804 ldr r0, [pc, #16] ; (80008fc )
+ 80008ea: f004 fe73 bl 80055d4
+ 80008ee: 4603 mov r3, r0
+ 80008f0: 2b00 cmp r3, #0
+ 80008f2: d001 beq.n 80008f8
+ {
+ Error_Handler();
+ 80008f4: f000 f90a bl 8000b0c
+ }
+ /* USER CODE BEGIN SPI1_Init 2 */
+
+ /* USER CODE END SPI1_Init 2 */
+
+}
+ 80008f8: bf00 nop
+ 80008fa: bd80 pop {r7, pc}
+ 80008fc: 20000134 .word 0x20000134
+ 8000900: 40013000 .word 0x40013000
+
+08000904 :
+ * @brief USART2 Initialization Function
+ * @param None
+ * @retval None
+ */
+static void MX_USART2_UART_Init(void)
+{
+ 8000904: b580 push {r7, lr}
+ 8000906: af00 add r7, sp, #0
+ /* USER CODE END USART2_Init 0 */
+
+ /* USER CODE BEGIN USART2_Init 1 */
+
+ /* USER CODE END USART2_Init 1 */
+ huart2.Instance = USART2;
+ 8000908: 4b11 ldr r3, [pc, #68] ; (8000950 )
+ 800090a: 4a12 ldr r2, [pc, #72] ; (8000954 )
+ 800090c: 601a str r2, [r3, #0]
+ huart2.Init.BaudRate = 115200;
+ 800090e: 4b10 ldr r3, [pc, #64] ; (8000950 )
+ 8000910: f44f 32e1 mov.w r2, #115200 ; 0x1c200
+ 8000914: 605a str r2, [r3, #4]
+ huart2.Init.WordLength = UART_WORDLENGTH_8B;
+ 8000916: 4b0e ldr r3, [pc, #56] ; (8000950 )
+ 8000918: 2200 movs r2, #0
+ 800091a: 609a str r2, [r3, #8]
+ huart2.Init.StopBits = UART_STOPBITS_1;
+ 800091c: 4b0c ldr r3, [pc, #48] ; (8000950 )
+ 800091e: 2200 movs r2, #0
+ 8000920: 60da str r2, [r3, #12]
+ huart2.Init.Parity = UART_PARITY_NONE;
+ 8000922: 4b0b ldr r3, [pc, #44] ; (8000950 )
+ 8000924: 2200 movs r2, #0
+ 8000926: 611a str r2, [r3, #16]
+ huart2.Init.Mode = UART_MODE_TX_RX;
+ 8000928: 4b09 ldr r3, [pc, #36] ; (8000950 )
+ 800092a: 220c movs r2, #12
+ 800092c: 615a str r2, [r3, #20]
+ huart2.Init.HwFlowCtl = UART_HWCONTROL_NONE;
+ 800092e: 4b08 ldr r3, [pc, #32] ; (8000950 )
+ 8000930: 2200 movs r2, #0
+ 8000932: 619a str r2, [r3, #24]
+ huart2.Init.OverSampling = UART_OVERSAMPLING_16;
+ 8000934: 4b06 ldr r3, [pc, #24] ; (8000950 )
+ 8000936: 2200 movs r2, #0
+ 8000938: 61da str r2, [r3, #28]
+ if (HAL_UART_Init(&huart2) != HAL_OK)
+ 800093a: 4805 ldr r0, [pc, #20] ; (8000950 )
+ 800093c: f004 feae bl 800569c
+ 8000940: 4603 mov r3, r0
+ 8000942: 2b00 cmp r3, #0
+ 8000944: d001 beq.n 800094a
+ {
+ Error_Handler();
+ 8000946: f000 f8e1 bl 8000b0c
+ }
+ /* USER CODE BEGIN USART2_Init 2 */
+
+ /* USER CODE END USART2_Init 2 */
+
+}
+ 800094a: bf00 nop
+ 800094c: bd80 pop {r7, pc}
+ 800094e: bf00 nop
+ 8000950: 2000018c .word 0x2000018c
+ 8000954: 40004400 .word 0x40004400
+
+08000958 :
+ * @brief GPIO Initialization Function
+ * @param None
+ * @retval None
+ */
+static void MX_GPIO_Init(void)
+{
+ 8000958: b580 push {r7, lr}
+ 800095a: b08c sub sp, #48 ; 0x30
+ 800095c: af00 add r7, sp, #0
+ GPIO_InitTypeDef GPIO_InitStruct = {0};
+ 800095e: f107 031c add.w r3, r7, #28
+ 8000962: 2200 movs r2, #0
+ 8000964: 601a str r2, [r3, #0]
+ 8000966: 605a str r2, [r3, #4]
+ 8000968: 609a str r2, [r3, #8]
+ 800096a: 60da str r2, [r3, #12]
+ 800096c: 611a str r2, [r3, #16]
+
+ /* GPIO Ports Clock Enable */
+ __HAL_RCC_GPIOE_CLK_ENABLE();
+ 800096e: 2300 movs r3, #0
+ 8000970: 61bb str r3, [r7, #24]
+ 8000972: 4b60 ldr r3, [pc, #384] ; (8000af4 )
+ 8000974: 6b1b ldr r3, [r3, #48] ; 0x30
+ 8000976: 4a5f ldr r2, [pc, #380] ; (8000af4 )
+ 8000978: f043 0310 orr.w r3, r3, #16
+ 800097c: 6313 str r3, [r2, #48] ; 0x30
+ 800097e: 4b5d ldr r3, [pc, #372] ; (8000af4 )
+ 8000980: 6b1b ldr r3, [r3, #48] ; 0x30
+ 8000982: f003 0310 and.w r3, r3, #16
+ 8000986: 61bb str r3, [r7, #24]
+ 8000988: 69bb ldr r3, [r7, #24]
+ __HAL_RCC_GPIOC_CLK_ENABLE();
+ 800098a: 2300 movs r3, #0
+ 800098c: 617b str r3, [r7, #20]
+ 800098e: 4b59 ldr r3, [pc, #356] ; (8000af4 )
+ 8000990: 6b1b ldr r3, [r3, #48] ; 0x30
+ 8000992: 4a58 ldr r2, [pc, #352] ; (8000af4 )
+ 8000994: f043 0304 orr.w r3, r3, #4
+ 8000998: 6313 str r3, [r2, #48] ; 0x30
+ 800099a: 4b56 ldr r3, [pc, #344] ; (8000af4 )
+ 800099c: 6b1b ldr r3, [r3, #48] ; 0x30
+ 800099e: f003 0304 and.w r3, r3, #4
+ 80009a2: 617b str r3, [r7, #20]
+ 80009a4: 697b ldr r3, [r7, #20]
+ __HAL_RCC_GPIOH_CLK_ENABLE();
+ 80009a6: 2300 movs r3, #0
+ 80009a8: 613b str r3, [r7, #16]
+ 80009aa: 4b52 ldr r3, [pc, #328] ; (8000af4 )
+ 80009ac: 6b1b ldr r3, [r3, #48] ; 0x30
+ 80009ae: 4a51 ldr r2, [pc, #324] ; (8000af4 )
+ 80009b0: f043 0380 orr.w r3, r3, #128 ; 0x80
+ 80009b4: 6313 str r3, [r2, #48] ; 0x30
+ 80009b6: 4b4f ldr r3, [pc, #316] ; (8000af4 )
+ 80009b8: 6b1b ldr r3, [r3, #48] ; 0x30
+ 80009ba: f003 0380 and.w r3, r3, #128 ; 0x80
+ 80009be: 613b str r3, [r7, #16]
+ 80009c0: 693b ldr r3, [r7, #16]
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ 80009c2: 2300 movs r3, #0
+ 80009c4: 60fb str r3, [r7, #12]
+ 80009c6: 4b4b ldr r3, [pc, #300] ; (8000af4 )
+ 80009c8: 6b1b ldr r3, [r3, #48] ; 0x30
+ 80009ca: 4a4a ldr r2, [pc, #296] ; (8000af4 )
+ 80009cc: f043 0301 orr.w r3, r3, #1
+ 80009d0: 6313 str r3, [r2, #48] ; 0x30
+ 80009d2: 4b48 ldr r3, [pc, #288] ; (8000af4 )
+ 80009d4: 6b1b ldr r3, [r3, #48] ; 0x30
+ 80009d6: f003 0301 and.w r3, r3, #1
+ 80009da: 60fb str r3, [r7, #12]
+ 80009dc: 68fb ldr r3, [r7, #12]
+ __HAL_RCC_GPIOB_CLK_ENABLE();
+ 80009de: 2300 movs r3, #0
+ 80009e0: 60bb str r3, [r7, #8]
+ 80009e2: 4b44 ldr r3, [pc, #272] ; (8000af4 )
+ 80009e4: 6b1b ldr r3, [r3, #48] ; 0x30
+ 80009e6: 4a43 ldr r2, [pc, #268] ; (8000af4 )
+ 80009e8: f043 0302 orr.w r3, r3, #2
+ 80009ec: 6313 str r3, [r2, #48] ; 0x30
+ 80009ee: 4b41 ldr r3, [pc, #260] ; (8000af4 )
+ 80009f0: 6b1b ldr r3, [r3, #48] ; 0x30
+ 80009f2: f003 0302 and.w r3, r3, #2
+ 80009f6: 60bb str r3, [r7, #8]
+ 80009f8: 68bb ldr r3, [r7, #8]
+ __HAL_RCC_GPIOD_CLK_ENABLE();
+ 80009fa: 2300 movs r3, #0
+ 80009fc: 607b str r3, [r7, #4]
+ 80009fe: 4b3d ldr r3, [pc, #244] ; (8000af4 )
+ 8000a00: 6b1b ldr r3, [r3, #48] ; 0x30
+ 8000a02: 4a3c ldr r2, [pc, #240] ; (8000af4 )
+ 8000a04: f043 0308 orr.w r3, r3, #8
+ 8000a08: 6313 str r3, [r2, #48] ; 0x30
+ 8000a0a: 4b3a ldr r3, [pc, #232] ; (8000af4 )
+ 8000a0c: 6b1b ldr r3, [r3, #48] ; 0x30
+ 8000a0e: f003 0308 and.w r3, r3, #8
+ 8000a12: 607b str r3, [r7, #4]
+ 8000a14: 687b ldr r3, [r7, #4]
+
+ /*Configure GPIO pin Output Level */
+ HAL_GPIO_WritePin(CS_I2C_SPI_GPIO_Port, CS_I2C_SPI_Pin, GPIO_PIN_RESET);
+ 8000a16: 2200 movs r2, #0
+ 8000a18: 2108 movs r1, #8
+ 8000a1a: 4837 ldr r0, [pc, #220] ; (8000af8 )
+ 8000a1c: f000 fede bl 80017dc
+
+ /*Configure GPIO pin Output Level */
+ HAL_GPIO_WritePin(OTG_FS_PowerSwitchOn_GPIO_Port, OTG_FS_PowerSwitchOn_Pin, GPIO_PIN_SET);
+ 8000a20: 2201 movs r2, #1
+ 8000a22: 2101 movs r1, #1
+ 8000a24: 4835 ldr r0, [pc, #212] ; (8000afc )
+ 8000a26: f000 fed9 bl 80017dc
+
+ /*Configure GPIO pin Output Level */
+ HAL_GPIO_WritePin(GPIOD, LD4_Pin|LD3_Pin|LD5_Pin|LD6_Pin
+ 8000a2a: 2200 movs r2, #0
+ 8000a2c: f24f 0110 movw r1, #61456 ; 0xf010
+ 8000a30: 4833 ldr r0, [pc, #204] ; (8000b00 )
+ 8000a32: f000 fed3 bl 80017dc
+ |Audio_RST_Pin, GPIO_PIN_RESET);
+
+ /*Configure GPIO pin : PE2 */
+ GPIO_InitStruct.Pin = GPIO_PIN_2;
+ 8000a36: 2304 movs r3, #4
+ 8000a38: 61fb str r3, [r7, #28]
+ GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
+ 8000a3a: 2300 movs r3, #0
+ 8000a3c: 623b str r3, [r7, #32]
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ 8000a3e: 2300 movs r3, #0
+ 8000a40: 627b str r3, [r7, #36] ; 0x24
+ HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);
+ 8000a42: f107 031c add.w r3, r7, #28
+ 8000a46: 4619 mov r1, r3
+ 8000a48: 482b ldr r0, [pc, #172] ; (8000af8 )
+ 8000a4a: f000 fd45 bl 80014d8
+
+ /*Configure GPIO pin : CS_I2C_SPI_Pin */
+ GPIO_InitStruct.Pin = CS_I2C_SPI_Pin;
+ 8000a4e: 2308 movs r3, #8
+ 8000a50: 61fb str r3, [r7, #28]
+ GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
+ 8000a52: 2301 movs r3, #1
+ 8000a54: 623b str r3, [r7, #32]
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ 8000a56: 2300 movs r3, #0
+ 8000a58: 627b str r3, [r7, #36] ; 0x24
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
+ 8000a5a: 2300 movs r3, #0
+ 8000a5c: 62bb str r3, [r7, #40] ; 0x28
+ HAL_GPIO_Init(CS_I2C_SPI_GPIO_Port, &GPIO_InitStruct);
+ 8000a5e: f107 031c add.w r3, r7, #28
+ 8000a62: 4619 mov r1, r3
+ 8000a64: 4824 ldr r0, [pc, #144] ; (8000af8 )
+ 8000a66: f000 fd37 bl 80014d8
+
+ /*Configure GPIO pins : PE4 PE5 MEMS_INT2_Pin */
+ GPIO_InitStruct.Pin = GPIO_PIN_4|GPIO_PIN_5|MEMS_INT2_Pin;
+ 8000a6a: 2332 movs r3, #50 ; 0x32
+ 8000a6c: 61fb str r3, [r7, #28]
+ GPIO_InitStruct.Mode = GPIO_MODE_EVT_RISING;
+ 8000a6e: 4b25 ldr r3, [pc, #148] ; (8000b04 )
+ 8000a70: 623b str r3, [r7, #32]
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ 8000a72: 2300 movs r3, #0
+ 8000a74: 627b str r3, [r7, #36] ; 0x24
+ HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);
+ 8000a76: f107 031c add.w r3, r7, #28
+ 8000a7a: 4619 mov r1, r3
+ 8000a7c: 481e ldr r0, [pc, #120] ; (8000af8 )
+ 8000a7e: f000 fd2b bl 80014d8
+
+ /*Configure GPIO pin : OTG_FS_PowerSwitchOn_Pin */
+ GPIO_InitStruct.Pin = OTG_FS_PowerSwitchOn_Pin;
+ 8000a82: 2301 movs r3, #1
+ 8000a84: 61fb str r3, [r7, #28]
+ GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
+ 8000a86: 2301 movs r3, #1
+ 8000a88: 623b str r3, [r7, #32]
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ 8000a8a: 2300 movs r3, #0
+ 8000a8c: 627b str r3, [r7, #36] ; 0x24
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
+ 8000a8e: 2300 movs r3, #0
+ 8000a90: 62bb str r3, [r7, #40] ; 0x28
+ HAL_GPIO_Init(OTG_FS_PowerSwitchOn_GPIO_Port, &GPIO_InitStruct);
+ 8000a92: f107 031c add.w r3, r7, #28
+ 8000a96: 4619 mov r1, r3
+ 8000a98: 4818 ldr r0, [pc, #96] ; (8000afc )
+ 8000a9a: f000 fd1d bl 80014d8
+
+ /*Configure GPIO pin : B1_Pin */
+ GPIO_InitStruct.Pin = B1_Pin;
+ 8000a9e: 2301 movs r3, #1
+ 8000aa0: 61fb str r3, [r7, #28]
+ GPIO_InitStruct.Mode = GPIO_MODE_EVT_RISING;
+ 8000aa2: 4b18 ldr r3, [pc, #96] ; (8000b04 )
+ 8000aa4: 623b str r3, [r7, #32]
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ 8000aa6: 2300 movs r3, #0
+ 8000aa8: 627b str r3, [r7, #36] ; 0x24
+ HAL_GPIO_Init(B1_GPIO_Port, &GPIO_InitStruct);
+ 8000aaa: f107 031c add.w r3, r7, #28
+ 8000aae: 4619 mov r1, r3
+ 8000ab0: 4815 ldr r0, [pc, #84] ; (8000b08 )
+ 8000ab2: f000 fd11 bl 80014d8
+
+ /*Configure GPIO pins : LD4_Pin LD3_Pin LD5_Pin LD6_Pin
+ Audio_RST_Pin */
+ GPIO_InitStruct.Pin = LD4_Pin|LD3_Pin|LD5_Pin|LD6_Pin
+ 8000ab6: f24f 0310 movw r3, #61456 ; 0xf010
+ 8000aba: 61fb str r3, [r7, #28]
+ |Audio_RST_Pin;
+ GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
+ 8000abc: 2301 movs r3, #1
+ 8000abe: 623b str r3, [r7, #32]
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ 8000ac0: 2300 movs r3, #0
+ 8000ac2: 627b str r3, [r7, #36] ; 0x24
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
+ 8000ac4: 2300 movs r3, #0
+ 8000ac6: 62bb str r3, [r7, #40] ; 0x28
+ HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
+ 8000ac8: f107 031c add.w r3, r7, #28
+ 8000acc: 4619 mov r1, r3
+ 8000ace: 480c ldr r0, [pc, #48] ; (8000b00 )
+ 8000ad0: f000 fd02 bl 80014d8
+
+ /*Configure GPIO pin : OTG_FS_OverCurrent_Pin */
+ GPIO_InitStruct.Pin = OTG_FS_OverCurrent_Pin;
+ 8000ad4: 2320 movs r3, #32
+ 8000ad6: 61fb str r3, [r7, #28]
+ GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
+ 8000ad8: 2300 movs r3, #0
+ 8000ada: 623b str r3, [r7, #32]
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ 8000adc: 2300 movs r3, #0
+ 8000ade: 627b str r3, [r7, #36] ; 0x24
+ HAL_GPIO_Init(OTG_FS_OverCurrent_GPIO_Port, &GPIO_InitStruct);
+ 8000ae0: f107 031c add.w r3, r7, #28
+ 8000ae4: 4619 mov r1, r3
+ 8000ae6: 4806 ldr r0, [pc, #24] ; (8000b00 )
+ 8000ae8: f000 fcf6 bl 80014d8
+
+}
+ 8000aec: bf00 nop
+ 8000aee: 3730 adds r7, #48 ; 0x30
+ 8000af0: 46bd mov sp, r7
+ 8000af2: bd80 pop {r7, pc}
+ 8000af4: 40023800 .word 0x40023800
+ 8000af8: 40021000 .word 0x40021000
+ 8000afc: 40020800 .word 0x40020800
+ 8000b00: 40020c00 .word 0x40020c00
+ 8000b04: 10120000 .word 0x10120000
+ 8000b08: 40020000 .word 0x40020000
+
+08000b0c :
+/**
+ * @brief This function is executed in case of error occurrence.
+ * @retval None
+ */
+void Error_Handler(void)
+{
+ 8000b0c: b480 push {r7}
+ 8000b0e: af00 add r7, sp, #0
+ \details Disables IRQ interrupts by setting the I-bit in the CPSR.
+ Can only be executed in Privileged modes.
+ */
+__STATIC_FORCEINLINE void __disable_irq(void)
+{
+ __ASM volatile ("cpsid i" : : : "memory");
+ 8000b10: b672 cpsid i
+ /* USER CODE BEGIN Error_Handler_Debug */
+ /* User can add his own implementation to report the HAL error return state */
+ __disable_irq();
+ while (1)
+ 8000b12: e7fe b.n 8000b12
+
+08000b14 :
+/* USER CODE END 0 */
+/**
+ * Initializes the Global MSP.
+ */
+void HAL_MspInit(void)
+{
+ 8000b14: b580 push {r7, lr}
+ 8000b16: b082 sub sp, #8
+ 8000b18: af00 add r7, sp, #0
+ /* USER CODE BEGIN MspInit 0 */
+
+ /* USER CODE END MspInit 0 */
+
+ __HAL_RCC_SYSCFG_CLK_ENABLE();
+ 8000b1a: 2300 movs r3, #0
+ 8000b1c: 607b str r3, [r7, #4]
+ 8000b1e: 4b10 ldr r3, [pc, #64] ; (8000b60 )
+ 8000b20: 6c5b ldr r3, [r3, #68] ; 0x44
+ 8000b22: 4a0f ldr r2, [pc, #60] ; (8000b60 )
+ 8000b24: f443 4380 orr.w r3, r3, #16384 ; 0x4000
+ 8000b28: 6453 str r3, [r2, #68] ; 0x44
+ 8000b2a: 4b0d ldr r3, [pc, #52] ; (8000b60 )
+ 8000b2c: 6c5b ldr r3, [r3, #68] ; 0x44
+ 8000b2e: f403 4380 and.w r3, r3, #16384 ; 0x4000
+ 8000b32: 607b str r3, [r7, #4]
+ 8000b34: 687b ldr r3, [r7, #4]
+ __HAL_RCC_PWR_CLK_ENABLE();
+ 8000b36: 2300 movs r3, #0
+ 8000b38: 603b str r3, [r7, #0]
+ 8000b3a: 4b09 ldr r3, [pc, #36] ; (8000b60 )
+ 8000b3c: 6c1b ldr r3, [r3, #64] ; 0x40
+ 8000b3e: 4a08 ldr r2, [pc, #32] ; (8000b60 )
+ 8000b40: f043 5380 orr.w r3, r3, #268435456 ; 0x10000000
+ 8000b44: 6413 str r3, [r2, #64] ; 0x40
+ 8000b46: 4b06 ldr r3, [pc, #24] ; (8000b60 )
+ 8000b48: 6c1b ldr r3, [r3, #64] ; 0x40
+ 8000b4a: f003 5380 and.w r3, r3, #268435456 ; 0x10000000
+ 8000b4e: 603b str r3, [r7, #0]
+ 8000b50: 683b ldr r3, [r7, #0]
+
+ HAL_NVIC_SetPriorityGrouping(NVIC_PRIORITYGROUP_0);
+ 8000b52: 2007 movs r0, #7
+ 8000b54: f000 fc7e bl 8001454
+ /* System interrupt init*/
+
+ /* USER CODE BEGIN MspInit 1 */
+
+ /* USER CODE END MspInit 1 */
+}
+ 8000b58: bf00 nop
+ 8000b5a: 3708 adds r7, #8
+ 8000b5c: 46bd mov sp, r7
+ 8000b5e: bd80 pop {r7, pc}
+ 8000b60: 40023800 .word 0x40023800
+
+08000b64 :
+* This function configures the hardware resources used in this example
+* @param hi2c: I2C handle pointer
+* @retval None
+*/
+void HAL_I2C_MspInit(I2C_HandleTypeDef* hi2c)
+{
+ 8000b64: b580 push {r7, lr}
+ 8000b66: b08a sub sp, #40 ; 0x28
+ 8000b68: af00 add r7, sp, #0
+ 8000b6a: 6078 str r0, [r7, #4]
+ GPIO_InitTypeDef GPIO_InitStruct = {0};
+ 8000b6c: f107 0314 add.w r3, r7, #20
+ 8000b70: 2200 movs r2, #0
+ 8000b72: 601a str r2, [r3, #0]
+ 8000b74: 605a str r2, [r3, #4]
+ 8000b76: 609a str r2, [r3, #8]
+ 8000b78: 60da str r2, [r3, #12]
+ 8000b7a: 611a str r2, [r3, #16]
+ if(hi2c->Instance==I2C1)
+ 8000b7c: 687b ldr r3, [r7, #4]
+ 8000b7e: 681b ldr r3, [r3, #0]
+ 8000b80: 4a19 ldr r2, [pc, #100] ; (8000be8 )
+ 8000b82: 4293 cmp r3, r2
+ 8000b84: d12c bne.n 8000be0
+ {
+ /* USER CODE BEGIN I2C1_MspInit 0 */
+
+ /* USER CODE END I2C1_MspInit 0 */
+
+ __HAL_RCC_GPIOB_CLK_ENABLE();
+ 8000b86: 2300 movs r3, #0
+ 8000b88: 613b str r3, [r7, #16]
+ 8000b8a: 4b18 ldr r3, [pc, #96] ; (8000bec )
+ 8000b8c: 6b1b ldr r3, [r3, #48] ; 0x30
+ 8000b8e: 4a17 ldr r2, [pc, #92] ; (8000bec )
+ 8000b90: f043 0302 orr.w r3, r3, #2
+ 8000b94: 6313 str r3, [r2, #48] ; 0x30
+ 8000b96: 4b15 ldr r3, [pc, #84] ; (8000bec )
+ 8000b98: 6b1b ldr r3, [r3, #48] ; 0x30
+ 8000b9a: f003 0302 and.w r3, r3, #2
+ 8000b9e: 613b str r3, [r7, #16]
+ 8000ba0: 693b ldr r3, [r7, #16]
+ /**I2C1 GPIO Configuration
+ PB6 ------> I2C1_SCL
+ PB9 ------> I2C1_SDA
+ */
+ GPIO_InitStruct.Pin = Audio_SCL_Pin|Audio_SDA_Pin;
+ 8000ba2: f44f 7310 mov.w r3, #576 ; 0x240
+ 8000ba6: 617b str r3, [r7, #20]
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_OD;
+ 8000ba8: 2312 movs r3, #18
+ 8000baa: 61bb str r3, [r7, #24]
+ GPIO_InitStruct.Pull = GPIO_PULLUP;
+ 8000bac: 2301 movs r3, #1
+ 8000bae: 61fb str r3, [r7, #28]
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
+ 8000bb0: 2300 movs r3, #0
+ 8000bb2: 623b str r3, [r7, #32]
+ GPIO_InitStruct.Alternate = GPIO_AF4_I2C1;
+ 8000bb4: 2304 movs r3, #4
+ 8000bb6: 627b str r3, [r7, #36] ; 0x24
+ HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
+ 8000bb8: f107 0314 add.w r3, r7, #20
+ 8000bbc: 4619 mov r1, r3
+ 8000bbe: 480c ldr r0, [pc, #48] ; (8000bf0 )
+ 8000bc0: f000 fc8a bl 80014d8
+
+ /* Peripheral clock enable */
+ __HAL_RCC_I2C1_CLK_ENABLE();
+ 8000bc4: 2300 movs r3, #0
+ 8000bc6: 60fb str r3, [r7, #12]
+ 8000bc8: 4b08 ldr r3, [pc, #32] ; (8000bec )
+ 8000bca: 6c1b ldr r3, [r3, #64] ; 0x40
+ 8000bcc: 4a07 ldr r2, [pc, #28] ; (8000bec )
+ 8000bce: f443 1300 orr.w r3, r3, #2097152 ; 0x200000
+ 8000bd2: 6413 str r3, [r2, #64] ; 0x40
+ 8000bd4: 4b05 ldr r3, [pc, #20] ; (8000bec )
+ 8000bd6: 6c1b ldr r3, [r3, #64] ; 0x40
+ 8000bd8: f403 1300 and.w r3, r3, #2097152 ; 0x200000
+ 8000bdc: 60fb str r3, [r7, #12]
+ 8000bde: 68fb ldr r3, [r7, #12]
+ /* USER CODE BEGIN I2C1_MspInit 1 */
+
+ /* USER CODE END I2C1_MspInit 1 */
+ }
+
+}
+ 8000be0: bf00 nop
+ 8000be2: 3728 adds r7, #40 ; 0x28
+ 8000be4: 46bd mov sp, r7
+ 8000be6: bd80 pop {r7, pc}
+ 8000be8: 40005400 .word 0x40005400
+ 8000bec: 40023800 .word 0x40023800
+ 8000bf0: 40020400 .word 0x40020400
+
+08000bf4 :
+* This function configures the hardware resources used in this example
+* @param hi2s: I2S handle pointer
+* @retval None
+*/
+void HAL_I2S_MspInit(I2S_HandleTypeDef* hi2s)
+{
+ 8000bf4: b580 push {r7, lr}
+ 8000bf6: b08e sub sp, #56 ; 0x38
+ 8000bf8: af00 add r7, sp, #0
+ 8000bfa: 6078 str r0, [r7, #4]
+ GPIO_InitTypeDef GPIO_InitStruct = {0};
+ 8000bfc: f107 0324 add.w r3, r7, #36 ; 0x24
+ 8000c00: 2200 movs r2, #0
+ 8000c02: 601a str r2, [r3, #0]
+ 8000c04: 605a str r2, [r3, #4]
+ 8000c06: 609a str r2, [r3, #8]
+ 8000c08: 60da str r2, [r3, #12]
+ 8000c0a: 611a str r2, [r3, #16]
+ if(hi2s->Instance==SPI2)
+ 8000c0c: 687b ldr r3, [r7, #4]
+ 8000c0e: 681b ldr r3, [r3, #0]
+ 8000c10: 4a51 ldr r2, [pc, #324] ; (8000d58 )
+ 8000c12: 4293 cmp r3, r2
+ 8000c14: d14b bne.n 8000cae
+ {
+ /* USER CODE BEGIN SPI2_MspInit 0 */
+
+ /* USER CODE END SPI2_MspInit 0 */
+ /* Peripheral clock enable */
+ __HAL_RCC_SPI2_CLK_ENABLE();
+ 8000c16: 2300 movs r3, #0
+ 8000c18: 623b str r3, [r7, #32]
+ 8000c1a: 4b50 ldr r3, [pc, #320] ; (8000d5c )
+ 8000c1c: 6c1b ldr r3, [r3, #64] ; 0x40
+ 8000c1e: 4a4f ldr r2, [pc, #316] ; (8000d5c )
+ 8000c20: f443 4380 orr.w r3, r3, #16384 ; 0x4000
+ 8000c24: 6413 str r3, [r2, #64] ; 0x40
+ 8000c26: 4b4d ldr r3, [pc, #308] ; (8000d5c )
+ 8000c28: 6c1b ldr r3, [r3, #64] ; 0x40
+ 8000c2a: f403 4380 and.w r3, r3, #16384 ; 0x4000
+ 8000c2e: 623b str r3, [r7, #32]
+ 8000c30: 6a3b ldr r3, [r7, #32]
+
+ __HAL_RCC_GPIOC_CLK_ENABLE();
+ 8000c32: 2300 movs r3, #0
+ 8000c34: 61fb str r3, [r7, #28]
+ 8000c36: 4b49 ldr r3, [pc, #292] ; (8000d5c )
+ 8000c38: 6b1b ldr r3, [r3, #48] ; 0x30
+ 8000c3a: 4a48 ldr r2, [pc, #288] ; (8000d5c )
+ 8000c3c: f043 0304 orr.w r3, r3, #4
+ 8000c40: 6313 str r3, [r2, #48] ; 0x30
+ 8000c42: 4b46 ldr r3, [pc, #280] ; (8000d5c )
+ 8000c44: 6b1b ldr r3, [r3, #48] ; 0x30
+ 8000c46: f003 0304 and.w r3, r3, #4
+ 8000c4a: 61fb str r3, [r7, #28]
+ 8000c4c: 69fb ldr r3, [r7, #28]
+ __HAL_RCC_GPIOB_CLK_ENABLE();
+ 8000c4e: 2300 movs r3, #0
+ 8000c50: 61bb str r3, [r7, #24]
+ 8000c52: 4b42 ldr r3, [pc, #264] ; (8000d5c )
+ 8000c54: 6b1b ldr r3, [r3, #48] ; 0x30
+ 8000c56: 4a41 ldr r2, [pc, #260] ; (8000d5c )
+ 8000c58: f043 0302 orr.w r3, r3, #2
+ 8000c5c: 6313 str r3, [r2, #48] ; 0x30
+ 8000c5e: 4b3f ldr r3, [pc, #252] ; (8000d5c )
+ 8000c60: 6b1b ldr r3, [r3, #48] ; 0x30
+ 8000c62: f003 0302 and.w r3, r3, #2
+ 8000c66: 61bb str r3, [r7, #24]
+ 8000c68: 69bb ldr r3, [r7, #24]
+ /**I2S2 GPIO Configuration
+ PC3 ------> I2S2_SD
+ PB10 ------> I2S2_CK
+ PB12 ------> I2S2_WS
+ */
+ GPIO_InitStruct.Pin = PDM_OUT_Pin;
+ 8000c6a: 2308 movs r3, #8
+ 8000c6c: 627b str r3, [r7, #36] ; 0x24
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
+ 8000c6e: 2302 movs r3, #2
+ 8000c70: 62bb str r3, [r7, #40] ; 0x28
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ 8000c72: 2300 movs r3, #0
+ 8000c74: 62fb str r3, [r7, #44] ; 0x2c
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
+ 8000c76: 2300 movs r3, #0
+ 8000c78: 633b str r3, [r7, #48] ; 0x30
+ GPIO_InitStruct.Alternate = GPIO_AF5_SPI2;
+ 8000c7a: 2305 movs r3, #5
+ 8000c7c: 637b str r3, [r7, #52] ; 0x34
+ HAL_GPIO_Init(PDM_OUT_GPIO_Port, &GPIO_InitStruct);
+ 8000c7e: f107 0324 add.w r3, r7, #36 ; 0x24
+ 8000c82: 4619 mov r1, r3
+ 8000c84: 4836 ldr r0, [pc, #216] ; (8000d60 )
+ 8000c86: f000 fc27 bl 80014d8
+
+ GPIO_InitStruct.Pin = CLK_IN_Pin|GPIO_PIN_12;
+ 8000c8a: f44f 53a0 mov.w r3, #5120 ; 0x1400
+ 8000c8e: 627b str r3, [r7, #36] ; 0x24
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
+ 8000c90: 2302 movs r3, #2
+ 8000c92: 62bb str r3, [r7, #40] ; 0x28
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ 8000c94: 2300 movs r3, #0
+ 8000c96: 62fb str r3, [r7, #44] ; 0x2c
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
+ 8000c98: 2300 movs r3, #0
+ 8000c9a: 633b str r3, [r7, #48] ; 0x30
+ GPIO_InitStruct.Alternate = GPIO_AF5_SPI2;
+ 8000c9c: 2305 movs r3, #5
+ 8000c9e: 637b str r3, [r7, #52] ; 0x34
+ HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
+ 8000ca0: f107 0324 add.w r3, r7, #36 ; 0x24
+ 8000ca4: 4619 mov r1, r3
+ 8000ca6: 482f ldr r0, [pc, #188] ; (8000d64 )
+ 8000ca8: f000 fc16 bl 80014d8
+ /* USER CODE BEGIN SPI3_MspInit 1 */
+
+ /* USER CODE END SPI3_MspInit 1 */
+ }
+
+}
+ 8000cac: e04f b.n 8000d4e
+ else if(hi2s->Instance==SPI3)
+ 8000cae: 687b ldr r3, [r7, #4]
+ 8000cb0: 681b ldr r3, [r3, #0]
+ 8000cb2: 4a2d ldr r2, [pc, #180] ; (8000d68 )
+ 8000cb4: 4293 cmp r3, r2
+ 8000cb6: d14a bne.n 8000d4e
+ __HAL_RCC_SPI3_CLK_ENABLE();
+ 8000cb8: 2300 movs r3, #0
+ 8000cba: 617b str r3, [r7, #20]
+ 8000cbc: 4b27 ldr r3, [pc, #156] ; (8000d5c )
+ 8000cbe: 6c1b ldr r3, [r3, #64] ; 0x40
+ 8000cc0: 4a26 ldr r2, [pc, #152] ; (8000d5c )
+ 8000cc2: f443 4300 orr.w r3, r3, #32768 ; 0x8000
+ 8000cc6: 6413 str r3, [r2, #64] ; 0x40
+ 8000cc8: 4b24 ldr r3, [pc, #144] ; (8000d5c )
+ 8000cca: 6c1b ldr r3, [r3, #64] ; 0x40
+ 8000ccc: f403 4300 and.w r3, r3, #32768 ; 0x8000
+ 8000cd0: 617b str r3, [r7, #20]
+ 8000cd2: 697b ldr r3, [r7, #20]
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ 8000cd4: 2300 movs r3, #0
+ 8000cd6: 613b str r3, [r7, #16]
+ 8000cd8: 4b20 ldr r3, [pc, #128] ; (8000d5c