Skip to content

Instantly share code, notes, and snippets.

@boochow
Last active November 4, 2018 16:30
Show Gist options
  • Save boochow/59f3c9ac090b92cdb575075b1d112ded to your computer and use it in GitHub Desktop.
Save boochow/59f3c9ac090b92cdb575075b1d112ded to your computer and use it in GitHub Desktop.
from machine import SD
import os
sd = SD()
sd.ioctl(1,0)
def pr(buf):
l=len(buf)
c=0
while(c<l):
print("%04x:" % c, end='')
for i in range(16):
print("%02x " % buf[c+i], end='')
print(" ", end='')
for i in range(16):
b = buf[c+i]
if b>0x20 and b<0x7f:
print(chr(b), end='')
else:
print('.', end='')
print()
c += 16
buf=bytearray(512)
sd.readblocks(0xbb00,buf)
pr(buf)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment