1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-22 15:38:11 +00:00

micropython: update submodule

This commit is contained in:
Jan Pochyla 2017-09-06 19:15:59 +02:00
parent a8e51ceda3
commit 29b90465ce
7 changed files with 171 additions and 130 deletions

View File

@ -34,38 +34,40 @@ SOURCE_MOD += [
SOURCE_MICROPYTHON = [ SOURCE_MICROPYTHON = [
'vendor/micropython/lib/libc/string0.c', 'vendor/micropython/lib/libc/string0.c',
'vendor/micropython/stmhal/startup_stm32.S', 'vendor/micropython/ports/stm32/startup_stm32.S',
] ]
SOURCE_STMHAL = [ SOURCE_STMHAL = [
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_adc_ex.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc_ex.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_adc.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_can.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_can.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_cortex.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_dac_ex.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dac_ex.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_dac.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dac.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_dma.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_flash_ex.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_flash.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_gpio.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_i2c.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_pcd_ex.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd_ex.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_pcd.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_pwr_ex.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_pwr.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_rcc_ex.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_rcc.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_rng.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rng.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_rtc_ex.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc_ex.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_rtc.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_sd.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sd.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_spi.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spi.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_tim_ex.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sram.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_tim.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_uart.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_ll_sdmmc.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_ll_usb.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_fsmc.c',
'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_sdmmc.c',
'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c',
] ]
SOURCE_BOARDLOADER = [ SOURCE_BOARDLOADER = [
@ -80,8 +82,6 @@ SOURCE_TREZORHAL = [
'embed/trezorhal/sdcard.c', 'embed/trezorhal/sdcard.c',
'embed/trezorhal/stm32_it.c', 'embed/trezorhal/stm32_it.c',
'embed/trezorhal/stm32_system.c', 'embed/trezorhal/stm32_system.c',
'embed/trezorhal/hal/stm32f4xx_hal_sram.c',
'embed/trezorhal/hal/stm32f4xx_ll_fsmc.c',
] ]
env = Environment(ENV=os.environ) env = Environment(ENV=os.environ)
@ -111,8 +111,9 @@ env.Replace(
'embed/trezorhal/hal', 'embed/trezorhal/hal',
'embed/extmod/modtrezorui', 'embed/extmod/modtrezorui',
'vendor/micropython/stmhal', 'vendor/micropython/stmhal',
'vendor/micropython/stmhal/cmsis', 'vendor/micropython/ports/stm32',
'vendor/micropython/stmhal/hal/f4/inc', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Inc',
'vendor/micropython/lib/stm32lib/CMSIS/STM32F4xx/Include',
'vendor/micropython/lib/cmsis/inc', 'vendor/micropython/lib/cmsis/inc',
] + CPPPATH_MOD, ] + CPPPATH_MOD,
CPPDEFINES=[ CPPDEFINES=[

View File

@ -40,38 +40,40 @@ SOURCE_MOD += [
SOURCE_MICROPYTHON = [ SOURCE_MICROPYTHON = [
'vendor/micropython/lib/libc/string0.c', 'vendor/micropython/lib/libc/string0.c',
'vendor/micropython/stmhal/startup_stm32.S', 'vendor/micropython/ports/stm32/startup_stm32.S',
] ]
SOURCE_STMHAL = [ SOURCE_STMHAL = [
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_adc_ex.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc_ex.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_adc.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_can.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_can.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_cortex.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_dac_ex.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dac_ex.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_dac.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dac.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_dma.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_flash_ex.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_flash.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_gpio.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_i2c.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_pcd_ex.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd_ex.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_pcd.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_pwr_ex.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_pwr.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_rcc_ex.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_rcc.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_rng.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rng.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_rtc_ex.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc_ex.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_rtc.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_sd.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sd.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_spi.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spi.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_tim_ex.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sram.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_tim.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_uart.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_ll_sdmmc.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_ll_usb.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_fsmc.c',
'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_sdmmc.c',
'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c',
] ]
SOURCE_BOOTLOADER = [ SOURCE_BOOTLOADER = [
@ -98,8 +100,6 @@ SOURCE_TREZORHAL = [
'embed/trezorhal/usbd_core.c', 'embed/trezorhal/usbd_core.c',
'embed/trezorhal/usbd_ctlreq.c', 'embed/trezorhal/usbd_ctlreq.c',
'embed/trezorhal/usbd_ioreq.c', 'embed/trezorhal/usbd_ioreq.c',
'embed/trezorhal/hal/stm32f4xx_hal_sram.c',
'embed/trezorhal/hal/stm32f4xx_ll_fsmc.c',
] ]
env = Environment(ENV=os.environ) env = Environment(ENV=os.environ)
@ -130,9 +130,9 @@ env.Replace(
'embed/trezorhal', 'embed/trezorhal',
'embed/trezorhal/hal', 'embed/trezorhal/hal',
'embed/extmod/modtrezorui', 'embed/extmod/modtrezorui',
'vendor/micropython/stmhal', 'vendor/micropython/ports/stm32',
'vendor/micropython/stmhal/cmsis', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Inc',
'vendor/micropython/stmhal/hal/f4/inc', 'vendor/micropython/lib/stm32lib/CMSIS/STM32F4xx/Include',
'vendor/micropython/lib/cmsis/inc', 'vendor/micropython/lib/cmsis/inc',
] + CPPPATH_MOD, ] + CPPPATH_MOD,
CPPDEFINES=[ CPPDEFINES=[

View File

@ -222,11 +222,11 @@ SOURCE_MICROPYTHON = [
'vendor/micropython/py/unicode.c', 'vendor/micropython/py/unicode.c',
'vendor/micropython/py/vstr.c', 'vendor/micropython/py/vstr.c',
'vendor/micropython/py/warning.c', 'vendor/micropython/py/warning.c',
'vendor/micropython/stmhal/gccollect.c', 'vendor/micropython/ports/stm32/gccollect.c',
'vendor/micropython/stmhal/gchelper.s', 'vendor/micropython/ports/stm32/gchelper.s',
'vendor/micropython/stmhal/pendsv.c', 'vendor/micropython/ports/stm32/pendsv.c',
'vendor/micropython/stmhal/startup_stm32.S', 'vendor/micropython/ports/stm32/startup_stm32.S',
'vendor/micropython/stmhal/systick.c', 'vendor/micropython/ports/stm32/systick.c',
] ]
SOURCE_MICROPYTHON_SPEED = [ SOURCE_MICROPYTHON_SPEED = [
@ -235,34 +235,36 @@ SOURCE_MICROPYTHON_SPEED = [
] ]
SOURCE_STMHAL = [ SOURCE_STMHAL = [
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_adc_ex.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc_ex.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_adc.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_can.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_can.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_cortex.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_dac_ex.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dac_ex.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_dac.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dac.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_dma.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_flash_ex.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_flash.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_gpio.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_i2c.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_pcd_ex.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd_ex.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_pcd.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_pwr_ex.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_pwr.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_rcc_ex.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_rcc.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_rng.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rng.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_rtc_ex.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc_ex.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_rtc.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_sd.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sd.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_spi.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spi.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_tim_ex.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sram.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_tim.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal_uart.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_hal.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_ll_sdmmc.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c',
'vendor/micropython/stmhal/hal/f4/src/stm32f4xx_ll_usb.c', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_fsmc.c',
'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_sdmmc.c',
'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c',
] ]
SOURCE_FIRMWARE = [ SOURCE_FIRMWARE = [
@ -285,8 +287,6 @@ SOURCE_TREZORHAL = [
'embed/trezorhal/usbd_core.c', 'embed/trezorhal/usbd_core.c',
'embed/trezorhal/usbd_ctlreq.c', 'embed/trezorhal/usbd_ctlreq.c',
'embed/trezorhal/usbd_ioreq.c', 'embed/trezorhal/usbd_ioreq.c',
'embed/trezorhal/hal/stm32f4xx_hal_sram.c',
'embed/trezorhal/hal/stm32f4xx_ll_fsmc.c',
] ]
SOURCE_QSTR = SOURCE_MOD + SOURCE_MICROPYTHON + SOURCE_MICROPYTHON_SPEED SOURCE_QSTR = SOURCE_MOD + SOURCE_MICROPYTHON + SOURCE_MICROPYTHON_SPEED
@ -332,10 +332,10 @@ env.Replace(
'embed/trezorhal/hal', 'embed/trezorhal/hal',
'embed/extmod/modtrezorui', 'embed/extmod/modtrezorui',
'vendor/micropython', 'vendor/micropython',
'vendor/micropython/stmhal', 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Inc',
'vendor/micropython/stmhal/cmsis', 'vendor/micropython/lib/stm32lib/CMSIS/STM32F4xx/Include',
'vendor/micropython/stmhal/hal/f4/inc',
'vendor/micropython/lib/cmsis/inc', 'vendor/micropython/lib/cmsis/inc',
'vendor/micropython/ports/stm32',
] + CPPPATH_MOD, ] + CPPPATH_MOD,
CPPDEFINES=[ CPPDEFINES=[
'TREZOR_STM32', 'TREZOR_STM32',

View File

@ -203,16 +203,16 @@ SOURCE_MICROPYTHON = [
] ]
SOURCE_UNIX = [ SOURCE_UNIX = [
'vendor/micropython/unix/main.c', 'vendor/micropython/ports/unix/main.c',
'vendor/micropython/unix/gccollect.c', 'vendor/micropython/ports/unix/gccollect.c',
'vendor/micropython/unix/unix_mphal.c', 'vendor/micropython/ports/unix/unix_mphal.c',
'vendor/micropython/unix/mpthreadport.c', 'vendor/micropython/ports/unix/mpthreadport.c',
'vendor/micropython/unix/input.c', 'vendor/micropython/ports/unix/input.c',
'vendor/micropython/unix/file.c', 'vendor/micropython/ports/unix/file.c',
'vendor/micropython/unix/modos.c', 'vendor/micropython/ports/unix/modos.c',
'vendor/micropython/unix/modtime.c', 'vendor/micropython/ports/unix/modtime.c',
'vendor/micropython/unix/moduselect.c', 'vendor/micropython/ports/unix/moduselect.c',
'vendor/micropython/unix/alloc.c', 'vendor/micropython/ports/unix/alloc.c',
'embed/unix/common.c', 'embed/unix/common.c',
'embed/unix/touch.c', 'embed/unix/touch.c',
] ]
@ -247,7 +247,7 @@ env.Replace(
'embed/unix', 'embed/unix',
'embed/extmod/modtrezorui', 'embed/extmod/modtrezorui',
'vendor/micropython', 'vendor/micropython',
'vendor/micropython/unix', 'vendor/micropython/ports/unix',
'vendor/micropython/lib/mp-readline', 'vendor/micropython/lib/mp-readline',
] + CPPPATH_MOD, ] + CPPPATH_MOD,
CPPDEFINES=[ CPPDEFINES=[

View File

@ -99,8 +99,7 @@ bool sdcard_power_on(void) {
sd_handle.Init.ClockDiv = SDIO_TRANSFER_CLK_DIV; sd_handle.Init.ClockDiv = SDIO_TRANSFER_CLK_DIV;
// init the SD interface, with retry if it's not ready yet // init the SD interface, with retry if it's not ready yet
HAL_SD_CardInfoTypedef cardinfo; for (int retry = 10; HAL_SD_Init(&sd_handle) != HAL_OK; retry--) {
for (int retry = 10; HAL_SD_Init(&sd_handle, &cardinfo) != SD_OK; retry--) {
if (retry == 0) { if (retry == 0) {
goto error; goto error;
} }
@ -108,7 +107,7 @@ bool sdcard_power_on(void) {
} }
// configure the SD bus width for wide operation // configure the SD bus width for wide operation
if (HAL_SD_WideBusOperation_Config(&sd_handle, SDIO_BUS_WIDE_4B) != SD_OK) { if (HAL_SD_ConfigWideBusOperation(&sd_handle, SDIO_BUS_WIDE_4B) != HAL_OK) {
HAL_SD_DeInit(&sd_handle); HAL_SD_DeInit(&sd_handle);
goto error; goto error;
} }
@ -133,39 +132,77 @@ uint64_t sdcard_get_capacity_in_bytes(void) {
if (sd_handle.Instance == NULL) { if (sd_handle.Instance == NULL) {
return 0; return 0;
} }
HAL_SD_CardInfoTypedef cardinfo; HAL_SD_CardInfoTypeDef cardinfo;
HAL_SD_Get_CardInfo(&sd_handle, &cardinfo); HAL_SD_GetCardInfo(&sd_handle, &cardinfo);
return cardinfo.CardCapacity; return (uint64_t)cardinfo.LogBlockNbr * (uint64_t)cardinfo.LogBlockSize;
} }
void SDIO_IRQHandler(void) { void SDIO_IRQHandler(void) {
HAL_SD_IRQHandler(&sd_handle); HAL_SD_IRQHandler(&sd_handle);
} }
static HAL_StatusTypeDef sdcard_wait_finished(SD_HandleTypeDef *sd, uint32_t timeout) {
// Wait for HAL driver to be ready (eg for DMA to finish)
uint32_t start = HAL_GetTick();
while (sd->State == HAL_SD_STATE_BUSY) {
if (HAL_GetTick() - start >= timeout) {
return HAL_TIMEOUT;
}
}
// Wait for SD card to complete the operation
for (;;) {
HAL_SD_CardStateTypeDef state = HAL_SD_GetCardState(sd);
if (state == HAL_SD_CARD_TRANSFER) {
return HAL_OK;
}
if (!(state == HAL_SD_CARD_SENDING || state == HAL_SD_CARD_RECEIVING || state == HAL_SD_CARD_PROGRAMMING)) {
return HAL_ERROR;
}
if (HAL_GetTick() - start >= timeout) {
return HAL_TIMEOUT;
}
}
return HAL_OK;
}
uint32_t sdcard_read_blocks(void *dest, uint32_t block_num, uint32_t num_blocks) { uint32_t sdcard_read_blocks(void *dest, uint32_t block_num, uint32_t num_blocks) {
// check that SD card is initialised // check that SD card is initialised
if (sd_handle.Instance == NULL) { if (sd_handle.Instance == NULL) {
return SD_ERROR; return HAL_ERROR;
} }
// check that dest pointer is aligned on a 4-byte boundary // check that dest pointer is aligned on a 4-byte boundary
if (((uint32_t)dest & 3) != 0) { if (((uint32_t)dest & 3) != 0) {
return SD_INVALID_PARAMETER; return HAL_ERROR;
} }
return HAL_SD_ReadBlocks_BlockNumber(&sd_handle, (uint32_t*)dest, block_num, SDCARD_BLOCK_SIZE, num_blocks); HAL_StatusTypeDef err = HAL_OK;
err = HAL_SD_ReadBlocks(&sd_handle, dest, block_num, num_blocks, 60000);
if (err == HAL_OK) {
err = sdcard_wait_finished(&sd_handle, 60000);
}
return err;
} }
uint32_t sdcard_write_blocks(const void *src, uint32_t block_num, uint32_t num_blocks) { uint32_t sdcard_write_blocks(const void *src, uint32_t block_num, uint32_t num_blocks) {
// check that SD card is initialised // check that SD card is initialised
if (sd_handle.Instance == NULL) { if (sd_handle.Instance == NULL) {
return SD_ERROR; return HAL_ERROR;
} }
// check that src pointer is aligned on a 4-byte boundary // check that src pointer is aligned on a 4-byte boundary
if (((uint32_t)src & 3) != 0) { if (((uint32_t)src & 3) != 0) {
return SD_INVALID_PARAMETER; return HAL_ERROR;
} }
return HAL_SD_WriteBlocks_BlockNumber(&sd_handle, (uint32_t*)src, block_num, SDCARD_BLOCK_SIZE, num_blocks); HAL_StatusTypeDef err = HAL_OK;
err = HAL_SD_WriteBlocks(&sd_handle, (uint8_t*)src, block_num, num_blocks, 60000);
if (err == HAL_OK) {
err = sdcard_wait_finished(&sd_handle, 60000);
}
return err;
} }

View File

@ -119,7 +119,10 @@
#define CONFIG_RCC_CR_2ND (RCC_CR_HSEON || RCC_CR_CSSON || RCC_CR_PLLON) #define CONFIG_RCC_CR_2ND (RCC_CR_HSEON || RCC_CR_CSSON || RCC_CR_PLLON)
#define CONFIG_RCC_PLLCFGR (0x24003010) #define CONFIG_RCC_PLLCFGR (0x24003010)
#if defined(MCU_SERIES_F7) #if defined(MCU_SERIES_F4)
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};
#elif defined(MCU_SERIES_F7)
const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; 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}; const uint8_t APBPrescTable[8] = {0, 0, 0, 0, 1, 2, 3, 4};
#endif #endif

2
vendor/micropython vendored

@ -1 +1 @@
Subproject commit b228a1317ff340d42db6f0b59ac7b2e68b8f9ed6 Subproject commit 6c5f953c797ff32911901215b8d0b7615d84ece8