You are here

USB State Machine

Like any other USB device, Bootloader processes standard USB requests and reacts to events at USB bus. USB bus events processing is implemented as a state machine in usb_state_machine subprogram in boot.asm file.

Bootloader reacts to the following events:


Attachment to USB bus and detachment. At attachment (ATTACH) internal state is reset to default values and Bootloader enters the wait mode for RESET command. At detachment (DETACH) Bootloader enters attachment wait mode.


USB bus reset. When bootloader receives the RESET command it configures Endpoint 0 and enters USB initialization mode. During initialization host assigns to device a unique, different from zero address (enumeration).


Switch to energy saving mode and exit it. When bootloader receives SUSPEND command it stops processing USB requests and enters the energy saving mode. Bootloader exits energy saving mode when it receives RESUME command.


Switch to inactive state. When bootloader receives IDLE command it enters the inactive state. To exit from inactive state RESET command must be received.


Reaction to unsupported requests or errors at USB bus.