Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: tools/emcore.py
- ===================================================================
- --- tools/emcore.py (revision 755)
- +++ tools/emcore.py (working copy)
- @@ -177,12 +177,16 @@
- elif infotype == "mallocpoolbounds":
- resp = self.emcore.getmallocpoolbounds()
- - self.logger.info("The malloc pool is 0x%X - 0x%X" % (
- + self.logger.info("The malloc pool is 0x%X - 0x%X\n" % (
- self.emcore.lib.dev.mallocpool.lower,
- self.emcore.lib.dev.mallocpool.upper - 1))
- + elif infotype == "serialnumber":
- + resp = self.emcore.getserialnumber()
- + self.logger.info("The serial number is %s\n" % self.emcore.lib.dev.serialnumber)
- +
- else:
- - raise ArgumentTypeError("one out of 'version', 'packetsize', 'mallocpoolbounds'", infotype)
- + raise ArgumentTypeError("one out of 'version', 'packetsize', 'mallocpoolbounds', 'serialnumber'", infotype)
- @command
- def reset(self, force=False):
- @@ -1247,4 +1251,4 @@
- interface = Commandline()
- interface._parsecommand(sys.argv[1], sys.argv[2:])
- except KeyboardInterrupt:
- - sys.exit()
- \ No newline at end of file
- + sys.exit()
- Index: tools/libemcore.py
- ===================================================================
- --- tools/libemcore.py (revision 755)
- +++ tools/libemcore.py (working copy)
- @@ -200,6 +200,14 @@
- return resp
- @command()
- + def getserialnumber(self):
- + """ This returns the serial number of the device (if supported) """
- + resp = self.lib.monitorcommand(struct.pack("<IIII", 1, 3, 0, 0), "III16s", (None, None, None, "sn"))
- + self.logger.debug("Serial number: %s\n" % resp.sn)
- + self.lib.dev.serialnumber = resp.sn
- + return resp
- +
- + @command()
- def reset(self, force=False):
- """ Reboot the device """
- if force:
- @@ -1041,6 +1049,8 @@
- self.mallocpool.lower = None
- self.mallocpool.upper = None
- + self.serialnumber = None
- +
- def __del__(self):
- self.disconnect()
- Index: usb/usb.c
- ===================================================================
- --- usb/usb.c (revision 755)
- +++ usb/usb.c (working copy)
- @@ -389,6 +389,12 @@
- dbgsendbuf[1] = (uint32_t)&_poolstart;
- dbgsendbuf[2] = (uint32_t)&_poolend;
- break;
- +#if 0x47324e49 == PLATFORM_ID
- + case 3: // GET SERIAL NUMBER
- + size = 32;
- + memcpy(&dbgsendbuf[4], (void *)(0x2202bdf0 + 0x18), 16);
- + break;
- +#endif
- default:
- dbgsendbuf[0] = 2;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement