Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add verifyflash build target #2368

Merged
merged 2 commits into from
Sep 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Sming/Arch/Host/Components/vflash/component.mk
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ define WriteFlash
$(if $1,$(Q) $(VFLASH) write-chunks $1)
endef

# Verify one or more chunks against flash content
# $1 -> List of `Offset=File` chunks
define VerifyFlash
@echo VerifyFlash not implemented for Host
endef

# Read flash memory into file
# $1 -> `Offset,Size` chunk
# $2 -> Output filename
Expand Down
9 changes: 9 additions & 0 deletions Sming/Components/esptool/component.mk
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ define WriteFlash
)
endef

# Verify flash against file contents
# $1 -> List of `Offset=File` chunks
define VerifyFlash
$(if $1,\
$(info VerifyFlash $1) \
$(call ESPTOOL_EXECUTE,verify_flash $(flashimageoptions) $(subst =, ,$1)) \
)
endef

# Read flash memory into file
# $1 -> `Offset,Size` chunk
# $2 -> Output filename
Expand Down
5 changes: 5 additions & 0 deletions Sming/component.mk
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,8 @@ ifeq ($(ENABLE_GDB), 1)
else ifneq ($(SMING_ARCH),Host)
$(TERMINAL)
endif

.PHONY: verifyflash
verifyflash: ##Read all flash sections and verify against source
$(Q) $(call CheckPartitionChunks,$(FLASH_PARTITION_CHUNKS))
$(call VerifyFlash,$(FLASH_BOOT_CHUNKS) $(FLASH_MAP_CHUNK) $(FLASH_PARTITION_CHUNKS))
4 changes: 4 additions & 0 deletions docs/source/troubleshooting/random-restart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@ To achieve this do the following:
3) Re-program your device::

make flash

4) Verify flash data has been written successfully

make verifyflash
2 changes: 1 addition & 1 deletion samples/Basic_Storage/basic_storage.hw
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* https://sming.readthedocs.io/en/latest/_inc/Sming/Components/esptool/index.html#envvar-SPI_MODE.
*/
// "mode": "qio",
"speed": 80
// "speed": 80
}
},
"partitions": {
Expand Down