lophtware projects
Report Type: IN / OUT
Report Size: 1037 Bytes
Acknowledged By: Command Acknowledgement
Report ID | Unlock Key | Offset LSB | Offset MSB | Count LSB | Count MSB | Contents |
---|---|---|---|---|---|---|
00011110 | 8 bytes | oooooooo |
000000 oo |
cccccccc |
00000 ccc |
1024 bytes |
THIS COMMAND HAS THE POTENTIAL TO DESTROY THE DEVICE AND / OR CONNECTED CIRCUITRY, IE. BY CORRUPTING THE FIRMWARE IF THE POWER IS INTERRUPTED.
HID Report ID. Always 0x1e
.
An 8-byte key that is used to prevent accidental changes to certain configuration values. If the supplied key does not match the stored key then this report is ignored.
For IN Reports the field is set as all zeroes.
The Least Significant Byte of a word that is the offset into the 1024-byte ROM array.
For an IN Report this is always 0x00
.
The Most Significant Byte of a word that is the offset into the 1024-byte ROM array.
For an IN Report this is always 0x00
.
The Least Significant Byte of a word that is the length of the Contents
field to copy into the ROM array.
For an IN Report this is always 0x00
.
The Most Significant Byte of a word that is the length of the Contents
field to copy into the ROM array.
For an IN Report this is always 0x04
.
An array of 1024 bytes, of which only the first Count
are significant, that will be copied into the ROM array.
This command stores the given bytes into the ROM that is accessible to the I2C Slaves. It is part of the non-volatile flash memory so that the contents are persisted across power cycles.
This command should not be used if the I2C bus is in use, so ensure any Slaves are inactive and that there are no pending Master transactions. Slaves will experience a locked-up bus, and the USB endpoint will be halted if there are any pending Master transactions - a USB Reset will be needed to recover from this state.
This command will reset the microcontroller so the USB connection will be lost and will proceed through enumeration again. This means that if any other configuration was not saved then it will be lost in the power cycle.
There are lots of things that can go wrong with this command since the PIC does not allow flash programming in anything less than 2048 byte pages. The device pins will remain unchanged during the store operation and the power should be clean, stable and not interrupted. If the operation does not complete successfully then the flash contents will be corrupted. Providing the failure was not because due to exceeding the flash erase-write endurance limits, another attempt at this command should fix the problem. A re-flash of the firmware - see ICSP - should not ordinarily be required. But any I2C Slaves depending on specific ROM contents probably won’t be happy.
The success (or otherwise) of the operation can be checked via the Device Status command once the device has been reset.
Device Status is also available via the I2C Device Information Bank.
Any ‘expected’ errors, such as an invalid Count
, will be negatively acknowledged with a Command Acknowledgement response
prior to the Flash erase sequence starting. In this scenario no device reset or update will take place.