Skip to content
/ mramtool Public

Small, flashrom-like, easy to use python library to communicate with some SPI MRAM chips over FTDI programmers. This library was created during my bachelors thesis project about electromagnetic fault injections on MRAM chips.

Notifications You must be signed in to change notification settings

7omg/mramtool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Small, flashrom-like, easy to use python library to communicate with some SPI MRAM chips over FTDI programmers. This library was created during my bachelors thesis project about electromagnetic fault injections on MRAM chips.

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages