| byte \ bit |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
| 0-3 |
dCBWSignature
("LaMS") |
|||||||
| 4-7 |
dCBWTag |
|||||||
| 8-11 |
dCBWDataTransferLength |
|||||||
| 12 |
bmCBWFlags |
|||||||
| 13 |
Reserved
(0) |
bCBWLUN |
||||||
| 14 |
Reserved(0) |
bCBWCBLength |
||||||
| 15-30 |
CBWCB |
|||||||
| byte \ bit |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
| 0-3 |
dCBWSignature
("LaMS") |
|||||||
| 4-7 |
dCBWTag |
|||||||
| 8-11 |
dCSWDataResidue |
|||||||
| 12 |
bCSWStatus |
|||||||
| Command |
Parameters |
Expected
DataTransferLength
|
Function |
Calls
Function |
| $10 verified |
8-11, 12 |
can be
determined by header |
Beeps, opens shutter, takes a
picture, closes shutter (verified). A couple of seconds delay, no photo flash. Stores in FLASH memory, but does not make a thumbnail. Returns compressed version with header. |
$2d, which calls $1d may call $23 will call $0F |
| $19 verified by a courageous BillW |
8-11, 12, 15 17-29 is a null-terminated filename |
whatever is
specified Takes a while, so use a long timeout before reading the response. |
File system format. Loads and
restores all files found in the filename table (all the root
directory files) so they are preserved. Pictures are erased. Not be
sensitive to filename. Looks more sensitive to LUN (=1 or
not), which makes sense because you wouldn't preserve system files
residing on external drives. Data probably not recoverable from this
format (probably flash erase). |
$28, which calls $26 and $24 |
| $26 verified |
8-11, 12, 13 |
reading from
camera: whatever is specified writing to camera: should be a multiple of $100 |
Writes eventually call the same
routine that command $28 does - executes a program immediately. Doesn't
return a status byte. Works in bootloader mode. Reads do something different? Bootloader returns $61 if read, length = 0 & LUN = 1. |
? |
| $28 verified |
12, 13, 17-20 |
Downloads code into SRAM (<
$1000 bytes) & executes it. Code is stored at location $90. LUN should be 0; anything else won't do anything. Does not work in bootloader mode (returns error $60). |
may call $23 will call $0F |
|
| $51 Boot loader Only! |
seems not sensitive to LUN or
byte 17 |
must be <= 0x3F or much bigger (0x40 hangs). |
Seems to be a bootloader-only
command; no support in version 6410 standard firmware. I got this data
back: 02 06 00 00 00 27 00 04 50 51 06 00 00
fc 3f 00
and then bytes 0x16 -> 0x4000 of FIRMWARE.BIN Writes seem to return an error code of $62, even if a good copy of FIRMWARE.BIN (with the correct checksum) is used. |
|
| $52 verified |
LUN=0: 13, 8-11, 17-20 LUN=1 or 2: 12, 13, 8-11, 17-20 LUN=4: 13, 8-11* 17-20 is block number (size=256 for LUN=0, 512 otherwise) * This is sensitive to 17-20, but I didn't see it in code. |
whatever is specified | Low-level data transfer. Four
values for LUN are supported: 0 = SRAM memory 1 = FLASH memory 2 = I got an error - perhaps unsupported card memory 3 = Not used by firmware, I got error $b1 4 = SRAM memory? Writing to FLASH memory works. I have only tried a 512-byte writes, which work perfectly. When in bootloader mode (you'll know this because the camera doesn't power up and gives only two low beeps), the LUN doesn't matter and you'll get back data from the file FIRMWARE.BIN. It always starts from the beginning, so adjust the data transfer size appropriately (typically 0x1f200 - 0x20000). Not sure if this is actually read from FLASH at the time of the command, or if it is left over from when the file was copied into SDRAM and failed the checksum check. Writing seems to always return an error code of $60, even when the firmware checksum is correct & the length is 0x1000 or 0x1f200. If I can get this to work, it might be what's needed to restore a broken camera. |
may call $23 will call $0F |
| $54 verified |
8-11, 12, 15. 17-29 is a null-terminated filename |
whatever is specified | Open file for Read/Write. Didn't work for me, but worked for others (thanks BillW). Returns status. |
$28, which calls either write: $0b (delete file), $1b (write file) read: $14 (read file) |
| $56 verified |
8-11, 12, 15. 17-29 is a null-terminated filename |
whatever is specified | Delete file (verified). The pictures-remaining counter increments, but the image serial number still increases. |
$28, which calls $0b |
| $57 verified |
8-11, 12, 15. 17-29 is a null-terminated filename |
whatever is specified | mkdir (verified). |
$28, which calls $1A |
| $58 verified |
8-11, 12, 15. 17-29 is a null-terminated filename |
whatever is
specified |
chdir (verified). First do a chdir "/", then the filename (like "DCIM"). Use LUN=1 for the flash file system. |
$28, which calls $15 |
| $5D partially verified |
12, 17, 18 |
variable |
Calls a complicated function
based on byte
17. See chart below. Does not seem to work in bootloader mode (len > 0 hangs, otherwise returns error $64) |
$1E |
| $5E partially verified |
8-9, 12, 13, 17, 18 |
should be 4 |
Calls a simpler function based
on byte 17 & returns a 32-bit word. See chart below. |
$2A may call $23 will call $0F |
| $80 verified |
12 |
$80 |
Initialization routine
needed before doing any other commands (except buffer overflow method) Reading $80 bytes gets the challenge (either from NVRAM or FIRMWARE.BIN). You must then write back $80 bytes of the correct response before it will acknowledge any other commands. Does not work in bootloader mode, but isn't needed. |
$32 |
| Byte
17 |
Calls function |
| 04 |
(related to 0B) maybe transfer
something $200 bytes. Use only with LUN=1 (FLASH) Or may be related to a transfer size of 4. |
| 0A |
Returns some hardware registers: $f722, $f723, $f726, $f727, 4 bytes read indirectly, $f10, $f71a, 8 uninitialized bytes |
| 0B |
(related to 04) maybe transfer
something $200 bytes. Use only with LUN=1 (FLASH) Or may be related to a transfer size of 4. |
| 0D |
complicated. |
| 0E verified |
Turns on the screen &
displays an image! Write with length $10000, followed by 128 packets of
512 bytes to set the image. Format is exactly the same as in TFT files.
Reads will turn on the display with whatever static is residing in
memory @ $140000. Waits until the user presses a button, then turns off
the screen &
returns status block (0=shutter pressed, 1=display or delete pressed) |
| 0F |
Slightly complicated. |
| 10 |
Slightly complicated. BillW: "Appears just to make the pv2's speaker beep high,low,high. I looked at the firmware and I couldn't see anything else in there." |
| 11 |
Looks like it does some hardware
stuff. It's precise descriptions like these that make my website so
great. BillW wildly speculates on this command: "I'd say it looks like a webcam mode. After you've sent this command and requested status, the camera's shutter pops open and the camera becomes seemingly unresponsive. I took a look at the firmware - there's a bunch of hardware init, and then a loop with more hardware fiddling going on." |
| 12 |
very long function. |
| otherwise |
causes a beep. |
| Byte 17 | Description | Based on |
Example (byte
order) |
| 07 |
Image counter |
LUN=0 |
Might be triggered by LUN=0
rather than byte17=07 |
| 0D |
Firmware
version |
static |
64
10 00 00 |
| 13 |
hardware reg $F710 =camera hardware version |
06 00 00 00 | |
| 14 |
static |
06 00 00 00 | |
| 15 |
hardware reg $F13A =camera type ID |
27 00 00 00 | |
| 16 |
Battery strength: $64=full,
0=empty (thanks BillW) |
64 00 00 00 | |
| 17 |
hardware reg $F718, bit 3 |
01 00 00 00 | |
| 18 |
static |
02 00 00 00 | |
| 19 |
static |
05 00 00 00 | |
| 1A |
static |
09 00 00 00 | |
| 1B |
LUN |
11 00 00 00 | |
| 1C |
static |
00 00 2c 00 | |
| 1D |
LUN |
00 80 00 00 | |
| 1E |
LUN |
20 00 00 00 | |
| 1F |
hardware reg $F30B |
00 00 00 00 | |
| 20 |
LUN |
00 00 00 00 | |
| 21 |
LUN |
73 00 00 00 | |
| 22 |
Query if a particular LUN is
supported. (thanks BillW) This way you can tell if the camera has internal memory and/or a memory card. 1=supported, 0=unsupported. Uses LUN 1 or 2. |
LUN |
01 00 00 00 |
| 3A |
LUN |
01 00 00 00 | |
| 3B |
LUN |
1e 00 00 00 | |
| 3C |
not expected. |
05 00 00 00 | |
| 3D |
not expected. | 01
00 00 00 |
|
| 3E |
not expected. | 00
00 00 00 |
|
| 3F |
not expected. | 00
00 00 00 |
|
| otherwise |
return error $B6 (not seen!) |
| 4c 61 4d 53 1d ba ab 1d 00 02 00 00 80
00 00 52 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |
| byte \ bit |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
| 0-3 |
dCBWSignature 4c 61 4d 53 = "LaMS" |
|||||||
| 4-7 |
dCBWTag I used 1d ba ab 1d |
|||||||
| 8-11 |
dCBWDataTransferLength 00 02 00 00 = 512 bytes (LSB first) |
|||||||
| 12 |
bmCBWFlags 80 |
|||||||
| 13 |
Reserved
(0) 0 |
bCBWLUN 0 |
||||||
| 14 |
Reserved(0) 0 |
bCBWCBLength 00 |
||||||
| 15-30 |
CBWCB 52 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |
|||||||
| 40 00 00 00 ce 29 15 a2 7a d8 d2
40 0c e3 8a 9a 84 93 2d ae ef c1 99 ab 6c 85 ef f7 d9 4d a1 5e 2a 40 67 f2 0f ff be 46 2d 2f c5 c9 ed c0 0c fc 6e ec cc f8 e1 eb 2c 03 64 df 1d a3 b3 0b 42 fc 40 be 07 19 1c ac c4 e2 93 ed 3a 04 55 31 f3 92 23 f7 65 fb 59 7c e0 b6 97 d3 78 2f b1 70 b5 04 81 9a a2 79 75 e4 ba 12 0f 49 6b 21 09 4d aa c6 98 02 93 e9 aa 7c cb 24 a5 39 b0 8a 63 4c 4b 79 33 33 b1 f3 33 13 33 23 12 33 32 d2 31 33 26 27 13 57 a2 b6 33 33 73 33 33 12 9a b3 33 33 33 13 31 19 a2 77 73 00 23 33 33 33 23 33 33 17 33 33 57 37 72 7a b3 13 6b 28 33 37 37 13 93 3f 22 23 b3 bb 33 31 33 33 36 0b 33 f3 21 33 37 31 35 32 33 33 77 32 23 9a 7b 33 35 33 27 23 13 3b 22 3a 63 23 23 22 3b 13 75 37 1b 33 62 63 31 31 73 b5 b1 33 22 33 23 31 22 33 32 39 32 f3 13 63 32 2f cd cd 6c 6e 80 6c ec ee 5c cd 0e ce ce cc ee 86 cc d8 cc cd 55 cc ce ef cd d9 4c ec 84 dc ec cc d4 cd e8 6e c7 cc de 8e 4e 4c 56 cd ec c4 8c c8 4c cd ce 8c 48 8c cc c6 ce d8 ed cd 8d 8c d8 88 97 c5 c9 cc dc 8f cc dc dc 4d ce ce 4c cc 4c ee 10 5c ce cc cc c8 fc c8 cc c4 ec ec dd ca cc 8c c8 c8 ce 4e 98 8d ed c4 cc cc ee 4c cc cc cc 4c cc 55 ec cc d8 89 c5 6e cc c1 ce 5c d8 9c dc 8c de e9 e4 cc 8d cc 4c c4 8c dc ee cc c4 cc c4 cc 4d 4c ec cc ce d9 cc 4c 54 cc ce ae 9c 84 84 44 e8 5c cc cc 48 c8 ec c4 c7 dc ce ce 9d 5c ee 8c 5d 0c ec cc e9 cc cc c8 d5 84 e5 cc 9c ce c2 ce dc ce 0e c4 9c 5d c4 cd 6f d8 cc cd cc d4 b4 cc cd 4c cd ce c8 9c 4c 4c cc fc cc ac d4 88 88 e8 ec c2 44 cc 58 cc e4 cd 0c cc c4 ec 4c 8d cc cd cc dc cc ac 8c 4c ee c4 9c a9 dc cc 4c c4 4c ec 4c 61 4d 53 1d ba ab 1d 00 02 00 00 64 |
| byte \ bit |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
| 0-3 |
dCBWSignature
("LaMS") 4c 61 4d 53 |
|||||||
| 4-7 |
dCBWTag 1d ba ab 1d |
|||||||
| 8-11 |
dCSWDataResidue 00 02 00 00 |
|||||||
| 12 |
bCSWStatus 64 |
|||||||
| 4c 61 4d 53 1d ba ab 1d 80 00 00 00 80 00 00 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |
| byte \ bit |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
| 0-3 |
dCBWSignature 4c 61 4d 53 = "LaMS" |
|||||||
| 4-7 |
dCBWTag I used 1d ba ab 1d |
|||||||
| 8-11 |
dCBWDataTransferLength 80 00 00 00 = 512 bytes (LSB first) |
|||||||
| 12 |
bmCBWFlags 80 (read) |
|||||||
| 13 |
Reserved
(0) 0 |
bCBWLUN 0 |
||||||
| 14 |
Reserved(0) 0 |
bCBWCBLength 00 |
||||||
| 15-30 |
CBWCB 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |
|||||||
| 02 29 23 be 84 e1 6c d6 ae
52 90 49 f1 f1 bb e9 eb b3 a6 db 3c 87 0c 3e 99 24 5e 0d 1c 06 b7 47 de b3 12 4d c8 43 bb 8b a6 1f 03 5a 7d 09 38 25 1f 5d d4 cb fc 96 f5 45 3b 13 0d 89 0a 1c db ae 32 20 9a 50 ee 40 78 36 fd 12 49 32 f6 9e 7d 49 dc ad 4f 14 f2 44 40 66 d0 6b c4 30 b7 32 3b a1 22 f6 22 91 9d e1 8b 1f da b0 ca 99 02 b9 72 9d 49 2c 80 7e c5 99 d5 e9 80 b2 ea c9 cc 53 bf 67 4c 61 4d 53 1d ba ab 1d 00 00 00 00 00 |
| 4c 61 4d 53 1d ba ab 1d 80 00 00 00 00 00 00 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |
| byte \ bit |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
| 0-3 |
dCBWSignature 4c 61 4d 53 = "LaMS" |
|||||||
| 4-7 |
dCBWTag I used 1d ba ab 1d |
|||||||
| 8-11 |
dCBWDataTransferLength 80 00 00 00 = 512 bytes (LSB first) |
|||||||
| 12 |
bmCBWFlags 00 (write) |
|||||||
| 13 |
Reserved
(0) 0 |
bCBWLUN 0 |
||||||
| 14 |
Reserved(0) 0 |
bCBWCBLength 00 |
||||||
| 15-30 |
CBWCB 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |
|||||||
| 14 37 1d 0f ce 29 15 a2 7a d8 d2 40 0c
e3 8a 9a 84 93 2d ae ef c1 99 ab 6c 85 ef f7 d9 4d a1 5e 2a 40 67 f2 0f ff be 46 2d 2f c5 c9 ed c0 0c fc 6e ec cc f8 e1 eb 2c 03 64 df 1d a3 b3 0b 42 fc 40 be 07 19 1c ac c4 e2 93 ed 3a 04 55 31 f3 92 23 f7 65 fb 59 7c e0 b6 97 d3 78 2f b1 70 b5 04 81 9a a2 79 75 e4 ba 12 0f 49 6b 21 09 4d aa c6 98 02 93 e9 aa 7c cb 24 a5 39 b0 8a 63 4c 4b 79 |
| byte \ bit |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
| 0-3 |
dCBWSignature
("LaMS") 4c 61 4d 53 |
|||||||
| 4-7 |
dCBWTag 1d ba ab 1d |
|||||||
| 8-11 |
dCSWDataResidue 00 00 00 00 |
|||||||
| 12 |
bCSWStatus 00 |
|||||||
| 0=SRAM memory 1=FLASH memory 2=I got an error. May be some sort of memory card that is not supported with this version of the camera. 3=I got an error. Ditto. |