parent
d028f34eac
commit
c00635b665
@ -0,0 +1,99 @@
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
#cmake_policy(SET CMP0079 NEW)
|
||||
|
||||
project(trezor VERSION 1.0 LANGUAGES C CXX ASM)
|
||||
|
||||
|
||||
set(CMAKE_C_COMPILER arm-none-eabi-gcc)
|
||||
set(CMAKE_CXX_COMPILER arm-none-eabi-g++)
|
||||
set(CMAKE_ASM_COMPILER arm-none-eabi-gcc)
|
||||
set(CMAKE_LINKER arm-none-abi-ld)
|
||||
|
||||
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
||||
|
||||
add_compile_definitions(STM32_HAL_H=<stm32f4xx.h>)
|
||||
add_compile_definitions(STM32F427xx)
|
||||
add_compile_definitions(USE_HAL_DRIVER)
|
||||
add_compile_definitions(TREZOR_MODEL_T)
|
||||
add_compile_definitions(UI_LAYOUT_TT)
|
||||
add_compile_definitions(HW_MODEL=827601492)
|
||||
add_compile_definitions(HW_REVISION=0)
|
||||
add_compile_definitions(TREZOR_BOARD="boards/trezor_t.h")
|
||||
add_compile_definitions(USE_DMA2D)
|
||||
add_compile_definitions(PRODUCTION=0)
|
||||
add_compile_definitions(BITCOIN_ONLY=0)
|
||||
add_compile_definitions(BOOTLOADER_QA=0)
|
||||
add_compile_definitions(USE_SVC_SHUTDOWN)
|
||||
add_compile_definitions(RDI)
|
||||
|
||||
|
||||
add_compile_definitions(USE_BIP32_CACHE=0)
|
||||
add_compile_definitions(USE_KECCAK=1)
|
||||
add_compile_definitions(USE_ETHEREUM=1)
|
||||
add_compile_definitions(USE_MONERO=1)
|
||||
add_compile_definitions(USE_CARDANO=1)
|
||||
add_compile_definitions(USE_NEM=1)
|
||||
add_compile_definitions(USE_EOS=1)
|
||||
|
||||
add_compile_definitions(AES_128)
|
||||
add_compile_definitions(AES_192)
|
||||
|
||||
add_compile_definitions(SCM_REVISION="11")
|
||||
|
||||
add_compile_definitions(TREZOR_UI2)
|
||||
|
||||
|
||||
add_compile_definitions(USE_ASM_ARM)
|
||||
add_compile_definitions(USE_EXTERNAL_ASM)
|
||||
add_compile_definitions(USE_EXTERNAL_DEFAULT_CALLBACKS)
|
||||
add_compile_definitions(ECMULT_GEN_PREC_BITS=2)
|
||||
add_compile_definitions(ECMULT_WINDOW_SIZE=8)
|
||||
add_compile_definitions(ENABLE_MODULE_GENERATOR)
|
||||
add_compile_definitions(ENABLE_MODULE_RECOVERY)
|
||||
add_compile_definitions(ENABLE_MODULE_SCHNORRSIG)
|
||||
add_compile_definitions(ENABLE_MODULE_EXTRAKEYS)
|
||||
add_compile_definitions(FANCY_FATAL_ERROR)
|
||||
|
||||
|
||||
|
||||
add_compile_definitions(TREZOR_FONT_NORMAL_ENABLE=Font_TTHoves_Regular_21)
|
||||
add_compile_definitions(TREZOR_FONT_NORMAL_INCLUDE="font_tthoves_regular_21.h")
|
||||
add_compile_definitions(TREZOR_FONT_BOLD_ENABLE=Font_TTHoves_Bold_17)
|
||||
add_compile_definitions(TREZOR_FONT_BOLD_INCLUDE="font_tthoves_bold_17.h")
|
||||
add_compile_definitions(TREZOR_FONT_DEMIBOLD_ENABLE=Font_TTHoves_DemiBold_21)
|
||||
add_compile_definitions(TREZOR_FONT_DEMIBOLD_INCLUDE="font_tthoves_demibold_21.h")
|
||||
add_compile_definitions(TREZOR_FONT_MONO_ENABLE=Font_RobotoMono_Medium_20)
|
||||
add_compile_definitions(TREZOR_FONT_MONO_INCLUDE="font_robotomono_medium_20.h")
|
||||
|
||||
|
||||
set(Rust_CARGO_TARGET thumbv7em-none-eabihf)
|
||||
|
||||
|
||||
Set(ENV{RUST_INCLUDES} "-I../trezorhal/stm32f4;-I../../vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Inc;
|
||||
-I../../vendor/micropython/lib/stm32lib/CMSIS/STM32F4xx/Include;
|
||||
-DSTM32_HAL_H=<stm32f4xx.h>")
|
||||
|
||||
|
||||
|
||||
add_compile_options(-mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mtune=cortex-m4)
|
||||
add_compile_options(-Os -g3 -std=gnu11 -fno-common -fsingle-precision-constant
|
||||
-fdata-sections -ffunction-sections -ffreestanding -fstack-protector-all)
|
||||
#add_compile_options(-Wall -Werror -Wdouble-promotion -Wpointer-arith)
|
||||
add_compile_options( -Wno-missing-braces -Wno-sequence-point)
|
||||
add_compile_options(-ffreestanding -fstack-protector-all)
|
||||
|
||||
|
||||
add_link_options(-nostdlib -Wl,--gc-sections -Wl,--warn-common)
|
||||
add_link_options(-mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mtune=cortex-m4)
|
||||
|
||||
include_directories(embed/extmod/modtrezorconfig)
|
||||
include_directories(${CMAKE_BINARY_DIR})
|
||||
|
||||
add_subdirectory(embed)
|
||||
add_subdirectory(vendor)
|
||||
add_subdirectory(src)
|
||||
add_subdirectory(genhdr)
|
||||
|
||||
|
@ -0,0 +1,9 @@
|
||||
add_subdirectory(models)
|
||||
add_subdirectory(lib)
|
||||
add_subdirectory(trezorhal)
|
||||
add_subdirectory(rust)
|
||||
add_subdirectory(extmod)
|
||||
|
||||
#add_subdirectory(boardloader)
|
||||
#add_subdirectory(bootloader)
|
||||
add_subdirectory(firmware)
|
@ -0,0 +1,8 @@
|
||||
add_executable(boardloader main.c startup.s ../trezorhal/stm32f4/util.s) # !@ utils.s !!!! to je divne
|
||||
|
||||
target_link_options(boardloader PRIVATE -T ${CMAKE_SOURCE_DIR}/embed/boardloader/memory.ld)
|
||||
|
||||
target_link_libraries(boardloader stm32cube-f4)
|
||||
target_link_libraries(boardloader trezor-hal)
|
||||
target_link_libraries(boardloader trezor-crypto trezor-storage models)
|
||||
|
@ -0,0 +1,16 @@
|
||||
add_executable(bootloader bootui.c header.S main.c messages.c startup.s
|
||||
../trezorhal/stm32f4/util.s protob/messages.pb.c
|
||||
../lib/fonts/font_tthoves_regular_21.c
|
||||
)
|
||||
|
||||
target_compile_definitions(bootloader PRIVATE TREZOR_FONT_NORMAL_ENABLE=Font_TTHoves_Regular_21)
|
||||
target_compile_definitions(bootloader PRIVATE TREZOR_FONT_NORMAL_INCLUDE="font_tthoves_regular_21.h")
|
||||
|
||||
target_include_directories(bootloader PRIVATE protob)
|
||||
target_include_directories(bootloader PRIVATE ../rust)
|
||||
|
||||
target_link_options(bootloader PRIVATE -T ${CMAKE_SOURCE_DIR}/embed/bootloader/memory.ld)
|
||||
|
||||
target_link_libraries(bootloader stm32cube-f4 trezor-hal)
|
||||
target_link_libraries(bootloader trezor-crypto trezor-storage models nanopb trezor_lib)
|
||||
|
@ -0,0 +1,28 @@
|
||||
add_library(extmod
|
||||
modtrezorconfig/modtrezorconfig.c
|
||||
modtrezorcrypto/crc.c
|
||||
modtrezorcrypto/modtrezorcrypto.c
|
||||
modtrezorcrypto/rand.c
|
||||
modtrezorio/modtrezorio.c
|
||||
modtrezorui/modtrezorui.c
|
||||
modtrezorutils/modtrezorutils.c
|
||||
modtrezorio/ff.c
|
||||
modtrezorio/ffunicode.c
|
||||
rustmods.c
|
||||
modutime.c
|
||||
)
|
||||
|
||||
target_include_directories(extmod PRIVATE ../firmware ../rust ${CMAKE_SOURCE_DIR})
|
||||
|
||||
target_link_libraries(extmod micropython trezor-hal trezor-lib trezor-crypto stm32cube-f4)
|
||||
|
||||
|
||||
add_library(extmod2
|
||||
trezorobj.c
|
||||
)
|
||||
|
||||
target_include_directories(extmod2 PRIVATE ../firmware ../rust ${CMAKE_SOURCE_DIR})
|
||||
|
||||
target_link_libraries(extmod2 micropython trezor-hal trezor-lib trezor-crypto stm32cube-f4)
|
||||
|
||||
add_dependencies(extmod2 qstr)
|
@ -0,0 +1,11 @@
|
||||
add_executable(firmware bl_check.c delay.c header.S main.c mphalport.c nlrthumb.c startup.S)
|
||||
|
||||
target_link_options(firmware PRIVATE -T ${CMAKE_SOURCE_DIR}/embed/firmware/memory_T.ld -Wl,--print-memory-usage)
|
||||
|
||||
target_include_directories(firmware PRIVATE .)
|
||||
|
||||
target_link_libraries(firmware extmod2 stm32cube-f4 trezor-hal trezor-crypto trezor-storage models trezor_lib micropython extmod extmod2 frozen_mpy)
|
||||
|
||||
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,19 @@
|
||||
add_library(trezor-lib
|
||||
mini_printf.c
|
||||
unit_variant.c
|
||||
buffers.c
|
||||
colors.c
|
||||
display.c
|
||||
fonts/fonts.c
|
||||
fonts/font_bitmap.c
|
||||
image.c
|
||||
fonts/font_tthoves_regular_21.c
|
||||
fonts/font_tthoves_bold_17.c
|
||||
fonts/font_tthoves_demibold_21.c
|
||||
fonts/font_robotomono_medium_20.c
|
||||
touch.c
|
||||
)
|
||||
|
||||
target_include_directories(trezor-lib PUBLIC .)
|
||||
|
||||
target_link_libraries(trezor-lib stm32cube-f4 trezor-crypto trezor-storage models)
|
@ -0,0 +1,7 @@
|
||||
add_library(models
|
||||
model_T2T1_layout.c
|
||||
)
|
||||
|
||||
target_include_directories(models PUBLIC .)
|
||||
|
||||
target_link_libraries(models trezor-hal)
|
@ -0,0 +1,18 @@
|
||||
include(FetchContent)
|
||||
|
||||
FetchContent_Declare(
|
||||
Corrosion
|
||||
GIT_REPOSITORY https://github.com/corrosion-rs/corrosion.git
|
||||
GIT_TAG v0.4 # Optionally specify a commit hash, version tag or branch here
|
||||
)
|
||||
|
||||
FetchContent_MakeAvailable(Corrosion)
|
||||
|
||||
corrosion_import_crate(
|
||||
MANIFEST_PATH Cargo.toml
|
||||
NO_DEFAULT_FEATURES
|
||||
FEATURES model_tt ui bootloader bitcoin_only touch micropython protobuf model_tt dma2d
|
||||
FLAGS -Z build-std=core -Z build-std-features=panic_immediate_abort
|
||||
)
|
||||
|
||||
# input", "rgb_led", "consumption_mask", "usb", "optiga"
|
@ -0,0 +1,38 @@
|
||||
add_library(trezor-hal
|
||||
stm32f4/board_capabilities.c
|
||||
stm32f4/common.c
|
||||
stm32f4/flash.c
|
||||
stm32f4/lowlevel.c
|
||||
stm32f4/mpu.c
|
||||
stm32f4/platform.c
|
||||
stm32f4/systick.c
|
||||
stm32f4/random_delays.c
|
||||
stm32f4/rng.c
|
||||
stm32f4/vectortable.s
|
||||
stm32f4/util.s
|
||||
stm32f4/displays/st7789v.c
|
||||
stm32f4/backlight_pwm.c
|
||||
stm32f4/displays/panels/tf15411a.c
|
||||
stm32f4/displays/panels/154a.c
|
||||
stm32f4/displays/panels/lx154a2411.c
|
||||
stm32f4/displays/panels/lx154a2422.c
|
||||
stm32f4/i2c.c
|
||||
stm32f4/touch/ft6x36.c
|
||||
stm32f4/sdcard.c
|
||||
stm32f4/sbu.c
|
||||
stm32f4/usb.c
|
||||
stm32f4/usbd_conf.c
|
||||
stm32f4/usbd_core.c
|
||||
stm32f4/usbd_ctlreq.c
|
||||
stm32f4/usbd_ioreq.c
|
||||
stm32f4/dma2d.c
|
||||
)
|
||||
|
||||
target_include_directories(trezor-hal PUBLIC .)
|
||||
target_include_directories(trezor-hal PRIVATE stm32f4)
|
||||
|
||||
target_include_directories(trezor-hal PRIVATE ../rust)
|
||||
|
||||
target_link_libraries(trezor-hal stm32cube-f4 trezor-lib trezor-storage models)
|
||||
|
||||
|
@ -0,0 +1,234 @@
|
||||
|
||||
set(QSTR_SOURCES
|
||||
../vendor/micropython/extmod/modubinascii.c
|
||||
../vendor/micropython/extmod/moductypes.c
|
||||
../vendor/micropython/extmod/moduheapq.c
|
||||
../vendor/micropython/extmod/modutimeq.c
|
||||
../vendor/micropython/extmod/utime_mphal.c
|
||||
../vendor/micropython/shared/libc/abort_.c
|
||||
../vendor/micropython/shared/libc/printf.c
|
||||
../vendor/micropython/shared/runtime/gchelper_m3.s
|
||||
../vendor/micropython/shared/runtime/gchelper_native.c
|
||||
../vendor/micropython/shared/runtime/interrupt_char.c
|
||||
../vendor/micropython/shared/runtime/pyexec.c
|
||||
../vendor/micropython/shared/runtime/stdout_helpers.c
|
||||
../vendor/micropython/shared/timeutils/timeutils.c
|
||||
../vendor/micropython/ports/stm32/gccollect.c
|
||||
../vendor/micropython/ports/stm32/pendsv.c
|
||||
../vendor/micropython/py/argcheck.c
|
||||
../vendor/micropython/py/asmarm.c
|
||||
../vendor/micropython/py/asmbase.c
|
||||
../vendor/micropython/py/asmthumb.c
|
||||
../vendor/micropython/py/asmx64.c
|
||||
../vendor/micropython/py/asmx86.c
|
||||
../vendor/micropython/py/asmxtensa.c
|
||||
../vendor/micropython/py/bc.c
|
||||
../vendor/micropython/py/binary.c
|
||||
../vendor/micropython/py/builtinevex.c
|
||||
../vendor/micropython/py/builtinhelp.c
|
||||
../vendor/micropython/py/builtinimport.c
|
||||
../vendor/micropython/py/compile.c
|
||||
../vendor/micropython/py/emitbc.c
|
||||
../vendor/micropython/py/emitcommon.c
|
||||
../vendor/micropython/py/emitglue.c
|
||||
../vendor/micropython/py/emitinlinethumb.c
|
||||
../vendor/micropython/py/emitinlinextensa.c
|
||||
../vendor/micropython/py/formatfloat.c
|
||||
../vendor/micropython/py/frozenmod.c
|
||||
../vendor/micropython/py/lexer.c
|
||||
../vendor/micropython/py/malloc.c
|
||||
../vendor/micropython/py/map.c
|
||||
../vendor/micropython/py/modarray.c
|
||||
../vendor/micropython/py/modbuiltins.c
|
||||
../vendor/micropython/py/modgc.c
|
||||
../vendor/micropython/py/modmath.c
|
||||
../vendor/micropython/py/modmicropython.c
|
||||
../vendor/micropython/py/modstruct.c
|
||||
../vendor/micropython/py/modsys.c
|
||||
../vendor/micropython/py/mpprint.c
|
||||
../vendor/micropython/py/mpstate.c
|
||||
../vendor/micropython/py/mpz.c
|
||||
../vendor/micropython/py/nativeglue.c
|
||||
../vendor/micropython/py/obj.c
|
||||
../vendor/micropython/py/objarray.c
|
||||
../vendor/micropython/py/objattrtuple.c
|
||||
../vendor/micropython/py/objbool.c
|
||||
../vendor/micropython/py/objboundmeth.c
|
||||
../vendor/micropython/py/objcell.c
|
||||
../vendor/micropython/py/objclosure.c
|
||||
../vendor/micropython/py/objcomplex.c
|
||||
../vendor/micropython/py/objdict.c
|
||||
../vendor/micropython/py/objenumerate.c
|
||||
../vendor/micropython/py/objexcept.c
|
||||
../vendor/micropython/py/objfilter.c
|
||||
../vendor/micropython/py/objfloat.c
|
||||
../vendor/micropython/py/objfun.c
|
||||
../vendor/micropython/py/objgenerator.c
|
||||
../vendor/micropython/py/objgetitemiter.c
|
||||
../vendor/micropython/py/objint.c
|
||||
../vendor/micropython/py/objint_longlong.c
|
||||
../vendor/micropython/py/objint_mpz.c
|
||||
../vendor/micropython/py/objlist.c
|
||||
../vendor/micropython/py/objmap.c
|
||||
../vendor/micropython/py/objmodule.c
|
||||
../vendor/micropython/py/objnamedtuple.c
|
||||
../vendor/micropython/py/objnone.c
|
||||
../vendor/micropython/py/objobject.c
|
||||
../vendor/micropython/py/objpolyiter.c
|
||||
../vendor/micropython/py/objproperty.c
|
||||
../vendor/micropython/py/objrange.c
|
||||
../vendor/micropython/py/objreversed.c
|
||||
../vendor/micropython/py/objset.c
|
||||
../vendor/micropython/py/objsingleton.c
|
||||
../vendor/micropython/py/objslice.c
|
||||
../vendor/micropython/py/objstr.c
|
||||
../vendor/micropython/py/objstringio.c
|
||||
../vendor/micropython/py/objstrunicode.c
|
||||
../vendor/micropython/py/objtuple.c
|
||||
../vendor/micropython/py/objtype.c
|
||||
../vendor/micropython/py/objzip.c
|
||||
../vendor/micropython/py/opmethods.c
|
||||
../vendor/micropython/py/pairheap.c
|
||||
../vendor/micropython/py/parse.c
|
||||
../vendor/micropython/py/parsenum.c
|
||||
../vendor/micropython/py/parsenumbase.c
|
||||
../vendor/micropython/py/persistentcode.c
|
||||
../vendor/micropython/py/qstr.c
|
||||
../vendor/micropython/py/reader.c
|
||||
../vendor/micropython/py/repl.c
|
||||
../vendor/micropython/py/runtime.c
|
||||
../vendor/micropython/py/runtime_utils.c
|
||||
../vendor/micropython/py/scheduler.c
|
||||
../vendor/micropython/py/scope.c
|
||||
../vendor/micropython/py/sequence.c
|
||||
../vendor/micropython/py/showbc.c
|
||||
../vendor/micropython/py/smallint.c
|
||||
../vendor/micropython/py/stackctrl.c
|
||||
../vendor/micropython/py/stream.c
|
||||
../vendor/micropython/py/unicode.c
|
||||
../vendor/micropython/py/vstr.c
|
||||
../vendor/micropython/py/warning.c
|
||||
../vendor/micropython/py/gc.c
|
||||
../vendor/micropython/py/pystack.c
|
||||
../vendor/micropython/py/vm.c
|
||||
../vendor/micropython/lib/uzlib/adler32.c
|
||||
../vendor/micropython/lib/uzlib/crc32.c
|
||||
../vendor/micropython/lib/uzlib/tinflate.c
|
||||
|
||||
|
||||
../embed/extmod/modtrezorconfig/modtrezorconfig.c
|
||||
../embed/extmod/modtrezorcrypto/crc.c
|
||||
../embed/extmod/modtrezorcrypto/modtrezorcrypto.c
|
||||
../embed/extmod/modtrezorcrypto/rand.c
|
||||
../embed/extmod/modtrezorio/modtrezorio.c
|
||||
../embed/extmod/modtrezorui/modtrezorui.c
|
||||
../embed/extmod/modtrezorutils/modtrezorutils.c
|
||||
../embed/extmod/modtrezorio/ff.c
|
||||
../embed/extmod/modtrezorio/ffunicode.c
|
||||
../embed/extmod/modutime.c
|
||||
../embed/extmod/rustmods.c
|
||||
|
||||
../embed/extmod/trezorobj.c
|
||||
)
|
||||
|
||||
list(TRANSFORM QSTR_SOURCES PREPEND ${CMAKE_CURRENT_SOURCE_DIR}/)
|
||||
|
||||
|
||||
add_custom_target(qstr
|
||||
SOURCES
|
||||
${CMAKE_CURRENT_BINARY_DIR}/qstrdefs.generated.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/moduledefs.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/mpversion.h
|
||||
|
||||
)
|
||||
|
||||
|
||||
get_target_property(MAIN_CFLAGS micropython COMPILE_OPTIONS)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/qstrdefs.collected_in.h
|
||||
DEPENDS ${QSTR_SOURCES} ${CMAKE_CURRENT_BINARY_DIR}/mpversion.h
|
||||
COMMAND ${CMAKE_C_COMPILER}
|
||||
${MAIN_CFLAGS}
|
||||
"-D$<JOIN:$<TARGET_PROPERTY:micropython,COMPILE_DEFINITIONS>,;-D>"
|
||||
"-DNO_QSTR;-DN_X64;-DN_X86;-DN_THUMB"
|
||||
"-I../..;-I../../embed/rust"
|
||||
"-I$<JOIN:$<TARGET_PROPERTY:micropython,INCLUDE_DIRECTORIES>,;-I>"
|
||||
-I ${CMAKE_BINARY_DIR}
|
||||
-E ${QSTR_SOURCES} > ${CMAKE_CURRENT_BINARY_DIR}/qstrdefs.collected_in.h
|
||||
COMMAND_EXPAND_LISTS VERBATIM
|
||||
)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/qstrdefs.collected.h
|
||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/qstrdefs.collected_in.h
|
||||
COMMAND
|
||||
grep -o MP_QSTR_[a-zA-Z0-9_]* ${CMAKE_CURRENT_BINARY_DIR}/qstrdefs.collected_in.h |
|
||||
sed -n "'s/.*MP_QSTR_\\([_a-zA-Z0-9]\\+\\).*/Q(\\1)/p'"
|
||||
> ${CMAKE_CURRENT_BINARY_DIR}/qstrdefs.collected.h
|
||||
)
|
||||
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/qstrdefs.preprocessed_1.h
|
||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/qstrdefs.collected.h
|
||||
COMMAND
|
||||
cat ../../vendor/micropython/py/qstrdefs.h ${CMAKE_CURRENT_BINARY_DIR}/qstrdefs.collected.h |
|
||||
sed "'s/^Q(.*)/\\\"&\\\"/'"
|
||||
> ${CMAKE_CURRENT_BINARY_DIR}/qstrdefs.preprocessed_1.h
|
||||
)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/qstrdefs.preprocessed_2.h
|
||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/qstrdefs.preprocessed_1.h
|
||||
COMMAND
|
||||
${CMAKE_C_COMPILER}
|
||||
${MAIN_CFLAGS}
|
||||
"-D$<JOIN:$<TARGET_PROPERTY:micropython,COMPILE_DEFINITIONS>,;-D>"
|
||||
"-DNO_QSTR;-DN_X64;-DN_X86;-DN_THUMB"
|
||||
"-I../..;-I../../embed/rust"
|
||||
"-I$<JOIN:$<TARGET_PROPERTY:micropython,INCLUDE_DIRECTORIES>,;-I>"
|
||||
-E ${CMAKE_CURRENT_BINARY_DIR}/qstrdefs.preprocessed_1.h
|
||||
> ${CMAKE_CURRENT_BINARY_DIR}/qstrdefs.preprocessed_2.h
|
||||
COMMAND_EXPAND_LISTS VERBATIM
|
||||
)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/qstrdefs.preprocessed.h
|
||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/qstrdefs.preprocessed_2.h
|
||||
COMMAND
|
||||
sed "'s/^\\\"\\(Q(.*)\\)\\\"/\\1/'" ${CMAKE_CURRENT_BINARY_DIR}/qstrdefs.preprocessed_2.h
|
||||
> ${CMAKE_CURRENT_BINARY_DIR}/qstrdefs.preprocessed.h
|
||||
)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/qstrdefs.generated.h
|
||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/qstrdefs.preprocessed.h
|
||||
COMMAND python3 ../../vendor/micropython/py/makeqstrdata.py
|
||||
${CMAKE_CURRENT_BINARY_DIR}/qstrdefs.preprocessed.h
|
||||
> ${CMAKE_CURRENT_BINARY_DIR}/qstrdefs.generated.h
|
||||
)
|
||||
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/modules.collected.h
|
||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/qstrdefs.collected_in.h
|
||||
COMMAND sed -n "'s/\\(MP_REGISTER_MODULE(.*,.*);.*\\)/\\1/p'"
|
||||
${CMAKE_CURRENT_BINARY_DIR}/qstrdefs.collected_in.h
|
||||
> ${CMAKE_CURRENT_BINARY_DIR}/modules.collected.h
|
||||
)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/moduledefs.h
|
||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/modules.collected.h
|
||||
COMMAND python3 ../../vendor/micropython/py/makemoduledefs.py
|
||||
${CMAKE_CURRENT_BINARY_DIR}/modules.collected.h
|
||||
> ${CMAKE_CURRENT_BINARY_DIR}/moduledefs.h
|
||||
)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/mpversion.h
|
||||
COMMAND python3 ../../vendor/micropython/py/makeversionhdr.py
|
||||
${CMAKE_CURRENT_BINARY_DIR}/mpversion.h
|
||||
)
|
||||
|
@ -0,0 +1,98 @@
|
||||
|
||||
set(MPY_CROSS ../../vendor/micropython/mpy-cross/mpy-cross)
|
||||
set(MPY_TOOL ../../vendor/micropython/tools/mpy-tool.py)
|
||||
|
||||
|
||||
set(PY_FILES main.py session.py usb.py)
|
||||
#file(GLOB_RECURSE PY_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.py )
|
||||
|
||||
|
||||
list(TRANSFORM PY_FILES PREPEND ${CMAKE_CURRENT_BINARY_DIR}/ OUTPUT_VARIABLE MPY_FILES)
|
||||
list(TRANSFORM MPY_FILES REPLACE "[.]py$" ".mpy")
|
||||
|
||||
add_library(frozen_mpy
|
||||
${CMAKE_CURRENT_BINARY_DIR}/frozen_mpy.c
|
||||
)
|
||||
|
||||
target_include_directories(frozen_mpy PRIVATE ../embed/firmware)
|
||||
|
||||
target_link_libraries(frozen_mpy micropython trezor-lib)
|
||||
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/frozen_mpy.c
|
||||
DEPENDS "${MPY_FILES}" ${CMAKE_BINARY_DIR}/genhdr/qstrdefs.preprocessed.h
|
||||
COMMAND ${MPY_TOOL} -f -q ${CMAKE_BINARY_DIR}/genhdr/qstrdefs.preprocessed.h ${MPY_FILES} > ${CMAKE_CURRENT_BINARY_DIR}/frozen_mpy.c
|
||||
)
|
||||
|
||||
#COMMAND ${MPY_TOOL} -f -q ${qstr_header} ${MPY_FILES} > ${CMAKE_CURRENT_BINARY_DIR}/frozen_mpy.c",
|
||||
|
||||
|
||||
function(add_mpy target_file source_file)
|
||||
cmake_path(RELATIVE_PATH source_file BASE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} OUTPUT_VARIABLE source_name)
|
||||
cmake_path(REMOVE_EXTENSION source_name LAST_ONLY)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${target_file}
|
||||
DEPENDS ${source_file}
|
||||
COMMAND ${MPY_CROSS} -o ${target_file} -s ${source_name} ${source_file}
|
||||
)
|
||||
endfunction()
|
||||
|
||||
|
||||
#[[foreach(file IN LISTS PY_FILES)
|
||||
string(REGEX REPLACE "[.]py$" ".mpy" mpy_file ${file})
|
||||
add_mpy(${CMAKE_CURRENT_BINARY_DIR}/${mpy_file} ${CMAKE_CURRENT_SOURCE_DIR}/${file} )
|
||||
endforeach()
|
||||
]]
|
||||
|
||||
|
||||
#[[
|
||||
sed_scripts = " ".join(
|
||||
[
|
||||
rf"-e 's/utils\.MODEL_IS_T2B1/{is_t2b1}/g'",
|
||||
rf"-e 's/utils\.BITCOIN_ONLY/{btc_only}/g'",
|
||||
rf"-e 's/utils\.USE_BACKLIGHT/{backlight}/g'",
|
||||
rf"-e 's/utils\.USE_OPTIGA/{optiga}/g'",
|
||||
rf"-e 's/utils\.UI_LAYOUT == \"TT\"/{layout_tt}/g'",
|
||||
rf"-e 's/utils\.UI_LAYOUT == \"TR\"/{layout_tr}/g'",
|
||||
r"-e 's/if TYPE_CHECKING/if False/'",
|
||||
r"-e 's/import typing/# \0/'",
|
||||
r"-e '/from typing import (/,/^\s*)/ {s/^/# /}'",
|
||||
r"-e 's/from typing import/# \0/'",
|
||||
]
|
||||
)
|
||||
]]
|
||||
|
||||
set(sed_script
|
||||
"-e 's/if TYPE_CHECKING/if False/'"
|
||||
)
|
||||
|
||||
|
||||
function(add_i_file target_file source_file)
|
||||
add_custom_command(
|
||||
OUTPUT ${target_file}
|
||||
DEPENDS ${source_file}
|
||||
COMMAND sed ${sed_script} ${source_file} > ${target_file}
|
||||
)
|
||||
endfunction()
|
||||
|
||||
|
||||
foreach(file IN LISTS PY_FILES)
|
||||
add_i_file(${CMAKE_CURRENT_BINARY_DIR}/${file}.i ${CMAKE_CURRENT_SOURCE_DIR}/${file} )
|
||||
endforeach()
|
||||
|
||||
foreach(file IN LISTS PY_FILES)
|
||||
string(REGEX REPLACE "[.]py$" ".mpy" mpy_file ${file})
|
||||
add_mpy(${CMAKE_CURRENT_BINARY_DIR}/${mpy_file} ${CMAKE_CURRENT_BINARY_DIR}/${file}.i )
|
||||
endforeach()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,6 @@
|
||||
include(secp256k1-zkp.cmake)
|
||||
include(micropython.cmake)
|
||||
include(stm32cube-f4.cmake)
|
||||
include(trezor-crypto.cmake)
|
||||
include(trezor-storage.cmake)
|
||||
include(nanopb.cmake)
|
@ -0,0 +1,124 @@
|
||||
add_library(micropython
|
||||
micropython/extmod/modubinascii.c
|
||||
micropython/extmod/moductypes.c
|
||||
micropython/extmod/moduheapq.c
|
||||
micropython/extmod/modutimeq.c
|
||||
micropython/extmod/utime_mphal.c
|
||||
micropython/shared/libc/abort_.c
|
||||
micropython/shared/libc/printf.c
|
||||
micropython/shared/runtime/gchelper_m3.s
|
||||
micropython/shared/runtime/gchelper_native.c
|
||||
micropython/shared/runtime/interrupt_char.c
|
||||
micropython/shared/runtime/pyexec.c
|
||||
micropython/shared/runtime/stdout_helpers.c
|
||||
micropython/shared/timeutils/timeutils.c
|
||||
micropython/ports/stm32/gccollect.c
|
||||
micropython/ports/stm32/pendsv.c
|
||||
micropython/py/argcheck.c
|
||||
micropython/py/asmarm.c
|
||||
micropython/py/asmbase.c
|
||||
micropython/py/asmthumb.c
|
||||
micropython/py/asmx64.c
|
||||
micropython/py/asmx86.c
|
||||
micropython/py/asmxtensa.c
|
||||
micropython/py/bc.c
|
||||
micropython/py/binary.c
|
||||
micropython/py/builtinevex.c
|
||||
micropython/py/builtinhelp.c
|
||||
micropython/py/builtinimport.c
|
||||
micropython/py/compile.c
|
||||
micropython/py/emitbc.c
|
||||
micropython/py/emitcommon.c
|
||||
micropython/py/emitglue.c
|
||||
micropython/py/emitinlinethumb.c
|
||||
micropython/py/emitinlinextensa.c
|
||||
micropython/py/formatfloat.c
|
||||
micropython/py/frozenmod.c
|
||||
micropython/py/lexer.c
|
||||
micropython/py/malloc.c
|
||||
micropython/py/map.c
|
||||
micropython/py/modarray.c
|
||||
micropython/py/modbuiltins.c
|
||||
micropython/py/modgc.c
|
||||
micropython/py/modmath.c
|
||||
micropython/py/modmicropython.c
|
||||
micropython/py/modstruct.c
|
||||
micropython/py/modsys.c
|
||||
micropython/py/mpprint.c
|
||||
micropython/py/mpstate.c
|
||||
micropython/py/mpz.c
|
||||
micropython/py/nativeglue.c
|
||||
micropython/py/obj.c
|
||||
micropython/py/objarray.c
|
||||
micropython/py/objattrtuple.c
|
||||
micropython/py/objbool.c
|
||||
micropython/py/objboundmeth.c
|
||||
micropython/py/objcell.c
|
||||
micropython/py/objclosure.c
|
||||
micropython/py/objcomplex.c
|
||||
micropython/py/objdict.c
|
||||
micropython/py/objenumerate.c
|
||||
micropython/py/objexcept.c
|
||||
micropython/py/objfilter.c
|
||||
micropython/py/objfloat.c
|
||||
micropython/py/objfun.c
|
||||
micropython/py/objgenerator.c
|
||||
micropython/py/objgetitemiter.c
|
||||
micropython/py/objint.c
|
||||
micropython/py/objint_longlong.c
|
||||
micropython/py/objint_mpz.c
|
||||
micropython/py/objlist.c
|
||||
micropython/py/objmap.c
|
||||
micropython/py/objmodule.c
|
||||
micropython/py/objnamedtuple.c
|
||||
micropython/py/objnone.c
|
||||
micropython/py/objobject.c
|
||||
micropython/py/objpolyiter.c
|
||||
micropython/py/objproperty.c
|
||||
micropython/py/objrange.c
|
||||
micropython/py/objreversed.c
|
||||
micropython/py/objset.c
|
||||
micropython/py/objsingleton.c
|
||||
micropython/py/objslice.c
|
||||
micropython/py/objstr.c
|
||||
micropython/py/objstringio.c
|
||||
micropython/py/objstrunicode.c
|
||||
micropython/py/objtuple.c
|
||||
micropython/py/objtype.c
|
||||
micropython/py/objzip.c
|
||||
micropython/py/opmethods.c
|
||||
micropython/py/pairheap.c
|
||||
micropython/py/parse.c
|
||||
micropython/py/parsenum.c
|
||||
micropython/py/parsenumbase.c
|
||||
micropython/py/persistentcode.c
|
||||
micropython/py/qstr.c
|
||||
micropython/py/reader.c
|
||||
micropython/py/repl.c
|
||||
micropython/py/runtime.c
|
||||
micropython/py/runtime_utils.c
|
||||
micropython/py/scheduler.c
|
||||
micropython/py/scope.c
|
||||
micropython/py/sequence.c
|
||||
micropython/py/showbc.c
|
||||
micropython/py/smallint.c
|
||||
micropython/py/stackctrl.c
|
||||
micropython/py/stream.c
|
||||
micropython/py/unicode.c
|
||||
micropython/py/vstr.c
|
||||
micropython/py/warning.c
|
||||
micropython/py/gc.c
|
||||
micropython/py/pystack.c
|
||||
micropython/py/vm.c
|
||||
|
||||
micropython/lib/uzlib/adler32.c
|
||||
micropython/lib/uzlib/crc32.c
|
||||
micropython/lib/uzlib/tinflate.c
|
||||
)
|
||||
|
||||
target_include_directories(micropython PUBLIC micropython)
|
||||
target_include_directories(micropython PRIVATE ../embed/firmware)
|
||||
|
||||
target_link_libraries(micropython PRIVATE trezor-hal)
|
||||
|
||||
add_dependencies(micropython qstr)
|
@ -0,0 +1,7 @@
|
||||
add_library(nanopb
|
||||
nanopb/pb_common.c
|
||||
nanopb/pb_decode.c
|
||||
nanopb/pb_encode.c
|
||||
)
|
||||
|
||||
target_include_directories(trezor-storage PUBLIC nanopb)
|
@ -0,0 +1,12 @@
|
||||
add_library(secp256k1-zkp
|
||||
secp256k1-zkp/src/secp256k1.c
|
||||
secp256k1-zkp/src/precomputed_ecmult.c
|
||||
secp256k1-zkp/src/precomputed_ecmult_gen.c
|
||||
secp256k1-zkp/src/asm/field_10x26_arm.s
|
||||
)
|
||||
|
||||
target_compile_definitions(secp256k1-zkp PUBLIC SECP256K1_CONTEXT_SIZE=180)
|
||||
|
||||
target_include_directories(secp256k1-zkp PUBLIC secp256k1-zkp/include )
|
||||
|
||||
target_link_libraries(secp256k1-zkp PUBLIC -lc_nano -lm -lgcc)
|
@ -0,0 +1,30 @@
|
||||
add_library(stm32cube-f4
|
||||
micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c
|
||||
micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c
|
||||
micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c
|
||||
micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c
|
||||
micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c
|
||||
micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c.c
|
||||
micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_ltdc.c
|
||||
micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd.c
|
||||
micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd_ex.c
|
||||
micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c
|
||||
micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c
|
||||
micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c
|
||||
micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sd.c
|
||||
micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spi.c
|
||||
micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sram.c
|
||||
micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sdram.c
|
||||
micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c
|
||||
micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c
|
||||
micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_fmc.c
|
||||
micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_sdmmc.c
|
||||
micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c
|
||||
micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c
|
||||
micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma2d.c
|
||||
)
|
||||
|
||||
target_include_directories(stm32cube-f4 PUBLIC micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Inc)
|
||||
target_include_directories(stm32cube-f4 PUBLIC micropython/lib/stm32lib/CMSIS/STM32F4xx/Include)
|
||||
target_include_directories(stm32cube-f4 PUBLIC micropython/lib/cmsis/inc)
|
||||
target_include_directories(stm32cube-f4 PUBLIC ../embed/trezorhal/stm32f4) # kvuli stm32f4xx_hal_conf.h
|
@ -0,0 +1,63 @@
|
||||
add_library(trezor-crypto
|
||||
trezor-crypto/address.c
|
||||
trezor-crypto/aes/aes_modes.c
|
||||
trezor-crypto/aes/aesccm.c
|
||||
trezor-crypto/aes/aescrypt.c
|
||||
trezor-crypto/aes/aeskey.c
|
||||
trezor-crypto/aes/aestab.c
|
||||
trezor-crypto/base32.c
|
||||
trezor-crypto/base58.c
|
||||
trezor-crypto/bignum.c
|
||||
trezor-crypto/bip32.c
|
||||
trezor-crypto/bip39.c
|
||||
trezor-crypto/bip39_english.c
|
||||
trezor-crypto/blake256.c
|
||||
trezor-crypto/blake2b.c
|
||||
trezor-crypto/blake2s.c
|
||||
trezor-crypto/chacha20poly1305/chacha20poly1305.c
|
||||
trezor-crypto/chacha20poly1305/chacha_merged.c
|
||||
trezor-crypto/chacha20poly1305/poly1305-donna.c
|
||||
trezor-crypto/chacha20poly1305/rfc7539.c
|
||||
trezor-crypto/chacha_drbg.c
|
||||
trezor-crypto/curves.c
|
||||
trezor-crypto/ecdsa.c
|
||||
trezor-crypto/ed25519-donna/curve25519-donna-32bit.c
|
||||
trezor-crypto/ed25519-donna/curve25519-donna-helpers.c
|
||||
trezor-crypto/ed25519-donna/curve25519-donna-scalarmult-base.c
|
||||
trezor-crypto/ed25519-donna/ed25519-donna-32bit-tables.c
|
||||
trezor-crypto/ed25519-donna/ed25519-donna-basepoint-table.c
|
||||
trezor-crypto/ed25519-donna/ed25519-donna-impl-base.c
|
||||
trezor-crypto/ed25519-donna/ed25519-keccak.c
|
||||
trezor-crypto/ed25519-donna/ed25519-sha3.c
|
||||
trezor-crypto/ed25519-donna/ed25519.c
|
||||
trezor-crypto/ed25519-donna/modm-donna-32bit.c
|
||||
trezor-crypto/groestl.c
|
||||
trezor-crypto/hasher.c
|
||||
trezor-crypto/hmac.c
|
||||
trezor-crypto/hmac_drbg.c
|
||||
trezor-crypto/memzero.c
|
||||
trezor-crypto/nem.c
|
||||
trezor-crypto/nist256p1.c
|
||||
trezor-crypto/pbkdf2.c
|
||||
trezor-crypto/rand.c
|
||||
trezor-crypto/rfc6979.c
|
||||
trezor-crypto/ripemd160.c
|
||||
trezor-crypto/secp256k1.c
|
||||
trezor-crypto/segwit_addr.c
|
||||
trezor-crypto/sha2.c
|
||||
trezor-crypto/sha3.c
|
||||
trezor-crypto/shamir.c
|
||||
trezor-crypto/slip39.c
|
||||
trezor-crypto/slip39_english.c
|
||||
trezor-crypto/tls_prf.c
|
||||
trezor-crypto/cardano.c
|
||||
trezor-crypto/monero/base58.c
|
||||
trezor-crypto/monero/serialize.c
|
||||
trezor-crypto/monero/xmr.c
|
||||
trezor-crypto/zkp_context.c
|
||||
trezor-crypto/zkp_ecdsa.c
|
||||
trezor-crypto/zkp_bip340.c
|
||||
)
|
||||
|
||||
target_include_directories(trezor-crypto PUBLIC trezor-crypto)
|
||||
target_link_libraries(trezor-crypto secp256k1-zkp)
|
@ -0,0 +1,8 @@
|
||||
add_library(trezor-storage
|
||||
trezor-storage/norcow.c
|
||||
trezor-storage/storage.c
|
||||
trezor-storage/flash_common.c
|
||||
)
|
||||
|
||||
target_include_directories(trezor-storage PUBLIC trezor-storage models)
|
||||
target_link_libraries(trezor-storage trezor-lib)
|
@ -0,0 +1,337 @@
|
||||
cmake_minimum_required(VERSION 3.20)
|
||||
project(core)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
|
||||
|
||||
add_definitions(
|
||||
-DFIRMWARE
|
||||
-DTREZOR_MODEL_DISC2
|
||||
-DUSE_HAL_DRIVER
|
||||
-DUI_LAYOUT_TT
|
||||
-DAES_128
|
||||
-DAES_192
|
||||
-DUSE_BIP32_CACHE=0
|
||||
-DUSE_KECCAK=1
|
||||
-DUSE_ETHEREUM=0
|
||||
-DUSE_MONERO=0
|
||||
-DUSE_CARDANO=0
|
||||
-DUSE_NEM=0
|
||||
-DUSE_EOS=0
|
||||
-DUSE_SECP256K1_ZKP
|
||||
-DUSE_SECP256K1_ZKP_ECDSA
|
||||
-DSECP256K1_CONTEXT_SIZE=180
|
||||
-DUSE_ASM_ARM
|
||||
-DUSE_EXTERNAL_ASM
|
||||
-DUSE_EXTERNAL_DEFAULT_CALLBACKS
|
||||
-DECMULT_GEN_PREC_BITS=2
|
||||
-DECMULT_WINDOW_SIZE=8
|
||||
-DENABLE_MODULE_GENERATOR
|
||||
-DENABLE_MODULE_RECOVERY
|
||||
-DENABLE_MODULE_SCHNORRSIG
|
||||
-DENABLE_MODULE_EXTRAKEYS
|
||||
-DTREZOR_UI2
|
||||
-DFANCY_FATAL_ERROR
|
||||
-DUSE_SVC_SHUTDOWN
|
||||
-DRDI
|
||||
-DTREZOR_FONT_NORMAL_ENABLE=Font_TTHoves_Regular_21
|
||||
-DTREZOR_FONT_NORMAL_INCLUDE="font_tthoves_regular_21.h"
|
||||
-DTREZOR_FONT_BOLD_ENABLE=Font_TTHoves_Bold_17
|
||||
-DTREZOR_FONT_BOLD_INCLUDE="font_tthoves_bold_17.h"
|
||||
-DTREZOR_FONT_DEMIBOLD_ENABLE=Font_TTHoves_DemiBold_21
|
||||
-DTREZOR_FONT_DEMIBOLD_INCLUDE="font_tthoves_demibold_21.h"
|
||||
-DTREZOR_FONT_MONO_ENABLE=Font_RobotoMono_Medium_20
|
||||
-DTREZOR_FONT_MONO_INCLUDE="font_robotomono_medium_20.h"
|
||||
-DSTM32_HAL_H=<stm32u5xx.h>
|
||||
-DSTM32U5A9xx
|
||||
-DTREZOR_BOARD="boards/stm32u5a9j-dk.h"
|
||||
-DHW_MODEL=842018884
|
||||
-DHW_REVISION=0
|
||||
-DUSE_DMA2D
|
||||
-DFRAMEBUFFERFRAMEBUFFER32BIT
|
||||
-DPRODUCTION=0
|
||||
-DBOOTLOADER_QA=0
|
||||
-DPYOPT=0
|
||||
-DBITCOIN_ONLY=1
|
||||
)
|
||||
|
||||
|
||||
include_directories(.)
|
||||
include_directories(embed/rust)
|
||||
include_directories(embed/firmware)
|
||||
include_directories(embed/lib)
|
||||
include_directories(embed/models)
|
||||
include_directories(embed/trezorhal)
|
||||
include_directories(embed/extmod/modtrezorui)
|
||||
include_directories(vendor/micropython)
|
||||
include_directories(embed/extmod/modtrezorconfig)
|
||||
include_directories(vendor/trezor-storage)
|
||||
include_directories(vendor/trezor-crypto)
|
||||
include_directories(vendor/secp256k1-zkp)
|
||||
include_directories(vendor/secp256k1-zkp/src)
|
||||
include_directories(vendor/secp256k1-zkp/include)
|
||||
include_directories(vendor/micropython/lib/uzlib)
|
||||
include_directories(embed/trezorhal/stm32u5)
|
||||
include_directories(vendor/stm32cube-u5/Drivers/STM32U5xx_HAL_Driver/Inc)
|
||||
include_directories(vendor/stm32cube-u5/Drivers/CMSIS/Device/ST/STM32U5xx/Include)
|
||||
include_directories(vendor/stm32cube-u5/Drivers/CMSIS/Core/Include)
|
||||
|
||||
|
||||
add_executable(core
|
||||
embed/extmod/modtrezorconfig/modtrezorconfig.c
|
||||
vendor/trezor-storage/norcow.c
|
||||
vendor/trezor-storage/storage.c
|
||||
embed/extmod/trezorobj.c
|
||||
embed/extmod/modtrezorcrypto/crc.c
|
||||
embed/extmod/modtrezorcrypto/modtrezorcrypto.c
|
||||
embed/extmod/modtrezorcrypto/rand.c
|
||||
vendor/trezor-crypto/address.c
|
||||
vendor/trezor-crypto/aes/aes_modes.c
|
||||
vendor/trezor-crypto/aes/aesccm.c
|
||||
vendor/trezor-crypto/aes/aescrypt.c
|
||||
vendor/trezor-crypto/aes/aeskey.c
|
||||
vendor/trezor-crypto/aes/aestab.c
|
||||
vendor/trezor-crypto/base32.c
|
||||
vendor/trezor-crypto/base58.c
|
||||
vendor/trezor-crypto/bignum.c
|
||||
vendor/trezor-crypto/bip32.c
|
||||
vendor/trezor-crypto/bip39.c
|
||||
vendor/trezor-crypto/bip39_english.c
|
||||
vendor/trezor-crypto/blake256.c
|
||||
vendor/trezor-crypto/blake2b.c
|
||||
vendor/trezor-crypto/blake2s.c
|
||||
vendor/trezor-crypto/chacha20poly1305/chacha20poly1305.c
|
||||
vendor/trezor-crypto/chacha20poly1305/chacha_merged.c
|
||||
vendor/trezor-crypto/chacha20poly1305/poly1305-donna.c
|
||||
vendor/trezor-crypto/chacha20poly1305/rfc7539.c
|
||||
vendor/trezor-crypto/chacha_drbg.c
|
||||
vendor/trezor-crypto/curves.c
|
||||
vendor/trezor-crypto/ecdsa.c
|
||||
vendor/trezor-crypto/ed25519-donna/curve25519-donna-32bit.c
|
||||
vendor/trezor-crypto/ed25519-donna/curve25519-donna-helpers.c
|
||||
vendor/trezor-crypto/ed25519-donna/curve25519-donna-scalarmult-base.c
|
||||
vendor/trezor-crypto/ed25519-donna/ed25519-donna-32bit-tables.c
|
||||
vendor/trezor-crypto/ed25519-donna/ed25519-donna-basepoint-table.c
|
||||
vendor/trezor-crypto/ed25519-donna/ed25519-donna-impl-base.c
|
||||
vendor/trezor-crypto/ed25519-donna/ed25519-keccak.c
|
||||
vendor/trezor-crypto/ed25519-donna/ed25519-sha3.c
|
||||
vendor/trezor-crypto/ed25519-donna/ed25519.c
|
||||
vendor/trezor-crypto/ed25519-donna/modm-donna-32bit.c
|
||||
vendor/trezor-crypto/groestl.c
|
||||
vendor/trezor-crypto/hasher.c
|
||||
vendor/trezor-crypto/hmac.c
|
||||
vendor/trezor-crypto/hmac_drbg.c
|
||||
vendor/trezor-crypto/memzero.c
|
||||
vendor/trezor-crypto/nem.c
|
||||
vendor/trezor-crypto/nist256p1.c
|
||||
vendor/trezor-crypto/pbkdf2.c
|
||||
vendor/trezor-crypto/rand.c
|
||||
vendor/trezor-crypto/rfc6979.c
|
||||
vendor/trezor-crypto/ripemd160.c
|
||||
vendor/trezor-crypto/secp256k1.c
|
||||
vendor/trezor-crypto/segwit_addr.c
|
||||
vendor/trezor-crypto/sha2.c
|
||||
vendor/trezor-crypto/sha3.c
|
||||
vendor/trezor-crypto/shamir.c
|
||||
vendor/trezor-crypto/slip39.c
|
||||
vendor/trezor-crypto/slip39_english.c
|
||||
vendor/trezor-crypto/tls_prf.c
|
||||
vendor/trezor-crypto/zkp_context.c
|
||||
vendor/trezor-crypto/zkp_ecdsa.c
|
||||
vendor/trezor-crypto/zkp_bip340.c
|
||||
embed/extmod/modtrezorio/modtrezorio.c
|
||||
embed/lib/mini_printf.c
|
||||
embed/lib/unit_variant.c
|
||||
embed/lib/buffers.c
|
||||
embed/lib/colors.c
|
||||
embed/lib/display.c
|
||||
embed/lib/fonts/fonts.c
|
||||
embed/lib/fonts/font_bitmap.c
|
||||
embed/lib/image.c
|
||||
embed/extmod/modtrezorui/modtrezorui.c
|
||||
vendor/micropython/lib/uzlib/adler32.c
|
||||
vendor/micropython/lib/uzlib/crc32.c
|
||||
vendor/micropython/lib/uzlib/tinflate.c
|
||||
embed/extmod/modtrezorutils/modtrezorutils.c
|
||||
embed/extmod/rustmods.c
|
||||
embed/extmod/modutime.c
|
||||
embed/lib/fonts/font_tthoves_regular_21.c
|
||||
embed/lib/fonts/font_tthoves_bold_17.c
|
||||
embed/lib/fonts/font_tthoves_demibold_21.c
|
||||
embed/lib/fonts/font_robotomono_medium_20.c
|
||||
embed/firmware/bl_check.c
|
||||
embed/firmware/delay.c
|
||||
embed/firmware/header.S
|
||||
embed/firmware/main.c
|
||||
embed/firmware/mphalport.c
|
||||
embed/firmware/nlrthumb.c
|
||||
embed/firmware/startup_stm32u5.S
|
||||
vendor/micropython/extmod/modubinascii.c
|
||||
vendor/micropython/extmod/moductypes.c
|
||||
vendor/micropython/extmod/moduheapq.c
|
||||
vendor/micropython/extmod/modutimeq.c
|
||||
vendor/micropython/extmod/utime_mphal.c
|
||||
vendor/micropython/shared/libc/abort_.c
|
||||
vendor/micropython/shared/libc/printf.c
|
||||
vendor/micropython/shared/runtime/gchelper_m3.s
|
||||
vendor/micropython/shared/runtime/gchelper_native.c
|
||||
vendor/micropython/shared/runtime/interrupt_char.c
|
||||
vendor/micropython/shared/runtime/pyexec.c
|
||||
vendor/micropython/shared/runtime/stdout_helpers.c
|
||||
vendor/micropython/shared/timeutils/timeutils.c
|
||||
vendor/micropython/ports/stm32/gccollect.c
|
||||
vendor/micropython/ports/stm32/pendsv.c
|
||||
vendor/micropython/py/argcheck.c
|
||||
vendor/micropython/py/asmarm.c
|
||||
vendor/micropython/py/asmbase.c
|
||||
vendor/micropython/py/asmthumb.c
|
||||
vendor/micropython/py/asmx64.c
|
||||
vendor/micropython/py/asmx86.c
|
||||
vendor/micropython/py/asmxtensa.c
|
||||
vendor/micropython/py/bc.c
|
||||
vendor/micropython/py/binary.c
|
||||
vendor/micropython/py/builtinevex.c
|
||||
vendor/micropython/py/builtinhelp.c
|
||||
vendor/micropython/py/builtinimport.c
|
||||
vendor/micropython/py/compile.c
|
||||
vendor/micropython/py/emitbc.c
|
||||
vendor/micropython/py/emitcommon.c
|
||||
vendor/micropython/py/emitglue.c
|
||||
vendor/micropython/py/emitinlinethumb.c
|
||||
vendor/micropython/py/emitinlinextensa.c
|
||||
vendor/micropython/py/formatfloat.c
|
||||
vendor/micropython/py/frozenmod.c
|
||||
vendor/micropython/py/lexer.c
|
||||
vendor/micropython/py/malloc.c
|
||||
vendor/micropython/py/map.c
|
||||
vendor/micropython/py/modarray.c
|
||||
vendor/micropython/py/modbuiltins.c
|
||||
vendor/micropython/py/modgc.c
|
||||
vendor/micropython/py/modmath.c
|
||||
vendor/micropython/py/modmicropython.c
|
||||
vendor/micropython/py/modstruct.c
|
||||
vendor/micropython/py/modsys.c
|
||||
vendor/micropython/py/mpprint.c
|
||||
vendor/micropython/py/mpstate.c
|
||||
vendor/micropython/py/mpz.c
|
||||
vendor/micropython/py/nativeglue.c
|
||||
vendor/micropython/py/obj.c
|
||||
vendor/micropython/py/objarray.c
|
||||
vendor/micropython/py/objattrtuple.c
|
||||
vendor/micropython/py/objbool.c
|
||||
vendor/micropython/py/objboundmeth.c
|
||||
vendor/micropython/py/objcell.c
|
||||
vendor/micropython/py/objclosure.c
|
||||
vendor/micropython/py/objcomplex.c
|
||||
vendor/micropython/py/objdict.c
|
||||
vendor/micropython/py/objenumerate.c
|
||||
vendor/micropython/py/objexcept.c
|
||||
vendor/micropython/py/objfilter.c
|
||||
vendor/micropython/py/objfloat.c
|
||||
vendor/micropython/py/objfun.c
|
||||
vendor/micropython/py/objgenerator.c
|
||||
vendor/micropython/py/objgetitemiter.c
|
||||
vendor/micropython/py/objint.c
|
||||
vendor/micropython/py/objint_longlong.c
|
||||
vendor/micropython/py/objint_mpz.c
|
||||
vendor/micropython/py/objlist.c
|
||||
vendor/micropython/py/objmap.c
|
||||
vendor/micropython/py/objmodule.c
|
||||
vendor/micropython/py/objnamedtuple.c
|
||||
vendor/micropython/py/objnone.c
|
||||
vendor/micropython/py/objobject.c
|
||||
vendor/micropython/py/objpolyiter.c
|
||||
vendor/micropython/py/objproperty.c
|
||||
vendor/micropython/py/objrange.c
|
||||
vendor/micropython/py/objreversed.c
|
||||
vendor/micropython/py/objset.c
|
||||
vendor/micropython/py/objsingleton.c
|
||||
vendor/micropython/py/objslice.c
|
||||
vendor/micropython/py/objstr.c
|
||||
vendor/micropython/py/objstringio.c
|
||||
vendor/micropython/py/objstrunicode.c
|
||||
vendor/micropython/py/objtuple.c
|
||||
vendor/micropython/py/objtype.c
|
||||
vendor/micropython/py/objzip.c
|
||||
vendor/micropython/py/opmethods.c
|
||||
vendor/micropython/py/pairheap.c
|
||||
vendor/micropython/py/parse.c
|
||||
vendor/micropython/py/parsenum.c
|
||||
vendor/micropython/py/parsenumbase.c
|
||||
vendor/micropython/py/persistentcode.c
|
||||
vendor/micropython/py/qstr.c
|
||||
vendor/micropython/py/reader.c
|
||||
vendor/micropython/py/repl.c
|
||||
vendor/micropython/py/runtime.c
|
||||
vendor/micropython/py/runtime_utils.c
|
||||
vendor/micropython/py/scheduler.c
|
||||
vendor/micropython/py/scope.c
|
||||
vendor/micropython/py/sequence.c
|
||||
vendor/micropython/py/showbc.c
|
||||
vendor/micropython/py/smallint.c
|
||||
vendor/micropython/py/stackctrl.c
|
||||
vendor/micropython/py/stream.c
|
||||
vendor/micropython/py/unicode.c
|
||||
vendor/micropython/py/vstr.c
|
||||
vendor/micropython/py/warning.c
|
||||
vendor/micropython/py/gc.c
|
||||
vendor/micropython/py/pystack.c
|
||||
vendor/micropython/py/vm.c
|
||||
vendor/stm32cube-u5/Drivers/STM32U5xx_HAL_Driver/Src/stm32u5xx_hal.c
|
||||
vendor/stm32cube-u5/Drivers/STM32U5xx_HAL_Driver/Src/stm32u5xx_hal_cortex.c
|
||||
vendor/stm32cube-u5/Drivers/STM32U5xx_HAL_Driver/Src/stm32u5xx_hal_cryp.c
|
||||
vendor/stm32cube-u5/Drivers/STM32U5xx_HAL_Driver/Src/stm32u5xx_hal_dma.c
|
||||
vendor/stm32cube-u5/Drivers/STM32U5xx_HAL_Driver/Src/stm32u5xx_hal_dma2d.c
|
||||
vendor/stm32cube-u5/Drivers/STM32U5xx_HAL_Driver/Src/stm32u5xx_hal_dsi.c
|
||||
vendor/stm32cube-u5/Drivers/STM32U5xx_HAL_Driver/Src/stm32u5xx_hal_flash.c
|
||||
vendor/stm32cube-u5/Drivers/STM32U5xx_HAL_Driver/Src/stm32u5xx_hal_flash_ex.c
|
||||
vendor/stm32cube-u5/Drivers/STM32U5xx_HAL_Driver/Src/stm32u5xx_hal_gfxmmu.c
|
||||
vendor/stm32cube-u5/Drivers/STM32U5xx_HAL_Driver/Src/stm32u5xx_hal_gpio.c
|
||||
vendor/stm32cube-u5/Drivers/STM32U5xx_HAL_Driver/Src/stm32u5xx_hal_i2c.c
|
||||
vendor/stm32cube-u5/Drivers/STM32U5xx_HAL_Driver/Src/stm32u5xx_hal_i2c_ex.c
|
||||
vendor/stm32cube-u5/Drivers/STM32U5xx_HAL_Driver/Src/stm32u5xx_hal_icache.c
|
||||
vendor/stm32cube-u5/Drivers/STM32U5xx_HAL_Driver/Src/stm32u5xx_hal_ltdc.c
|
||||
vendor/stm32cube-u5/Drivers/STM32U5xx_HAL_Driver/Src/stm32u5xx_hal_ltdc_ex.c
|
||||
vendor/stm32cube-u5/Drivers/STM32U5xx_HAL_Driver/Src/stm32u5xx_hal_pcd.c
|
||||
vendor/stm32cube-u5/Drivers/STM32U5xx_HAL_Driver/Src/stm32u5xx_hal_pcd_ex.c
|
||||
vendor/stm32cube-u5/Drivers/STM32U5xx_HAL_Driver/Src/stm32u5xx_hal_pwr.c
|
||||
vendor/stm32cube-u5/Drivers/STM32U5xx_HAL_Driver/Src/stm32u5xx_hal_pwr_ex.c
|
||||
vendor/stm32cube-u5/Drivers/STM32U5xx_HAL_Driver/Src/stm32u5xx_hal_rcc.c
|
||||
vendor/stm32cube-u5/Drivers/STM32U5xx_HAL_Driver/Src/stm32u5xx_hal_rcc_ex.c
|
||||
vendor/stm32cube-u5/Drivers/STM32U5xx_HAL_Driver/Src/stm32u5xx_hal_sd.c
|
||||
vendor/stm32cube-u5/Drivers/STM32U5xx_HAL_Driver/Src/stm32u5xx_hal_spi.c
|
||||
vendor/stm32cube-u5/Drivers/STM32U5xx_HAL_Driver/Src/stm32u5xx_hal_sram.c
|
||||
vendor/stm32cube-u5/Drivers/STM32U5xx_HAL_Driver/Src/stm32u5xx_hal_tim.c
|
||||
vendor/stm32cube-u5/Drivers/STM32U5xx_HAL_Driver/Src/stm32u5xx_hal_tim_ex.c
|
||||
vendor/stm32cube-u5/Drivers/STM32U5xx_HAL_Driver/Src/stm32u5xx_ll_fmc.c
|
||||
vendor/stm32cube-u5/Drivers/STM32U5xx_HAL_Driver/Src/stm32u5xx_ll_sdmmc.c
|
||||
embed/trezorhal/stm32u5/board_capabilities.c
|
||||
embed/trezorhal/stm32u5/common.c
|
||||
embed/trezorhal/stm32u5/flash.c
|
||||
embed/trezorhal/stm32u5/lowlevel.c
|
||||
embed/trezorhal/stm32u5/mpu.c
|
||||
embed/trezorhal/stm32u5/platform.c
|
||||
embed/trezorhal/stm32u5/secure_aes.c
|
||||
embed/trezorhal/stm32u5/systick.c
|
||||
embed/trezorhal/stm32u5/random_delays.c
|
||||
embed/trezorhal/stm32u5/rng.c
|
||||
embed/trezorhal/stm32u5/vectortable.s
|
||||
embed/trezorhal/stm32u5/util.s
|
||||
embed/models/model_D002_layout.c
|
||||
embed/trezorhal/stm32u5/displays/dsi.c
|
||||
embed/lib/touch.c
|
||||
embed/trezorhal/stm32u5/touch/sitronix.c
|
||||
embed/trezorhal/stm32u5/sbu.c
|
||||
embed/trezorhal/stm32u5/usb.c
|
||||
embed/trezorhal/stm32u5/usbd_conf.c
|
||||
embed/trezorhal/stm32u5/usbd_core.c
|
||||
embed/trezorhal/stm32u5/usbd_ctlreq.c
|
||||
embed/trezorhal/stm32u5/usbd_ioreq.c
|
||||
vendor/stm32cube-u5/Drivers/STM32U5xx_HAL_Driver/Src/stm32u5xx_ll_usb.c
|
||||
embed/trezorhal/stm32u5/dma2d.c
|
||||
vendor/secp256k1-zkp/src/secp256k1.c
|
||||
vendor/secp256k1-zkp/src/precomputed_ecmult.c
|
||||
vendor/secp256k1-zkp/src/precomputed_ecmult_gen.c
|
||||
vendor/secp256k1-zkp/src/asm/field_10x26_arm.s
|
||||
)
|
||||
|
@ -0,0 +1,343 @@
|
||||
cmake_minimum_required(VERSION 3.20)
|
||||
project(core)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
|
||||
|
||||
add_definitions(
|
||||
-DFIRMWARE
|
||||
-DTREZOR_MODEL_T
|
||||
-DUSE_HAL_DRIVER
|
||||
-DUI_LAYOUT_TT
|
||||
-DAES_128
|
||||
-DAES_192
|
||||
-DUSE_BIP32_CACHE=0
|
||||
-DUSE_KECCAK=1
|
||||
-DUSE_ETHEREUM=1
|
||||
-DUSE_MONERO=1
|
||||
-DUSE_CARDANO=1
|
||||
-DUSE_NEM=1
|
||||
-DUSE_EOS=1
|
||||
-DUSE_SECP256K1_ZKP
|
||||
-DUSE_SECP256K1_ZKP_ECDSA
|
||||
-DSECP256K1_CONTEXT_SIZE=180
|
||||
-DUSE_ASM_ARM
|
||||
-DUSE_EXTERNAL_ASM
|
||||
-DUSE_EXTERNAL_DEFAULT_CALLBACKS
|
||||
-DECMULT_GEN_PREC_BITS=2
|
||||
-DECMULT_WINDOW_SIZE=8
|
||||
-DENABLE_MODULE_GENERATOR
|
||||
-DENABLE_MODULE_RECOVERY
|
||||
-DENABLE_MODULE_SCHNORRSIG
|
||||
-DENABLE_MODULE_EXTRAKEYS
|
||||
-DTREZOR_UI2
|
||||
-DFANCY_FATAL_ERROR
|
||||
-DUSE_SVC_SHUTDOWN
|
||||
-DRDI
|
||||
-DTREZOR_FONT_NORMAL_ENABLE=Font_TTHoves_Regular_21
|
||||
-DTREZOR_FONT_NORMAL_INCLUDE="font_tthoves_regular_21.h"
|
||||
-DTREZOR_FONT_BOLD_ENABLE=Font_TTHoves_Bold_17
|
||||
-DTREZOR_FONT_BOLD_INCLUDE="font_tthoves_bold_17.h"
|
||||
-DTREZOR_FONT_DEMIBOLD_ENABLE=Font_TTHoves_DemiBold_21
|
||||
-DTREZOR_FONT_DEMIBOLD_INCLUDE="font_tthoves_demibold_21.h"
|
||||
-DTREZOR_FONT_MONO_ENABLE=Font_RobotoMono_Medium_20
|
||||
-DTREZOR_FONT_MONO_INCLUDE="font_robotomono_medium_20.h"
|
||||
-DSTM32_HAL_H=<stm32f4xx.h>
|
||||
-DSTM32F427xx
|
||||
-DTREZOR_BOARD="boards/trezor_t.h"
|
||||
-DHW_MODEL=827601492
|
||||
-DHW_REVISION=0
|
||||
-DUSE_DMA2D
|
||||
-DPRODUCTION=0
|
||||
-DBOOTLOADER_QA=0
|
||||
-DPYOPT=1
|
||||
-DBITCOIN_ONLY=0
|
||||
)
|
||||
|
||||
|
||||
include_directories(.)
|
||||
include_directories(embed/rust)
|
||||
include_directories(embed/firmware)
|
||||
include_directories(embed/lib)
|
||||
include_directories(embed/models)
|
||||
include_directories(embed/trezorhal)
|
||||
include_directories(embed/extmod/modtrezorui)
|
||||
include_directories(vendor/micropython)
|
||||
include_directories(vendor/micropython/lib/cmsis/inc)
|
||||
include_directories(embed/extmod/modtrezorconfig)
|
||||
include_directories(vendor/trezor-storage)
|
||||
include_directories(vendor/trezor-crypto)
|
||||
include_directories(vendor/secp256k1-zkp)
|
||||
include_directories(vendor/secp256k1-zkp/src)
|
||||
include_directories(vendor/secp256k1-zkp/include)
|
||||
include_directories(vendor/micropython/lib/uzlib)
|
||||
include_directories(embed/trezorhal/stm32f4)
|
||||
include_directories(vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Inc)
|
||||
include_directories(vendor/micropython/lib/stm32lib/CMSIS/STM32F4xx/Include)
|
||||
|
||||
|
||||
add_executable(core
|
||||
embed/extmod/modtrezorconfig/modtrezorconfig.c
|
||||
vendor/trezor-storage/norcow.c
|
||||
vendor/trezor-storage/storage.c
|
||||
vendor/trezor-storage/flash_common.c
|
||||
embed/extmod/trezorobj.c
|
||||
embed/extmod/modtrezorcrypto/crc.c
|
||||
embed/extmod/modtrezorcrypto/modtrezorcrypto.c
|
||||
embed/extmod/modtrezorcrypto/rand.c
|
||||
vendor/trezor-crypto/address.c
|
||||
vendor/trezor-crypto/aes/aes_modes.c
|
||||
vendor/trezor-crypto/aes/aesccm.c
|
||||
vendor/trezor-crypto/aes/aescrypt.c
|
||||
vendor/trezor-crypto/aes/aeskey.c
|
||||
vendor/trezor-crypto/aes/aestab.c
|
||||
vendor/trezor-crypto/base32.c
|
||||
vendor/trezor-crypto/base58.c
|
||||
vendor/trezor-crypto/bignum.c
|
||||
vendor/trezor-crypto/bip32.c
|
||||
vendor/trezor-crypto/bip39.c
|
||||
vendor/trezor-crypto/bip39_english.c
|
||||
vendor/trezor-crypto/blake256.c
|
||||
vendor/trezor-crypto/blake2b.c
|
||||
vendor/trezor-crypto/blake2s.c
|
||||
vendor/trezor-crypto/chacha20poly1305/chacha20poly1305.c
|
||||
vendor/trezor-crypto/chacha20poly1305/chacha_merged.c
|
||||
vendor/trezor-crypto/chacha20poly1305/poly1305-donna.c
|
||||
vendor/trezor-crypto/chacha20poly1305/rfc7539.c
|
||||
vendor/trezor-crypto/chacha_drbg.c
|
||||
vendor/trezor-crypto/curves.c
|
||||
vendor/trezor-crypto/ecdsa.c
|
||||
vendor/trezor-crypto/ed25519-donna/curve25519-donna-32bit.c
|
||||
vendor/trezor-crypto/ed25519-donna/curve25519-donna-helpers.c
|
||||
vendor/trezor-crypto/ed25519-donna/curve25519-donna-scalarmult-base.c
|
||||
vendor/trezor-crypto/ed25519-donna/ed25519-donna-32bit-tables.c
|
||||
vendor/trezor-crypto/ed25519-donna/ed25519-donna-basepoint-table.c
|
||||
vendor/trezor-crypto/ed25519-donna/ed25519-donna-impl-base.c
|
||||
vendor/trezor-crypto/ed25519-donna/ed25519-keccak.c
|
||||
vendor/trezor-crypto/ed25519-donna/ed25519-sha3.c
|
||||
vendor/trezor-crypto/ed25519-donna/ed25519.c
|
||||
vendor/trezor-crypto/ed25519-donna/modm-donna-32bit.c
|
||||
vendor/trezor-crypto/groestl.c
|
||||
vendor/trezor-crypto/hasher.c
|
||||
vendor/trezor-crypto/hmac.c
|
||||
vendor/trezor-crypto/hmac_drbg.c
|
||||
vendor/trezor-crypto/memzero.c
|
||||
vendor/trezor-crypto/nem.c
|
||||
vendor/trezor-crypto/nist256p1.c
|
||||
vendor/trezor-crypto/pbkdf2.c
|
||||
vendor/trezor-crypto/rand.c
|
||||
vendor/trezor-crypto/rfc6979.c
|
||||
vendor/trezor-crypto/ripemd160.c
|
||||
vendor/trezor-crypto/secp256k1.c
|
||||
vendor/trezor-crypto/segwit_addr.c
|
||||
vendor/trezor-crypto/sha2.c
|
||||
vendor/trezor-crypto/sha3.c
|
||||
vendor/trezor-crypto/shamir.c
|
||||
vendor/trezor-crypto/slip39.c
|
||||
vendor/trezor-crypto/slip39_english.c
|
||||
vendor/trezor-crypto/tls_prf.c
|
||||
vendor/trezor-crypto/cardano.c
|
||||
vendor/trezor-crypto/monero/base58.c
|
||||
vendor/trezor-crypto/monero/serialize.c
|
||||
vendor/trezor-crypto/monero/xmr.c
|
||||
vendor/trezor-crypto/zkp_context.c
|
||||
vendor/trezor-crypto/zkp_ecdsa.c
|
||||
vendor/trezor-crypto/zkp_bip340.c
|
||||
embed/extmod/modtrezorio/modtrezorio.c
|
||||
embed/lib/mini_printf.c
|
||||
embed/lib/unit_variant.c
|
||||
embed/lib/buffers.c
|
||||
embed/lib/colors.c
|
||||
embed/lib/display.c
|
||||
embed/lib/fonts/fonts.c
|
||||
embed/lib/fonts/font_bitmap.c
|
||||
embed/lib/image.c
|
||||
embed/extmod/modtrezorui/modtrezorui.c
|
||||
vendor/micropython/lib/uzlib/adler32.c
|
||||
vendor/micropython/lib/uzlib/crc32.c
|
||||
vendor/micropython/lib/uzlib/tinflate.c
|
||||
embed/extmod/modtrezorutils/modtrezorutils.c
|
||||
embed/extmod/rustmods.c
|
||||
embed/extmod/modutime.c
|
||||
embed/lib/fonts/font_tthoves_regular_21.c
|
||||
embed/lib/fonts/font_tthoves_bold_17.c
|
||||
embed/lib/fonts/font_tthoves_demibold_21.c
|
||||
embed/lib/fonts/font_robotomono_medium_20.c
|
||||
embed/firmware/bl_check.c
|
||||
embed/firmware/delay.c
|
||||
embed/firmware/header.S
|
||||
embed/firmware/main.c
|
||||
embed/firmware/mphalport.c
|
||||
embed/firmware/nlrthumb.c
|
||||
embed/firmware/startup.S
|
||||
vendor/micropython/extmod/modubinascii.c
|
||||
vendor/micropython/extmod/moductypes.c
|
||||
vendor/micropython/extmod/moduheapq.c
|
||||
vendor/micropython/extmod/modutimeq.c
|
||||
vendor/micropython/extmod/utime_mphal.c
|
||||
vendor/micropython/shared/libc/abort_.c
|
||||
vendor/micropython/shared/libc/printf.c
|
||||
vendor/micropython/shared/runtime/gchelper_m3.s
|
||||
vendor/micropython/shared/runtime/gchelper_native.c
|
||||
vendor/micropython/shared/runtime/interrupt_char.c
|
||||
vendor/micropython/shared/runtime/pyexec.c
|
||||
vendor/micropython/shared/runtime/stdout_helpers.c
|
||||
vendor/micropython/shared/timeutils/timeutils.c
|
||||
vendor/micropython/ports/stm32/gccollect.c
|
||||
vendor/micropython/ports/stm32/pendsv.c
|
||||
vendor/micropython/py/argcheck.c
|
||||
vendor/micropython/py/asmarm.c
|
||||
vendor/micropython/py/asmbase.c
|
||||
vendor/micropython/py/asmthumb.c
|
||||
vendor/micropython/py/asmx64.c
|
||||
vendor/micropython/py/asmx86.c
|
||||
vendor/micropython/py/asmxtensa.c
|
||||
vendor/micropython/py/bc.c
|
||||
vendor/micropython/py/binary.c
|
||||
vendor/micropython/py/builtinevex.c
|
||||
vendor/micropython/py/builtinhelp.c
|
||||
vendor/micropython/py/builtinimport.c
|
||||
vendor/micropython/py/compile.c
|
||||
vendor/micropython/py/emitbc.c
|
||||
vendor/micropython/py/emitcommon.c
|
||||
vendor/micropython/py/emitglue.c
|
||||
vendor/micropython/py/emitinlinethumb.c
|
||||
vendor/micropython/py/emitinlinextensa.c
|
||||
vendor/micropython/py/formatfloat.c
|
||||
vendor/micropython/py/frozenmod.c
|
||||
vendor/micropython/py/lexer.c
|
||||
vendor/micropython/py/malloc.c
|
||||
vendor/micropython/py/map.c
|
||||
vendor/micropython/py/modarray.c
|
||||
vendor/micropython/py/modbuiltins.c
|
||||
vendor/micropython/py/modgc.c
|
||||
vendor/micropython/py/modmath.c
|
||||
vendor/micropython/py/modmicropython.c
|
||||
vendor/micropython/py/modstruct.c
|
||||
vendor/micropython/py/modsys.c
|
||||
vendor/micropython/py/mpprint.c
|
||||
vendor/micropython/py/mpstate.c
|
||||
vendor/micropython/py/mpz.c
|
||||
vendor/micropython/py/nativeglue.c
|
||||
vendor/micropython/py/obj.c
|
||||
vendor/micropython/py/objarray.c
|
||||
vendor/micropython/py/objattrtuple.c
|
||||
vendor/micropython/py/objbool.c
|
||||
vendor/micropython/py/objboundmeth.c
|
||||
vendor/micropython/py/objcell.c
|
||||
vendor/micropython/py/objclosure.c
|
||||
vendor/micropython/py/objcomplex.c
|
||||
vendor/micropython/py/objdict.c
|
||||
vendor/micropython/py/objenumerate.c
|
||||
vendor/micropython/py/objexcept.c
|
||||
vendor/micropython/py/objfilter.c
|
||||
vendor/micropython/py/objfloat.c
|
||||
vendor/micropython/py/objfun.c
|
||||
vendor/micropython/py/objgenerator.c
|
||||
vendor/micropython/py/objgetitemiter.c
|
||||
vendor/micropython/py/objint.c
|
||||
vendor/micropython/py/objint_longlong.c
|
||||
vendor/micropython/py/objint_mpz.c
|
||||
vendor/micropython/py/objlist.c
|
||||
vendor/micropython/py/objmap.c
|
||||
vendor/micropython/py/objmodule.c
|
||||
vendor/micropython/py/objnamedtuple.c
|
||||
vendor/micropython/py/objnone.c
|
||||
vendor/micropython/py/objobject.c
|
||||
vendor/micropython/py/objpolyiter.c
|
||||
vendor/micropython/py/objproperty.c
|
||||
vendor/micropython/py/objrange.c
|
||||
vendor/micropython/py/objreversed.c
|
||||
vendor/micropython/py/objset.c
|
||||
vendor/micropython/py/objsingleton.c
|
||||
vendor/micropython/py/objslice.c
|
||||
vendor/micropython/py/objstr.c
|
||||
vendor/micropython/py/objstringio.c
|
||||
vendor/micropython/py/objstrunicode.c
|
||||
vendor/micropython/py/objtuple.c
|
||||
vendor/micropython/py/objtype.c
|
||||
vendor/micropython/py/objzip.c
|
||||
vendor/micropython/py/opmethods.c
|
||||
vendor/micropython/py/pairheap.c
|
||||
vendor/micropython/py/parse.c
|
||||
vendor/micropython/py/parsenum.c
|
||||
vendor/micropython/py/parsenumbase.c
|
||||
vendor/micropython/py/persistentcode.c
|
||||
vendor/micropython/py/qstr.c
|
||||
vendor/micropython/py/reader.c
|
||||
vendor/micropython/py/repl.c
|
||||
vendor/micropython/py/runtime.c
|
||||
vendor/micropython/py/runtime_utils.c
|
||||
vendor/micropython/py/scheduler.c
|
||||
vendor/micropython/py/scope.c
|
||||
vendor/micropython/py/sequence.c
|
||||
vendor/micropython/py/showbc.c
|
||||
vendor/micropython/py/smallint.c
|
||||
vendor/micropython/py/stackctrl.c
|
||||
vendor/micropython/py/stream.c
|
||||
vendor/micropython/py/unicode.c
|
||||
vendor/micropython/py/vstr.c
|
||||
vendor/micropython/py/warning.c
|
||||
vendor/micropython/py/gc.c
|
||||
vendor/micropython/py/pystack.c
|
||||
vendor/micropython/py/vm.c
|
||||
vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c
|
||||
vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c
|
||||
vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c
|
||||
vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c
|
||||
vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c
|
||||
vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c.c
|
||||
vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_ltdc.c
|
||||
vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd.c
|
||||
vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd_ex.c
|
||||
vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c
|
||||
vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c
|
||||
vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c
|
||||
vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sd.c
|
||||
vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spi.c
|
||||
vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sram.c
|
||||
vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sdram.c
|
||||
vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c
|
||||
vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c
|
||||
vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_fmc.c
|
||||
vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_sdmmc.c
|
||||
embed/trezorhal/stm32f4/board_capabilities.c
|
||||
embed/trezorhal/stm32f4/common.c
|
||||
embed/trezorhal/stm32f4/flash.c
|
||||
embed/trezorhal/stm32f4/lowlevel.c
|
||||
embed/trezorhal/stm32f4/mpu.c
|
||||
embed/trezorhal/stm32f4/platform.c
|
||||
embed/trezorhal/stm32f4/systick.c
|
||||
embed/trezorhal/stm32f4/random_delays.c
|
||||
embed/trezorhal/stm32f4/rng.c
|
||||
embed/trezorhal/stm32f4/vectortable.s
|
||||
embed/trezorhal/stm32f4/util.s
|
||||
embed/models/model_T2T1_layout.c
|
||||
embed/trezorhal/stm32f4/displays/st7789v.c
|
||||
embed/trezorhal/stm32f4/backlight_pwm.c
|
||||
embed/trezorhal/stm32f4/displays/panels/tf15411a.c
|
||||
embed/trezorhal/stm32f4/displays/panels/154a.c
|
||||
embed/trezorhal/stm32f4/displays/panels/lx154a2411.c
|
||||
embed/trezorhal/stm32f4/displays/panels/lx154a2422.c
|
||||
embed/trezorhal/stm32f4/i2c.c
|
||||
embed/trezorhal/stm32f4/touch/ft6x36.c
|
||||
embed/lib/touch.c
|
||||
embed/trezorhal/stm32f4/sdcard.c
|
||||
embed/extmod/modtrezorio/ff.c
|
||||
embed/extmod/modtrezorio/ffunicode.c
|
||||
vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c
|
||||
embed/trezorhal/stm32f4/sbu.c
|
||||
embed/trezorhal/stm32f4/usb.c
|
||||
embed/trezorhal/stm32f4/usbd_conf.c
|
||||
embed/trezorhal/stm32f4/usbd_core.c
|
||||
embed/trezorhal/stm32f4/usbd_ctlreq.c
|
||||
embed/trezorhal/stm32f4/usbd_ioreq.c
|
||||
vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c
|
||||
embed/trezorhal/stm32f4/dma2d.c
|
||||
vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma2d.c
|
||||
vendor/secp256k1-zkp/src/secp256k1.c
|
||||
vendor/secp256k1-zkp/src/precomputed_ecmult.c
|
||||
vendor/secp256k1-zkp/src/precomputed_ecmult_gen.c
|
||||
vendor/secp256k1-zkp/src/asm/field_10x26_arm.s
|
||||
)
|
||||
|
Loading…
Reference in new issue