12
« on: January 20, 2021, 02:58:22 AM »
Here is an example code in python to access the registers of flash:
def bb(*b):
return pad4(array.array('B', b).tostring())
def txrx(eve, txpart, n_rx):
eve.cmd_flashspidesel()
eve.cmd_flashspitx(len(txpart))
eve.c(bb(*txpart))
eve.cmd_flashspirx(0, n_rx)
if n_rx:
eve.finish()
return array.array('B', eve.rdstr(0, n_rx))
def do_sfdp(eve):
""" Dump the SFDP area in binary """
eve.cmd_flashdetach()
eve.cmd_flashspidesel()
eve.cmd_flashspitx(1)
eve.c(bb(0x9f))
eve.cmd_flashspirx(0, 3)
eve.finish()
print repr(array.array('B', eve.rdstr(0, 3)).tolist())