Hi,
I am currently working on U-Boot source code.
I have to change the uboot environment variables saving to SDCARD instead i have to store into FLASH.
I would like to know what are the changes i have to do to save it to FLASH.
board specific header file contains the below macro
#define CONFIG_ENV_IS_IN_MMC
I think may be i have replace the above line with #define CONFIG_ENV_IS_IN_FLASH
Still any changes i have to do to save uboot environment variables.
I have also added the FLASH base address and OFFSET and environment size.
Please give any suggestion to save it to FLASH.
Thanks & Regards,
Ramanjineyulu.
Hi Ramanjineyulu
you are right, for saving uboot environment variables in flash it is sufficient to
set #define CONFIG_ENV_IS_IN_FLASH, no other changes in uboot sources
are necessary.
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Igor,
Thanks for your reply.
Below are the changes in board specific header file.
#define CONFIG_ENV_IS_IN_FLASH
#define CONFIG_SYS_FLASH_BASE CONFIG_SYS_FSL_FLASH0_BASE
#define FLASH_SECTOR_SIZE 0x40000
#define CONFIG_SYS_MAX_FLASH_BANKS 1
#define CONFIG_ENV_SIZE (0x2000) /* 8 KB */
#define CONFIG_ENV_SECT_SIZE (FLASH_SECTOR_SIZE) /* 256 KB */
#define CONFIG_SYS_MAX_FLASH_SECT (0x4000000 / CONFIG_ENV_SECT_SIZE)
#define CONFIG_ENV_OFFSET 2 * CONFIG_ENV_SECT_SIZE
I have comment MMC related macros.
When i have compiled the source code am getting the below error.
u-boot/common/board_r.c:364: undefined reference to `flash_init'
common/built-in.o: In function `addr2info':
u-boot/common/flash.c:95: undefined reference to `flash_info'
u-boot/common/flash.c:163: undefined reference to `write_buff'
common/built-in.o: In function `do_env_save':
u-boot/common/cmd_nvedit.c:710: undefined reference to `saveenv'
Segmentation fault (core dumped)
Makefile:1207: recipe for target 'u-boot' failed
make: *** [u-boot] Error 139
Could you please help on this.
Thanks & Regards,
Ramanjineyulu Thota.
Hi Ramanjineyulu
what uboot version used in the case, please try nxp release imx_v2016.03 :
http://git.freescale.com/git/cgit.cgi/imx/uboot-imx.git/tree/?h=imx_v2016.03_4.1.15_2.0.0_ga
Best regards
igor