Hi,
I am trying to bring net-console in uboot. For that, I first added 'ncip' in "uboot-imx/include/configs/imx8mm_evk.h" as following. Later, DFMC_SWUG is called at the end of CONFIG_EXTRA_ENV_SETTINGS.
#define DFMC_SWUG \
"setenv ncip 192.168.100.98 \0" \
"ethaddr=00:80:A3:CA:B5:77 \0" \
"swugip=192.168.100.16 \0" \
"ipaddr=192.168.100.2 \0" \
"serverip=192.168.100.16 \0" \
"bootdelay=3\0" \
#define CONFIG_EXTRA_ENV_SETTINGS \
CONFIG_MFG_ENV_SETTINGS \
JAILHOUSE_ENV \
"script=boot.scr\0" \
--
--
--
"fi;\0" \
DFMC_SWUG
Interestingly, I was able to set 'ethaddr', "swugip" and other variables except "ncip". I guess, I am doing some formatting mistakes in line --> "setenv ncip 192.168.100.98 \0" \
Later I tried setting some dummy variables named dummy_var_1, dummy_var_2, dummy_var_3. Even they are not getting set.
Can some one please guide me here?
Regards,
Aravind
Solved! Go to Solution.
my colleague has given you very clear example.
you use the "setenv ncip 192.168.100.98" in imx8mm_evk.h
because you think you are still at runtime in front of i.mx8mm board's debug console. and type the command
"setenv ncip 192.168.100.98" to change the variable ncip using setenv command.
now you are at compile time, you should use the "=" as my colleague's previous reply.
in the header file imx8mm_evk.h , you should use "ncip=192.168.100.98".
If you want to use the command, you should create your own command then chain to the bootcmd.
like this, "set_ncip=setenv ncip 192.168.100.98". then use the "run set_ncip" in bootcmd chain.
or directly use setenv ncip 192.168.100.98 in bootcmd.
u-boot only runs bootcmd. and like mmcboot is in the chain of the bootcmd.
run mmcargs of mmc boot is an example
"mmcargs=setenv bootargs ${jh_clk} console=${console} root=${mmcroot}\0 " \
"loadbootscript=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${bsp_script};\0" \
"bootscript=echo Running bootscript from mmc ...; " \
"source\0" \
"loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
"loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr_r} ${fdtfile}\0" \
"mmcboot=echo Booting from mmc ...; " \
"run mmcargs; " \
"if test ${boot_fit} = yes || test ${boot_fit} = try; then " \
Hello,
I think you shouldn’t use setenv and just create the variable as is, i.e.
#define DFMC_SWUG \
"ncip=192.168.100.98 \0" \
"ethaddr=00:80:A3:CA:B5:77 \0" \
"swugip=192.168.100.16 \0" \
"ipaddr=192.168.100.2 \0" \
"serverip=192.168.100.16 \0" \
"bootdelay=3\0" \
Best regards,
Aldo.
Hi Aldo,
Thank you very much! It worked!
- Aravind
Basically my requirement is to bring 'netconsole' straight after u-boot booting. I will not have serial cable in the end product.
my colleague has given you very clear example.
you use the "setenv ncip 192.168.100.98" in imx8mm_evk.h
because you think you are still at runtime in front of i.mx8mm board's debug console. and type the command
"setenv ncip 192.168.100.98" to change the variable ncip using setenv command.
now you are at compile time, you should use the "=" as my colleague's previous reply.
in the header file imx8mm_evk.h , you should use "ncip=192.168.100.98".
If you want to use the command, you should create your own command then chain to the bootcmd.
like this, "set_ncip=setenv ncip 192.168.100.98". then use the "run set_ncip" in bootcmd chain.
or directly use setenv ncip 192.168.100.98 in bootcmd.
u-boot only runs bootcmd. and like mmcboot is in the chain of the bootcmd.
run mmcargs of mmc boot is an example
"mmcargs=setenv bootargs ${jh_clk} console=${console} root=${mmcroot}\0 " \
"loadbootscript=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${bsp_script};\0" \
"bootscript=echo Running bootscript from mmc ...; " \
"source\0" \
"loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
"loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr_r} ${fdtfile}\0" \
"mmcboot=echo Booting from mmc ...; " \
"run mmcargs; " \
"if test ${boot_fit} = yes || test ${boot_fit} = try; then " \
Hi BiyongSUN,
You caught my mistake!! You are absolutely correct.
I was thinking that, the commands/statements entered in between Quotation marks (" ") gets executed during run time!
But your answer helped me!
Thanks,
Aravind