diff --git a/.gitmodules b/.gitmodules index 6300339d16..5c3387077c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -29,10 +29,6 @@ [submodule "tools/python-semver"] path = tools/python-semver url = https://github.com/k-bx/python-semver.git -[submodule "lib/stm32lib"] - path = lib/stm32lib - url = https://github.com/micropython/stm32lib - branch = work-F4-1.13.1+F7-1.5.0+L4-1.3.0 [submodule "atmel-samd/asf4"] path = ports/atmel-samd/asf4 url = https://github.com/adafruit/asf4.git @@ -96,9 +92,6 @@ [submodule "frozen/circuitpython-stage"] path = frozen/circuitpython-stage url = https://github.com/python-ugame/circuitpython-stage.git -[submodule "ports/stm/stm32f4"] - path = ports/stm/stm32f4 - url = https://github.com/adafruit/stm32f4.git [submodule "ports/cxd56/spresense-exported-sdk"] path = ports/cxd56/spresense-exported-sdk url = https://github.com/sonydevworld/spresense-exported-sdk.git @@ -122,4 +115,7 @@ url = https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI [submodule "frozen/Adafruit_CircuitPython_Requests"] path = frozen/Adafruit_CircuitPython_Requests - url = https://github.com/adafruit/Adafruit_CircuitPython_Requests \ No newline at end of file + url = https://github.com/adafruit/Adafruit_CircuitPython_Requests +[submodule "ports/stm/st_driver"] + path = ports/stm/st_driver + url = https://github.com/hathach/st_driver.git diff --git a/conf.py b/conf.py index 1f9f85b0bc..2ea0e8dc0f 100644 --- a/conf.py +++ b/conf.py @@ -132,7 +132,7 @@ exclude_patterns = ["**/build*", "ports/nrf/nrfx", "ports/nrf/peripherals", "ports/nrf/usb", - "ports/stm/stm32f4", + "ports/stm/st_driver", "ports/stm/peripherals", "ports/stm/ref", "ports/unix", diff --git a/ports/stm/Makefile b/ports/stm/Makefile index 3a6191c851..f8c05fd802 100755 --- a/ports/stm/Makefile +++ b/ports/stm/Makefile @@ -66,10 +66,10 @@ INC += -I. INC += -I../.. INC += -I$(BUILD) INC += -I$(BUILD)/genhdr -INC += -I./stm32f4/STM32F4xx_HAL_Driver/Inc -INC += -I./stm32f4/STM32F4xx_HAL_Driver/Inc/Legacy -INC += -I./stm32f4/CMSIS/Device/ST/STM32F4xx/Include -INC += -I./stm32f4/CMSIS/Include +INC += -I./st_driver/STM32F4xx_HAL_Driver/Inc +INC += -I./st_driver/STM32F4xx_HAL_Driver/Inc/Legacy +INC += -I./st_driver/CMSIS/Device/ST/STM32F4xx/Include +INC += -I./st_driver/CMSIS/Include INC += -I./boards INC += -I./boards/$(BOARD) INC += -I./peripherals @@ -147,46 +147,45 @@ CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_STM32F4 -DCFG_TUD_CDC_RX_BUFSIZE=1024 -DCFG_TUD ###################################### SRC_STM32 = \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc_ex.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dac.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dac_ex.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c_ex.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_qspi.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rng.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc_ex.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spi.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_usart.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_exti.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sd.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_gpio.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_adc.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_fsmc.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_i2c.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_dma.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_sdmmc.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usart.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_rcc.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_utils.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_exti.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc_ex.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dac.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dac_ex.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c_ex.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_qspi.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rng.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc_ex.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spi.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_usart.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_exti.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sd.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_gpio.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_adc.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_fsmc.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_i2c.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_dma.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_sdmmc.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usart.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_rcc.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_utils.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_exti.c \ system_stm32f4xx.c diff --git a/ports/stm/st_driver b/ports/stm/st_driver new file mode 160000 index 0000000000..3fc2e0f3db --- /dev/null +++ b/ports/stm/st_driver @@ -0,0 +1 @@ +Subproject commit 3fc2e0f3db155b33177bb0705e0dd65cadb58412 diff --git a/ports/stm/stm32f4 b/ports/stm/stm32f4 deleted file mode 160000 index 89a356f0b4..0000000000 --- a/ports/stm/stm32f4 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 89a356f0b44883d55c45a5d22940777a44a2b881