summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2013-07-11 11:22:47 (GMT)
committerChristian Pointner <equinox@spreadspace.org>2013-07-11 11:22:47 (GMT)
commit086aae3198e74218f84d9d88facb2a1bba1e7ee4 (patch)
tree05ebfb569149d8ae18ed6485e6034e30d619edbe
parent745d3054879daa9d41d3811b8b5047ec3eb8eda0 (diff)
added number of config words to identify command
git-svn-id: https://svn.spreadspace.org/pic/trunk@82 a09c6847-51d9-44de-8ef2-e725cf50f3c7
-rw-r--r--bootloader/bootloader-887.asm1
-rw-r--r--bootloader/bootloader-947.asm1
-rwxr-xr-xbootloader/downloader.py8
-rw-r--r--bootloader/generic-mainloop.inc5
-rw-r--r--bootloader/proto.txt5
5 files changed, 14 insertions, 6 deletions
diff --git a/bootloader/bootloader-887.asm b/bootloader/bootloader-887.asm
index 31f0db0..e767372 100644
--- a/bootloader/bootloader-887.asm
+++ b/bootloader/bootloader-887.asm
@@ -47,6 +47,7 @@ FSS EQU .16 ; writing is done 8 words at a time but 16
EEPROM_SIZE_L EQU H'00'
EEPROM_SIZE_H EQU H'01' ; 0x0100 -> 256 Bytes of EEPROM
MESS EQU .64 ; this limit is because of to combuff size and single byte len field for messages
+CFG EQU .2 ; anyway this is not read or writable for this chip
SUPPORTED_H EQU .0
SUPPORTED_L EQU b'00000110' ; only read/write flash is supported by now
diff --git a/bootloader/bootloader-947.asm b/bootloader/bootloader-947.asm
index f8111d0..7575b13 100644
--- a/bootloader/bootloader-947.asm
+++ b/bootloader/bootloader-947.asm
@@ -47,6 +47,7 @@ FSS EQU .32 ; there 32 write latches
EEPROM_SIZE_L EQU H'00'
EEPROM_SIZE_H EQU H'01' ; 0x0100 -> 256 Bytes of EEPROM
MESS EQU .64 ; this limit is because of to combuff size and single byte len field for messages
+CFG EQU .2
SUPPORTED_H EQU .0
SUPPORTED_L EQU b'00000111' ; only reset and read/write flash is supported by now
diff --git a/bootloader/downloader.py b/bootloader/downloader.py
index 7edd650..e214171 100755
--- a/bootloader/downloader.py
+++ b/bootloader/downloader.py
@@ -163,9 +163,9 @@ def exec_command(dev, cmd, param, answer):
### low level commands
def cmd_identify(dev, name):
- data = exec_command(dev, 1, '', '<BB3sHHBHBH')
+ data = exec_command(dev, 1, '', '<BB3sHHBHBBH')
id = { 'ver_min': data[0], 'ver_maj': data[1], 'name': data[2], 'devid': data[3],
- 'fs': data[4], 'fss': data[5], 'es': data[6], 'mess': data[7], 'supported': data[8] }
+ 'fs': data[4], 'fss': data[5], 'es': data[6], 'mess': data[7], 'cfg': data[8], 'supported': data[9] }
if id['ver_maj'] != VERSION_MAJ:
print >> sys.stderr, "incompatible protocol version, expected: %d, got: %d" % (VERSION_MAJ, id['ver_maj'])
@@ -176,8 +176,8 @@ def cmd_identify(dev, name):
print >> sys.stderr, " right device?"
sys.exit(4)
- print >> sys.stderr, "connected with Bootloader '%s' Version %d.%d,\n (ID=%04X, %d words Flash, FSS=%d, %d bytes EEPROM, MESS=%d)\n" % \
- (id['name'], id['ver_maj'], id['ver_min'], id['devid'], id['fs'], id['fss'], id['es'], id['mess'])
+ print >> sys.stderr, "connected with Bootloader '%s' Version %d.%d,\n (ID=%04X, %d words Flash, FSS=%d, %d bytes EEPROM, MESS=%d, %d words config)\n" % \
+ (id['name'], id['ver_maj'], id['ver_min'], id['devid'], id['fs'], id['fss'], id['es'], id['mess'], id['cfg'])
return id
def cmd_boot(dev):
diff --git a/bootloader/generic-mainloop.inc b/bootloader/generic-mainloop.inc
index 6bfbcf5..1cecf3a 100644
--- a/bootloader/generic-mainloop.inc
+++ b/bootloader/generic-mainloop.inc
@@ -115,7 +115,7 @@ cmd_identify
movf combuff,w
call com_tx_byte
- movlw .19
+ movlw .20
call com_tx_byte
movlw E_OK
@@ -152,6 +152,9 @@ cmd_identify
movlw MESS
call com_tx_byte
+ movlw CFG
+ call com_tx_byte
+
movlw SUPPORTED_L
call com_tx_byte
movlw SUPPORTED_H
diff --git a/bootloader/proto.txt b/bootloader/proto.txt
index 0e35e1e..61975cf 100644
--- a/bootloader/proto.txt
+++ b/bootloader/proto.txt
@@ -43,7 +43,7 @@ identify:
1 | len=3 | <csum>
answer:
- 1 | len=19 | <ret> | version | name | devid | fs | fss | es | mess | supported | <csum>
+ 1 | len=19 | <ret> | version | name | devid | fs | fss | es | mess | cfg | supported | <csum>
version:
2bytes, protocol version
@@ -79,6 +79,9 @@ identify:
read at once. Unlike <fss> value it is ok to write or read less than <mess>
bytes.
+ cfg:
+ 1byte, number of configuration words.
+
supported:
2bytes, a bitmap showing supported commands
The commands 'identify' and 'boot' are always supported by the bootloader,