On 17.04.24 03:41, E Shattow wrote:
Successful in use w/ 'tio' serial tool and Adafruit CP2102N Friend
adapter on Mars CM Lite board in DFRobot mini router carrier.

While SPL and u-boot.itb payload are sourced via UART the environment
variables are from the environment variable storage as-is. This makes
sense in the use case for development but may have side-effects in the
case of U-Boot as a JH7110 recovery tool. There is now 'env default -f
-a' which does not purge non-default variables and retains the
non-default variables when migrating from vendor firmware. Consider to
also build for U-Boot the commands that can aid in cleaning the stored
environment variable state CONFIG_CMD_ERASEENV=y and in-memory state
CONFIG_CMD_NVEDIT_LOAD=y. With these it can be done easily with: 'env
erase; env load; env save'.

Thank you for testing.

After erasing there is no need to save the environment. If there is no environment on flash, the default will be loaded anyway:

  *** Warning - bad CRC, using default environment

Instead of 'env erase' you could use 'sf erase 0xf0000 0x1000' which is already available. As adding CONFIG_CMD_ERASEENV=y is not necessary in the scope of this patch series I would prefer leaving it to future discussion.

Best regards

Heinrich


On Mon, Apr 15, 2024 at 4:51 AM Heinrich Schuchardt
<heinrich.schucha...@canonical.com> wrote:

We can use U-Boot for recovering JH7110 based boards via UART
if CONFIG_SPL_YMODEM_SUPPORT=y.

* Send u-boot-spl.normal.out via XMODEM.
* Send u-boot.itb via YMODEM.

Signed-off-by: Heinrich Schuchardt <heinrich.schucha...@canonical.com>
---
  configs/starfive_visionfive2_defconfig | 1 +
  1 file changed, 1 insertion(+)

diff --git a/configs/starfive_visionfive2_defconfig 
b/configs/starfive_visionfive2_defconfig
index fa80d489f5e..e2d83c62b28 100644
--- a/configs/starfive_visionfive2_defconfig
+++ b/configs/starfive_visionfive2_defconfig
@@ -62,6 +62,7 @@ CONFIG_SPL_I2C=y
  CONFIG_SPL_DM_SPI_FLASH=y
  CONFIG_SPL_DM_RESET=y
  CONFIG_SPL_SPI_LOAD=y
+CONFIG_SPL_YMODEM_SUPPORT=y
  CONFIG_SYS_PROMPT="StarFive # "
  CONFIG_CMD_EEPROM=y
  CONFIG_SYS_EEPROM_SIZE=512
--
2.43.0


Tested-by: E Shattow <luc...@gmail.com>

Reply via email to