[SOLVED] Arria10 using qspi - Cannot saveenv in u-boot

Hi all,

I’m using A10 GSRD 15.1 with QSPI. I have compiled and wrote the u-boot and it is working, I was able to to boot linux and everything works.

But under the u-boot I cannot saveenv variables, I can setenv a variable and print it but i cannot saveenv it. The u-boot doesn’t seem to acknowledge the command.

I have another build that I use sdram instead of qspi and it works perfectly.

Update -
The CONFIG_ENV_IS_IN_SPI_FLASH in file include/configs/socfpga_arria10.h isn’t set, instead CONFIG_ENV_IS_NOWHERE is set. I’ve tried to set is up and set other defines as well -
define CONFIG_ENV_IS_IN_SPI_FLASH
define CONFIG_ENV_ADDR 0x3010000
define CONFIG_ENV_OVERWRITE
define CONFIG_ENV_SECT_SIZE CONFIG_ENV_SIZE

The address is set according to the memory layout on the GSRD v16.
Now the saveenv command is acknowledged and i can use it, when i use it seems to work but still after I reset the variable is not set. Th uboot crashes and resets itself.

Note that the U-boot code in V16 isn’t aligned to the memory layout of V16, the environment variables aren’t mentioned in the code.

SOLVED
Finally I found the problem, the CONFIG_ENV_SIZE is too big, it makes the uboot to reset after saveenv.
I set it to 0x1000 instead of 0x10000 and it solved it.

Daniel