mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-22 15:38:11 +00:00
apps.debug implement DebugLinkMemoryRead/Write
This commit is contained in:
parent
65ee44b636
commit
ae0c5b3cbc
@ -41,13 +41,18 @@ async def dispatch_DebugLinkStop(session_id, msg):
|
||||
|
||||
|
||||
async def dispatch_DebugLinkMemoryRead(session_id, msg):
|
||||
# TODO: return memaccess(msg.address, msg.length)
|
||||
pass
|
||||
from trezor.messages.DebugLinkMemory import DebugLinkMemory
|
||||
from uctypes import bytes_at
|
||||
m = DebugLinkMemory()
|
||||
m.memory = bytes_at(msg.address, msg.length)
|
||||
return m
|
||||
|
||||
|
||||
async def dispatch_DebugLinkMemoryWrite(session_id, msg):
|
||||
# TODO: memcpy((void *)msg.address, msg.memory, len(msg.memory))
|
||||
pass
|
||||
from uctypes import bytearray_at
|
||||
l = len(msg.memory)
|
||||
data = bytearray_at(msg.address, l)
|
||||
data[0:l] = msg.memory
|
||||
|
||||
|
||||
async def dispatch_DebugLinkFlashErase(session_id, msg):
|
||||
|
Loading…
Reference in New Issue
Block a user