Interface FlashOptions

Options for flashing a device with firmware. FlashOptions

interface FlashOptions {
    calculateMD5Hash?: ((image) => string);
    compress: boolean;
    eraseAll: boolean;
    fileArray: {
        address: number;
        data: string;
    }[];
    flashFreq: string;
    flashMode: string;
    flashSize: string;
    reportProgress?: ((fileIndex, written, total) => void);
}

Properties

calculateMD5Hash?: ((image) => string)

A function to calculate the MD5 hash of the firmware image (optional).

Type declaration

    • (image): string
    • Parameters

      • image: string

      Returns string

compress: boolean

Flag indicating whether to compress the data before flashing.

eraseAll: boolean

Flag indicating whether to erase all existing data in the flash memory before flashing.

fileArray: {
    address: number;
    data: string;
}[]

An array of file objects representing the data to be flashed.

Type declaration

  • address: number
  • data: string
flashFreq: string

The flash frequency to be used (e.g., 40MHz, 80MHz).

flashMode: string

The flash mode to be used (e.g., QIO, QOUT, DIO, DOUT).

flashSize: string

The size of the flash memory to be used.

reportProgress?: ((fileIndex, written, total) => void)

A function to report the progress of the flashing operation (optional).

Type declaration

    • (fileIndex, written, total): void
    • Parameters

      • fileIndex: number
      • written: number
      • total: number

      Returns void