cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Contributor
Contributor
461 Views
Registered: ‎10-02-2018

Petalinux 2017.4 doesnt recognise adding the saveenv u-boot command

Jump to solution

I have been going through the petalinux 2017.4 workflow and have tested editing u-boot CONFIG_* options.

I added the CONFIG_CMD_MEMTEST in platform-top.h and I have verified that it adds that u-boot command when in the prompt which performs a simple ram test.

However I want to make those environment variables persistent in flash using the saveenv command but when I add the CONFIG_CMD_SAVEENV the saveenv isnt added into u-boot. I also enabled it in the .cfg file:

CONFIG_CMD_SAVEENV=y

Also disabled the environment variable to allow me to flash the device:

#undef CONFIG_ENV_IS_NOWHERE

undefining that variable gave me errors so is there any way I could enable saveenv without adding a custom u-boot patch.
Note: U-boot version 2017.1

Contents of platform-top.h:

#include <configs/platform-auto.h>

#define CONFIG_SYS_BOOTM_LEN 0xF000000

/*Required for uartless designs */
#ifndef CONFIG_BAUDRATE
#define CONFIG_BAUDRATE 115200
#ifdef CONFIG_DEBUG_UART
#undef CONFIG_DEBUG_UART
#endif
#endif

/* Additional U-Boot Commands */
#define CONFIG_CMD_MEMTEST
#define CONFIG_CMD_SAVEENV

/* Read GEM MAC Address from EEPROM */
#define CONFIG_ZYNQ_I2C0
#define CONFIG_SYS_I2C_ZYNQ
#define CONFIG_CMD_I2C
#define CONFIG_SYS_I2C
#define CONFIG_SYS_I2C_ZYNQ_SPEED             100000
#define CONFIG_SYS_I2C_ZYNQ_SLAVE             0

#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
#define CONFIG_CMD_EEPROM
#define CONFIG_ZYNQ_GEM_EEPROM_ADDR    0x50
#define CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET 0xFA

/* Add ability to read uEnv.txt when not using SPI Flash for env */

#ifndef CONFIG_ENV_IS_IN_SPI_FLASH
#define CONFIG_ENV_IS_NOWHERE
#define CONFIG_ENV_SIZE 0x20000
#undef CONFIG_PREBOOT
#define CONFIG_PREBOOT  "echo U-BOOT for Zybo; setenv preboot; setenv bootenv uEnv.txt;  setenv loadbootenv_addr 0x1EE00000; if test $modeboot = sdboot && env run sd_uEnvtxt_existence_test; then if env r$
#endif
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Contributor
Contributor
419 Views
Registered: ‎10-02-2018

Found the solution within the /cmd/Kconfig file if anyone else has this problem. Under the config CMD_SAVEENV add, "default y".

So it should look like this: 

config CMD_SAVEENV
bool "saveenv"
default y
help
Save all environment variables into the compiled-in persistent storage

Regards,

Emmet 

View solution in original post

0 Kudos
1 Reply
Highlighted
Contributor
Contributor
420 Views
Registered: ‎10-02-2018

Found the solution within the /cmd/Kconfig file if anyone else has this problem. Under the config CMD_SAVEENV add, "default y".

So it should look like this: 

config CMD_SAVEENV
bool "saveenv"
default y
help
Save all environment variables into the compiled-in persistent storage

Regards,

Emmet 

View solution in original post

0 Kudos