flasher

package
v0.0.0-...-b44964e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 13, 2023 License: Apache-2.0, Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

Copyright (c) 2014-2019 Cesanta Software Limited All rights reserved

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright (c) 2014-2019 Cesanta Software Limited All rights reserved

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright (c) 2014-2019 Cesanta Software Limited All rights reserved

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright (c) 2014-2019 Cesanta Software Limited All rights reserved

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright (c) 2014-2019 Cesanta Software Limited All rights reserved

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	FLASH_BLOCK_SIZE  = 65536
	FLASH_SECTOR_SIZE = 4096
	// These consts should be in sync with stub_flasher.c
	BUF_SIZE        = 4096
	UART_BUF_SIZE   = 4 * BUF_SIZE
	FLAG_EMPTY      = uint8(1 << 0)
	FLAG_COMPRESSED = uint8(1 << 1)
)

Variables

This section is empty.

Functions

func ConnectToFlasherClient

func ConnectToFlasherClient(ct esp.ChipType, opts *esp.FlashOpts) (*cfResult, error)

func Flash

func Flash(ct esp.ChipType, fw *fwbundle.FirmwareBundle, opts *esp.FlashOpts) error

func ReadFlash

func ReadFlash(ct esp.ChipType, addr uint32, length int, opts *esp.FlashOpts) ([]byte, error)

func WriteFlash

func WriteFlash(ct esp.ChipType, addr uint32, data []byte, opts *esp.FlashOpts) error

Types

type FlasherClient

type FlasherClient struct {
	// contains filtered or unexported fields
}

func NewFlasherClient

func NewFlasherClient(ct esp.ChipType, rc *rom_client.ROMClient, romBaudRate uint, baudRate uint) (*FlasherClient, error)

func (*FlasherClient) BootFirmware

func (fc *FlasherClient) BootFirmware() error

func (*FlasherClient) Digest

func (fc *FlasherClient) Digest(addr, length, blockSize uint32) ([][]byte, error)

func (*FlasherClient) Disconnect

func (fc *FlasherClient) Disconnect()

func (*FlasherClient) EraseChip

func (fc *FlasherClient) EraseChip() error

func (*FlasherClient) GetFlashChipID

func (fc *FlasherClient) GetFlashChipID() (uint32, error)

func (*FlasherClient) Read

func (fc *FlasherClient) Read(addr uint32, data []byte) error

func (*FlasherClient) ReadReg

func (fc *FlasherClient) ReadReg(addr uint32) (uint32, error)

func (*FlasherClient) Sync

func (fc *FlasherClient) Sync() error

func (*FlasherClient) Write

func (fc *FlasherClient) Write(addr uint32, data []byte, erase bool, compress bool) (int, error)

func (*FlasherClient) WriteReg

func (fc *FlasherClient) WriteReg(addr uint32, value uint32) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL