From fcbcd99677cc864a0c8911c99a6e2a106f92567c Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sun, 7 Jul 2013 21:41:29 +0000 Subject: fixed new features git-svn-id: https://svn.spreadspace.org/pic/trunk@51 a09c6847-51d9-44de-8ef2-e725cf50f3c7 --- bootloader/bootloader.asm | 6 +++--- downloader/downloader.py | 13 ++++++++----- downloader/proto.txt | 14 +++++++++++--- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/bootloader/bootloader.asm b/bootloader/bootloader.asm index 629b6f5..db177af 100644 --- a/bootloader/bootloader.asm +++ b/bootloader/bootloader.asm @@ -168,7 +168,7 @@ boot movwf RCSTA ;; --------- end of init - + wait_new_cmd movlw combuff movwf FSR @@ -282,7 +282,7 @@ cmd_identify movf combuff,w call uart_tx_byte - movlw .22 + movlw .19 call uart_tx_byte movlw E_OK @@ -299,7 +299,7 @@ cmd_identify call uart_tx_byte movlw NAME_2 call uart_tx_byte - + movlw DEVID_L call uart_tx_byte movlw DEVID_H diff --git a/downloader/downloader.py b/downloader/downloader.py index 653bd72..86a41c9 100755 --- a/downloader/downloader.py +++ b/downloader/downloader.py @@ -108,9 +108,11 @@ def exec_command(dev, cmd, param, answer): 5: "address invalid", 6: "address prohibited", 7: "value out of bounds" } - cstr = bytearray(struct.pack(' answer: - 1 | len=22 | | version | name | devid | fss | mess | supported | + 1 | len=19 | | version | name | devid | fs | fss | es | mess | supported | version: 2bytes, protocol version @@ -59,12 +59,20 @@ identify: 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 @@ -157,12 +165,12 @@ write eeprom: ~~~~~~~~~~~~~ command: - 7 | len=4+2 + 7 | len=4+len(data) | addr | data | answer: 7 | len=4 | | - The bootloader writes (which has to contain exactly bytes) to address + The bootloader writes (which has to contain exactly -4 bytes) to address inside the eeprom. len is 1byte long and the value must not exceed bytes. -- cgit v1.2.3