diff --git a/extmod/modtrezordebug/modtrezordebug.c b/extmod/modtrezordebug/modtrezordebug.c index b492d3a985..b0de3d8779 100644 --- a/extmod/modtrezordebug/modtrezordebug.c +++ b/extmod/modtrezordebug/modtrezordebug.c @@ -27,7 +27,7 @@ STATIC mp_obj_t mod_TrezorDebug_Debug_make_new(const mp_obj_type_t *type, size_t return MP_OBJ_FROM_PTR(o); } -/// def trezor.utils.memaccess(address: int, length: int) -> bytes +/// def trezor.debug.memaccess(address: int, length: int) -> bytes /// ''' /// Creates a bytes object that can be used to access certain memory location. /// ''' diff --git a/src/trezor/debug.py b/src/trezor/debug.py index 783e321047..2217e614f2 100644 --- a/src/trezor/debug.py +++ b/src/trezor/debug.py @@ -5,5 +5,15 @@ from TrezorDebug import Debug _utils = Debug() +MEM_FLASH_BASE = const(0x08000000) +MEM_FLASH_SIZE = const(1024 * 1024) +MEM_FLASH_END = const(MEM_FLASH_BASE + MEM_FLASH_SIZE - 1) +MEM_CCM_BASE = const(0x10000000) +MEM_CCM_SIZE = const(64 * 1024) +MEM_CCM_END = const(MEM_CCM_BASE + MEM_CCM_SIZE - 1) +MEM_SRAM_BASE = const(0x20000000) +MEM_SRAM_SIZE = const(128 * 1024) +MEM_SRAM_END = const(MEM_SRAM_BASE + MEM_SRAM_SIZE - 1) + def memaccess(address, length): return _utils.memaccess(address, length)