Skip to content

Latest commit

 

History

History
43 lines (32 loc) · 1.07 KB

File metadata and controls

43 lines (32 loc) · 1.07 KB

mramtool

A tool to read/write from/to MRAM chips with FTDI programmers.

Usage

Command line

# Reading
mramtool -f 'ftdi://ftdi:2232:TG111464/2' -c 'S3A1004R0M' -r content.bin

# Writing
mramtool -f 'ftdi://ftdi:2232:TG111464/2' -c 'S3A1004R0M' -w test-data/1Mb_55.bin

Scripts

Basic usage

from mramlib import MRAM, get_chip_info

ftdi_url = 'ftdi://ftdi:2232:TG111464/2' # see `mramtool -lf`
chip_info = get_chip_info('S3A1004V0M')  # see `mramtool -lc`

m = MRAM(ftdi_url, chip_info)

# read 16 bytes starting from address 0
print(m.read(0, 0x10))

# write 8 bytes to address 0x100
m.write(0x100, 8*b'\xAA')

Triggering on write

# By default write() calls the chips unlock function which sends
# a sequence of commands to reset chip specific write protection modes.
# Also by default, write() sends the WEL command before every chunk
# written. We can prevent this by doing the following.

m.send_raw(b'\x06') # send WEL command manually

# (activate trigger here)

m.write(addr, data, unlock=False, wel_cmd=None) # send only write command