Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6A388EB64D9 for ; Thu, 15 Jun 2023 16:56:38 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id ACEEF85F79; Thu, 15 Jun 2023 18:56:34 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="b9iyosXq"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E24D085F4F; Thu, 15 Jun 2023 18:56:32 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C3F4C85F79 for ; Thu, 15 Jun 2023 18:56:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BD786614A4; Thu, 15 Jun 2023 16:56:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D21BDC433C8; Thu, 15 Jun 2023 16:56:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686848185; bh=kJB+nU9jjH2MEBSjoV9EpOA/5h404z5q4IOjT1RFVqE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=b9iyosXqJbOJ9HZfbc1tnESDkXZuu7tpWxvYq2XzEAtRR8JsLBg7hKUlbTaI5X1Tn sQ3hBBIMes3IGmBRUYuJmBhZxu+nvzmiwHZxuc0h2BRtnoV+YPvp6Plrbmg9EZ+bPN TYf5OQZv5ifis7269+ctnep1OqdAwhC0dAC6Tnf7INzY+ws//8kn96VMywmwaYtNoU VEOXrwJvYA10s7b8ctbDWQOngyonraXhvPAxDHQrqp2hOdz/snlgB/cOtYxxkL/KeC qkskdkzj4bNpJ3GtQnjLnnHBp1ZN0BBjrySC5/lhhoO1Sy2W70Ivl6y676noh7/yPg NSwAHFbzA4hGQ== Received: by pali.im (Postfix) id C2D7B614; Thu, 15 Jun 2023 18:56:21 +0200 (CEST) Date: Thu, 15 Jun 2023 18:56:21 +0200 From: Pali =?utf-8?B?Um9ow6Fy?= To: Simon Glass Cc: U-Boot Mailing List , Mark Kettenis , Frank Wunderlich , Heinrich Schuchardt , Ilias Apalodimas , Masahisa Kojima , Stefan Roese Subject: Re: [PATCH] menu: Re-enable the ANSI codes Message-ID: <20230615165621.humixhmo4pgxzisi@pali> References: <20230612201434.861700-1-sjg@chromium.org> <20230612202247.cqo4wbrlc7ckbdpj@pali> <20230612213318.4hum2bn3bwoe4n3v@pali> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20180716 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean On Thursday 15 June 2023 13:34:09 Simon Glass wrote: > Hi Pali, > > On Mon, 12 Jun 2023 at 22:33, Pali Rohár wrote: > > > > On Monday 12 June 2023 22:17:48 Simon Glass wrote: > > > Hi Pali, > > > > > > On Mon, 12 Jun 2023 at 21:22, Pali Rohár wrote: > > > > > > > > On Monday 12 June 2023 21:14:32 Simon Glass wrote: > > > > > The intent here was to allow ANSI codes to be disabled, since it was > > > > > proving impoosible to test operation of the menu code when it kept moving > > > > > the cursor. Unfortunately this ended up in the patch. > > > > > > > > > > Correct this by enabling ANSI again. > > > > > > > > > > Signed-off-by: Simon Glass > > > > > Reported-by: Pali Rohár > > > > > Reported-by: Mark Kettenis > > > > > Reported-by: Frank Wunderlich > > > > > Fixes: 32bab0eae51b ("menu: Make use of CLI character processing") > > > > > --- > > > > > > > > > > common/menu.c | 2 +- > > > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > > > > > diff --git a/common/menu.c b/common/menu.c > > > > > index 94514177e4e9..b55cf7b99967 100644 > > > > > --- a/common/menu.c > > > > > +++ b/common/menu.c > > > > > @@ -15,7 +15,7 @@ > > > > > > > > > > #include "menu.h" > > > > > > > > > > -#define ansi 0 > > > > > +#define ansi 1 > > > > > > > > > > /* > > > > > * Internally, each item in a menu is represented by a struct menu_item. > > > > > -- > > > > > 2.41.0.162.gfafddb0af9-goog > > > > > > > > > > > > > Hello, I have tested this change but bootmenu still does not work. There > > > > is still same issue which I reported month ago. When I press DOWN key > > > > then bootmenu immediately quit instead of moving into the next entry. > > > > > > Thanks for testing this. > > > > > > Is there a way for me to test this with sandbox? Or does your Nokia > > > test check it? > > > > I guess that bootmenu command could work in sandbox. But I have not > > tried it. > > > > Nokia CI test does not try any terminal, keyboard or VGA interaction, so > > broken rendering or broken keyboard input is not caught by CI. > > > > But it is possible to test it manually. See U-Boot documentation how to > > run Nokia u-boot image in qemu. Bootmenu is automatically started. > > https://u-boot.readthedocs.io/en/latest/board/nokia/rx51.html#run-in-qemu > > I tried to follow this but got stuck here: > > ./configure --enable-system --target-list=arm-softmmu --disable-werror > > ERROR: Cannot use 'python', Python 2.4 or later is required. > Note that Python 3 or later is not yet supported. > Use --python=/path/to/python to specify a supported Python. > > Python 2 has been deprecated for years and I think it was removed recently. Ach :-( Is not there some configure option to disable python? In U-Boot CI is qemu compiling without issues (but variant without GUI). > > > > Bootmenu is available on both VGA display and terminal output. Problem > > with DOWN key is on the terminal. > > > > > > > > I'm sure you have this commit:? > > > > > > 17b45e684af9 ("cli: Correct several bugs in cli_getch()") > > > > Yes, as it is in the master branch already. > > I tried the following with sandbox: > > setenv bootmenu_0 "my item=echo item 0" > setenv bootmenu_1 "second item=echo item 1" > setenv bootmenu_delay 10 > bootmenu > > I see that with the ANSI patch the 'press key' prompt now appears in > the right place. > > When I press down key repeatedly, it goes down until the last item and > then refuses to go any further. > > So I can't repeat this problem. Hm... so it looks like some ARM or UART specific thing... or something which is not triggered by sandbox. Just some suggestions, could you try to add some more entries? Or trying to wait e.g. 30s before pressing another key (qemu is slow so there can be some delay issue?)? Or could you try to run bootmenu on some real hardware via UART? > I tried looking at the Nokia code. The keyboard driver should be in > drivers/input, but I eventually found it in the board directory. > > Are you sure that rx51_kp_tstc() behaves correctly? Can you add > debugging to see what codes it is emitting? > > Also you don't need to generate escape sequences in rx51_kp_fill(). > You can just use Ctrl-N, Ctrl-P, Ctrl-B and Ctrl-F (see cli_ch_esc()). > That should simplify things a bit. > > If you can find a way to repeat this problem and have verified that > the Nokia code is correct, I can take another look. Problem with DOWN key is on the terminal, not on the screen or keyboard. So all those rx51_kp_tstc() and rx51_kp_fill() should not be the cause (unless some input/output multiplexing in u-boot takes a role). Terminal to qemu is connected via qemu's UART emulation, so omap2 uart driver in this case is the one which connects u-boot to the qemu's UART emulation. > Regards, > Simon > > [1] https://patchwork.ozlabs.org/project/uboot/patch/20230612201434.861700-1-sjg@chromium.org/