From 66e1493a741bee0ab916d74e7e55a76114fa822d Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sun, 7 Jul 2013 14:39:52 +0000 Subject: switched back to name but only 3 bytes git-svn-id: https://svn.spreadspace.org/pic/trunk@50 a09c6847-51d9-44de-8ef2-e725cf50f3c7 --- downloader/downloader.py | 15 ++++++--------- downloader/proto.txt | 20 ++++++-------------- 2 files changed, 12 insertions(+), 23 deletions(-) (limited to 'downloader') diff --git a/downloader/downloader.py b/downloader/downloader.py index c0ce34f..653bd72 100755 --- a/downloader/downloader.py +++ b/downloader/downloader.py @@ -108,11 +108,9 @@ def exec_command(dev, cmd, param, answer): 5: "address invalid", 6: "address prohibited", 7: "value out of bounds" } - dev.flushInput() - dev.flushOutput() - - cstr = bytearray(struct.pack(' answer: - 1 | len=22 | | version | userid | devid | fs | fss | es | mess | supported | + 1 | len=22 | | version | name | devid | fss | mess | supported | version: 2bytes, protocol version It is an error if the major version (MSB) is different (hence any protocol update must change the major version of the bootloader). - userid: - 2bytes, an id which determines the exact device - The downloader has to compare this with the device id supplied + name: + 3bytes, a descriptive name of the device. + The downloader has to compare this name with the device name supplied via commandline and stop in case they don't match devid: 2bytes, device id of the PIC The downlaoder may use this id to check if it talks to the right bootloader - fs: - 2bytes, flash size - The size of the flash in code words. - fss: 1byte, flash segment size The number of words of one flash segment which has to be written at once. If less than should be updated the downloader has to perform a read operation first. - es: - 2bytes, eeprom size - The size of the eeprom in bytes. - mess: 1byte, maximum eeprom segment size This represents the maximum number of eeprom bytes which may be written or @@ -165,12 +157,12 @@ write eeprom: ~~~~~~~~~~~~~ command: - 7 | len=4+len(data) | addr | data | + 7 | len=4+2 answer: 7 | len=4 | | - The bootloader writes (which has to contain exactly -4 bytes) to address + The bootloader writes (which has to contain exactly bytes) to address inside the eeprom. len is 1byte long and the value must not exceed bytes. -- cgit v1.2.3