Did you mean after you set uEnv.txt, but it doesn’t execute when board boot?
i modified uEnv.txt, but it is not loaded in my construct for kernel 4.16 or at least my var-setting does not work
btw. here is my bootlog:
dev_num = 1
***size=4096, offset=1577059840, blk_start=3080195, blk_cnt=8
*** Warning - bad CRC, using default environment
In: serial
Out: serial
Err: serial
Boot From SD(id:1)
dev_num = 1
***size=4096, offset=1577059840, blk_start=3080195, blk_cnt=8
*** Warning - bad CRC, using default environment
bootargs = board=bpi-r2 earlyprintk console=tty1 fbcon=map:0 console=ttyS0,1152t
Net: mtk_eth
Uip activated
*** U-Boot Boot Menu ***
1. System Load Linux to SDRAM via TFTP.
2. System Load Linux Kernel then write to Flash via TFTP.
3. Boot Linux from SD.
4. System Load Boot Loader then write to Flash via TFTP.
5. System Load Linux Kernel then write to Flash via Serial.
6. System Load Boot Loader then write to Flash via Serial.
7. Boot system code via Flash.
8. Boot Kernel 4.4.
9. Boot Kernel 4.9.
10. Boot Kernel 4.16.
U-Boot console
BPI: SD/eMMC SD=1 eMMC=0 id = 1 (drivers/mmc/mediatek/mtk_mmc.c)
__mmc_init ret = 0
ret2 = 1
ret2 = 1
BPI: g_mtk_mmc_block.dev = 1
<= [mmc1 block 0] =>
[0x00000000] 53 44 4d 4d 43 5f 42 4f
[0x00000008] 4f 54 00 00 01 00 00 00
[0x00000010] 00 02 00 00 ff ff ff ff
[0x00000018] ff ff ff ff ff ff ff ff
[0x00000020] ff ff ff ff ff ff ff ff
[0x00000028] ff ff ff ff ff ff ff ff
[0x00000030] ff ff ff ff ff ff ff ff
[0x00000038] ff ff ff ff ff ff ff ff
[0x00000040] ff ff ff ff ff ff ff ff
[0x00000048] ff ff ff ff ff ff ff ff
[0x00000050] ff ff ff ff ff ff ff ff
[0x00000058] ff ff ff ff ff ff ff ff
[0x00000060] ff ff ff ff ff ff ff ff
[0x00000068] ff ff ff ff ff ff ff ff
[0x00000070] ff ff ff ff ff ff ff ff
[0x00000078] ff ff ff ff ff ff ff ff
[0x00000080] ff ff ff ff ff ff ff ff
[0x00000088] ff ff ff ff ff ff ff ff
[0x00000090] ff ff ff ff ff ff ff ff
[0x00000098] ff ff ff ff ff ff ff ff
[0x000000a0] ff ff ff ff ff ff ff ff
[0x000000a8] ff ff ff ff ff ff ff ff
[0x000000b0] ff ff ff ff ff ff ff ff
[0x000000b8] ff ff ff ff ff ff ff ff
[0x000000c0] ff ff ff ff ff ff ff ff
[0x000000c8] ff ff ff ff ff ff ff ff
[0x000000d0] ff ff ff ff ff ff ff ff
[0x000000d8] ff ff ff ff ff ff ff ff
[0x000000e0] ff ff ff ff ff ff ff ff
[0x000000e8] ff ff ff ff ff ff ff ff
[0x000000f0] ff ff ff ff ff ff ff ff
[0x000000f8] ff ff ff ff ff ff ff ff
[0x00000100] ff ff ff ff ff ff ff ff
[0x00000108] ff ff ff ff ff ff ff ff
[0x00000110] ff ff ff ff ff ff ff ff
[0x00000118] ff ff ff ff ff ff ff ff
[0x00000120] ff ff ff ff ff ff ff ff
[0x00000128] ff ff ff ff ff ff ff ff
[0x00000130] ff ff ff ff ff ff ff ff
[0x00000138] ff ff ff ff ff ff ff ff
[0x00000140] ff ff ff ff ff ff ff ff
[0x00000148] ff ff ff ff ff ff ff ff
[0x00000150] ff ff ff ff ff ff ff ff
[0x00000158] ff ff ff ff ff ff ff ff
[0x00000160] ff ff ff ff ff ff ff ff
[0x00000168] ff ff ff ff ff ff ff ff
[0x00000170] ff ff ff ff ff ff ff ff
[0x00000178] ff ff ff ff ff ff ff ff
[0x00000180] ff ff ff ff ff ff ff ff
[0x00000188] ff ff ff ff ff ff ff ff
[0x00000190] ff ff ff ff ff ff ff ff
[0x00000198] ff ff ff ff ff ff ff ff
[0x000001a0] ff ff ff ff ff ff ff ff
[0x000001a8] ff ff ff ff ff ff ff ff
[0x000001b0] ff ff ff ff ff ff ff ff
[0x000001b8] cd d6 0e 00 00 00 00 be
[0x000001c0] 33 0c 0c 61 34 2d 00 20
[0x000001c8] 03 00 00 00 08 00 00 61
[0x000001d0] 35 2d 83 81 cb b6 00 20
[0x000001d8] 0b 00 00 e0 dd 00 00 00
[0x000001e0] 00 00 00 00 00 00 00 00
[0x000001e8] 00 00 00 00 00 00 00 00
[0x000001f0] 00 00 00 00 00 00 00 00
[0x000001f8] 00 00 00 00 00 00 55 aa
Partition Map for MMC device 1 -- Partition Type: DOS
Part Start Sector Num Sectors UUID Type
1 204800 524288 000ed6cd-01 0c
2 729088 14540800 000ed6cd-02 83
mmc1 is available
Interface: MMC
Device 1: Vendor: Man 000003 Snr 8a0e0900 Rev: 13.10 Prod: SL32G0
Type: Removable Hard Disk
Capacity: 29664.0 MB = 28.9 GB (60751872 x 512)
Filesystem: FAT16 "BPI-BOOT "
Boot from SD
reading bananapi/bpi-r2/linux/uEnv.txt
1190 bytes read in 10 ms (116.2 KiB/s)
Loaded environment from uEnv.txt
Banana Pi bpi-r2 chip: mt7623n Service: linux
reading bananapi/bpi-r2/linux/uImage
6096565 bytes read in 803 ms (7.2 MiB/s)
reading bananapi/berryboot.img
** Unable to read file bananapi/berryboot.img **
bootm flag=0, states=70f
## Booting kernel from Legacy Image at 84000000 ...
Image Name: Linux Kernel 4.14.35-main
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 6096501 Bytes = 5.8 MiB
Load Address: 80008000
Entry Point: 80008000
Verifying Checksum ... OK
Loading Kernel Image ... OK
Starting kernel ...
i modified boot416 like this:
"boot416=run newloadenv; setenv kernel ${kernel416}; printenv; run newboot\0" \
i choose “10. kernel 4.16” but default uImage is loaded…printenv is also not executed
really strange behaviour…
making the steps manually:
BPI-IoT> mmc init
BPI: SD/eMMC SD=1 eMMC=0 id = 1 (drivers/mmc/mediatek/mtk_mmc.c)
__mmc_init ret = 0
ret2 = 1
ret2 = 1
BPI: g_mtk_mmc_block.dev = 1
<= [mmc1 block 0] =>
[0x00000000] 53 44 4d 4d 43 5f 42 4f
[0x00000008] 4f 54 00 00 01 00 00 00
[0x00000010] 00 02 00 00 ff ff ff ff
[0x00000018] ff ff ff ff ff ff ff ff
[0x00000020] ff ff ff ff ff ff ff ff
[0x00000028] ff ff ff ff ff ff ff ff
[0x00000030] ff ff ff ff ff ff ff ff
[0x00000038] ff ff ff ff ff ff ff ff
[0x00000040] ff ff ff ff ff ff ff ff
[0x00000048] ff ff ff ff ff ff ff ff
[0x00000050] ff ff ff ff ff ff ff ff
[0x00000058] ff ff ff ff ff ff ff ff
[0x00000060] ff ff ff ff ff ff ff ff
[0x00000068] ff ff ff ff ff ff ff ff
[0x00000070] ff ff ff ff ff ff ff ff
[0x00000078] ff ff ff ff ff ff ff ff
[0x00000080] ff ff ff ff ff ff ff ff
[0x00000088] ff ff ff ff ff ff ff ff
[0x00000090] ff ff ff ff ff ff ff ff
[0x00000098] ff ff ff ff ff ff ff ff
[0x000000a0] ff ff ff ff ff ff ff ff
[0x000000a8] ff ff ff ff ff ff ff ff
[0x000000b0] ff ff ff ff ff ff ff ff
[0x000000b8] ff ff ff ff ff ff ff ff
[0x000000c0] ff ff ff ff ff ff ff ff
[0x000000c8] ff ff ff ff ff ff ff ff
[0x000000d0] ff ff ff ff ff ff ff ff
[0x000000d8] ff ff ff ff ff ff ff ff
[0x000000e0] ff ff ff ff ff ff ff ff
[0x000000e8] ff ff ff ff ff ff ff ff
[0x000000f0] ff ff ff ff ff ff ff ff
[0x000000f8] ff ff ff ff ff ff ff ff
[0x00000100] ff ff ff ff ff ff ff ff
[0x00000108] ff ff ff ff ff ff ff ff
[0x00000110] ff ff ff ff ff ff ff ff
[0x00000118] ff ff ff ff ff ff ff ff
[0x00000120] ff ff ff ff ff ff ff ff
[0x00000128] ff ff ff ff ff ff ff ff
[0x00000130] ff ff ff ff ff ff ff ff
[0x00000138] ff ff ff ff ff ff ff ff
[0x00000140] ff ff ff ff ff ff ff ff
[0x00000148] ff ff ff ff ff ff ff ff
[0x00000150] ff ff ff ff ff ff ff ff
[0x00000158] ff ff ff ff ff ff ff ff
[0x00000160] ff ff ff ff ff ff ff ff
[0x00000168] ff ff ff ff ff ff ff ff
[0x00000170] ff ff ff ff ff ff ff ff
[0x00000178] ff ff ff ff ff ff ff ff
[0x00000180] ff ff ff ff ff ff ff ff
[0x00000188] ff ff ff ff ff ff ff ff
[0x00000190] ff ff ff ff ff ff ff ff
[0x00000198] ff ff ff ff ff ff ff ff
[0x000001a0] ff ff ff ff ff ff ff ff
[0x000001a8] ff ff ff ff ff ff ff ff
[0x000001b0] ff ff ff ff ff ff ff ff
[0x000001b8] cd d6 0e 00 00 00 00 be
[0x000001c0] 33 0c 0c 61 34 2d 00 20
[0x000001c8] 03 00 00 00 08 00 00 61
[0x000001d0] 35 2d 83 81 cb b6 00 20
[0x000001d8] 0b 00 00 e0 dd 00 00 00
[0x000001e0] 00 00 00 00 00 00 00 00
[0x000001e8] 00 00 00 00 00 00 00 00
[0x000001f0] 00 00 00 00 00 00 00 00
[0x000001f8] 00 00 00 00 00 00 55 aa
Partition Map for MMC device 1 -- Partition Type: DOS
Part Start Sector Num Sectors UUID Type
1 204800 524288 000ed6cd-01 0c
2 729088 14540800 000ed6cd-02 83
mmc1 is available
BPI-IoT> printenv partition
partition=1:1
BPI-IoT> run loadbootenv
reading bananapi/bpi-r2/linux/uEnv.txt
1270 bytes read in 10 ms (124 KiB/s)
BPI-IoT> env import -t ${scriptaddr} ${filesize}
BPI-IoT> printenv boot16
## Error: "boot16" not defined
BPI-IoT> printenv boot416
boot416=run newloadenv; setenv kernel ${kernel416}; printenv; run newboot
BPI-IoT> printenv kernel416
kernel416=uImage_4.16.4
BPI-IoT> setenv kernel ${kernel416}
BPI-IoT> printenv kernel
kernel=uImage_4.16.4
BPI-IoT> run newboot
reading bananapi/bpi-r2/linux/uImage_4.16.4
5087956 bytes read in 670 ms (7.2 MiB/s)
bootm flag=0, states=70f
## Booting kernel from Legacy Image at 84000000 ...
Image Name: Linux Kernel 4.16.4-main
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 5087892 Bytes = 4.9 MiB
Load Address: 80008000
Entry Point: 80008000
Verifying Checksum ... OK
Loading Kernel Image ... OK
Maybe you miss “env import -t ${scriptaddr} ${filesize}”.
Did you check item10,will it run “env import -t ${scriptaddr} ${filesize}”?
newloadenv contains the “env import …”, but had some tests without the “run uenvcmd” and the checksd-part there, seems to work, but have to do some more tests
see https://github.com/frank-w/BPI-R2-4.4/commit/200b8f358a9ad087ac929ba5be60b280abefe04e
but anyway it will be nice if environment is loaded before menu is displayed so uboot can be controlled via uEnv.txt without modifying the code and permanently flash it
@Jackzeng have you looked into it to load uenv.txt before displaying menu?
it is very annoying to patch uboot or using the uboot-console when switching between kernels
Hello, frank, I have looked it before but not deeply, so what do you mean annoying when switching kernels? I probably could work this with you lately.
i have multiple kernels installed in my system and patched uboot to have multiple entries, see commit posted above my last posting.
now i switching between 2 4.16-kernels (wlan/hdmi)… one defined by using kernel-directive (default entry), one using my kernel416-entry
it would be nice setting the names of bootmenu entries via uEnv.txt, so i have not to reflash uboot when doing these things…
any chance getting a newer uboot to work? maybe with hdmi-support? current uboot give only a purple screen…
tried to modify it again…seems i bricked my card…(same with my current github-state)
[PART] load "UBOOT" from 0x0000000000050000 (dev) to 0x81E00000 (mem) [SUCCESS]
[PART] load speed: 5978KB/s, 300000 bytes, 49ms
[BT_SD_PG] device info 0x8590 0x8A00 0xCB01 0x102
0:dram_rank_size:80000000
[PLFM] md_type[0] = 0
[PLFM] md_type[1] = 0
[PLFM] boot reason: 0
[PLFM] boot mode: 0
[PLFM] META COM0: 0
[PLFM] <0xFFB7CC10>: 0x0
[PLFM] boot time: 1893ms
[PLFM] DDR reserve mode: enable = 0, success = 0
[BLDR] jump to 0x81E00000
[BLDR] <0x81E00000>=0xEA00000F
[BLDR] <0x81E00004>=0xE59FF014
this seems to be a compile-issue…multiple compilations in ubuntu 18.4 (gcc6) failed to boot…compiling in 14.4 works on the first try…
here my logs from build.sh
build_14-4.log (13,7 KB) build_18-4.log (18,6 KB)
in ubuntu 14.4 it works with gcc 4.8.4
in ubuntu 18.4 it does not work…gcc ist 7.3 and arm-linux-gnueabihf-gcc is set to /usr/bin/arm-linux-gnueabihf-gcc-5
i do not work if crosscompiler is really used for uboot…i think it should be
:~$ update-alternatives --config arm-linux-gnueabihf-gcc
There are 2 choices for the alternative arm-linux-gnueabihf-gcc (providing /usr/bin/arm-linux-gnueabihf-gcc).
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/bin/arm-linux-gnueabihf-gcc-5 100 auto mode
1 /usr/bin/arm-linux-gnueabihf-gcc-5 100 manual mode
2 /usr/bin/arm-linux-gnueabihf-gcc-7 50 manual mode
i tried to make a manual diff (automatic shows to much differences due to different message formats): diff.txt (5,3 KB)
any idea why uboot compiled in 18.4 fails to boot? @garywang
my uboot-menu looks now like this:
*** U-Boot Boot Menu ***
1. Reload Bootmenu.
2. Load Environment.
3. Boot Linux from SD.
4. Boot Kernel 4.4.
5. Boot Kernel 4.9.
6. Boot Kernel 4.14.
7. Boot Kernel 4.16.
U-Boot console
Press UP/DOWN to move, ENTER to select
all entries except the 3rd (default, not changed) loading env from sd first.
definitions:
BPI-IoT> printenv
arch=arm
baudrate=115200
board=bpi-r2
board_name=mt7623_evb
boot0=tftpboot; bootm
boot1=tftpboot;run boot_wr_img;run boot_rd_img;bootm
boot10=mmc init; run boot_normal; bootm
boot2=run boot_rd_img;run rescue;bootm
boot3=tftpboot ${loadaddr} u-boot-mtk.bin;run wr_uboot
boot4=loadb;run boot_wr_img;run boot_rd_img;bootm
boot414=run newloadenv; setenv kernel ${kernel414}; printenv; run newboot
boot416=run newloadenv; setenv kernel ${kernel416}; printenv; run newboot
boot44=run newloadenv; setenv kernel ${kernel44}; printenv; run newboot
boot49=run newloadenv; setenv kernel ${kernel49}; printenv; run newboot
boot5=loadb;run wr_uboot
boot6=usb start;run boot_wr_img;bootm
boot7=http_upgrade 10.10.10.3;run boot_wr_img;run boot_rd_img;bootm
boot8=mmc init; fatload mmc 0:1 ${loadaddr} "root_uImage";run boot_wr_img; bootm
boot9=mmc init; fatload mmc 0:1 ${loadaddr} ${bpi}/${board}/${service}/${kernel}; bootm
boot_normal=if run checksd; then echo Boot from SD ; setenv partition 1:1; else echo Boot from eMMC ; mmc init 0 ; setenv partition 0:1 ; fi; if run loadboom
boot_rd_img=mmc device 0;mmc read ${loadaddr} 0xA00 1;image_blks 512;mmc read ${loadaddr} 0xA00 ${img_blks}
boot_rd_sec_img=mmc device 0;mmc read ${loadaddr} 0x10A00 1;image_blks 512;mmc read ${loadaddr} 0x10A00 ${img_blks}
boot_wr_img=image_check; if test ${img_result} = good; then image_blks 512 ${filesize};mmc device 0;mmc write ${loadaddr} 0xA00 ${img_blks}; fi
boot_wr_sec_img=image_check; if test ${img_result} = good; then image_blks 512 ${filesize};mmc device 0;mmc write ${loadaddr} 0x10A00 ${img_blks}; fi
bootargs=board=bpi-r2 earlyprintk console=tty1 fbcon=map:0 console=ttyS0,115200 vmalloc=496M debug=7 initcall_debug=0 root=/dev/mmcblk0p2 rootfstype=ext4 rot
bootcmd=No
bootdelay=3
bootenv=uEnv.txt
bootfile=iverson_uImage
bootmenu_0=1. Reload Bootmenu.=run reloadmenu
bootmenu_1=2. Load Environment.=run newloadenv
bootmenu_2=3. Boot Linux from SD.=run boot10
bootmenu_3=4. Boot Kernel 4.4.=run boot44
bootmenu_4=5. Boot Kernel 4.9.=run boot49
bootmenu_5=6. Boot Kernel 4.14.=run boot414
bootmenu_6=7. Boot Kernel 4.16.=run boot416
bootmenu_delay=30
bpi=bananapi
bpiver=1
checksd=fatinfo ${device} 1:1
chip=MT7623N
cpu=armv7
debug=7
device=mmc
duimage_backup=mmc device 0;mmc read ${loadaddr} 0x10A00 1;image_check; if test ${img_result} = bad;then run boot_rd_img; serious_image_check; if test ${imgi
duimage_recovery=serious_image_check; if test ${img_result} = bad; then run boot_rd_sec_img;serious_image_check; if test ${img_result} = good; then reco_mesi
ethact=mtk_eth
ethaddr=00:0C:E7:11:22:33
ipaddr=10.10.10.254
kernel=uImage
kernel414=uImage_4.14
kernel416=uImage_4.16
kernel44=uImage_4.4
kernel49=uImage_4.9
loadaddr=0x84000000
loadbootenv=fatload ${device} ${partition} ${scriptaddr} ${bpi}/${board}/${service}/${bootenv} || fatload ${device} ${partition} ${scriptaddr} ${bootenv}
newboot=fatload mmc ${partition} ${loadaddr} ${bpi}/${board}/${service}/${kernel}; bootm
newchecksd=if run checksd; then echo Boot from SD ; setenv partition 1:1; else echo Boot from eMMC ; mmc init 0 ; setenv partition 0:1 ; fi;
newloadenv=mmc init; run loadbootenv; env import -t ${scriptaddr} ${filesize};
partition=1:1
reloadmenu=run newloadenv;bootmenu
rescue=serious_image_check;
root=/dev/mmcblk0p2
scriptaddr=0x83000000
serverip=10.10.10.3
service=linux
soc=mt7623
stderr=serial
stdin=serial
stdout=serial
vendor=mediatek
wr_uboot=uboot_check;if test ${uboot_result} = good; then mmc device 0;mmc write ${loadaddr} 0x200 0x200;reset; fi
Environment size: 3937/4092 bytes
Uboot does not work if i compile it in ubuntu 18.4 using linaeo gcc arm-gnueabihf 5.5. Any idea why?
Kernel with wifi-driver cannot be compiled with gcc7
what do you mean default entry?
entry what process?
the numer that is selected in the bootmenu…currently it is always the 3rd
imho in code it is done via a const:
but imho there should be a way to set this via uenv.txt
maybe we can modify this to use a env-variable:
currently i don’t know how to access env-vars here, bit the code should look like this:
#if defined(CONFIG_MENU_ACTIVE_ENTRY)
menu->active = CONFIG_MENU_ACTIVE_ENTRY;
#else
menu->active = 0;
#endif
if (ENV_MENU_ACTIVE_ENTRY) {menu->active = ENV_MENU_ACTIVE_ENTRY;}
this seems to be the key:
i can add a new env-var like it’s done for bootmenu-delay…maybe i have to change the header of bootmenu_create and bootmenu_show to pass the new var like delay
Hello, frank, after I checked, I will post you.
hoping it works testing tomorrow, just for you to see how i mean (no need for param-moving over different functions)
Basicly this works. I’ve set the env-var in uboot-console and run bootmenu. If i go again in console, change this var and run bootmenu again it is not recognized. In code it looks like bootmenu is created everytime it is shown so it should work everytime
mhm…last param of simple_strtol is “base”…here so decimal not the default value i thought try to change it back to 10 => works now as expected
hi, frank, I need some time, haha:grinning: