mfreudenberg Posted September 1, 2022 Share Posted September 1, 2022 Hi, i'm trying to compile an u-boot for my Rock-PI 4B. I wanted to apply a userpatch, that disables the uart debug console in u-boot. I seem to have an issue when using the Rock-PI together with a weather-sensor via RS485-Hat. Here is my patch: diff --git a/configs/rock-pi-4-rk3399_defconfig b/configs/rock-pi-4-rk3399_defconfig index be07b16bae..63d04ced6e 100644 --- a/configs/rock-pi-4-rk3399_defconfig +++ b/configs/rock-pi-4-rk3399_defconfig @@ -13,7 +13,7 @@ CONFIG_DEBUG_UART_CLOCK=24000000 CONFIG_SPL_SPI_FLASH_SUPPORT=y CONFIG_SPL_SPI=y -CONFIG_DEBUG_UART=y +CONFIG_DEBUG_UART=n CONFIG_SYS_LOAD_ADDR=0x800800 # CONFIG_ANDROID_BOOT_IMAGE is not set CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-rock-pi-4b.dtb" When i run the compile script, the patch is applied successfully, but something goes wrong and i cannot find a hint what could be the issue. This is my config-default.conf # Read build script documentation https://docs.armbian.com/Developer-Guide_Build-Options/ # for detailed explanation of these options and for additional options not listed here KERNEL_ONLY="yes" # leave empty to select each time, set to "yes" or "no" to skip dialog prompt KERNEL_CONFIGURE="no" # leave empty to select each time, set to "yes" or "no" to skip dialog prompt CLEAN_LEVEL="make,debs,oldcache,cache" # comma-separated list of clean targets: "make" = make clean for selected ke> # "debs" = delete packages in "./output/debs" for current branch and family, # "alldebs" = delete all packages in "./output/debs", "images" = delete "./o> # "cache" = delete "./output/cache", "sources" = delete "./sources" # "oldcache" = remove old cached rootfs except for the newest 8 files REPOSITORY_INSTALL="" # comma-separated list of core modules which will be installed from reposito> # "u-boot", "kernel", "bsp", "armbian-config", "armbian-firmware" # leave empty to build from sources or use local cache DEST_LANG="en_US.UTF-8" # sl_SI.UTF-8, en_US.UTF-8 # advanced EXTERNAL_NEW="prebuilt" # compile and install or install prebuilt additional packages INSTALL_HEADERS="" # install kernel headers package LIB_TAG="master" # change to "branchname" to use any branch currently available. USE_TORRENT="no" # use torrent network for faster toolchain and cache download DOWNLOAD_MIRROR="" # set to "china" to use mirrors.tuna.tsinghua.edu.cn CARD_DEVICE="" # device name /dev/sdx of your SD card to burn directly to the card when done # additions to compile for the rock-pi4 CREATE_PATCHES="yes" BOARD="rockpi-4b" BRANCH="current" RELEASE="bullseye" PROGRESS_LOG_TO_FILE="yes" OFFLINE_WORK="no" USE_MAINLINE_GOOGLE_MIRROR="yes" USE_GITHUB_UBOOT_MIRROR="yes" LIB_TAG="v22.05.3" userpatch log [ o.k. ] Started patching process for [ u-boot rockchip64-rockpi-4b-current ] [ o.k. ] Looking for user patches in [ userpatches/u-boot/u-boot-rockchip64 ] [ o.k. ] * [l][c] add-board-clockworkpi-a06.patch ... [ o.k. ] * [l][c] u-boot-rk-rk3399-usb-start-nanopc-t4.patch [ o.k. ] * [l][c] u-boot-rk-rk3399-usb-start.patch [ o.k. ] * [u][c] u-boot-rk_rk3399-disable-uart-debug.patch [ warn ] Make your changes in this directory: [ /home/michael/ws/build/cache/sources/u-boot/v2022.04 ] [ warn ] Press <Enter> after you are done [ waiting ] compilation aborts with AR spl/drivers/built-in.o LD spl/u-boot-spl OBJCOPY spl/u-boot-spl-nodtb.bin SYM spl/u-boot-spl.sym CAT spl/u-boot-spl-dtb.bin COPY spl/u-boot-spl.bin [ error ] ERROR in function compile_uboot [ main.sh:588 -> main.sh:481 -> compilation.sh:240 -> general.sh:0 ] [ error ] U-boot compilation failed [ o.k. ] Process terminated i found this in the compilation.log /home/michael/ws/build/cache/sources/u-boot/v2022.04/drivers/ram/rockchip/sdram_common.c:232: undefined reference to> /home/michael/ws/build/cache/toolchain/gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-> /home/michael/ws/build/cache/sources/u-boot/v2022.04/drivers/ram/rockchip/sdram_common.c:349: undefined reference to> CC spl/drivers/mmc/sdhci.o CC spl/drivers/core/syscon-uclass.o make[1]: *** [scripts/Makefile.spl:509: tpl/u-boot-tpl] Error 1 make: *** [Makefile:2112: tpl/u-boot-tpl.bin] Error 2 make: *** Waiting for unfinished jobs.... CC spl/drivers/mmc/rockchip_sdhci.o CC spl/drivers/core/of_extra.o CC spl/drivers/core/ofnode.o But i cannot makeup, what could be the issue? 0 Quote Link to comment Share on other sites More sharing options...
usual user Posted September 1, 2022 Share Posted September 1, 2022 3 hours ago, mfreudenberg said: CONFIG_DEBUG_UART=n wrong way to disable Kconfig option use: # CONFIG_DEBUG_UART is not set see for reference: # CONFIG_ANDROID_BOOT_IMAGE is not set 0 Quote Link to comment Share on other sites More sharing options...
mfreudenberg Posted September 2, 2022 Author Share Posted September 2, 2022 Hi @usual user, thanks a lot for the hint. I would never thought, that this is the way of disabling a Kconfig option. Still it seems i cannot run the compile script successfully. I have changed the patch to the following: diff --git a/configs/rock-pi-4-rk3399_defconfig b/configs/rock-pi-4-rk3399_defconfig index be07b16bae..63d04ced6e 100644 --- a/configs/rock-pi-4-rk3399_defconfig +++ b/configs/rock-pi-4-rk3399_defconfig @@ -13,7 +13,7 @@ CONFIG_DEBUG_UART_CLOCK=24000000 CONFIG_SPL_SPI_FLASH_SUPPORT=y CONFIG_SPL_SPI=y -CONFIG_DEBUG_UART=y +# CONFIG_DEBUG_UART is not set CONFIG_SYS_LOAD_ADDR=0x800800 # CONFIG_ANDROID_BOOT_IMAGE is not set CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-rock-pi-4b.dtb" but i still get the same error as listed above. If i disable, the patch by moving it to a non-patch file. The compiling runs without any issues. Anything else that i can check? Thanks a lot! 0 Quote Link to comment Share on other sites More sharing options...
usual user Posted September 2, 2022 Share Posted September 2, 2022 9 hours ago, mfreudenberg said: Anything else that i can check? Modifing /configs/rock-pi-4-rk3399_defconfig is a brute force method without paying attention to restrictions and dependencies. You have to know what you are doing. Usually I run "make menuconfig" to make changes, then I compare previous and new .config to learn necessary option changes, which I then add in *_defconfig for easy package building. 0 Quote Link to comment Share on other sites More sharing options...
mfreudenberg Posted September 7, 2022 Author Share Posted September 7, 2022 Hi, sorry for the late response. I was busy compiling 😄. How do you run make menuconfig? Do you run it from the root of the build repo? 0 Quote Link to comment Share on other sites More sharing options...
usual user Posted September 7, 2022 Share Posted September 7, 2022 8 hours ago, mfreudenberg said: How do you run make menuconfig? Do you run it from the root of the build repo? In the root of the uboot source tree run: make rock-pi-4-rk3399_defconfig Save a copy of the .config file for later comparison. Then run: make menuconfig After exiting with Save, compare the current .config with the saved default .config. 0 Quote Link to comment Share on other sites More sharing options...
mfreudenberg Posted September 9, 2022 Author Share Posted September 9, 2022 Hi, i was successfully able to run menuconfig. I spent the last two days playing around with the settings and creating different patches. But somehow, i am not able to disable the console in u-boot. Every time i reboot i can stop the Rock-PI from booting, by spamming a connected serial console with random characters from my keyboard. But that's maybe offtopic. I have a seperate thread for that. I guess, this one can be marked as solved (is there such a feature in this forum?). 0 Quote Link to comment Share on other sites More sharing options...
usual user Posted September 9, 2022 Share Posted September 9, 2022 6 hours ago, mfreudenberg said: Every time i reboot i can stop the Rock-PI from booting, by spamming a connected serial console with random characters from my keyboard. If the goal is to prevent the boot interruption, then maybe adding CONFIG_BOOTDELAY=-2 to rock-pi-4-rk3399_defconfig is what you're looking for. 0 Quote Link to comment Share on other sites More sharing options...
mfreudenberg Posted September 12, 2022 Author Share Posted September 12, 2022 (edited) Hi @usual user, thanks for the hint. I'll try it out. Just to make sure i'm not making another mistake: For installing the U-Boot, do i just need to install the *.deb from the output/debs folder? Or do i have to do somehting else? Currently, I'm just installing the Packages linux-u-boot-current-rockpi-4b_*-trunk_arm64.deb and linux-image-current-rockchip64_*-trunk_arm64.deb. Thanks Edited September 12, 2022 by mfreudenberg added clarification regarding package installation 0 Quote Link to comment Share on other sites More sharing options...
Igor Posted September 12, 2022 Share Posted September 12, 2022 3 minutes ago, mfreudenberg said: For installing the U-Boot, do i just need to install the *.deb from the output/debs folder? Or do i have to do somehting else? Yes. You need to run nand-sata-installer and choose "update u-boot" 0 Quote Link to comment Share on other sites More sharing options...
mfreudenberg Posted September 12, 2022 Author Share Posted September 12, 2022 Hi @Igor, thanks for this hint! I didn't knew that, but it seems logical to me, that the NAND somehow has to be updated. When i run the nand-sata-installer i get two screens and no other options: 1. Install/Update the bootloader on SD/eMMC 2. Writing Bootloader. Done It seems to work, but somehow it doesn't solve my actual issue. The 1st reboot of the Rock-PI works fine. When i do my "spamming" during the second reboot, the rockpi stops booting - so it seems nothing has changed. But maybe that's offtopic for this thread. 0 Quote Link to comment Share on other sites More sharing options...
mfreudenberg Posted September 12, 2022 Author Share Posted September 12, 2022 Out of curiosity i have unpacked the compiled linux-u-boot-current-rockpi-4b_22.08.0-trunk_arm64.deb. In the folder /usr/lib/u-boot i have found a rock-pi-4-rk3399_defconfig. Looking into it i could see, that neither CONFIG_BOOTDELAY nor CONFIG_DISABLE_CONSOLE were set, allthough the build script claimed the patches were successfully accapted. See also my logs and patches: patching.log ... Processing file /home/michael/ws/build/userpatches/u-boot/u-boot-rockchip64/rk3399-disable-console.patch Processing file /home/michael/ws/build/patch/u-boot/u-boot-rockchip64/rk3399-disable-hdmi-roc-pc.patch Processing file /home/michael/ws/build/patch/u-boot/u-boot-rockchip64/rk3399-disable-hdmi.patch Processing file /home/michael/ws/build/patch/u-boot/u-boot-rockchip64/rk3399-enable-stable-mac.patch Processing file /home/michael/ws/build/patch/u-boot/u-boot-rockchip64/rk3399-populate-child-node-of-syscon.patch Processing file /home/michael/ws/build/userpatches/u-boot/u-boot-rockchip64/rk3399-set-bootdelay.patch ... extracted rock-pi-4-rk3399_defconfig # CONFIG_AUTOBOOT=y CONFIG_BOOTDELAY=0 # CONFIG_AUTOBOOT_KEYED is not set # CONFIG_AUTOBOOT_USE_MENUKEY is not set # CONFIG_USE_BOOTARGS is not set # CONFIG_BOOTARGS_SUBST is not set CONFIG_USE_BOOTCOMMAND=y CONFIG_BOOTCOMMAND="run distro_bootcmd" # CONFIG_USE_PREBOOT is not set CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-rock-pi-4b.dtb" # # Console # CONFIG_MENU=y # CONFIG_CONSOLE_RECORD is not set # CONFIG_DISABLE_CONSOLE is not set CONFIG_LOGLEVEL=4 CONFIG_SPL_LOGLEVEL=4 my patches: # rk3399-disable-console.patch --- a/configs/rock-pi-4-rk3399_defconfig 2022-09-08 13:11:36.338776585 +0000 +++ a/configs/rock-pi-4-rk3399_defconfig 2022-09-09 07:57:35.991434703 +0000 @@ -89,2 +89,3 @@ CONFIG_SPL_TINY_MEMSET=y CONFIG_ERRNO_STR=y +CONFIG_DISABLE_CONSOLE=y # rk3399-set-bootdelay.patch --- a/configs/rock-pi-4-rk3399_defconfig 2022-09-09 09:46:19.898147074 +0000 +++ b/configs/rock-pi-4-rk3399_defconfig 2022-09-09 09:46:19.898147074 +0000 @@ -89,3 +89,4 @@ CONFIG_SPL_TINY_MEMSET=y CONFIG_ERRNO_STR=y CONFIG_DISABLE_CONSOLE=y +CONFIG_BOOTDELAY=-2 run of compile.sh [ o.k. ] * [l][c] rk3399-always-init-rkclk.patch [ o.k. ] * [u][c] rk3399-disable-console.patch [ o.k. ] * [l][c] rk3399-disable-hdmi-roc-pc.patch [ o.k. ] * [l][c] rk3399-disable-hdmi.patch [ o.k. ] * [l][c] rk3399-enable-stable-mac.patch [ o.k. ] * [l][c] rk3399-populate-child-node-of-syscon.patch [ o.k. ] * [u][c] rk3399-set-bootdelay.patch [ o.k. ] * [l][c] sdmmc-force-fifo-mode-in-spl.patch [ o.k. ] * [l][c] u-boot-rk-rk3399-usb-start-firefly-rk3399.patch [ o.k. ] * [l][c] u-boot-rk-rk3399-usb-start-nanopc-t4.patch [ o.k. ] * [l][c] u-boot-rk-rk3399-usb-start.patch 0 Quote Link to comment Share on other sites More sharing options...
usual user Posted September 12, 2022 Share Posted September 12, 2022 3 hours ago, mfreudenberg said: See also my logs and patches Sorry, I'm confused what you're really doing. Before we sort this apart, let's do a quick test. I built a firmware for you and uploaded it here. Please download the archive and copy it unpacked into the firmware area of your SD card as follows: dd bs=512 seek=64 conv=notrunc,fsync if=u-boot-rockchip.bin of=/dev/${entire-card-device-to-be-used} This is doing what nand-sata-installer is doing behind the curtains. Please test and report if the boot process still stalls. 0 Quote Link to comment Share on other sites More sharing options...
mfreudenberg Posted September 13, 2022 Author Share Posted September 13, 2022 vor 17 Stunden schrieb usual user: Please test and report if the boot process still stalls. Hi, so did the following flashing your u-boot image using linux and dd with the provided command This seemed not to work, as i wasn't sure which device i should use for flashing. I used the fourth of the /dev/mmcblk devices (sorry, don't have the exact name for it as i'm currently reflashing my rock with RKDevTool). lsusb listed this blockdevice labeled with BOOT, so i used this one. After rebooting the Rock-PI didn't boot. I saw some characters popping up in my serial console (USB-to-serial connected to a RS485-HAT). flashing you u-boot image using RKDevTool on Windows. This seemed to work as the RKDevTool indicated a success. But still, after rebooting the Rock-PI, there was no Screen, and the boot seemingly halted. What i can say is, that there were way more "characters" popping up in my serial console as with the "stock-u-boot" from armbian. Michael 0 Quote Link to comment Share on other sites More sharing options...
usual user Posted September 13, 2022 Share Posted September 13, 2022 5 hours ago, mfreudenberg said: I used the fourth of the /dev/mmcblk devices ... labeled with BOOT Looks like you choose the wrong device name. The firmware area resides between MBR and the first partition. You probably used the boot partition and the original firmware remained intact. Therfor you have corrupted the data in the boot partition which has rewarded your original firmware with a boot failure. The desired device name is the one marked with type "disk" in an lsblk output. That's the entire device or raw device I've called entire-card-device-to-be-used because I don't know how your storage is connected and will show up. Example lsblk output: Spoiler NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 1 29,8G 0 disk ├─sda1 8:1 1 512M 0 part └─sda2 8:2 1 28,9G 0 part sdb 8:16 0 931,5G 0 disk ├─sdb1 8:17 0 2G 0 part ├─sdb2 8:18 0 6G 0 part └─sdb3 8:19 0 900G 0 part /mnt/sdb3 sdc 8:32 1 29,3G 0 disk └─sdc1 8:33 1 29,3G 0 part /mnt/sdc1 mmcblk2 179:0 0 14,6G 0 disk mmcblk2boot0 179:8 0 4M 1 disk mmcblk2boot1 179:16 0 4M 1 disk mmcblk1 179:24 0 29,7G 0 disk └─mmcblk1p1 179:25 0 20G 0 part / zram0 252:0 0 2,8G 0 disk [SWAP] nvme0n1 259:0 0 931,5G 0 disk ├─nvme0n1p1 259:1 0 2G 0 part ├─nvme0n1p2 259:2 0 6G 0 part └─nvme0n1p3 259:3 0 900G 0 part /mnt/nvme3 0 Quote Link to comment Share on other sites More sharing options...
mfreudenberg Posted September 14, 2022 Author Share Posted September 14, 2022 vor 13 Stunden schrieb usual user: Example lsblk output: so this is my layout: NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT mmcblk1 179:0 0 28,9G 0 disk └─mmcblk1p1 179:1 0 28,6G 0 part / mmcblk1boot0 179:32 0 4M 1 disk mmcblk1boot1 179:64 0 4M 1 disk zram0 252:0 0 1,9G 0 disk [SWAP] zram1 252:1 0 50M 0 disk /var/log I'm bit confused as i'm not sure which of the three "disk" type partitions i should use. I'd probably go with one of the mmcblk1boot* disks, but you wrote, that it's between the MBR and the first partition, so i guess i go for mmcblk1. 0 Quote Link to comment Share on other sites More sharing options...
mfreudenberg Posted September 14, 2022 Author Share Posted September 14, 2022 Success! I was able to get this nice screen: In addition to that, i could not disrupt the boot with the serial console. So my question would be, which parameter did you set to get the serial console not to react on my "random" keys? 0 Quote Link to comment Share on other sites More sharing options...
mfreudenberg Posted September 14, 2022 Author Share Posted September 14, 2022 Small update. Meanwhile i have started to building u-boot according to the manual from u-boot directly. What i can determine is, that there is a difference between the u-boot.bin, that is contained in the *.deb file i am creating with the armbian-build-framework and the u-boot-bin that i create with the u-boot sources. The armbian u-boot is exaclty 4MB in size. If i flash it, my Rock-PI does not boot. The "original" compiled u-boot is around 8,9MB (the same size, that you @usual user) have sent me. Unfortunately, if i flash it, the rock-pi does not boot. I compiled it with no specific settings - it's all defaults for the rk3399 platform. Btw.: I was able to flash your u-boot by using the RKDevTool. I just had to setup two "items" in the tool - The loader itself - The u-boot binary with an offset of 0x00000040 (i took the hint from your linux-command decimal offset of 64 is 0x40 in hex ;-)). 0 Quote Link to comment Share on other sites More sharing options...
usual user Posted September 14, 2022 Share Posted September 14, 2022 10 hours ago, mfreudenberg said: mmcblk1boot* These are special emmc devices and are read only by default, as can be seen in the RO column of the lsblk output. As far as I know, the rk3399 MASKROM code has no support to use them as a boot device, therefore useless in terms of a firmware location. 9 hours ago, mfreudenberg said: So my question would be, which parameter did you set to get the serial console not to react on my "random" keys? My provided firmware is a build from this release tar ball. It pulls in the ATF binary build from this release tar ball and has only applied this modification: Spoiler diff --git a/configs/rock-pi-4-rk3399_defconfig b/configs/rock-pi-4-rk3399_defconfig index 4d534c3..13d9d18 100644 --- a/configs/rock-pi-4-rk3399_defconfig 2022-07-11 15:42:58.000000000 +0200 +++ b/configs/rock-pi-4-rk3399_defconfig 2022-09-12 18:31:31.038651852 +0200 @@ -12,6 +12,7 @@ CONFIG_DEBUG_UART_BASE=0xFF1A0000 CONFIG_DEBUG_UART_CLOCK=24000000 CONFIG_SYS_LOAD_ADDR=0x800800 CONFIG_DEBUG_UART=y +CONFIG_BOOTDELAY=-2 # CONFIG_ANDROID_BOOT_IMAGE is not set CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-rock-pi-4b.dtb" CONFIG_DISPLAY_BOARDINFO_LATE=y 0 Quote Link to comment Share on other sites More sharing options...
mfreudenberg Posted September 15, 2022 Author Share Posted September 15, 2022 Hi, thanks for the reply. Did you just replaced the local source folders of your armbian-build-framework repo? Like cp to cache/sources/u-boot? I'm still struggeling with flashing the bootloader. I have compiled my own u-boot, but as soon as i flash it (no matter if RKDevTool or dd via linux) the Rock does not boot. Update: I have figured out, how to see whats going on on my serial console during boot. I just needed to set my baudrate to 1500000 and switch off flow control. Afterwards, i can see this: U-Boot TPL 2022.07-dirty (Sep 15 2022 - 08:41:28) sdram_init: LPDDR3 - 800MHz failed! rk3399_dmc_init DRAM init failed -22 Any idea, what that means? I'm getting this when flashing my self-built u-boot-rockchip.bin. 0 Quote Link to comment Share on other sites More sharing options...
usual user Posted September 15, 2022 Share Posted September 15, 2022 (edited) 4 hours ago, mfreudenberg said: Did you just replaced the local source folders of your armbian-build-framework repo? Not at all, I run fedora on all my SBCs and build on target. I simply built the 2022.07 RPM source version I had already handy. The source references should only serve to let you know what you have received from me. Which specific version is ultimately used is not really important. 4 hours ago, mfreudenberg said: Any idea, what that means? Not sure, but did you pulled in ATF properly, the BL31=.../bl31.elf clause of your referenced mainline documentation? But since we have proven that the BOOTDELAY setting is all you need, you can also use the Armbian version. From you previous rock-pi-4-rk3399_defconfig sniplet I see this: On 9/12/2022 at 3:32 PM, mfreudenberg said: CONFIG_BOOTDELAY=0 This is not present in the mainline sources, i.e. it is added by an Armbian patch. So you just have to locate the Armbian patch in the Armbian build system and replace 0 with -2 and you are ready to go. Edited September 15, 2022 by usual user 0 Quote Link to comment Share on other sites More sharing options...
mfreudenberg Posted September 16, 2022 Author Share Posted September 16, 2022 Hi, if you mean this snipplet # CONFIG_AUTOBOOT=y CONFIG_BOOTDELAY=0 # CONFIG_AUTOBOOT_KEYED is not set # CONFIG_AUTOBOOT_USE_MENUKEY is not set # CONFIG_USE_BOOTARGS is not set # CONFIG_BOOTARGS_SUBST is not set CONFIG_USE_BOOTCOMMAND=y CONFIG_BOOTCOMMAND="run distro_bootcmd" # CONFIG_USE_PREBOOT is not set CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-rock-pi-4b.dtb" # # Console # CONFIG_MENU=y # CONFIG_CONSOLE_RECORD is not set # CONFIG_DISABLE_CONSOLE is not set CONFIG_LOGLEVEL=4 CONFIG_SPL_LOGLEVEL=4 That's not a patch. That's the config file i am extracting from the compiled u-boot*.deb to chek if the patch was applied. If i run the script with a working patch i get this log output: [ o.k. ] * [l][c] rk3399-disable-hdmi.patch [ o.k. ] * [l][c] rk3399-enable-stable-mac.patch [ o.k. ] * [l][c] rk3399-populate-child-node-of-syscon.patch [ o.k. ] * [u][c] rk3399-set-bootdelay.patch [ o.k. ] * [l][c] sdmmc-force-fifo-mode-in-spl.patch [ o.k. ] * [l][c] u-boot-rk-rk3399-usb-start-firefly-rk3399.patch [ o.k. ] * [l][c] u-boot-rk-rk3399-usb-start-nanopc-t4.patch [ o.k. ] * [l][c] u-boot-rk-rk3399-usb-start.patch [ o.k. ] * [l][c] u-boot-rk3399-set-bootdelay.patch [ warn ] Make your changes in this directory: [ /home/michael/ws/build/cache/sources/u-boot/v2022.04 ] [ warn ] Press <Enter> after you are done [ waiting ] I guess that means, that my patch (rk3399-set-bootdelay.patch) was applied. Not sure what [u][c] means - I guess it stands for userpatch? The point is when i continue with <enter>, at that state of the script, i get the log output below. I must have missed it the whole time, i guess. [ warn ] No changes found, skipping patch creation I have checked the script source here and as it seems, the first branch of the if clause is not executed. I always end up in the else branch with the display_alert warning. I just don't understand why? Do i have to apply the userpatches, when the script halts? To try an alternative way, i have placed my patch in patch/u-boot/u-boot-rockchip64. The script runs fine, i get no warnings whatsoever, but as soon as i unzip the compiled deb-file i see that CONFIG_BOOTDELAY is still set to 0, allthough the patch was applied. I don't understand why? 0 Quote Link to comment Share on other sites More sharing options...
usual user Posted September 17, 2022 Share Posted September 17, 2022 On 9/16/2022 at 3:14 PM, mfreudenberg said: That's not a patch. That's the config file i am extracting from the compiled u-boot*.deb to chek if the patch was applied. Sure, but mainline "make rock-pi-4-rk3399_defconfig" sets BOOTDELAY=2, so the Armbian build system has to cause this change. Maybe that's what you should be looking for: [ o.k. ] * [l][c] u-boot-rk3399-set-bootdelay.patch On 9/16/2022 at 3:14 PM, mfreudenberg said: I don't understand why? Sorry, but we have here reached a point where Armbian knowledge is required, which I do not have. You now need an Armbian maintainer to help you. You now know which uboot modification is necessary to fix your issue and if you do not find a solution to build uboot yourself you still have my firmware. As I can see from your script log, my version is even more up-to-date, but that doesn't really matter. 0 Quote Link to comment Share on other sites More sharing options...
Igor Posted September 18, 2022 Share Posted September 18, 2022 On 9/16/2022 at 3:14 PM, mfreudenberg said: I guess it stands for userpatch? Yes. On 9/16/2022 at 3:14 PM, mfreudenberg said: i see that CONFIG_BOOTDELAY is still set to 0 I think its related to this code. BOOTDELAY is armbian internal variable, which you can set with parameter. https://github.com/armbian/build/blob/master/lib/compilation.sh#L225-L227 0 Quote Link to comment Share on other sites More sharing options...
usual user Posted September 19, 2022 Share Posted September 19, 2022 And off topic, after reading out of curiosity of u-boot-2022.07/doc/README.iomux, I would do this in my device's uboot console and forget about the build of uboot: Spoiler => coninfo List of available devices: serial@3000 00000007 IO serial 00000003 IO stdin stdout stderr nulldev 00000003 IO vidconsole 00000002 .O usbkbd 00000001 I. => printenv stdin stdin=usbkbd,serial => setenv stdin usbkbd => saveenv 0 Quote Link to comment Share on other sites More sharing options...
mfreudenberg Posted September 19, 2022 Author Share Posted September 19, 2022 vor 13 Stunden schrieb Igor: I think its related to this code. BOOTDELAY is armbian internal variable, which you can set with parameter. https://github.com/armbian/build/blob/master/lib/compilation.sh#L225-L227 Where do i set that varibale? I tried to set it in the following files - config-default.conf - config/boards/rockpi-4b.conf - build/config/bootscripts/boot-rockchip64.cmd (yes, i know i shouldn't edit this one) Interestringly, i cannot add bootdelay=-2 to the armbianEnv.txt. That doesn't seem to work. 0 Quote Link to comment Share on other sites More sharing options...
Igor Posted September 19, 2022 Share Posted September 19, 2022 7 minutes ago, mfreudenberg said: Interestringly, i cannot add bootdelay=-2 to the armbianEnv.txt. That doesn't seem to work. Adding there would be too late. https://github.com/armbian/build/blob/master/config/bootscripts/boot-sunxi.cmd#L36 9 minutes ago, mfreudenberg said: Where do i set that varibale? I tried to set it in the following files Anywhere, but the problem are overrides: config:% grep -R BOOTDELAY * config:% grep -R BOOTDELAY * sources/families/rockchip.conf:BOOTDELAY=1 sources/families/rk322x.conf:BOOTDELAY=0 sources/families/include/rockchip64_common.inc:BOOTDELAY=0 sources/families/include/sunxi64_common.inc:BOOTDELAY=1 sources/families/include/sunxi_common.inc:BOOTDELAY=1 I don't know why we have this in first place. 0 Quote Link to comment Share on other sites More sharing options...
mfreudenberg Posted September 19, 2022 Author Share Posted September 19, 2022 vor 38 Minuten schrieb Igor: sources/families/include/rockchip64_common.inc That seems to be the guy, that does the trick. After setting the option in that file, and flashing the compiled u-boot i was able to resolve my issue. The boot does not hang anymore, when i "spam" the console via keyboard. vor 40 Minuten schrieb Igor: I don't know why we have this in first place. That's the least location, where i would expect to put my changes 😁. That slightly brings me back to the original topic of this thread. I wanted to apply a userpatch, but it doesn't work as described by the "manual". Wouldn't this be worth a bug in github? Nevertheless, thanks a lot for your hints and the support @usual user @Igor!!! 0 Quote Link to comment Share on other sites More sharing options...
mfreudenberg Posted September 19, 2022 Author Share Posted September 19, 2022 vor 6 Stunden schrieb usual user: my device's uboot console and forget about the build of uboot So this solution didn't work out on my Rock-PI. I got the following errors: => coninfo List of available devices: serial@ff1a0000 00000007 IO serial 00000003 IO stdin stdout stderr nulldev 00000003 IO => printenv stdin ## Error: "stdin" not defined => setenv stdin usbkbd ## Error inserting "stdin" variable, errno=22 BUT, fideling around a bit with the u-boot console i was able to set the bootdelay environment variable via the u-boot console. After a reboot, the console did not react anymore to any random keys i was sending via console 👍. The command i used was: => setenv bootdelay -2 => saveenv Saving Environment to SPIFlash... Erasing SPI flash...Writing to SPI flash...done OK => boot Interestingly, after reflashing a different U-Boot without the bootdelay mod, i wasn't able get back to the u-boot console. It seems, that this is kind of permanent? Just wondering, not that it would be an issue for me 🙃. 0 Quote Link to comment Share on other sites More sharing options...
Igor Posted September 19, 2022 Share Posted September 19, 2022 16 minutes ago, mfreudenberg said: Wouldn't this be worth a bug in github? It would be worth to clean / rework this properly following by opening a merge request. I think how we have this inside is wrong, but its not only my judgement. Merge request is just a proposal of change, propose them. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.