Skip to Content
HardwareDevice APIfirmwareUpdateV4
On this page

firmwareUpdateV4

Protocol V2 firmware update for OneKey Pro 2 and OneKey Neo.

Do not call this on Classic / Mini / Touch / Pro. Those devices use firmwareUpdateV2 or firmwareUpdateV3.

Run this only after the user selects the target device and approves the update. The binary variables below must contain verified artifacts for that model; they are supplied by your release flow.

const res = await HardwareSDK.firmwareUpdateV4(connectId, { platform: 'desktop', // 'native' | 'desktop' | 'ext' | 'web' | 'web-embed' bootloaderBinary, applicationP1Binary, applicationP2Binary, coprocessorBinary, resourceArchiveBinary, }); if (!res.success) throw new Error(res.payload.error);

The method installs the binaries you pass, then reports progress through FIRMWARE_PROGRESS / FIRMWARE_TIP. After DeviceFirmwareUpdateRequest the device may reboot; the SDK reconnects on the same protocol.

Params

Optional common params

ParamTypeRequiredNotes
platform'native' | 'desktop' | 'ext' | 'web' | 'web-embed'YesHost environment
bootloaderBinaryArrayBufferNoBootloader image
applicationP1BinaryArrayBufferNoApplication partition 1
applicationP2BinaryArrayBufferNoApplication partition 2
coprocessorBinaryArrayBufferNoBLE / coprocessor image
resourceArchiveBinaryArrayBufferNoComplete Protocol V2 resource ZIP. Core writes only changed files
forcedUpdateResbooleanNoForce resource update
expectedDeviceIdstringNoRefuse to continue if the device identity changed mid-update

Romloader cannot be installed through firmwareUpdateV4. SE images (se01Binary … se04Binary) are accepted by the type but are not a general integrator path.

OneKey App uses a prepared-plan / host-binding flow for official releases. Third-party hosts should pass the binaries they already verified.

Result

{ success: true, payload: { bleVersion: string, firmwareVersion: string, bootloaderVersion: string, } }

Error

{ success: false, payload: { error: string, code?: string | number, } }

Do not automatically retry firmwareUpdateV4 after a transport timeout or disconnect. The device may already be installing. Re-read device state, then decide.

Button confirmation during update is informational (REQUEST_BUTTON with reason='firmware-update'). Do not call uiResponse() for that hint. If the user cancels the hint, cancel the SDK call; do not send a second Cancel.

Last updated on