Skip to content

Commit 7ec8632

Browse files
committed
esp: Check in sources for flasher stub
Recovered from https://github.com/cesanta/mongoose-os/tree/f626b5113861634e9a4acc96bdb73de29ed8a4d0/common/platforms/ refactored the build system. Example to rebuild and test esp8266 stub (read flash): ``` $ make stubs mos && ./mos flash-read --platform esp8266 --esp-baud-rate=1500000 test.bin --v 4 --logtostderr ``` Signed-off-by: Deomid "rojer" Ryabkov <[email protected]>
1 parent f51db66 commit 7ec8632

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+11106
-110
lines changed

Makefile

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.DEFAULT_GOAL := mos
2-
.PHONY: all build clean clean-tools clean-version deploy-fwbuild deploy-mos-binary deps downloads fwbuild-instance fwbuild-manager generate install linux mac mos version win
2+
.PHONY: all build clean clean-tools clean-version deploy-fwbuild deploy-mos-binary deps downloads fwbuild-instance fwbuild-manager generate genstubs install linux mac mos stubs version win
33

44
TAG ?= latest
55

@@ -57,6 +57,15 @@ vendor/modules.txt:
5757

5858
deps: vendor/modules.txt
5959

60+
genstubs:
61+
cli/flash/esp32/stub/genstub.sh
62+
cli/flash/esp8266/stub/genstub.sh
63+
64+
# Build the flasher stubs
65+
# E.g.:
66+
# make stubs mos && ./mos flash-read --platform esp8266 --esp-baud-rate=1500000 test.bin --v 4 --logtostderr
67+
stubs: genstubs generate
68+
6069
generate: $(GOBIN)/go-bindata $(GOBIN)/go-bindata-assetfs
6170
$(GO) generate \
6271
github.com/mongoose-os/mos/cli/... \

cli/bindata.go

+11-11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cli/flash/esp/flasher/flasher_client.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ func (fc *FlasherClient) connect(romBaudRate, baudRate uint) error {
9191
var stubJSON []byte
9292
switch fc.ct {
9393
case esp.ChipESP8266:
94-
stubJSON = esp8266.MustAsset("data/stub_flasher.json")
94+
stubJSON = esp8266.MustAsset("stub/stub.json")
9595
case esp.ChipESP32:
96-
stubJSON = esp32.MustAsset("data/stub_flasher.json")
96+
stubJSON = esp32.MustAsset("stub/stub.json")
9797
default:
9898
return errors.Errorf("unknown chip type %d", fc.ct)
9999
}

0 commit comments

Comments
 (0)