The host application GUI program communicates with the USB HID bootloader firmware using a set of 9 commands. The host application is the “master” of the bootloading operation, and is responsible for issuing commands to the bootloader firmware that is responsible for fulfilling the requests.
All commands that the host application sends to the microcontroller firmware are fixed 64-byte USB packets that are sent over the HID interrupt OUT endpoint to the device. Some commands that the host software sends to the microcontroller firmware require that the firmware responds with a fixed 64-byte response packet on the HID interrupt IN endpoint, while other commands require no response.
The first byte of the packet is always the command for the current packet. The remaining 63 bytes are command-specific information, where required. The commands are listed and summarized below.
Command Byte (Hex) |
Command |
Device Response Packet Expected |
02 |
QUERY_DEVICE |
Yes |
03 |
UNLOCK_CONFIG |
No |
04 |
ERASE_DEVICE |
No |
05 |
PROGRAM_DEVICE |
No |
06 |
PROGRAM_COMPLETE |
No |
07 |
GET_DATA |
Yes |
08 |
RESET_DEVICE |
No |
09 |
SIGN_FLASH |
No |
0C |
QUERY_EXTENDED_INFO |
Yes |
Name |
Description |
The QUERY_DEVICE command (0x02) is a request from the host to determine the valid memory ranges that are allowed to be programmed, among other things about the microcontroller. | |
The UNLOCK_CONFIG (0x03) command is used to unlock protected sections of the program memory. | |
The ERASE_DEVICE (0x04) command erases all of the reprogrammable memory regions indicated by the response to the QUERY_DEVICE command. | |
The PROGRAM_DEVICE (0x05) command sends the data that is going to be written to the device. | |
The PROGRAM_COMPLETE command (0x06) is used to indicate to the device that the host program is finished sending contiguous address PROGRAM_DEVICE commands. | |
The GET_DATA (0x07) command reads the requested data from the device. | |
The RESET_DEVICE (0x08) command reads the requested data from the device. | |
The SIGN_FLASH command (0x09) causes a special flash signature word to be programmed at a fixed address in the flash memory. | |
The QUERY_EXTENDED_INFO command (0x0C) is used by the host PC application to get additional info about the device, beyond the basic NVM layout provided by the QUERY_DEVICE command. |
MLA - USB Library Help Version : 2.16
![]() |